<? session_start();
$brcode = $_SESSION['brcode'];
$user   = $_SESSION['user'];
include("opendb.php");
$us=mysqli_query($db,"select level from bruser where username='$user'")or die(mysqli_error());
$r=mysqli_fetch_row($us);
$user_level=$r[0];
if($user_level<=0)
 print "<script> document.location='level0mnu.php'</script>";


 $trd=mysqli_query($db,"select sum(dramt)-sum(cramt) from journal2 where brcode='$brcode'");
 $trdrow=mysqli_fetch_row($trd);
  if(abs($trdrow[0])>'0.5')
   print "<script> alert('Trial balance mismatch \\nDr: '+$trdrow[0]); </script>";

?>
<link type="text/css" href="css2/left.css" rel="stylesheet" />	


<base target=main>
<body topmargin="5" >
<center>
<font color='white' size=4 face=sans-serif><b>VEHICLE </font><hr>

<table  cellspacing=1 cellpadding=1 width=97%>
<?
if($user_level>5)
{
?>
<tr ><td>Pre Sale</font><br>
<a href="mis/presalerepo.php">Report</a>,<a href="mis/presalestat.php" target='stat'>Status</a></td></tr>


<tr><td ><CENTER>VEH STOCK</td></tr>
<tr ><td><a href="mis/conrepo.php">Config Wise Report</a></td></tr>

<tr ><td><a href="mis/agerepo.php">Age Wise Report</a></td></tr>
<tr ><td><a href="mis/itstock.php">Item Stock Report</a></td></tr>
<tr ><td><a href="dstate.php">Daily Statement</a></td></tr>
<tr ><td><a href="mis/bstate.php">Bank Statement</a></td></tr>
<tr ><td><a href="debtaging.php">Debtors Aging(Dr)</a></td></tr>

<tr ><td><a href="mis/aler.php" onClick=alerfun()>Alerts -></a></td></tr>

<!--
<tr><td><a href="mis/payrepo.php">Paid/Un-Paid Stock</a></td></tr>
-->
<tr><td ><CENTER>BILLING</td></tr>
<tr><td><a href="mis/awrepo.php" target='x'>Summary</a></td></tr>
<tr><td><a href="mis/netreal4.php" target='x'>Netreal-1</a>, <a href="mis/netreal.php" target='x'>Netreal-2</a></td></tr>


<tr><td ><CENTER>DA REPORTS</td></tr>
<tr><td><a href="mis/dapending.php" target='x'>Pending DA</a></td></tr>
<!--<tr><td><a href="mis/dastat.php" target='x'>DA Status</a></td></tr>-->

<tr><td ><CENTER>ORDER FORM</td></tr>
<tr ><td><a href="veh/profinvnewclt.php">Prof. Invoice(New CLT)</a></td></tr>

<tr ><td><a href="veh/oform_repo2.php" target='x'>O.F Status</a></td></tr>

<tr ><td><a href="mis/ofrepo.php" target='x'>Status at Branch</a></td></tr>

<tr ><td><a href="mis/pwstat.php" target='x'>Payment wise status</a></td></tr>

<tr >
  <td ><a href="mis/ofrepoarea.php" target='x'>To be sold (areawise)</a></td></tr>
<tr >
  <td ><a href="mis/cusmnu.php">Customer List </a></td></tr>
<tr ><td><a href="chp.php">Change Password</a></td></tr>
<tr ><td><a href="mis/amcmastrep.php">AMC Report</a></td></tr>


<?
return;
}
if($user_level>2||$user=='admin')
{
?>
<tr ><td><a href="veh/supp-mast.php" onClick=safun()><b>SALES -></a></td></tr>
<tr ><td><a href="veh/supp-mast.php" onClick=mastfun()><b>MASTER -></a></td></tr>
</table>
<?
}
?>
<table  cellspacing=1 cellpadding=1 width=97%>
<?
if($user_level>2||$user=='admin')
{
?>
<tr ><td><a href="veh/opstock.php">Op. Stock</a></td></tr>

<?
}
?>
<?
if($user_level==1||$user=='admin'||$user_level>=2 )
{
?>
<tr ><td><a href="veh/oform.php" onClick=oformfun()><b>Order Form -></a></td></tr>

<tr ><td><a href="veh/advform.php">Advance Receipt</a></td></tr>
<tr ><td><a href="mis/agerepo1.php">Age Wise Report</a></td></tr>

<?
}
?>

<?if($user_level>2||$user=='admin')
{
?>
<tr ><td><a href="../psn/blank.html" onClick=purfun()><b>Purchase -></a></td></tr>

<tr ><td><a href="blank.html" onClick=invoicefun()><b>Invoice -></a></td></tr>
<?
}
?>
<?if($user_level>=2||$user=='admin')
{
?>
<tr ><td><a href="blank.html" onClick=fun1(); style="color: black;font-weight: bold;"><b>Reports -></a></td></tr>
<?
}
?>

<?if($user_level>2||$user=='admin')
{
?>
<tr ><td><a href="veh/oform.php" onClick=oformsch()><b>Scheme -></a></td></tr>

<!-- <tr ><td><a href="veh/dbnote.php">Debit Note</a></td></tr> -->
<tr ><td><a href="veh/crnote.php">Cr Note (Dis Allowed)</a></td></tr>
<tr ><td><a href="veh/crnote_gst.php">Cr Note with GST</a></td></tr>
<tr ><td><a href="gst_creditnote.php">Debit Note with GST</a></td></tr>
<tr ><td><a href="upld_acpost.php">Upload Cr Note</a></td></tr>


<tr ><td><a href="spares/einvoice_crnote_gst.php">E-Inv JSON Download(CR Note)</a></td></tr>
<tr ><td><a href="spares/sap_creditnotejson.php">E-Inv JSON Download(CR Note)Multi</a></td></tr>
<tr ><td><a href="spares/einvoice_dbnote_gst.php">E-Inv JSON Download(DB Note)</a></td></tr>
<tr ><td><a href="veh/scert.php">Sale Certificate</a></td></tr>
<tr ><td><a href="veh/salecertreport.php">Edit Sale Certificate</a></td></tr>
<tr ><td><a href="saleqot.php">Sale Details</a></td></tr>
<tr ><td><a href="sale_report.php">Sale Report</a></td></tr>
<tr ><td><a href="seacust.php">Customer Search</a></td></tr>

<?
}
?>
<!--
<tr ><td><a href="veh/stockrepo_veh.php">Veh.Stock Report</a></td></tr>
-->
</table>
<table  cellspacing=1 cellpadding=1 width=97%>
<?if($user_level>2||$user=='admin')
{
?>
<tr ><td><a href="veh/veh_transin.php">Stock Transfer IN</a></td></tr>
<tr ><td><a href="veh/veh_transout.php">Stock Transfer OUT</a></td></tr>
<tr ><td><a href="blank.html" onClick=funinsure();><b>Insure -></a></td></tr>

<tr ><td><a href="veh/tcr.php">T C R</a></td></tr>
<tr ><td><a href="veh/oform_repo2.php" target='x'>O.F Status</a></td></tr>
<tr ><td><a href="spares/purindex.html" target='x'>BodyOrder</a></td></tr>

<tr ><td><a href="spares/transin.php" target='x'>TransferIn Body</a></td></tr>
<tr ><td><a href="veh/upldeichersap.php" target='x'>Portal_Import</a></td></tr>
<tr ><td><a href="portaldetails.php" target='x'>Portal_Report</a></td></tr>

<?
}
?>
<?
if($user_level<2)
{
?>
<tr ><td><a href="veh/prnprofnew.php?invno=" target='k'>Prof.Invoice</a></td></tr>
<?
}
?>
</table>
<table  cellspacing=1 cellpadding=1 width=97%>
<tr ><td><a href="chp.php">Change Password</a></td></tr>
</table>
<script>
function safun()
{
 document.location='sales/samnu.php';
}

function mastfun()
{
 document.location='mastmnu.html';
}
function funinsure()
{
 document.location='insuremnu.html';
}
function fun1()
{
<?if($brcode=='PSN236')
{
?>
 	document.location='vehreports1.html';
<?
}
else
{
?>
 	document.location='vehreports.html';
<?
}
?>
}

function cusfun()
{
 document.location='mis/cusmnu.php';
}

function repfun1()
{
 document.location='repmnu.html';
}
function purfun()
{
 document.location='purmnu.html';
}
function oformfun()
{
 document.location='oformmnu.php';
}
function oformsch()
{
 document.location='oformsch.php';
}


function invoicefun()
{
 document.location='invoicemnu.html';
}
function alerfun()
{
 document.location='mis/alert.php';
}

</script>
