<?php 
include("../../include/dbconnect.php");
?>
<title> Purchase Order details edit</title>
<body bgcolor="#ffffff"  topmargin=0>
<center>
<table cellpadding=0 cellspacing=4 width=590>
<tr>
<td style="padding:3px;" colspan=2 bgcolor="#93BEE2"><font ><b>Purchase Order  details edit</font></td>
</tr><tr valign="top"><td colspan=2>
<font >&nbsp;</font>
</td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="590">
<form name="form1" method="POST"  action="update.php?record=<?echo($record);?>">
<?php 

$result = mysql_query("SELECT distinct matpo.record,matpo.compcode,matpo.print_status,matpo.po_no,matpo.po_date,supplier.name,rawmaterial.prodname,matpo.qty,matpo.rate,matpo.delivery_date,matpo.sales_tax,matpo.excise_duty,matpo.documents,matpo.pay_terms,matpo.desp_mode,matpo.despatch_from,matpo.received_qty,matpo.received_date,matpo.indent_record,matpo.remarks,matpo.specifications,account_year,matpo.reference,matpo.unit,matpo.rejected_qty FROM matpo,supplier,rawmaterial WHERE (matpo.record ='$record') and matpo.bcode=supplier.bcode and matpo.prodcode=rawmaterial.prodcode  order by po_date,po_no ") or die(mysql_error());
$row1=mysql_fetch_row($result);
?>

<table border="0" cellspacing="1" cellpadding="4" align="center" width="500" bgcolor="#999999">
        

<input type="hidden" name="record" value="<? echo($row1[0]); ?>">


<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Compcode </font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="40" name="compcode" readonly value = <?php echo("'$row1[1]'");?>>  </td></tr>

<tr><td bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">P O Printed </font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   maxlength=12 size="10" name="print_status" value = <?php echo("'$row1[2]'");?>></td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">P O No  </font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   maxlength=20 size="40" name="po_no" value = <?php echo($row1[3]);?>></td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">PO Date</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="11" name="po_date" value = <?php echo("'$row1[4]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Supplier Name</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="50" name="temp" readonly value = <?php echo("'$row1[5]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Product</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="50" name="temp" readonly value = <?php echo("'$row1[6]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Specification</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="20" name="specifications"  value = <?php echo("'$row1[20]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">PO Qty</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="qty"  value = <?php echo("'$row1[7]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Rate</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="rate"  value = <?php echo("'$row1[8]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Unit</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="20" name="unit"  value = <?php echo("'$row1[23]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Delivery Date</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="delivery_date"  value = <?php echo("'$row1[9]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Sales Tax type</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="sales_tax"  value = <?php echo("'$row1[10]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Excise Duty</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="excise_duty"  value = <?php echo("'$row1[11]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Document Type</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="documents"  value = <?php echo("'$row1[12]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Payment Terms</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="pay_terms"  value = <?php echo("'$row1[13]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Despatch Mode</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="desp_mode"  value = <?php echo("'$row1[14]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Despatch From</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="despatch_from"  value = <?php echo("'$row1[15]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Received Qty</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="received_qty"  value = <?php echo("'$row1[16]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Rejected Qty</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="rejected_qty"  value = <?php echo("'$row1[24]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Received Date</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="15" name="received_date"  value = <?php echo("'$row1[17]'");?>>  </td></tr>



<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Remarks</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="20" name="remarks"  value = <?php echo("'$row1[19]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Accounting Year</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="20" name="account_year"  value = <?php echo("'$row1[21]'");?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Reference</font></td><td  bgcolor="#FFFFFF">
<input type="text"    onKeyPress="return event.keyCode!=13"   size="20" name="reference"  value = <?php echo("'$row1[22]'");?>>  </td></tr>



<tr>
<td align=right>
 <blockquote>  <input  type =submit name=submit value = "Update"></td> <td><input type =submit name=submit value = "Delete"></blockquote>
</table>

<br><br><font size=1><center><a href= "index.html">Return to index page</center></font>
</body>
</form>
