<? session_start();
 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>";

if($brcode=='Aut141'&& $user_level<6)
{

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

<SCRIPT>
parent.main.document.location="blank.html";
function alerfun()
{
 document.location='mis/alert.php';
}
</script>
<style>
td{background-color:ivory;font-family:'arial narrow';letter-spacing:1;}
.mnu{margin-left:5}
a{text-decoration:none}
</style>

<body bgcolor='e4ecc4'>

<base target=main>
<body topmargin="5" leftmargin="0" link=black vlink=black>
<center>
<font  size=4 face=sans-serif><b>VEHICLE <img src='img/UPSTruck.gif'></font><hr>

<table bgcolor=brown cellspacing=1 cellpadding=1 width=97%>
<?
if($user_level>=5)
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<font color='darkbrown'>Pre Sale</font><br>&nbsp;&nbsp;
<a href="mis/presalerepo.php">Report</a>,<a href="mis/presalestat.php" target='stat'>Status</a></td></tr>


<tr><td STYLE={background-color:lightsteelblue}><CENTER>VEH STOCK</td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/conrepo.php">Config Wise Report</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/agerepo.php">Age Wise Report</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/itstock.php">Item Stock Report</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="dstate.php">Daily Statement</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/bstate.php">Bank Statement</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="debtaging.php">Debtors Aging(Dr)</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/aler.php" onClick=alerfun()>Alerts -></a></td></tr>

<!--
<tr><td>&nbsp;&nbsp;<a href="mis/payrepo.php">Paid/Un-Paid Stock</a></td></tr>
-->
<tr><td STYLE={background-color:lightsteelblue}><CENTER>BILLING</td></tr>
<tr><td>&nbsp;&nbsp;<a href="mis/awrepo.php" target='x'>Summary</a></td></tr>
<tr><td>&nbsp;&nbsp;<a href="mis/netreal4.php" target='x'>Netreal-1</a>, <a href="mis/netreal.php" target='x'>Netreal-2</a></td></tr>


<tr><td STYLE={background-color:lightsteelblue}><CENTER>DA REPORTS</td></tr>
<tr><td>&nbsp;&nbsp;<a href="mis/dapending.php" target='x'>Pending DA</a></td></tr>
<!--<tr><td>&nbsp;&nbsp;<a href="mis/dastat.php" target='x'>DA Status</a></td></tr>-->

<tr><td STYLE={background-color:lightsteelblue}><CENTER>ORDER FORM</td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/oform_repo.php" target='x'>O.F Status</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/ofrepo.php" target='x'>Status at Branch</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/pwstat.php" target='x'>Payment wise status</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'>
  <td >&nbsp;&nbsp;<a href="mis/ofrepoarea.php" target='x'>To be sold (areawise)</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'>
  <td >&nbsp;&nbsp;<a href="mis/cusmnu.php">Customer List </a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="chp.php">Change Password</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="mis/amcmastrep.php">AMC Report</a></td></tr>


<?
return;
}
if($user_level>2||$user=='admin')
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/supp-mast.php" onClick=safun()><font color='darkbrown'><b>SALES -></a></td></tr>


<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/supp-mast.php" onClick=mastfun()><font color='darkbrown'><b>MASTER -></a></td></tr>

</table>
<?
}
?>

<BR>

<table bgcolor=brown cellspacing=1 cellpadding=1 width=97%>
<?
if($user_level>2||$user=='admin')
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/opstock.php">Op. Stock</a></td></tr>

<?
}
?>
<?
if($user_level==1||$user=='admin'||$user_level>2 )
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/oform.php" onClick=oformfun()><b>Order Form -></a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/advform.php">Advance Receipt</a></td></tr>

<?
}
?>

<?if($user_level>2||$user=='admin')
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="../psn/blank.html" onClick=purfun()><b>Purchase -></a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/invoice.php" onClick=invoicefun()><b>Invoice -></a></td></tr>
<?
}
?>
<?if($user_level>=2||$user=='admin')
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="blank.html" onClick=fun1();><b>Reports -></a></td></tr>
<?
}
?>

<?if($user_level>2||$user=='admin')
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/dbnote.php">Debit Note</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/crnote.php">Cr Note (Dis Allowed)</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="util/scheme.php">Scheme(55000)</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="util/scheme1.php">Scheme(100000)</a></td></tr>

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="util/xwty.php">Extended Warranty</a></td></tr>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/scert.php">Sale Certificate</a></td></tr>

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

<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/tcr.php">T C R</a></td></tr>
<?
}
?>
<?
if($user_level<2)
{
?>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<a href="veh/prnprof.php?invno=" target='k'>Prof.Invoice</a></td></tr>
<?
}
?>
</table>
<br>
<table bgcolor=brown cellspacing=1 cellpadding=1 width=97%>
<tr bgcolor=silver onMouseOver=bgColor='aliceblue'; onMouseOut=bgColor='silver'><td>&nbsp;&nbsp;<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()
{
 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 invoicefun()
{
 document.location='invoicemnu.html';
}
function alerfun()
{
 document.location='mis/alert.php';
}

</script>
