<? session_start();
if(strlen($brcode)<=0)
{
 print "<script> alert('Session timed out'); parent.document.location='../index.html'; </script>";
 return;
}

 include("opendb.php");
/* $trd=mysqli_query($db,"select sum(dramt), sum(cramt) from journal2");
 $trdrow=mysqli_fetch_row($trd);
  if($trdrow[0]!=$trdrow[1])
   print "<script> alert('Trial balance mismatch \\nDr: '+$trdrow[0]+' Cr: '+$trdrow[1]); </script>";*/
?>

<SCRIPT>
parent.main.document.location="blank.html";
</script>
<link type="text/css" href="css2/left.css" rel="stylesheet" />	
<body>

<base target=main>
<body topmargin="5" leftmargin="0" link=black vlink=black>
<center>
<font  size=4 face=sans-serif><b>SPARES</font><hr>

<table cellspacing=1 cellpadding=1 width=97%>
<?
$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>=6)
{
   print "<script>document.location='mdtop.php'</script>";
   return;

}
if($user_level>=6)
{
?>
<tr><td color='white'><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>&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/netreal.php" target='x'>Netreal</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><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 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><td><a href="chp.php">Change Password</a></td></tr>


<?
return;
}

?>
<tr><td><a href="blank.html " 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><td><a href="blank.html" onClick=purfun()><b>Purchase -></a></td></tr>

<tr><td><a href="blank.html" onClick=invoicefun()><b>Invoice -></a></td></tr>

<tr><td><a href="blank.html" onClick=fun1();><b>Reports -></a></td></tr>

<tr><td><a href="blank.html" onClick=funQ();><b>Quotation -></a></td></tr>


<?
}
?>


</table>
<br>
<table bgcolor=brown cellspacing=1 cellpadding=1 width=97%>
<?if($user_level>=2||$user=='admin')
{
?>
<tr><td><a href="spares/transin.php">Stock Transfer IN</a></td></tr>
<tr><td><a href="spares/transout.php">Stock Transfer OUT</a></td></tr>

<tr><td><a href="spares/spareinvwar.php" target='x'>Warranty Transfer OUT </a></td></tr>
<?
if($brcode=='SER516')
{
?>
<tr><td><a href="spares/sparetrinwar.php" target='x'>Warranty Trans <font color='dark brown'>IN</font> </a></td></tr>

<tr><td><a href="spares/sparetrinwarTQ.php" target='tq'>Warranty Trans <font color='dark brown' size=2>IN <br>&nbsp;&nbsp;&nbsp;(TELC QTY)</font> </a></td></tr>
<tr><td><a href="spares/sparetroutwarTQ.php" target='tq'>Warranty Trans <font color='dark brown'>OUT <br>&nbsp;&nbsp;&nbsp;<font size=2>(TELC QTY)</font> </a></td></tr>

<tr><td><a href="spares/sparetrinwarpho.php" target='x'>Warranty Trans <font color='dark brown'>PHY IN (LAST YEAR)</font> </a></td></tr>


<tr><td><a href="spares/sparetrinwarph.php" target='x'>Warranty Trans <font color='dark brown'>PHY IN</font> </a></td></tr>

<tr><td><a href="spares/autotrans.php" target='x1'><font color='dark brown'>Auto Trans OUT</font> </a></td></tr>

<?
}
?>
<tr><td><a href="spares/declare.html">Declaration</a></td></tr>

</table> <br>
<table bgcolor=brown cellspacing=1 cellpadding=1 width=97%>

<tr><td><a href="spares/edsparetrndx.php" target='x'>Edit Warranty Trans OUT </a></td></tr>

<tr><td><a href="spares/Edeclare.html">Edit Declaration</a></td></tr>

<tr><td><a href="spares/prnspareinvoice.php?invno=" target='x'><b>Duplicate Copy</a></td></tr>

<!--
<tr><td><a href="blank.html" onClick=funinsure();><b>Insure -></a></td></tr>
-->
<?
}
if($level>=4 &&$brcode=='ERA153')
{
?>
<tr><td><a href="spares/sparetrinwarph4era.php" target='a1'>Warranty from Telcon</a></td></tr>
<?
}
?>
<!--
<tr><td><a href="veh/tcr.php">T C R</a></td></tr>
-->
</table>
<br>
<script>
function mastfun()
{
 document.location='spares/mastmnu.html';
}
function funinsure()
{
 document.location='insuremnu.html';
}
function fun1()
{
 document.location='spares/report.php';
}
function funQ()
{
 document.location='spares/quotemnu.php';
}

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

function repfun1()
{
 document.location='spares/repmnu.html';
}
function purfun()
{
 document.location='spares/purmnu.php';
}
function oformfun()
{
 document.location='oformmnu.html';
}
function invoicefun()
{
 document.location='spares/invoicemnu.php';
}

</script>
