<?
session_start();
if(strlen($brcode)<=0)
{
  print "<script> alert('Invalid User'); parent.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;
  }
 textarea
  {border-style:ridge;
   border-color:#22437f;
   background-color:white;
   height:45;
   border-size=1;
   font-family:sans-serif;
   color:BLACK;
  }
</style>
<?
 include("opendb.php");
$result=mysqli_query($db,"select * from ledger where brcode='$brcode' and led!='Cash' order by led") or die(mysqli_error());
$re=mysqli_query($db,"select max(dt) from actrans");
$rw=mysqli_fetch_row($re);
$date=explode('-',$rw[0]);
?>

<body onload=document.f1.d.focus()>
<center>
<p>&nbsp;<p>&nbsp;

<form name=f1 action="svjournal.php">
<table border=0 width=700>
<tr><td bgcolor=yellow colspan=4></td></tr>
<TR bgcolor=5b5858><TD colspan=4 align=center><font color=white><B>JOURNAL ENTRY</B></td></tr>
<tr><td>Date</td><td>DD<input type=text maxlength='2' name=d size=2 value='<?print $date[2]?>'>
MM<input type=text name=m maxlength='2' size=2 value='<?print $date[1]?>'>
YYYY<input type=text name=y maxlength='4' size=4 value='<?print $date[0]?>'>
<tr>
  <td>By</td>
  <td>
<select name=dr>
<option></option>
<?
while($row=mysqli_fetch_row($result))
{
 print "<option>$row[0]</option>";
}
?>
</select>
</td>
  <td>(Rs.) </td><td><input type=text name=amt size=22 style={text-align:right}></td>
</tr>
<tr><td>To</td><td>
<select name=cr>
<option></option>
<?
$result=mysqli_query($db,"select * from ledger where brcode='$brcode' and  led!='Cash' order by led") or die(mysqli_error());
while($row=mysqli_fetch_row($result))
{
 print "<option>$row[0]</option>";
}
?>
</select>
<td>Narration</td><td><textarea rows=5 name=narr></textarea></tr>
<TR bgcolor=5b5858><TD colspan=4 align=center><input type=submit value="Save">
<input type=reset value='Cancel'> </td></tr>
<tr><td bgcolor=ivory colspan=4></td></tr>
</table>
</form>
Any transaction other than Cash/Bank are to be posted through journal only<br>
     (eg. Credit Transactions, Bank OCC, Bank OD etc.)
