<?
session_start();
include("../opendb.php");
$result=mysqli_query($db,"select * from ledger where led='$ledg' and (brcode='$brcode' or brcode='1')");
$row=mysqli_fetch_array($result)or die('Leger '.$ledg.' does not belong to this branch'.mysqli_error($db));
?>
<title>Xpress</title>
    <script type="text/javascript" src="../scripts/jquery-latest.js"></script>
	<link type="text/css" href="../includes/style1.css" rel="stylesheet" />
	<link type="text/css" href="../css/form.css" rel="stylesheet" />
    <script type="text/javascript">
        $(function() {
          if ($.browser.msie && $.browser.version.substr(0,1)<7)
          {
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').show();
				}).mouseout(function(){
				$(this).children('ul').hide();
				})
          }
        });        
    </script>
<body background="../back_ground.jpg">
<?php include('top.php'); ?>
<style>
td,input,body{font-family:verdana}
</style>

<center>
<form name=f1 action='updledger.php' method='post'>
<?
if($ledg == "Cash" || $ledg == "Petty Cash")
{
print "<font color=red>(Update opening balance only)";
?>
<table border=1>
<TR><TD COLSPAN=2 BGCOLOR=#5b5858 ALIGN=CENTER><FONT COLOR=WHITE><B>EDIT LEDGER
</TD></TR>
<input type=hidden name=led value='<? echo $row[0]?>'>
<tr><td>Ledger</td><td><?print $row[0]?></td></tr>
<tr><td>Group</td><td><input type=text readonly name=grp size=40 value='<?print $row[1]?>'> 
</td></tr>
<tr><td>Opening Balance</td><td><input type=text name=opb value='<?print $row[2]?>' style={text-align:right}></td></tr>
<tr><td>Debit/Credit</td><td>
<input type=text name=drcr readonly size=4 value='<?print $row[drcr]?>' style={background:silver}>

<TR><TD COLSPAN=2 BGCOLOR=#5b5858 ALIGN=CENTER>
 <INPUT TYPE=SUBMIT VALUE='SAVE'> <INPUT TYPE=BUTTON VALUE='CANCEL' onClick=history.back(1)>
</TD></TR>
</table>
<?
}
else
{
echo $row[0];
?>
<table border=1>
<TR><TD COLSPAN=2 BGCOLOR=#5b5858 ALIGN=CENTER><FONT COLOR=WHITE><B>EDIT LEDGER
</TD></TR>
<input type=hidden name=led value='<?print $row[0]?>'>
<tr><td>Ledger</td><td><? echo $row[0] ?></td></tr>
<tr><td>Group</td><td><input type=text readonly name=grp size=40 value='<? echo $row[1]?>'> <input type=button value='?' onClick=window.open('getgrp.php',menubar=false,resizeable=false);></td></tr>
<tr><td>Opening Balance</td><td><input type=text name=opb value='<? echo $row[2]?>' style={text-align:right}></td></tr>
<tr><td>Debit/Credit</td><td>
<input type=text name=drcr readonly size=4 value='<?print $row[drcr]?>' style={background:silver}>

<TR><TD COLSPAN=2 BGCOLOR=#5b5858 ALIGN=CENTER>
 <INPUT TYPE=SUBMIT VALUE='SAVE'> <INPUT TYPE=BUTTON VALUE='CANCEL' onClick=history.back(1)>
</TD></TR>
</table>
<?
}
?>
</form>
