<?php 
session_start();
include './connection_sql.php';
if ($_SESSION["CURRENT_USER"] == "") { 
    exit('Please Logging Again..');
} 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<title>Search Customer</title>
<link rel="stylesheet" href="css/table.css" type="text/css"/>	
<script language="JavaScript" src="js/bank_depo.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>

<body>

 <table width="735" border="0" class=\"form-matrix-table\">
 
<tr>
					<?php 
	  				$stname = $_GET["stname"];
					?>
                             <td width="122"  background="images/headingbg.gif" ><input type="text" size="20" name="cusno" id="cusno" value="" class="txtbox" tabindex="1" onkeyup="<?php	echo "update_cust_list('$stname')"; ?>"/></td>
      <td width="603"  background="images/headingbg.gif" ><input type="text" size="70" name="customername" id="customername" value="" class="txtbox" onkeyup="<?php echo "update_cust_list('$stname')"; ?>"/></td>
      </table>    
                <div id="filt_table">  <table class="table">
                            <tr>
                              <th>Cheque No</th>
                              <th>Cheque Date</th>
                              <th>Cheque Amount</th>
                              <th>Bank</th>
                              <th>Customer</th>
                             
                             
   </tr>
                            <?php 
							
				// 		 company='" . $_SESSION["COMCODE"] . "' and 

							$sql="select cheque_no, che_amount, che_date, bank, refno, CUS_NAME, cus_code, ID, ret_refno  from s_invcheq where   ret_refno='0' or ret_refno='1'  ORDER BY che_date desc limit 50";
							//echo $sql;
							$stname = $_GET["stname"];
							foreach ($conn->query($sql) as $row) {
								$cuscode = $row["ID"];
								
								
							echo "<tr>               
                              <td onclick=\"chqno('$cuscode', '$stname');\">".$row['cheque_no']."</a></td>
                              <td onclick=\"chqno('$cuscode', '$stname');\">".$row['che_date']."</a></td>
                         	  <td onclick=\"chqno('$cuscode', '$stname');\">".$row['che_amount']."</a></td>
							  <td onclick=\"chqno('$cuscode', '$stname');\">".$row['bank']."</a></td>
							  <td onclick=\"chqno('$cuscode', '$stname');\">".$row['cus_code']." ".$row['CUS_NAME']."</a></td>";
							                               
                            echo "</tr>";
							}
							  ?>
                    </table>
                </div>

</body>
</html>
