<!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>Untitled Document</title>
<link rel="stylesheet" href="css/table_min.css" type="text/css"/>	
</head>

<body>
<div class="CSSTableGenerator" id="chq_table1" >
     <?php
    $dateFilterOff = $_GET['dateFilterOff'];
    if ($_GET['dateFilterOff'] != 'true') {
        $txthead = "from ".$_GET['from'] . " to " . $_GET['to'];
    }
    $txthead .= " for ".$_GET["company"];
    echo "<center><span class=\"style1\">Deposited Cheques " . $txthead . "</span></center><br>";
    ?>
<table width="1000" border="0">
  <tr>
    <td>Cheque No</td>
    <td>Ref No</td>
    <td>Cheque Date</td>
    <td>Cheque Amount</td>
    <td>Bank</td>
    <td>Customer</td>
  </tr>
  <?php
  include('connectioni.php');
  $phrase = "";
    if ($_GET['dateFilterOff'] != 'true') {
        $phrase .= " and che_date between '" . $_GET['from'] . "' and '" . $_GET['to'] . "' ";
    }
    if ($_GET['company'] != 'All') {
        $phrase .= " and ret_refno like 'PTA%'";
    }
							$sql="select cheque_no, che_amount, che_date, bank, refno, CUS_NAME, cus_code, ID, ret_refno  from s_invcheq where ret_refno!='0' and ret_refno!='1' $phrase ORDER BY che_date desc ";
				// 			echo $sql;
							$stname = $_GET["stname"];
							$result=mysqli_query($GLOBALS['dbinv'],$sql);
							while($row = mysqli_fetch_array($result)){
								$cuscode = $row["ID"];
								
								
							echo "<tr>               
                              <td>".$row['cheque_no']."</a></td>
							  <td>".$row['ret_refno']."</a></td>
                              <td>".$row['che_date']."</a></td>
                         	  <td>".$row['che_amount']."</a></td>
							  <td>".$row['bank']."</a></td>
							  <td>".$row['cus_code']." ".$row['CUS_NAME']."</a></td>";
							                               
                            echo "</tr>";
							}
  ?>
</table>
</div>
</body>
</html>
