<?
session_start();
include_once('includes/top.php');
include_once("test.php");
include_once('opendb.php');
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
//$br=$_SESSION['branch'];
$dbno=$_REQUEST['dbno'];

if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='inde.php' </script>";
  return;
}
$level=$_REQUEST['level'];
//print $dbno;
 
?>

<style>
 td{font-family:verdana;font-size:14;color:black;}
 th{font-family:verdana;font-size:14;color:white;background-color:#5b5858}
 body{background-color:silver;}
 select
  {border-style:ridge;
   border-color:black;
   height:25px;
   border-size=1;
   font-family:verdana;
   color:black;
  }
 input
  {border-style:ridge;
   border-color:#22437f;
   background-color:white;
   height:25px;
   font-weight:bold;
   border-size=1;
   font-family:sans-serif;
   color:BLACK;
  }
</style>
<head>
<title>PSNFI</title>
 <script src="rightclick_deactive.js"></script>
    <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>


<script>
 var dr_cr=[];


function chkey(abc)
{
 yy=abc.value
 if(yy.indexOf('  ')>-1) 
  {
    alert('Multiple space is not allowed');
    abc.value='';
  }
 if(yy.indexOf("'")>-1) 
  {
    alert("\' is not allowed");
    abc.value='';
  }
 if(yy.indexOf('"')>-1) 
  {
    alert("\" is not allowed");
    abc.value='';
  }
 if(yy.indexOf('&')>-1) 
  {
    alert("\& is not allowed");
    abc.value='';
  }
}

function valid()
{ 
 subOK="false";
 x=confirm("Do you want to save?");
 if(x)
  subOK="true";
   if(subOK=="true")
     return true;
   else
     return false;
} 

</script>

<body background="back_ground.jpg">
<?
$sql1="select * from dbnote where brcode='$brcode' and dbno='$dbno'";
//print $sql1;
  $res=mysqli_query($db,$sql1)or die(mysqli_error($db));
 $row=mysqli_fetch_array($res);
//print $row[date];
?>
<body>
<center>
<form name=f1 action="upddbnote1.php" method=post onSubmit="return valid()">
<table width=90%>
<tr><td colspan=2 bgcolor=#5b5858 align=center><font color=white size=3>Debit Note <input type=hidden name=dbno value=<? print $dbno ?>><? print $dbno ?></font></tr></td>
<tr><td>Debit</td><td><input type=text readonly  name=led value= 'Eicher Truck And Buses' size=40 onKeyDown=chkey(this)>
Date: <input type=text name='dt' size='15' value='<? print $row[date] ?>'>

</td>
</tr>
<tr><td>Head</td><td>
<select name=grp >
<option><?print $row[partic]?></option>
<?


 print "\n<option value='Sales Promotion Expenses'>Sales Promotion Expenses</option>";
 print "\n<option value='Service Promotion Expenses'>Service Promotion Expenses</option>";
 

?>
</select> </tr></td>
<tr><td>Amount </td><td><input type=text name=op value='<?print $row[dramt]?>'> 

<!--
<select name=drcr>
<option>Dr</option>
<option>Cr</option>
<select>
-->
</td></tr>
<tr><td>Desc.</td><td><input type=textarea name=desc  size=80 value='<?print $row[narr]?>'></td></tr>


<tr><td colspan=2 bgcolor=#5b5858 align=center>
<input type=submit value="Update"> <input type=button value="Cancel" onClick=document.location='blank.html'> 
</tr></td>
</table>
</form>




<script>
    function edit(a)
{
   document.location='editdbnote.php?dbno='+a';
}


</script>