<?
session_start();
include("../opendb.php");
include("../test.php");
//$res=mysqli_query($db,"select * from sparetrinwar where brcode='$brcode'")or die(mysqli_error());
?>
<head>
<title>Spare Transfer IN</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
	tr{background-color:white}
	th{background-color:steelblue;color:white}
</style>
</head>
<center>
<h3>
<?
  $brres=mysqli_query($db,"select * from branch where brcode='$brcode'");
  $brrow=mysqli_fetch_array($brres);
  print "PSN TELCON <BR>".$brrow[brname].' BRANCH<BR>'.$brrow[braddr];
?>
</h3>
<h4>PHYSICAL STOCK TRANSFER IN (WARRANTY)</H4><hr>
<!-- <table border=0 cellspacing=1 cellpadding=3>-->
<?
$res=mysqli_query($db,"select distinct warno,cust,msno,brcode from sparetrinwarph where brcode='$brcode'")or die(mysqli_error());
if(mysqli_num_rows($res)>0)
{
while($ro=mysqli_fetch_array($res))
{
  $brres=mysqli_query($db,"select brname from branch where brcode='$ro[brcode]'")or die(mysqli_error());
  $brrow=mysqli_fetch_array($brres)or die(mysqli_error());
?>
<fieldset> <legend> Warranty No : <b><?print $ro[0]?> </b>
Customer : <font color=blue><?print $ro[cust]."</font> MSNO :<font color=blue>".$ro[msno]."</font> From Branch: <font color=red>$brrow[0]</font>"?></legend>

<table border=0 width=100%>
<th>No <th>Part Code <th>Part Name <th>PSN Qty <th>Tel Qty <th>Amount <th> Entry Date
<th> STO No.<th>Preq No. <th>Inv No. <th>Inv Date <th>Status
<?
 $res1=mysqli_query($db,"select * from sparetrinwarph where warno='$ro[0]' and brcode='$brcode'")or die(mysqli_error());
$i=1;
  while($row=mysqli_fetch_array($res1))
 {
  print "\n<tr><td>".$i++."</td><td>$row[partcode]";
  print "</td><td>$row[2]</td>";
  print "<td align=right>$row[recqty]</td>";
   print "<td align=right>$row[telcqty]</td><td align=right>$row[amount]</td>";
   print "\n<td align=right>".datetohtml($row[date])."</td>";

   print "<td><center>$row[stono]</td>";
   print "<td><center>$row[preqno]</td>";
   print "<td><center>$row[invno]</td>";
   print "\n<td><center>".datetohtml($row[invdate])."</td>";
   print "<td><center>$row[stat]</td></tr>";
}
print "\n</table></fieldset><br>";

}
}
?>
