<?php
session_start();
$username=$_SESSION['user'];
$brcode=$_SESSION['brcode'];
$level=$_SESSION['level'];
$fin_year=$_SESSION['fin_year'];
include_once("../../opendb.php");
$query="select level from bruser where username='$username' and brcode='".$_SESSION['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)||($fin_year=='2015-16'))
if(($row2[0]==$fin_year)||($row2[0]==''))
{
$succsyear=1;
}
else
{
$succsyear=0;
}
?>
<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="item_purchasenew.php">Purchase</a></li>
  <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){?>
  
<?}?>
<?if($row1[0]==5){?>
 

<?}?>
<?
/*
if($row1[0]==5){?>
  <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="prof_cntr.php">Profit Center</a></li>

<li>

  <a href="holiday.php">Select Holidays</a>
  </li>

*/?>

 <?if($username=='anoop'||$username=='joy'){?>
<li>
  <a href="../custmaster.php">Customer</a>
  </li>
<li>
  <a href="../supp-mast.php">Supplier</a>
  </li>
  <li>
  <a href="monthclosing.php">Stock</a>
  </li>
<li><a href="transactmaster.php">Transaction Master</a></li>

<li><a href="reportmaster.php">Report Master</a></li>
<?}?>

<?if($row1[0]==5){?>
      <li>
<?//  <a href="bankmast.php">Bank Master(Customer)</a>?>
  

  <?}?>
  </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($username=='anoop'||$username=='joy'){?>
<li><a href="../acgroup.php">Group Master</a></li>
<li><a href="../ledge.php">Ledger Master</a></li>

<?}?>
    <?if($row1[0]==5){?>
  
<li><a href="../sealedge.php">Search Ledger</a></li>
<li><a href="../grp_ledgers1.php">Search Ledger Grp Wise</a></li>


<?//<--<li><a href="chqcrdtcust.php">Cheque - Credit Customer</a></li>-->?>


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


                              

<?//<--<li><a href="transactslct.php">Transactions</a></li>-->?>

    <?}?>
    <?if($row1[0]==10){?>
  <li><a href="accounts/breco.php">Bank Reconciliation</a></li>
  <li><a href="accounts/ledreco.php">Ledger Reconciliation</a></li>
 <li><a href="dbnote.php">Debit Note</a></li>

  <?}?>
    <?if($row1[0]==5){?>
  
    <?}?>
        <!--
<li><a href="accounts/prnvoucher.php?jvno=" target="blank">Voucher</a></li>

                <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="accounts/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>
 <?

if($level>2)
{
    ?>
<li><a href="mis_repo.php">P&L</a></li>
<li><a href="db3.php"> Ageing Receivables(Dr) </a></li>
<li><a href="db33.php"> Ageing Payables(Cr) </a></li>


<li><a href="genfull.php">Gen Full List</a></li>
<?
}
?>           
          </ul>
          </li>
		  <?
if($succsyear==1)
{
//<li><a href="merge_ledger.php">Merge Ledgers</a></li>

?>

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

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

    
</ul>
  </li>
  
  
  
<?
if($username=='antony')
	{
	?>

<?
	}
}
//<li><a href="upld_sparepurchase.php">Upload Purchase</a></li>
//<li><a href="spares/item_purchase.php" target='x'>Item Purchase(Mannual)</a></li>

?>
<li>
<a href="#">UPLOADS</a>
<ul>


</li>
<!--
<li><a href="upld_transferin.php">Stock Transfer In Upload</a></li>
<li><a href="upld_transferout.php">Stock Transfer Out Upload</a></li>

<li><a href="upld_adjstock.php">Upload Adj Stock</a></li>
<li><a href="#">Account Posting</a>
<ul>
<li><a href="jour_transin.php">Acc Post Tranfer In</a></li>
<li><a href="jour_tranferout.php">Acc Post Transfer Out</a></li>

</ul>
-->
</ul>
</li>
<li>
<a href="#">SPARES</a>

<ul>
<?
if($brcode!='3776'&&$brcode!='3783'&&$brcode!='3788')
	{
	    //<li><a href="spares/item_purchase.php" target='x'>Item Purchase(Mannual)</a></li>

 
    
}?>
<!--
 <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>
<li><a href="spares/waranty_repo.php"  target='x'>Waranty Report</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="spares/traceitem.php"  target='x'>Spare Stock Ledger</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="#">Utility</a>

<ul>
    <!--
    <li><a href="upld_eicherpur.php">Upload Eicher Purchase</a></li>
<li><a href="jour_eichpurch.php">A/C Posting Eicher Purchase</a></li>
-->
<?
if($succsyear==1)
{
?>
<?if($row1[0]==5){?>
   <li><a href="dbnote1.php">Debit Note</a></li>
<li><a href="prndbnote1.php?jvno=" target="blank">Debit Note Print</a></li>


<?
if($username=='anoop2'||$username=='joy2')
	{
?>

<li><a href="upldcustnew.php">New Customer</a></li>
   <li><a href="merge_ledger.php">Merge Ledgers</a></li>
   
   <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_coupon.php">Coupon Invoice Upload</a></li>
<li><a href="upld_sparepurchase.php">Upload Purchase</a></li>
<li><a href="upld_warnty.php">Warranty Invoice Upload</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>
<li><a href="jour_waranty.php">Acc Post Waranty</a></li>
<li><a href="jour_coupon.php">Acc Post Coupon</a></li>
<li><a href="jour_transin.php">Acc Post Tranfer In</a></li>
<li><a href="jour_tranferout.php">Acc Post Transfer Out</a></li>
<li><a href="jour_sparesaleret.php">Acc Post Sales ret</a></li>

</ul>

<? 
} ?>

  <?}?>
<?
if($username=='admin')
	{
//<li><a href="merge_ledger.php">Merge Ledgers</a></li>
/*
 <li><a href="dupitmlst.php">Duplicate Items</a></li>

<li><a href="upldcust.php">Sap Uploading customer</a></li>
<li><a href="upldcustop.php">Customer Opening</a></li>
<li><a href="upldsup.php">Sap Uploading Supplier</a></li>
<li><a href="upldsupop.php">Supplier Opening</a></li>
<li><a href="cust_change.php">Customer Name Change</a></li>
     <li><a href="grp_change.php">Group Change</a></li>
<li><a href="upldsap.php">Sap Uploading day</a></li>
<li><a href="uplditem.php">Item Uploading</a></li>
<li><a href="upldstock.php">Item Stock Uploading</a></li>
<li><a href="upldlocation.php">Item Location Uploading</a></li>
<li><a href="purchslct.php">Transaction</a></li>
<li><a href="saleslct.php">Invoice Entry</a></li>

*/

	?>
<?
	}
}
?>


  <li><a href="corr_stock.php">Stock Correction</a></li>
    <li><a href="databackup.php">Backup Database</a></li>

    <?if($row1[0]==11 || $row1[0]==55){?>
    <li><a href="eoy.php">**Year Ending Process</a></li>
    <li><a href="dropnew.php">**Deleting Newly Created Database</a></li>
    <?}?>
  </ul>
  </li>


  <li>
  <a href="chp.php">Change Password</a>
  </li>
  <li>
  <a href="../logout.php">Logout</a>
  </li>  
  
   <div><a style="margin-left: 250px;"><img src='images/logo_05.png' width=80px height=50px></a> </div> 
  
 </ul>

 
<style>
   #txt a {
  text-decoration: none;
  color:DarkSlateGray;
font-family: calibri, 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:50px'>
<table width='100%'>
<tr bgcolor='LightSalmon'>

<?
$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' bgcolor='white'><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 id='txt'>Branch code:<b><? echo $brcode ?></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></font></td>
</tr>
</table></div>


