<?
session_start();
include("opendb.php");
$code=$brcode;

print $code;

$led_code='csh'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Cash','Cash in hand','','Dr','$led_code','$code')") or die('1'.mysqli_error());

 $led_code='pet'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Petty Cash','Cash in hand','','Dr','$led_code','$code')") or die('2'.mysqli_error());

 $led_code='out'.substr(time(),7,3); 

 mysqli_query($db,"insert into ledger values('Output tax 12.5','Output Tax','','Cr', '$led_code','$code')") or die('3'.mysqli_error());


 $led_code='otc'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Output tax on credit notes 12.5','Output Tax','','Cr', '$led_code','$code')") or die('4'.mysqli_error());

 $led_code='dis'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Discount allowed(vehicles)','Discount Allowed','','Dr', '$led_code','$code')") or die('5'.mysqli_error());

 $led_code='sal'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Sales 12.5(vehicle)','Sales 12.5', '','Cr', '$led_code', '$code')") or die('6'.mysqli_error());

 $led_code='inp'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Input tax 12.5','Input Tax','','Dr', '$led_code', '$code')") or die('7'.mysqli_error());


 $led_code='pur'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Purchase 12.5(vehicle)','Purchases 12.5','','Dr', '$led_code', '$code')")or die('8'.mysqli_error());

 $led_code='sre'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Sales ret  12.5(vehicle)','Sales Return','','Dr', '$led_code', '$code')") or die('9'.mysqli_error());

 $led_code='pre'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Purchase ret  12.5(vehicle)','Purch. Returns','','Cr', '$led_code', '$code')") or die(mysqli_error());

 $led_code='pub'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Purchase 12.5(Body)','Purchases 12.5','','Dr', '$led_code', '$code')") or die(mysqli_error());

 $led_code='pun'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Purchase(Un registered)','Purchases Unreg.','','Dr', '$led_code', '$code')") or die(mysqli_error());

 $led_code='ots'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Output tax 12.5 (Sale Ret)','Output Tax','','Cr', '$led_code','$code')") or die(mysqli_error());

 $led_code='ipr'.substr(time(),7,3); 
 mysqli_query($db,"insert into ledger values('Input tax 12.5 (Pur Ret)','Input Tax','','Dr', '$led_code', '$code')") or die(mysqli_error()); 
 print "Done...";
?>
