<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}

include("../opendb.php");
include("../test.php");
$dbno=$_REQUEST['dbno'];
$re1=mysqli_query($db,"select * from dbnote where dbno='$dbno' and brcode='$brcode'");
$dbrow=mysqli_fetch_array($re1);
$re=mysqli_query($db,"select * from branch where brcode='$brcode'");
$brow=mysqli_fetch_array($re);
?>
<style>
td,body{font-family:arial;background-color:white;font-size:14}
</style>
<CENTER>
<table width=100% BORDER=0>
<?
$brname=explode(',',$branch);
?>
<tr><td align=center COLSPAN=2><span style={letter-spacing:5}><b><?print STRTOUPPER($brname[0])?></b> </span> <br>AUTHORISED DEALER FOR EICHER VEHICLES<BR>
Regd.Off. 35/189, NH 47, PALARIVATTOM, COCHIN, PIN.682 025<BR>
<?Print $brow[braddr].'<br>'.$brow[brcity].',Phone:'.$brow[brphone]?>
</td></tr>
<tr><td><center>
<table width=60%>
<tr><td><center> No : <?print $dbno?></td><td><center>Date : <?print datetohtml($dbrow[date])?></td>
    <td><center>EML DA No</td></tr>
</table>
</td></tr>
</table>
<br>

<table border=1 width=80%  cellpadding=4>
<TH> DESCRIPTION <TH> AMOUNT
<TR><TD>
<br>
<?
$re2=mysqli_query($db,"select * from dbnote where dbno='$dbno' and type='Dr' and brcode='$brcode'");
$dbrow=mysqli_fetch_array($re2);
?>
To <br>
 <?print $dbrow[dbto];?>
<br>
<?
print '<br>'.$dbrow[narr].'<br>&nbsp;';
?>
</td><td><center><? print $dbrow[dramt]?></td></tr>
</table>
<br>
<table width=80%>
<?$re3=mysqli_query($db,"select * from dbnote where dbno='$dbno' and type='Dr' and brcode='$brcode'");
$dbrow=mysqli_fetch_array($re3);
?>
<tr><td>Debit A/c </td><td>: <?print $dbrow[partic]?></td></tr>

<?$re4=mysqli_query($db,"select * from dbnote where dbno='$dbno' and type='Cr' and brcode='$brcode'");
$dbrow=mysqli_fetch_array($re4);
?>
<tr><td>Credit A/c </td><td>: <?print $dbrow[partic]?></td></tr>
<tr><td colspan=2 align=right>For <?print STRTOUPPER($brname[0])?></TD></TR>
<tr><td colspan=2 align=right><BR><BR><BR>Authorised Signatory</TD></TR>




