<?
session_start();
$brcode=$_SESSION['brcode'];
$username=$_SESSION['user'];
include("../../opendb.php");
$query="select level from bruser where username='$username' and brcode='$brcode'";
$rslt=mysqli_query($db,$query);
$row1=mysqli_fetch_row($rslt);
$query1="select brpass from khadidb.branch where brcode='".$_SESSION['brcode']."'";
$rslt1=mysqli_query($db,$query1);
$row2=mysqli_fetch_row($rslt1);
if(($row2[0]==$fin_year)||($row2[0]==''))
{
$succsyear=1;
}
else
{
$succsyear=0;
}
if($row1[0]==6)
{
 mysqli_query($db,"update bruser set level='5' where brcode='$brcode' and username='$username'");
}
?>
<link type="text/css" href="../../includes/style1.css" rel="stylesheet" />

<ul id="menu">
	<li><a href="../../index2.php">Home</a>

</li>

 <?
if($succsyear==0)
{
?>
<li>
  <a href="#">SALES</a>
  <ul>
<?if($row1[0]==5){?>
  <li>
  <a href="../../countersale_prevyr.php">Retail Sale</a>
  </li>
<?}?>

<?if($row1[0]==5){?>
  <li><a href="../../branchtransfer_prvyr.php">Sale By Transfer(Branch Transfer)</a></li>
  <li><a href="../../salesret1_prvyr.php">Sales Return Retail</a></li>
<?}?>

  </ul>
  </li>
  <li>
  <a href="#">PURCHASE</a>
  <ul>

   <?if($row1[0]==5){?>
  <li><a href="../../branchreceipt_prvyr.php">Branch Receipt</a></li>

    <?}?>

  </ul>
  </li>

<?
}
?>
<?
if($succsyear==1)
{
?>
<li>
  <a href="#">Master</a>
  <ul>
<?if($row1[0]==5 || $row1[0]==6){?>
  <li>
  <a href="../../custmaster.php">Customer</a>
  </li>
<?}?>
<?if($row1[0]==5){?>
  <li>
  <a href="../../supp-mast.php">Supplier</a>
  </li>
  <li>
  <a href="../../khadistaff.php">Khadi Staff</a>
  </li>
  <?}?>
<?if($row1[0]==10){?>
  <li>
  <a href="../../createbr.php">Branch Master</a>
  </li>
<?}?>
<?if($row1[0]==5){?>
  <li>
  <a href="../../partmaster.php">Item Master</a>
  </li>
       <li>
  <a href="../../partmastrepo.php">Edit Item Master</a>
  </li>
  <li>
  <a href="../../grmaster.php">Group Master</a>
  </li>
  <li>
  <a href="../../subgrmaster.php">Sub Group Master</a>
  </li>
  <li>
  <a href="../../unit.php">Unit Master</a>
  </li>
  <li>
  <a href="../../taxmast.php">Tax Master</a>
  </li>
  <li>
  <a href="../../corp-mast.php">Corporate Master</a>
  </li>
<li>
  <a href="../../transactmaster.php">Transaction Master</a>
  </li>
  <li>
  <a href="../../procsunit.php">Processing Unit</a>
  </li>
  <li>
  <a href="../../bankmast.php">Bank Master(Customer)</a>
  </li>
  <?}?>
  </ul>
  </li>
  <li>
  <a href="#">SALES</a>
  <ul>
  <?if($row1[0]==5){?>
  <li>
  <a href="../../counter_sale.php">Retail Sale</a>
  </li>
  <?}?>
<?if($row1[0]==10){?>
       <li>
  <a href="../../countersale_wholesale.php">Wholesale</a>
  </li>
<?}?>
  <?if($row1[0]==5){?>
  <li><a href="../../branchtransfer.php">Branch Transfer</a></li>
  <li><a href="../../salesret1.php">Sales Return Retail</a></li>
<?}?>
<?if($row1[0]==10){?>
  <li><a href="../../salesretwholesale.php">Sales Return Wholesale</a></li>
  <li><a href="../../delvrchlnout.php">Transfer Against Register (OUT)</a></li>
<?}?>
  </ul>
  </li>
<li>

  <li>
  <a href="#">PURCHASE</a>
  <ul>
<?if($row1[0]==10){?>
  <li>
  <a href="../../item_purchase.php">Purchase</a>
  </li>

<?}?>
  <?if($row1[0]==5){?>
  <li><a href="../../branchreceipt.php">Branch Receipt</a></li>
  <?}?>
<?if($row1[0]==10){?>
  <li>
  <a href="../../purchaseretn.php">Purchase Return</a>
  </li>
  <li><a href="../../delvrchlnin.php">Transfer Against Register (IN)</a></li>
<?}?>
  </ul>
  </li>
  <!--
  -->
  <li>
  <a href="#">INVENTORY</a>
  <ul>
  <?if($row1[0]==5){?>
  <li><a href="../../qtytransfer.php">Stock Conversion</a></li>
  <?}
if($row1[0]==55){?>
  <li><a href="../../stockverentry.php">Stock Verification Entry</a></li>
<?}?>

  </ul>
  </li>
  <li>


<li>
    <a href="#">Accounts</a>
    <ul>
      <?if($row1[0]==5){?>
                                        <li><a href="../../chqcrdtcust.php">Cheque - Credit Customer</a></li>

          <li><a href="../../sealedge.php">Search Ledger</a></li>
          <li><a href="../../ledge.php">Ledger Master</a></li>
          <li><a href="../../acgroup.php">Group Master</a></li>
          <li><a href="../../cshrec.php">Debtors Collection(Cash Receipts)</a></li>
          <li><a href="../../cshpay.php">Bank Remittance(Cash Payment)</a></li>
          <li><a href="../../brec.php">Debtors Collection-Cheque/DD<br>(Bank Receipts)</a></li>
          <li><a href="../../bpay.php">Bank Payment</a></li>
          <?}?>
<?if($row1[0]==10){?>

          <li><a href="../breco.php">Bank Reconciliation</a></li>
          <li><a href="../ledreco.php">Ledger Reconciliation</a></li>

<?}?>
      <?if($row1[0]==5){?>
          <li><a href="../../jour.php">Journal</a></li>
          <?}?>
       
      <li><a href="../acrepo_menu.php">Reports >></a>
          <ul>




          <li><a href="../cbookmnu.php">Cash Book</a></li>

          <li><a href="../bnkbookmnu.php">Bank Book</a></li>

          <li><a href="../listledgers2.php">Ledger - Date wise</a></li>


          <li><a href="../../tbmnu.php">Trial Balance -></a></li>



        <li><a href="../db1.php">Day Book</a></li>



            <li><a href="../jour1.php">Journal Entries</a></li>

                                            <li><a href="../../db3.php">Debtors Aging</a></li>

          </ul>
          </li>

        </ul>
  </li>
<?
}
?>
<li>
  <a href="#">REPORTS</a>
  <ul>
<?if($row1[0]!=55 ){?>
            <li><a href="../cbookmnu.php">Cash Book</a></li>
  <li>
  <a href="../../seaitem.php">Search Item</a>
  </li>
         <li><a href="#">VAT Reports >></a>
  <ul>

          <li><a href="../../stax_sales.php">VAT Register(Sales)</a></li>
          <li><a href="../../stax_salesday.php">VAT Register(Sales daywise)</a></li>
  <li><a href="../../stax_salrtn.php">Sales Return</a></li>
  <li><a href="../../stax_transout.php">Sale By Transfer Register</a></li>

  </ul>
  </li>


        <li><a href="#">Sales Summary Reports >></a>
  <ul>

        <li>
  <a href="../../sale_summ.php">Sales Summary Report</a>
  </li>
        <li>
  <a href="../../sale_summ_new.php">Sales Summary Billwise</a>
  </li>
  </ul>
  </li>

<?if($row1[0]==5){?>
  <li>
  <a href="../../bill_report.php">Billwise Report</a>
  </li>

<?}?>
  <li>
  <a href="../../rebt_stmt.php">Rebate Statement</a>
  </li>
  <li>
  <a href="../../qtysale_report.php">Quantitywise Sales </a>
  </li>

  <li>
  <a href="../../creditsale_report.php">Credit Sale Report</a>
  </li>
<?if($row1[0]==10){?>
  <li>
  <a href="../../wholesale_repo.php">Wholesale Report</a>
  </li>
  <li>
  <a href="../../purchase_report.php">Purchase Report</a>
  </li>

<?}?>

        <li>
  <a href="../../branch_trasf_repo.php">Branch Transfer (Sale) Report</a>
  </li>
        <li>
  <a href="../../stax_transin.php">Purchase Report(Branch Receipt)</a>
  </li>
           <li>
  <a href="../../purchreg_new.php">Purchase Register</a>
  </li>
    <li>
  <a href="../bnkbookrpt.php">Bank Report</a>
  </li>
         <li><a href="#">Form , R & D Reports >></a>
  <ul>
   <li>
  <a href="../../form4.php">Form 4</a>
  </li>
        <li>
  <a href="../../forma.php">Form A</a>
  </li>
        <li>
  <a href="../../rdreport.php">R & D Report</a>
  </li>

  </ul>
  </li>
         <li><a href="#">Debtors/Staff Reports >></a>
  <ul>
        <li>
  <a href="../../staff_billreport.php">Staff Sales Report</a>
  </li>
        <li>
  <a href="../../staffdebtors.php">Staff Sale & Collection Report</a>
  </li>
  
  <li>
  <a href="../../cshrecrept1.php">Debtors Collection Report</a>
  </li>

  <li><a href="../listdebtors.php">Debtors Report</a></li>

  </ul>
  </li>
<?}?>
  <li>
  <a href="../../stockrepodw.php">Stock Report - Group Wise</a>
  </li>
    <li>
  <a href="../../stockverrep.php">Stock Verification Report</a>
  </li>
   
   <li><a href="../../stockverblnk.php">Stock Verification Blank</a></li>

  <li>
  <a href="../../stockleddw.php">Stock Ledger</a>
  </li>

   </ul>
  </li>
   <li>
  <a href="#">Utility</a>

<ul>
        <li><a href="../../dupitmlst.php">Duplicate Items</a></li>
<?
if($succsyear==1)
{
?>
<?if($row1[0]!=55 ){?>
        <li><a href="../../cust_change.php">Customer Name Change</a></li>
  <li><a href="../../dataexch.php">Data Exchange</a></li>
<?}?>
<?
}
?>
  <li><a href="../../corr_stock.php">Stock Correction</a></li>
        <li><a href="../../databackup.php">Backup Database</a></li>
  </ul>

  </li>
<li>
    <a href="../../chp.php">Change Password</a>
  </li>
<li>
    <a href="../../logout.php">Logout</a>
  </li>
</ul>
<style>
   #txt a {
  text-decoration: none;
  color:DarkSlateGray;
font-family: Arial, Helvetica;
    }
#txt{
font-family: Arial, Helvetica;
}
.tb
{
-moz-box-shadow:    inset 1px 1px 10px Grey;
   -webkit-box-shadow: inset 1px 1px 10px Grey;
   box-shadow:         inset 1px 1px 10px Grey;
}
</style>
<table width='100%' bgcolor='Gainsboro' class='tb'>
<tr>
<?
$exmsg="Password expires in"." ".$_SESSION['expir']." "."days";
?>
<td align='left' id='txt'>User : <b><? echo $username ?></td><td align='left' id='txt'><? echo $exmsg ?></b></td>
</tr>
</table>
