<? 
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.php'; </script>";
 return;
}
include("../opendb.php");
include ("../test.php");
$re1=mysqli_query($db,"select distinct(invno),cust,chasis from veh_invoice where brcode='$brcode' order by invno desc limit 80");
?>

<center>
<form action='einvoice_spareinvoicenew.php' method='POST' onSubmit="return valid()">
<table cellspacing=1 cellpadding=2 class='form'>
<tr height=21><td colspan=2 align=center bgcolor='steelblue'><FONT COLOR=white><B>Spare Invoice</td></tr>
</td></tr>
<tr><td>Inovice No.</td><td>
<select name='trnsno'>
<?

while($row=mysqli_fetch_array($re1))
{
    $query=mysqli_query($db,"select * from cust_master where code='$row[cust]'"); 
    $cus_row=mysqli_fetch_array($query);
    print "<option value='$row[0]'>$row[0]-($cus_row[custname])-$row[2]</option>";
}

?>
</select>
</td></tr>









<tr><td colspan=2 align=center bgcolor='lightsteelblue'>
<input type=submit value='Save' name='sv'> <input type=button value='Cancel'>
</td></tr>
</table>
</form>


</td></tr></table>
