
<style>
 td{font-family:'fixed';color:black;}
 body{background-color:white;font-family:'arial narrow' ;color:black;}
</style>

<?
include ("opendb.php");
include("test.php");
?>
<FONT SIZE=4><u><center>JOURNAL ENTRIES FROM <?echo datetohtml($dt1)?> TO <?echo datetohtml($dt2)?></u></FONT><BR>&nbsp;

<?
/*
$sql="select * from actrans where mode='jour' and dt>='$dt1' and dt<='$dt2' order by dt";
$result=mysqli_query($db,$sql) or die(mysqli_error());
print "<table bgcolor=white cellspacing=11 cellpading=1>";
print "<th>Date <th>Particulars <th>Amount";
while($row=mysqli_fetch_array($result))
{
 print "\n<tr bgcolor=white><td valign=top>".datetohtml($row[dt])."</td><td>$row[dr] Dr <br> &nbsp;&nbsp;To $row[cr]</td>";
 print "<td valign=bottom align=right>".putComa($row[amt])."</td></tr>";
}
*/

$re=mysqli_query($db,"select distinct jvno,date from journal2 where j_type='JV' and brcode='$brc'  and date>='$dt1' and date<='$dt2' order by date");
print"<hr>";

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

}
?>
</table>
