
<?
 session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../ind.php'; </script>";
 return;
}
include("../opendb.php");
include("../test.php");
?>
<style>
body,td{font-family:'arial narrow';letter-spacing:1;font-size:13}
th{background-color:c1d799}
.mnu{margin-left:5}
body{BACKGROUND-COLOR:fcfff1}
</style>
<H3>PROFORMA REGISTER</H3>
<form action='<?print $PHP_SELF?>'>
<table bgcolor='silver'>
<tr><td> Date from </td><td>dd<input type=text name='d' size=2 value='<?print date("d",time())?>'>
				mm<input type=text name='m' size=2 value='<?print date("m",time())?>'>
				yy<input type=text name='y' size=4 value='<?print date("Y",time())?>'>
			</td></tr>

<tr><td> To </td><td>dd<input type=text name='d1' size=2 value='<?print date("d",time())?>'>
				mm<input type=text name='m1' size=2 value='<?print date("m",time())?>'>
				yy<input type=text name='y1' size=4 value='<?print date("Y",time())?>'>
			</td>
</tr>



<tr><td colspan=2 align=center><input type=submit name='show' value='Show'>
<input type=submit name='prn' value='Print'>
</td></tr>
</table>
</form>
<?
if($prn)
{
   $df=$y.'-'.$m.'-'.$d;
   $dt=$y1.'-'.$m1.'-'.$d1;
   //    print "<script> window.open('prnvehsreg.php?df=$df&dt=$dt&tp=$tp');</script>";
}
 if($show)
  {
   $df=$y.'-'.$m.'-'.$d;
   $dt=$y1.'-'.$m1.'-'.$d1;
   $res=mysqli_query($db,"select * from profinv where brcode='$brcode' and invdate>='$df' and invdate<='$dt' order by invno desc");
print "<table bgcolor='gray' cellspacing=1 cellpadding=1>";
print "<th>Inv<th>Customer <th>Model/config<th>Fin<th>Date <th>Unit<br>Price";
print "<th>Disc <th>Before <br>Tax <th>Net";
while($row=mysqli_fetch_array($res))
{
print "\n\n<tr bgcolor='white'><td>$row[invno]</td><td>$row[cust]-$row[addr]</td><td>$row[model_code]$row[config]</td>";
print "<td>$row[fin]</td><td>".datetohtml($row[invdate])."</td>";
print "<td align=right>$row[unit]</td><td align=right>$row[disc]</td>";
print "\n<td align=right>$row[amt2]</td><td align=right>$row[netamt]</td></tr>";
}

}
?>
</table>
