<?
session_start();
$brcode=$_SESSION['brcode'];
include_once('opendb.php');
$cod=$_REQUEST['cod'];
if(isset($_POST['save']))
{
$cod=$_REQUEST['cod'];
$opstock=$_REQUEST['opstock'];
$clstock=$_REQUEST['clstock'];
$wip=$_REQUEST['wip'];


$sql="update monthmaster set clstock='$clstock',opstock='$opstock',wip='$wip' where cod='$cod'";
mysqli_query($db,$sql) or die('Insert Err:'.mysqli_error($db));


print "<script> document.location='monthmaster.php';</script>";
return;
}
//$re=mysqli_query($db,"select * from configmaster");
//$row=mysqli_fetch_array($re);
?>
<link rel="stylesheet" href="style.css" type="text/css" />
<script type="text/javascript" src="scripts/jquery-latest.js"></script>
<link type="text/css" href="includes/style1.css" rel="stylesheet" />
<link rel="stylesheet" href="css/form.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>
this.resizeTo(750,170);
function valid()
{
 
 /*if(document.f1.tax.value.length<=0)
 {
   alert("Invalid Tax.");
   document.f1.tax.focus();
   return false;
 }*/

}
</script>
<style>
#txt{
font-family: Arial, Helvetica;
background-color: #F2F2F2;

}
th{background-color:steelblue;color:white}
</style>
<?php include('includes/top.php'); ?>
<table class='container'><tr><td>
<font style="font-family: 'Trebuchet MS',Verdana,Helvetica,sans-serif; font-size:15px;">  &nbsp;&nbsp;Master >> Stock >> Edit Stock</font>
<br>
<center>

<?
$re=mysqli_query($db,"select * from monthmaster where cod='$cod'");
$rerow=mysqli_fetch_array($re);
?>
<table cellspacing=1 cellpadding=1 bgcolor=black >
<tr><td align=center bgcolor='white'>
<form name='f1' action='<?print $PHP_SELF?>' method='post' onSubmit="return valid()">
<input type=hidden name=code value='<?print $code?>'>
<table cellspacing=1 cellpadding=3 width='350' class=form>
<th colspan=2><font size=3 color=black>EDIT STOCK MASTER</th>

<tr ><td>Month</td><td><input type=text name='month' size=40 value='<?print $rerow[0]?>' onKeyPress='return handleEnter(this, event)'></td></tr>
<tr ><td>Opening Stock </td><td><input type=text name='opstock' size=40 value='<?print $rerow[1]?>' onKeyPress='return handleEnter(this, event)'></td></tr>
<tr ><td>Closing Stock</td><td><input type=text name='clstock' size=40 value='<?print $rerow[2]?>' onKeyPress='return handleEnter(this, event)'></td></tr>
<tr ><td>Work In Progress</td><td><input type=text name='wip' size=40 value='<?print $rerow[5]?>' onKeyPress='return handleEnter(this, event)'></td></tr>



<th colspan=2><input type=submit value='Save' name='save'> <input type=button value='Cancel' onClick='window.location="monthclosing.php"'></td></tr>

</table>
</form>
</td></tr>
</table>
