<?php 
session_start();
include('../includes/dbcon.php');

$str=" ";

$data = array();

$edate=date("Y-m-d");
$userid=$_SESSION['hrm_id'];

if (isset($_POST['cus_id'])) {
	//$cus_id=1;
 	$cus_id = trim($_POST['cus_id']);
 	//$loc_id=$_SESSION['loc_id_bill'];

	        	$sqlsp=mysqli_query($con,"SELECT chqheader.docid,chqheader.docdate,chqheader.chqno,chqheader.amount ,chqheader.chqdate,
chqheader.chqbank,customer_master.cus_name
FROM chqheader
LEFT JOIN customer_master ON chqheader.cus_id=customer_master.cus_id
WHERE deposit<>1 AND TYPE='Cheque' AND cancel<>1 ")or die(mysqli_error($con));
	        	$count=mysqli_num_rows($sqlsp);	
	        	if ($count>0) {
	        		while($rowsp=mysqli_fetch_array($sqlsp)){			
					 $data[]=$rowsp;				
				   }	

				    echo json_encode($data);
	        	}//	if ($count>0) {
exit();
	        	 //echo 'hello';
	  


} ///// if (isset($_POST['category'])) {

?>