<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
$no=$_REQUEST['no'];
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 bnkrec where brno='$no' and type='Cr' and brcode='$brcode'");
$row=mysqli_fetch_array($re);

$cusre=mysqli_query($db,"select * from customer where cname='$row[partic]' and brcode='$brcode'")or die(mysqli_error($db));
 $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>PSN AUTOMOTIVE MARKETING PVT LIMITED</TD></TR>
<?if($brcode=='PSN236')
{
?>
<TR><TD ALIGN=CENTER><font size=2>AUTHORISED DEALER FOR EICHER VEHICLES</td></TR>
<?
}
elseif($brcode=='PSN672')
{
?>
<TR><TD ALIGN=CENTER><font size=2>AUTHORISED DEALER FOR EICHER GENSET</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>
<?
  $cnr=mysqli_query($db,"select * from bnkrec where brno='$no' and type='Cr'")or die(mysqli_error($db));
   $cno=mysqli_fetch_row($cnr) or die("Error - Enter receipt No.".mysqli_error($db));
print "<table width=90%><tr><td>NO: ".$cno[1]."</td><td align=right>Date: ".datetohtml($row[date])."</span></td></tr></table>";
?>
<center>
<table width=90%>
<tr><td class=x><hr> RECEIVED with thanks from <u>
<?
    print strtoupper($row[partic]).'('.$row[no].') '.$row[cus_ac].', '.$cus_row[addr1].', '.$cus_row[city];

?> 

</u> sum of Rupees <u><?print word($row[cramt])?></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?>;
-->

<?
 print $row[narr];
?> on <?print datetohtml($row[date])?>.  This cancels the provisional receipt no.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dt.<?print datetohtml($row[date])?> 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 PSN AUTOMOTIVE MARKETING PVT LIMITED</td></tr>
<tr><td><b>Rs.<?print number_format($row[cramt],2)?>/-</b><br>(subject to realisation)&nbsp;</td></tr>
<tr><td align=right>Authorised Signatory</td></tr>
</table>

 
