<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("../opendb.php");
include("../test.php");
$re=mysqli_query($db,"select * from receipts where jvno='$jvno' and brcode='$brcode'");
$row=mysqli_fetch_array($re);

$cusre=mysqli_query($db,"select * from cust_master where acname='$row[cus_ac]' and branch='$brcode'")or die(mysqli_error());
 $cus_row=mysqli_fetch_array($cusre);

$ad=mysqli_query($db,"select * from branch where brcode='$brcode'");
$brrow=mysqli_fetch_array($ad);
?>
<style>
td,body{font-family:sans;letter-spacing:1;}
.x{line-height:3}
</style>

<table width=90%>
<?
$brname=explode(',',$branch);
?>
<tr><td align=center><p style={letter-spacing:9;font-size:15}><b><?print strtoupper($brname[0])?></TD></TR>
<TR><TD ALIGN=CENTER><font size=2>AUTHORISED DEALER FOR EICHER VEHICLES</td></TR>
<TR><TD ALIGN=CENTER><font size=2><?print strtoupper($brrow[braddr]).', '.strtoupper($brrow[brcity])?></td></tr>
<tr><td align=center><br><U>R E C E I P T </U></TD></TR>
</table>
<center>
<?
$type='';

if($row[ptype]=='Cash')
{
  $cnr=mysqli_query($db,"select crno from cshrec where j_type='$jvno'");
   $cno=mysqli_fetch_row($cnr);
print "<table width=90%><tr><td>NO: ".$cno[0]."</td><td align=right>Date: ".datetohtml($row[date])."</span></td></tr></table>";
 $type='Cash';
}
else
{
  $cnr=mysqli_query($db,"select brno from bnkrec where j_type='$jvno'");
   $cno=mysqli_fetch_row($cnr);
print "<table width=90%><tr><td>NO: ".$cno[0]."</td><td align=right>Date: ".datetohtml($row[date])."</span></td></tr></table>";
 $type='Cheque';
}
?>
<center>
<table width=90%>
<tr><td class=x><hr> RECEIVED with thanks from <u>
<?
if($row[fine]=='Cheque')
  {
    print $cus_row[custname].''.$cus_row[addr1].', '.$cus_row[city];
  }
else if ($type=='Cheque')
  {
   if($row[fine]=='Cash')
    print $cus_row[custname].', '.$cus_row[addr1].', '.$cus_row[city];
    else
    print strtoupper($row[fine]).' , A/c. '.$cus_row[custname].', '.$cus_row[addr1].', '.$cus_row[city];
  }
else
  print $cus_row[custname].', '.$cus_row[addr1].', '.$cus_row[city]. ' ';

?> 

</u> sum of Rupees <u><?print word($row[amount])?></u> Only towards our Invoice No. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Delivery Order No. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by <? print $type?>.

<!-- </u> Only towards our Invoice No. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Delivery Order No. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by <? print $type?>;.
-->

<?
if($type=='Cheque')
 print $row[narr];
?>   This cancels the provisional receipt no.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dt. for Rs.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  issued by</td></tr>
<tr><td align=right> For <?print $brname[0]?></td></tr>
<tr><td><b>Rs.<?print $row[amount]?>/-</b><br>
<?if ($type=='Cheque')
print "(sub. to realisation)";
?>
</td></tr>
<tr><td align=right>Authorised Signatory</td></tr>
</table>

 
