<?
session_start();
?>

<style>
 th,td{font-family:sans-serif;color:black; font-size:12}
 body{background-color:silver;font-family:sans-serif;color:black;}
</style>

<center>
<?
include ("../opendb.php");
include("../test.php");
$ad=mysqli_query($db,"select * from branch where brcode='$brcode'");
$brrow=mysqli_fetch_array($ad);
$brname=explode(',',$branch);

?>
<br><br>
<center>
<table width=90%>
<tr><td align=center><p style={letter-spacing:2;font-size:15}><b>PSN AUTOMOBILES P.Ltd</TD></TR>
<TR><TD ALIGN=CENTER><font size=2></td></TR>
<TR><TD ALIGN=CENTER><font size=2><?print strtoupper($brrow[braddr]).', '.strtoupper($brrow[brcity])?></td></tr>
<tr><td ALIGN=CENTER><FONT SIZE=4>JOURNAL ENTRIES</FONT><BR>&nbsp;</td></tr>

</table>
</center>

<?
$re=mysqli_query($db,"select distinct jvno,date from journal2 where j_type='JV' and brcode='$brcode'  and date>='$dt1' and date<='$dt2' order by date");
print "<table bgcolor='ivory' border=0 cellspacing=3 cellpadding=1 width=100%> <th>Tr. No <th>Date <th>Particulars <th>Debit <th>Credit <th>Narration <th width=50>Type<th>Ref <th>No";
while($row=mysqli_fetch_array($re))
{
  print "\n<tr bgcolor='silver'><td>$row[jvno]</td><td>".datetohtml($row[date])."</td><td></td>";
  print "<td></td><td></td><td></td><td></td><td></td><td></td></tr>";
  $re2=mysqli_query($db,"select * from journal2 where jvno='$row[jvno]' and brcode='$brcode'") or die(mysqli_error($db));
    while($jvrow=mysqli_fetch_array($re2))
    {
        print "\n<tr><td>&nbsp;</td><td>&nbsp;</td><td>$jvrow[partic]</td>";
        print "<td align=right>".nozero($jvrow[dramt])."</td>";
        print "<td align=right>".nozero($jvrow[cramt])."</td><td>$jvrow[narr]</td><td>$jvrow[j_type]</td><td>$jvrow[against]</td><td>$jvrow[no]</td></tr>";
  }
     print "<tr><td colspan=9 bgcolor=silver></td></tr>";

}
?>
</table>
<br>


