<?php 
include("../../include/dbconnect.php");
?>
<title> Opening Balance Edit</title>
<style type="text/css">
body{
font-family:Verdana, Arial, Helvetica, sans-serif;
}
</style>
<link rel="stylesheet" href="../../include/style.css">
<body oncontextmenu = "javascript:return false;" ondragdrop= "javascript:return false;" onselectstart="javascript:return false;">
<center>
<table cellpadding=0 cellspacing=4 width=744>
<tr>
<td style="padding:3px;" colspan=2 class="tdhead"><b>Opening Balance</b></td>
</tr><tr valign="top"><td colspan=2>
</td>
</tr>
</table>
<table border=0 cellpadding=3 cellspacing=4 width="744" class="tdindent"><td width="205">

<form name="form1" method="POST"  action="update.php?<?echo($record);?>">
  <? 	

$result=mysqli_fetch_array(mysqli_query($conn,"select * from openbalance where record = '$record' "));

$accthead = $result['acctcode'];


$aresult=mysqli_fetch_array(mysqli_query($conn,"select description from acctmast where acctcode ='$accthead' "));

?>

  <tr>
    <td><b>Account Head</b></td>
    <td width="515">  
      <input type="text" onKeyPress="return event.keyCode!=13" size="40"  readonly name="reserved_word" value = <?php echo("'$aresult[description]'");?>>
      </td>
  </tr>  

  <tr>
    <td><b>Opening Balance</b></td>
    <td width="515">  
      <input type="text" onKeyPress="return event.keyCode!=13" size="40" name="opening_balance" value = <?php echo("'$result[opening_balance]'");?>>
      </td>
  </tr>
  
  <tr>
    <td><b>Type</b></td>
    <td width="515">  
      <input type="text" onKeyPress="return event.keyCode!=13" size="40" name="db_cr" value = <?php echo("'$result[db_cr]'");?>>
      </td>
  </tr>  
  
  <tr>
    <td><b>Account Year</b></td>
    <td width="515">  
      <input type="text" onKeyPress="return event.keyCode!=13" size="40" name="account_year" value = <?php echo("'$result[account_year]'");?>>
      </td>
  </tr>    
  <input type="hidden" name="record" value="<?=$record?>">
  <input type="hidden" name="acctcode" value="<?=$result['acctcode'];?>"

  <table cellpading=0 cellspacing=10 width= 50>
    <tr> <blockquote>
      <td>  <input type =submit name=submit value = "Update"></td>
      <td><input type ="submit" name="submit" value = "Delete"></blockquote>
        
  </table>
</table>
<br><br><font size=1><center>
  <a href= "#" onClick="javascript:window.close();">Close Window</a>
</center>
 
</body>
</form>
