<?
session_start();
include("../opendb.php");
include("../test.php");
//$res=mysqli_query($db,"select * from sparetrinwar where brcode='$brcode'")or die(mysqli_error($db));
?>
<link rel="stylesheet" href="../style.css" type="text/css" />
<style>
	tr{background-color:white}
	th{background-color:steelblue;color:white}
</style>
<center>
<h3>STOCK TRANSFER OUT (WARRANTY)</H3><hr>
<!-- <table border=0 cellspacing=1 cellpadding=3>-->
<?
$res=mysqli_query($db,"select distinct warno,cust,msno,brcode from warsparetransout where brcode='$brcode' and stono='' order by warno");
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($db));
  $brrow=mysqli_fetch_array($brres)or die(mysqli_error($db));
?>
<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>
<form action='deltranswareout2.php' method='post'>
<input type=hidden name='war_no' value='<?print $ro[0]?>'>
<input type=submit value='Cancel this warranty'>
</form>
<table border=0 width=100%>
<th>No <th>Part Code <th>Part Name <th>PSN Qty <th>Tel Qty <th>Price <th> Date
<th> STO No.<th>Preq No. <th>Inv No. <th>Inv Date <th>Status
<?
 $res1=mysqli_query($db,"select * from warsparetransout where warno='$ro[0]' and brcode='$brcode'")or die(mysqli_error($db));
$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[psnqty]</td>";
   print "<td align=right>$row[telcqty]</td><td align=right>$row[price]</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>";

}
}
?>
