<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
?>
<center>
<?
include_once("../opendb.php");
include_once("../test.php");
$y=$_REQUEST['y'];
$m=$_REQUEST['m'];
$d=$_REQUEST['d'];
$y1=$_REQUEST['y1'];
$m1=$_REQUEST['m1'];
$d1=$_REQUEST['d1'];
$dtfrom=$y.'-'.$m.'-'.$d;
$dtto=$y1.'-'.$m1.'-'.$d1;
?>
<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('logo1.php'); ?>
<?php include_once('top.php'); ?>
<table class="container"><tr><td>
<table border=0 >
<tr><td align=right><input type=button value=print onClick=window.open('prnjour.php?dt1=<?print $dtfrom?>&dt2=<?print $dtto?>')></td></tr>

<tr bgcolor='green'><td>
<FONT SIZE=4 COLOR='WHITE'>JOURNAL ENTRIES</FONT><BR>&nbsp;</td></tr>
</table>
<?
$re=mysqli_query($db,"select distinct jvno,date,tr_no from journal2 where j_type='JV' and brcode='$brcode'  and date>='$dtfrom' and date<='$dtto' order by date");
print "<table  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<th>Print";
while($row=mysqli_fetch_array($re))
{
    print "\n<tr bgcolor='silver'><td>$row[tr_no]</td><td>".$row['date']."</td><td></td>";
    print "<td></td><td></td><td></td><td></td><td></td><td></td><td><input type=button value='Print Journal' onclick=window.open('prnvoucher.php?jvno=".$row['jvno']."')></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>".$jvrow['dramt']."</td>";
        print "<td align=right>".$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>
<script>
function printjournal(jno)
{

</script>

