<?
session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.html'; </script>";
 return;
}
?>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>

	th{background-color:steelblue;color:white}
</style>
<center>
PSN TELCON <?PRINT $branch?><br>
CLOSED PURCHASE ORDER REPORT <br>
AS ON <?print date('r')?>
<?
include("../opendb.php");
include("../test.php");
$re=mysqli_query($db,"select * from purorder_spare where brcode='$brcode' and closed='y' order by date")or die(mysqli_error());
print "<table border=0 width=90% cellspacing=2> <th width=30> NO <th width=110>Pord Date <th width=100>Part Code <th>Part Name  <th width=50>P Qty<th>Reason <th>Date";
$i=1;
  while($row=mysqli_fetch_array($re))
  {
    print "<tr bgcolor=white onMouseOver=bgColor='lightsteelblue'; onMouseOut=bgColor='white'><td>".$i++."</td><td>".datetohtml($row[date])."</td><td>$row[partcode]</td><td>$row[partname]</td>";
    print "<td align=right>".($row[qty])."</td>";
    print "<td>$row[reas]</td><td>".datetohtml($row[cldate])."</td>";
  }
 print "<tr bgcolor='steelblue'><td colspan=12></td></tr>";
 print "</table><br>";

?>
