<?
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 IN (WAR) REPORT AS ON ".date("r")."<br>&nbsp;";

$sq="select * from sparetrinwar where brcode='$brcode' and date>='$df' and date<='$dto'";
 $res=mysqli_query($db,$sq);
 print "<center><table cellspacing=1 cellpadding=4 bgcolor='gray'>";
 print "<th>War No<th>From Branch <th>Part Name <th>Qty<th>MSNO <th>STONO";
 while($row=mysqli_fetch_array($res))
 {
   print "<tr bgcolor=white><td>$row[warno]</td><td>$row[frombr]</td><td>$row[partname]</td>";
   print "<td align=right>$row[psnqty]</td><td>$row[msno]</td><td>$row[stono]</td>";
 }
return;
}

?>
<form action='<?print $PHP_SELF?>' method='post'>
<table>
<th colspan=4><font size=4>WARANTY TRANSFER IN 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>



