<?php
session_start();
include_once('../opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.php'; </script>";
 return;
}
$cname=$_REQUEST['cname'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='../index.php' </script>";
  return;
}
$sql="select distinct orderno from saleorder_sparedc where brcode='$brcode' and qty>sup_qty and closed='N' order by orderno desc";
$result = mysqli_query($db,$sql);
if(mysqli_num_rows($result)<1)
{
    print "<script>alert(No Sale Order For ".$cname.");</script>";
}
print "<select name='pono' onChange='showinfo(this.value)'>";
?>
print "\n<option>-select-</option>";
<?
while($row=mysqli_fetch_array($result))
 {
   print "\n<option>".$row['0']."</option>";
 }
    print "</select>";

?>
<input type=text name='cstmr' id='cstmr' readonly>


