<?php 
include("../../include/dbconnect.php");
?>
<title> spurchase 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>Items 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="abc" method="POST"  action="pupdate.php?record=<?echo($record);?>">
<?php 

$result = mysqli_query($conn,"SELECT distinct spurch.record,product.prodname,spurch.qty,spurch.capacity,spurch.rate,spurch.discount,spurch.remarks FROM spurch,product WHERE spurch.record = '$record' and spurch.prodcode = product.prodcode ") or die(mysqli_error());
$row1=mysqli_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">Product Name </font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   size="40" name="prodname" readonly value = <?php echo("'$row1[1]'");?>>  </td></tr>

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

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Capacity </font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   maxlength=20 size="40" name="capacity" value = <?php echo($row1[3]);?>></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"   maxlength=20 size="40" name="rate" value = <?php echo($row1[4]);?>></td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Discount %</font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   maxlength=20 size="40" name="discount" value = <?php echo($row1[5]);?>></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"   maxlength=20 size="40" name="remarks" value = <?php echo($row1[6]);?>></td></tr>


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


                                                                             
</body>
</form>
