<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.html'; </script>";
 return;
}
include("../../opendb.php");
include("../../test.php");
?>
<link rel="stylesheet" href="../../style.css" type="text/css" />
<style>
	tr{background-color:white}
	th{background-color:steelblue;color:white}
</style>
<center>

<?
if($show)
{
$df=$y.'-'.$m.'-'.$d;
$dto=$y1.'-'.$m1.'-'.$d1;
print "PSN TELCON ".$branch."<BR>";
PRINT "SPARE TRANSFER OUT (WAR) REPORT FROM ".datetohtml($df).' TO '.datetohtml($dto);
print "<br> Printed By $user  On ".date("r")."<br>&nbsp;";

$sq="select * from warsparetransout where brcode='$brcode' and transdate>='$df' and transdate<='$dto'";

 $res=mysqli_query($db,$sq);
 print "<center><table cellspacing=1 cellpadding=4 bgcolor='gray'>";
 print "<th>War No<th>Part Name <th>Qty<th>Amount<th>MSNO <th>STONO";
 while($row=mysqli_fetch_array($res))
 {
  $amt=($row[psnqty]*$row[price]);
  $tamt+=$amt;
   print "<tr bgcolor=white><td>$row[warno]</td><td>$row[partname]</td>";
   print "<td align=right>$row[psnqty]</td>";
   print "<td align=right>".putcoma($row[psnqty]*$row[price])."</td>";
   print "<td>$row[msno]</td><td>$row[stono]</td>";
 }
 print "<tr><td colspan=3 align=center><b>Total</b></td><td align=right>".putComa($tamt)."</td>";
 print "<td></td><td></td>";
return;
}

?>
<form action='<?print $PHP_SELF?>' method='post'>
<table>
<th colspan=4><font size=4>WARANTY TRANSFER OUT REPORT</font></TH>
<TR><TD>From </td><td>dd <input type=text name='d' size=2 value='<?print date('d')?>'>
mm <input type=text name='m' size=2 value='<?print date('m')?>'>
yy <input type=text name='y' size=4 value='<?print date('Y')?>'>
</td></tr>
<TR><TD>To </td><td>dd <input type=text name='d1' size=2 value='<?print date('d')?>'>
mm <input type=text name='m1' size=2 value='<?print date('m')?>'>
yy <input type=text name='y1' size=4 value='<?print date('Y')?>'>
</td></tr>
<th colspan=4><input type=submit value='Show' name='show'></TH>
</table>
</form>



