<?
session_start();
if(strlen($user)<=0)
{
  print "<script> alert('Invalid User'); document.location='ind.php' </script>";
  return;
}
?>
<style>
 td{font-family:verdana;font-size:12;color:black;}
 th{font-family:verdana;font-size:12;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>
<script type="text/javascript">
function checkLen(x,y)
{
if (y.length==x.maxLength)
	{
	var next=x.tabIndex
	if (next<document.getElementById("myForm").length)
		{
		document.getElementById("myForm").elements[next].focus()
		}
	}
}
</script>
</head>

<body onLoad=document.x.vouch.focus()>
<center>
<form id='myForm' name=x action="svrec.php" method=post>
<table width=700>
<tr><td colspan=4 bgcolor=#5b5858 align=center><font color=white size=3><B>RECEIPT ENTRY</font></tr></td>
<tr>
  <td>Receipt No.</td><td><input type=text tabindex='1' name=vouch size=10></td>
  <td>Date</td><td>dd 
<input type=text name=d tabindex='2' size=1 maxlength=2 value=<?print date('d',time())?> >
	mm<input type=text name=m tabindex='3' size=1 maxlength=2 value=<?print date('m',time())?>>

	yyyy<input type=text name=y tabindex='4'  size=3 maxlength=4 value=<?print date('Y',time())?>>
  </td>
</tr>
<tr><td>Cr.</td><td>
<select name=ledg>
<option></option>
<?
include("opendb.php");
 $result=mysqli_query($db,"select * from ledger where brcode='$brcode' order by led");
 while($row=mysqli_fetch_row($result))
 {
  print "<option>$row[0]</option>";
 }
?>
</select>
</td> <td>Amount</td><td><input type=text name=amt style={text-align:right} size=22></td></tr>
<tr>
  <td>Mode</td><td><select name=mode><option>Cash</option>
<?
 $result=mysqli_query($db,"select * from ledger where grp='Bank Accounts' and brcode='$brcode'");
 while($row=mysqli_fetch_row($result))
 {
  print "<option>$row[0]</option>";
 }
?>
</select></td>
  <td>Narration </td><td><textarea name=narr></textarea></td>
</tr>
<tr><td colspan=4 bgcolor=#5b5858 align=center>
<input type=submit value="Save"> <input type=reset value='Cancel'>
</td></tr>
</table>
</form>


