<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='inde.php'; </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>
<form name="f1" action="pbyporder1.php" method=post>
<table border=0 cellspacing=1 cellpadding=3>
<th colspan=4><b>Purchase By P Order</b>
<tr><td>Type</td><td>
<select name='taxtype'>
<option>CST</option>
<option>VAT</option>
</select></td>
<?
$sq=mysqli_query($db,"select distinct orderno from purorder_spare where brcode='$brcode' and orderto not in(select brcode from branch) and (qty-sup_qty)>0 order by orderno desc");
print "<td>Purchase Order No</td><td>";
print "<select name='pono'>";
print "<option></option>";
while($pn=mysqli_fetch_array($sq))
{
print "<option>$pn[orderno]</option>";
}
print "</select></td></tr>";

?>
<th colspan=4><input type=submit value="Next->" name="sv">
</table>
</form>
