<?php session_start();
?>
<!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>Print GRN</title>
<style type="text/css">
<!--
.companyname {
	color: #0000FF;
	font-weight: bold;
	font-size: 24px;
}

.com_address {
	color: #000000;
	font-weight: bold;
	font-size: 18px;
}

.heading {
	color: #000000;
	font-weight: bold;
	font-size: 20px;
}

body {
	color: #000000;
	font-size: 16px;
}


-->
</style>
</head>

<body><center>
<?php 
include('connectioni.php');
	?>
    
<table width="860" border="0">
  
        <?php
		
    	$sql_para="Select * from dep_mas where code='".$_SESSION['company']."'";
		//echo $sql_para;
		$result_para=mysqli_query($GLOBALS['dbacc'],$sql_para);
    	$row_para = mysqli_fetch_array($result_para);
				 
		
        
		//$sql1="Select * from vendor where CODE='".$_GET["txtcuscode"]."'";
    	//$result1=mysqli_query($GLOBALS['dbinv'],$sql1);
		//$row1 = mysqli_fetch_array($result1);
		
	   
	?>
        <tr>
          <td colspan="6" align="center"><?php
		  	
		  	echo "<span class=\"heading\">".$row_para["description"]."</span>";
		  ?></td>
        </tr>
        <tr>
          <td colspan="6"  align="center"><?php
		  	
		  	echo $row_para["ADD1"];
		  ?></td>
        </tr>
        <tr>
          <td colspan="6" align="center"><span class="heading">PAYMENT RECEIPT</span></td>
        </tr>
  <tr>
    <td colspan="3" scope="col">&nbsp;</td>
    <td scope="col">&nbsp;</td>
    <td colspan="2" scope="col">&nbsp;</td>
  </tr>
  </table>
  
  <table width="860" border="0">
  <tr>
    <td scope="col"><strong>Payee</strong></td>
    <td colspan="2" scope="col"><?php 
	
	echo $_GET["txt_bea"]; ?></td>
	 
    <td scope="col"><strong>Receipt No</strong></td>
	 
    <td  scope="col"><?php echo $_GET["txt_entno"]; ?></td>
  </tr>
  
  
  <tr>
    <td >&nbsp;</td>
    <td colspan="2"><?php 
	
	echo $row1["ADD1"]; ?></td>
    <td ><strong>Date</strong></td>
    <td ><?php echo $_GET["Calendar1"]; ?></td>
  </tr>
  
  <tr>
    <td><strong>Cheque No</strong></td>
    <td><?php 
	
	echo "<b>".$_GET["txt_cheno"]."</b>"; ?></td>
	 <td >&nbsp;</td>
    <td><strong>Bank</strong></td>
    <td><?php 
	
	$sql_ban="Select * from lcodes where c_code='".$_GET["com_cas"]."'";
		//echo $sql_para;
	$result_ban=mysqli_query($GLOBALS['dbacc'],$sql_ban);
    $row_ban = mysqli_fetch_array($result_ban);
		
	echo "<b>".$row_ban["c_name"].".</b>"; ?></td>
   
  </tr>
  
    <tr>
   <td width="151"><strong>Cheque Date</strong></td>
    <td width="134"><?php 
	
	echo "<b>".$_GET["chqdate"]."</b>"; ?></td>
  </tr>
  
  <tr>
   <td width="151">&nbsp;</td>
    <td width="134">&nbsp;</td>
  </tr>
  
    <tr>
   <td width="151"><strong>Narration</strong></td>
    <td width="134"><?php 
	
	echo "<b>".$_GET["TXT_NARA"]."</b>"; ?></td>
  </tr>
  
  
  </table>
  
      <center>
     <table width="615" border="1" cellpadding="0" cellspacing="0">
	  <?php
	  if (($_GET["txtmcount"]!="")&&($_GET["txtmcount"]>1)){
	  ?>    
      <tr>
        <th width="150" scope="col" align="left">Invoice No</th>
        <th width="164" scope="col" align="left">Purchase No</th>
        <th width="150" scope="col" align="right">Discount</th>
       <th width="151" scope="col" align="right">Amount</th>
      </tr>
	  <?php
	  }
	  $i=1;
	  while ($i<$_GET["txtmcount"]){
	  	
		
		$REFNO="REFNO".$i;
	  	$txtpay="txtpay".$i;
		$disc="disc".$i;
		$pi_no="pi_no".$i;
	   if (($_GET[$txtpay]>0) or ($_GET[$disc]>0)){
	  	echo "<tr>
        <td align=\"left\">".$_GET[$pi_no]."</td>
        <td align=\"left\">".$_GET[$REFNO]."</td>
		<td align=\"right\">".number_format($_GET[$disc], 2, ".", ",")."</td>
		<td align=\"right\">".number_format($_GET[$txtpay], 2, ".", ",")."</td></tr>";
		}
		$i=$i+1;	
	 }	
     
      
	 
	  ?>
      </table> <center> 
	  
	 <table width="860" border="0">
   
	    <tr>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td><strong>&nbsp;</strong></td>
    <td colspan="2"><b></b></td>
  </tr>
  <tr>
    <td>&nbsp;&nbsp;</td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td><strong>Total Payment</strong></td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><?php echo number_format($_GET["txtpaybill"], 2, ".", ","); ?></b></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td>_______________________</td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">________________________</td>
  </tr>
  <tr>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Received By</td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checked by</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
</table>
</body>
</html>
