<?
session_start();
include("../opendb.php");
include("../test.php");
?>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
td{font-size:14}
</style>
<?
$dtf=$yf.'-'.$mf.'-'.$df;
$dtt=$yt.'-'.$mt.'-'.$dt;

$re=mysqli_query($db,"select distinct jvno,date from journal2 where brcode='$brcode' and date>='$dtf' and date<='$dtt' 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());
    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>
<input type=button value='Back' onClick=document.location='jour.php'>
