<?
session_start();
//include_once('includes/top.php');
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
//$br=$_SESSION['branch'];
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}

?>
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <title>khadi villages and industries board</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" src="js/jquery-1.6.1.min.js"></script>

<link rel="stylesheet" href="style.css" type="text/css" />
<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>
	<script type="text/javascript">
    $(document).ready(function() {
        var cont_left = $("#container").position().left;
        $("a img").hover(function() {
            // hover in
            //$(this).parent().parent().css("z-index", 1);
            $(this).animate({
               height: "110",
               width: "110",
              
            }, "fast");
        }, function() {
            // hover out
         //   $(this).parent().parent().css("z-index", 0);
            $(this).animate({
                height: "80",
                width: "80",
                
            }, "fast");
        });
        
        $(".img").each(function(index) {
            var left = (index * 160) + cont_left;
            $(this).css("left", left + "px");
        });
    });
    </script>
<style>
#txt{
font-family: Arial, Helvetica;
background-color: #F2F2F2;

}
</style>
<style>
.cont
	{


       background-color:#3b5999;

	//background:url(images/bg-inner.jpg) #e9e0c3 repeat-x;
  	width: 100%;position: absolute ;
	height:99%;
    	/* Optional - just for DIV)*/
    	//border: solid 1px #000000;
	-moz-box-shadow: 0px 5px 5px #888;
	-webkit-box-shadow: 0px 5px 5px #888;
	box-shadow: 0px 5px 10px #888;
    
	}
</style>
<body bgcolor="EEEECE">
<div class='cont'>
<?php include('includes/top.php'); ?>
<br/>

<?
$result=mysqli_query($db,"select op from ledger where led='CASH' and brcode='$brcode'") or die(mysqli_error($db));
$row=mysqli_fetch_array($result);
if(isset($_POST['upd']))
{
	$cashbal=$_REQUEST['cashbal'];
	
 
	$dt=date('Y-m-d');
    mysqli_query($db,"update ledger set op='$cashbal' where led='CASH' and brcode='$brcode'") or die(mysqli_error($db));
    print "<script> alert('Cash Balance Updated'); document.location='stock_ver_ledger.php'</script>";    
}

?>
<body>
<center> <br><br><br>
<br>
<form  method='post' >
<table border=1 class=form>
<tr><td>Cash Balance</td><td><input type=text name=cashbal value=<?echo $row[0];?>></td></tr>
<tr><td colspan=2 align=center><input type=SUBMIT name='upd' value='Update'>
<input type=button value='Cancel' onClick=document.location='index2.php'></td></tr>
</FORM>



