<?
session_start();
include("../opendb.php");
include("../test.php");
?>
<title>PSN Telcon</title>
    <script type="text/javascript" src="../../scripts/jquery-latest.js"></script>
	<link type="text/css" href="../../includes/style1.css" rel="stylesheet" />
    <link type="text/css" href="../../css/form.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
    </script>
<body background="../../back_ground.jpg">

<?php include('top.php'); ?>
<br>

<table class="container"><tr><td>
<?
$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% class=report> <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>
<input type=button value='Back' onClick=document.location='jour.php'>
