<?php 
include("../../include/dbconnect.php");
?>
<title> 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>Edit Entered Details </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="pupdate2.php?record=<?echo($record);?>&compcode=<?=$compcode?>&branch=<?=$branch?>&date=<?=$date?>">
<?php 
$result = mysqli_fetch_array(mysqli_query($conn,"select acctcode,date,narration,dbamt,cramt,type,trans_id,record,invno,account_year from  templedger where record = '$record' ")) or die(mysqli_error());

$acctcode = $result['acctcode'];

	
	$prodname = mysqli_fetch_array(mysqli_query($conn,"select description from acctmast where acctcode = '$acctcode'")) or die(mysqli_error());
	
?>

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

<input type="hidden" name="record" value="<?=$result['record']?>">


<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Account Head </font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   size="40" name="prodname" readonly value = <?=$prodname['description']?>>  </td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Bill / Voucher No </font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   maxlength=10 size="10" name="invno" value = <?=$result['invno']?>></td></tr>


<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Date </font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"   maxlength=10 size="10" name="date" value = <?=british($result['date'])?>></td></tr>


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

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Debit Amount</font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"    size="40" name="dbamt" value = <?=$result['dbamt']?>></td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Credit Amount</font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"    size="40" name="cramt" value = <?=$result['cramt']?>></td></tr>

<tr><td  bgcolor="#FFFFFF"><font  face="Arial, Helvetica, sans-serif">Type</font></td><td  bgcolor="#FFFFFF">
<input type="text" onKeyPress="return event.keyCode!=13"    size="40" name="type" readonly value = <?=$result['type']?>></td></tr>

<input type="hidden" name="trans_id" value="<?=$result['trans_id']?>">
<input type="hidden" name="acctcode" value="<?=$result['acctcode']?>">
<input type="hidden" name="account_year" value="<?=$result['account_year']?>">


<tr> <blockquote>
<td align=right>
  <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= "javascript:window.close();">Close Window</a></center></font>
</body>
</form>
