<?
session_start();
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}
.right{text-align:right};
</style>
<center>
<h3>SPARE TRANSFER OUT</H3>
<?
$re=mysqli_query($db,"select tr_no,entrydate,sum(qty) q,pord_no,to_branch,received from sparetransout  where brcode='$brcode' group by(tr_no)");
print "<table border=0 cellspacing=1 cellpadding=3 bgcolor='lightsteelblue'> <th>Tr No <th>Entry Date ";
print "<th>QTY <th>Pur Ordno <th> Branch <th>Received<th colspan=2>Action";
while($row=mysqli_fetch_array($re))
{
 print "<tr bgcolor=white><td>$row[tr_no]</td><td>".datetohtml($row[entrydate])."</td>";
 print "<td align=right>$row[q]</td>";
 print "<td><center>$row[pord_no]</td>";
  $br=mysqli_query($db,"select * from branch where brcode='$row[to_branch]'");
  $br_row=mysqli_fetch_row($br);
 print "<td>$br_row[1]</td><td><center>$row[received]</td>";
 print "<td align=center><a href='vmtrout.php?tr_no=$row[tr_no]' target=x>View</a></td>";
 if($row[received]=='N')
  print "<td><input type=button value='Del' onClick=fun('$row[tr_no]')></td>";
 print "</tr>";
}
?>
<tr><td colspan=10></td>
</table>
<script>
 function fun(x)
 {
   if(confirm('Do you want to delete Trasfer No '+x+' ?'))
    document.location='deltransout.php?trno='+x;
 }
</script>
