<?
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="../prof_cntr.php">Profit Center</a></li>
<li><a href="../transactmaster.php">Transaction Master</a></li>
<li><a href="../reportmaster.php">Report Master</a></li>
  <li>
  <a href="../holiday.php">Select Holidays</a>
  </li>
  <?}?>
  </ul>
  </li>



 
 


  


<li>
    <a href="#">Accounts</a>
    <ul>
<?
if($succsyear==1)
{
?>
       <?if($row1[0]==55 ){?>
        <li><a href="../stock_ver_ledger.php">Opening Cash Entry</a></li>
        <?}?>

      <?if($row1[0]==5){?>
                                        

<li><a href="../acgroup.php">Group Master</a></li>
<li><a href="../ledge.php">Ledger Master</a></li>            
<li><a href="../sealedge.php">Search Ledger</a></li>
<?//<--<li><a href="chqcrdtcust.php">Cheque - Credit Customer</a></li>-->?>
<li><a href="../cshrec.php">Cash Receipts</a></li>
<li><a href="../cshpay.php">Cash Payment</a></li>
<li><a href="../brec.php">Bank Receipts</a></li>
<li><a href="../bpay.php">Bank Payment</a></li>
<li><a href="../jour.php">Journal</a></li>
<li><a href="../sealedgall.php">Search Ledger All</a></li>

<!--<li><a href="../transactslct.php">Transactions</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="../dupcpy_menu.php">Dup. copy >></a>
          <ul>








          <li><a href="../veh/prnadvrec.php" target="blank">Advance Receipt</a></li>
          <li><a href="../veh/duprec.php" target="blank">Receipt</a></li>
          <li><a href="../veh/prncrnote1.php" target="blank">Cr. Note</a></li>
          <li><a href="../veh/prncrnote.php" target="blank">Cr. Note(Spare)</a></li>
          <li><a href="prnvoucher.php" target="blank">Voucher</a></li>
          </ul>
          </li>
       -->
       
	   <?
	   
}
  ?>

      <li><a href="acrepo_menu.php">Reports >></a>
          <ul>

<?
if($succsyear==0)
{
?>
<li><a href="../sealedge.php">Search Ledger</a></li>
<?
}
?>

          <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>


<?
if($succsyear==1)
{
?>
        <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="#">UPLOADS</a>
<ul>
<li><a href="../upld_jobcard.php">Jobcard Invoice Upload</a></li>
<li><a href="../upld_spareinvoice.php">Spare Invoice Upload</a></li>
<li><a href="../upld_sparepurchase.php">Upload Purchase</a></li>
<li><a href="../upld_warranty.php">Warranty Invoice Upload</a></li>
<li><a href="../spares/purchase_edit1.php" target='x'>Update Vendor Invoice</a></li>
<li><a href="#">Account Posting</a>
<ul>
<li><a href="../jour_sapreinvoice.php">Acc Post SpareInvoice</a></li>
<li><a href="../jour_jobcard.php">Acc Post Jobcard</a></li>
</ul>
</li>
</ul>
</li>
<li>
<a href="#">SPARES</a>
<ul>
<li><a href="../spares/item_purchase.php" target='x'>Item Purchase(Mannual)</a></li>
<li><a href="../spares/pur1new.php" target='x'>Spare Transfer Request</a></li>
<li><a href="../spares/transout.php" target='x'>Spare Transferout</a></li>
<li><a href="../spares/transin.php" target='x'>Spare Transferin</a></li>
<li><a href="../spares/prnspareinvoice2.php?invno=" target='x'>Duplicate Spare Invoice</a></li>
<?if($username=='thomas'||$username=='antony'){?>
<li><a href="../spares/purrepo.php" target='x'>Spare Purchase Checking</a></li>
<?}?>
<li><a href="../spares/stockrepodw.php"  target='x'>Spare Stock Report</a></li>
<li><a href="">Sales Tax Reports>></a>
<ul>>
    <li><a href="../spares/invrepo_stax.php"  target='x'>Spare Invoice - VAT</a></li>
    <li><a href="../spares/purrepo_stax.php"  target='x'>Spare Purchase - VAT</a></li>
</ul>
</ul>
</li>
<li>
<a href="#">SERVICE</a>
<ul>
<li><a href="../service/prnjcardbill_sb.php?invno=" target='x'>Duplicate Jobcard Invoice</a></li>

</ul>
</li>
<!--
<li>
<a href="#">REPORTS</a>
<ul>
<li><a href="../trans_reg.php">Transaction Registers</a></li>
<li><a href="../print_cbook1.php">Cash Book Registers</a></li>
<li><a href="../print_inv_reg1.php">Invoice Registers</a></li>
<li><a href="../invreport.php">Invoice Report</a></li>
<li><a href="../print_bbook1.php">Bank Registers</a></li>
<li><a href="../invreportsls.php">Invoice Report(Sales)</a></li>
</ul>
</li>
-->
  <li>
  <a href="#">REPORTS</a>
  <ul>

    <li><a href="../trans_reg.php">Transaction Registers</a></li>


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

<ul>
        <li><a href="../dupitmlst.php">Duplicate Items</a></li>
        <li><a href="../merge_ledger.php">Merge Ledgers</a></li>
<?
if($succsyear==1)
{
?>
<?if($row1[0]!=55 ){?>
        <li><a href="../cust_change.php">Customer Name Change</a></li>
        <li><a href="../grp_change.php">Group Change</a></li>
 <!--
	 <li><a href="../cshcorrect.php">Cashbook Correction</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: calibri,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>
<div style='padding-top:45px'>
<table width='100%' >
<tr>

<?
$query="select brname,login_date from branch where brcode ='".$_SESSION['brcode']."'";
//echo $query;
$rslt1=mysqli_query($db,$query);
$row11=mysqli_fetch_row($rslt1);

$exmsg="Password expires in"." ".$_SESSION['expir']." "."days";
$date_1 = implode('-', array_reverse(explode('-', $row11[1])));

?>
<td align='center'><font size=3><font face=calibri></td><td align='left' id='txt'><font size= 2><font color = 'black' size= 3><b>  Financial Year : <? print $fin_year?> </td><td id='txt'>Branch :<b><? echo $row11[0] ?></td><td align='left' id='txt'><font color = 'black'>Login Date : <b><? echo $date_1; ?></td><td align='left' id='txt'>User : <b><? echo $username ?></td><td align='left' id='txt'><? echo $exmsg ?></b></td>
</tr>
</table></div>