<?php 
session_start();
error_reporting(0);
include ("include/db-connect.php"); 
include "checksession.php";
date_default_timezone_set("Asia/Kolkata");
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="UTF-8" />
<title><? echo $TITLE; ?></title>
<link rel="stylesheet" href="" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />
<script type="text/javascript" src="view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link type="text/css" href="view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="view/javascript/jquery/superfish/js/superfish.js"></script>
<script type="text/javascript" src="view/javascript/common.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('#form').submit(function(){
        if ($(this).attr('action').indexOf('delete',1) != -1) {
            if (!confirm('Delete/Uninstall cannot be undone! Are you sure you want to do this?')) {
                return false;
            }
        }
    });
    $('a').click(function(){
        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall', 1) != -1) {
            if (!confirm('Delete/Uninstall cannot be undone! Are you sure you want to do this?')) {
                return false;
            }
        }
    });
        });
    </script>
</head>
<body>
<div id="container">
    <div id="header">
<div class="div1">
    <div class="div2" style="font-size:20px;"><? echo $TITLE; ?></div>
        <div class="div3"><img src="view/image/lock.png" alt="" style="position: relative; top: 3px;" /><a href="logout.php" class="top" style="color:#FFF; text-decoration:none;">Logout</a></div>
      </div>
    <div id="menu">
    <ul class="left" style="display: none;">
      <li id="dashboard"><a href="dashboard.php" class="top">Dashboard</a></li>
      <?php
   $user=$_SESSION['UN'];
   $set=mysql_query("select * from admin where adm_name='$user'");
   $fet=mysql_fetch_array($set);
   
   $utype=$fet['utype'];
  
   if($utype=='admin')
   {
   ?>  
<!---------------------------------------------------------------------------------------->        
      <li id="catalog"><a class="top">System</a>
        <ul>
          <li><a href="#" class="parent">Content</a>
          <ul>
              <li><a href="about.php?id=1">About</a></li>
              <li><a href="about.php?id=2">Faq</a></li>
              <li><a href="about.php?id=3">Contact</a></li>
            </ul>
          </li>
          <li><a href="logo.php">Logo</a></li>
          <li><a href="shipping_cost.php">Shipping Cost</a></li>
          <li><a href="" class="parent">Bank</a>
           <ul>
              <li><a href="add_product.php">Add Details</a></li>
              <li><a href="view_bankdetails.php">View Details</a></li>
            </ul>
          </li>
         <!-- <li><a href="" class="parent">Offer</a>
           <ul>
              <li><a href="add_offer.php">Add Offer</a></li>
              <li><a href="view_offer.php">View Offer</a></li>
            </ul>
          
          </li>-->
          <li><a href="" class="parent">User Permission</a>
          <ul>
              <li><a href="add_user.php">Add User</a></li>
              <li><a href="view_users.php">View User</a></li>
            </ul>
          </li>
        </ul>
      </li>
 <!---------------------------------------------------------------------------------------->     
      
        <li id="extension"><a href="customers.php" class="top">Customer</a></li>
        
   <!---------------------------------------------------------------------------------------->       
        
        
      <li id="extension"><a class="top">Products</a>
        <ul>
         <li><a href="" class="parent">Category</a>
           <ul>
              <li><a href="add_cat.php">Add Category</a></li>
              <li><a href="view_cat.php">View Category</a></li>
            </ul>
          </li>
           <!--<li><a href="" class="parent">Sub-Category</a>
           <ul>
              <li><a href="add.php">Add Sub-Category</a></li>
              <li><a href="view.php">View Sub-Category</a></li>
            </ul>
          
          </li>
          <li><a href="" class="parent">Sub-Sub-Category</a>
           <ul>
              <li><a href="add_sub_sub.php">Add Sub-Sub-Category</a></li>
              <li><a href="view_sub_sub.php">View Sub-Sub-Category</a></li>
            </ul>
          
          </li>-->
          <li><a href="" class="parent">Products </a>
            <ul>
              <li><a href="add_product2.php">Add Products</a></li>
              <li><a href="view_pro.php">View Products</a></li>
               <!--<li><a href="viewproductsearch.php">Search Products</a></li>-->
            </ul>
          </li>
          
           <li><a href="view_tot_stock.php">Stock Products</a> </li>
           <li><a href="view_stock.php">Reorder Quantity</a> </li>
		   </ul>
      </li>
      
      
  <!---------------------------------------------------------------------------------------->      
      <li id="sale"><a class="top">Purchase</a>
        <ul>
        
          
          <li><a href="search_sup.php">Add Purchase</a></li>
          <li><a href="view_pur.php">View Purchase </a></li>
          <li><a href="purchase_return.php">Purchase Return</a></li>
           <li><a href="view_pur_return.php">View Purchase Return</a></li>
           <li><a href="view_pur_tax.php">View Purchase Tax</a></li>
        </ul>
      </li>
  <!---------------------------------------------------------------------------------------->      
      <li id="system"><a class="top">Sales</a>
        <ul>
         <li><a href="" class="parent">Receipt </a>
           <ul>
              <li><a href="receipt_add.php">Add Receipt</a></li>
              <li><a href="view_receipt.php">View Receipt</a></li>
            </ul>
          </li>
          <li><a href="bulk_order.php">View Bulk Order</a></li>
           <li><a href="tot_purchase.php">Total Sales</a></li>
          <li><a href="sales_tax.php" >View Sales Profit</a> </li>
                     
         <!--- <li><a href="sales_tax1.php">view Sales Tax</a></li>-->
          
            <li><a href="sales_return.php">Add Sales Return</a></li>
            <li><a href="view_sales_return.php">View Sales Return</a></li>
            <li><a href="add_payment.php">Add Payment Status</a></li>
            <li><a href="add_awb.php" >Add AWB Number</a></li>
             <li><a href="add_delivery.php">Add Delivery Status</a></li>
          </ul>
      </li> 
      
  <!---------------------------------------------------------------------------------------->           
       <li id="system"><a class="top">Payment</a>
        <ul>
          <li><a href="payment.php">Add Payment</a></li>
          <li><a href="view_pay.php">View Payment</a> </li>
          <li><a href="view_havetopay.php">view Payable</a></li>
          </ul>
      </li>
 <!---------------------------------------------------------------------------------------->       
      <li id="reports"><a class="top">Reports</a>
        <ul>
        
         <li><a href="search_cash.php">Cash Report</a></li>
              <li><a href="search_bank.php">Bank Report</a></li>
      
    </ul>
<!----------------------------------------------------------------------------------------> 
<?php } 
else {
   $system=$fet['system'];
   $customer=$fet['customer'];
   $products=$fet['products'];
   $sales=$fet['sales'];
   $payment=$fet['payment'];
   $reports=$fet['reports'];
   $purchase=$fet['purchase']; 

?> 
<!----------------------------------------------------------------------------------------> 
<?php  if($system=='1'){  ?>       
      <li id="catalog"><a class="top">System</a>
        <ul>
          <li><a href="#" class="parent">Content</a>
          <ul>
              <li><a href="about.php?id=1">About</a></li>
              <li><a href="about.php?id=2">Faq</a></li>
              <li><a href="about.php?id=3">Contact</a></li>
            </ul>
          </li>
          <li><a href="logo.php">Logo</a></li>
          <li><a href="" class="parent">Bank</a>
           <ul>
              <li><a href="add_product.php">Add Details</a></li>
              <li><a href="view_bankdetails.php">View Details</a></li>
            </ul>
          </li>
          <li><a href="" class="parent">Offer</a>
           <ul>
              <li><a href="add_offer.php">Add Offer</a></li>
              <li><a href="view_offer.php">View Offer</a></li>
            </ul>
          
          </li>
          <li><a href="" class="parent">User Permission</a>
          <ul>
              <li><a href="add_user.php">Add User</a></li>
              <li><a href="view_users.php">View User</a></li>
            </ul>
          </li>
        </ul>
      </li>
      <?php } ?>
 <!---------------------------------------------------------------------------------------->     
    <?php  if($customer=='1'){  ?>  
        <li id="extension"><a href="customers.php" class="top">Customer</a></li>
     <?php } ?>   
   <!---------------------------------------------------------------------------------------->       
        
     <?php  if($products=='1'){  ?>   
      <li id="extension"><a class="top">Products</a>
        <ul>
          <li><a href="" class="parent">Category</a>
           <ul>
              <li><a href="add_cat.php">Add Category</a></li>
              <li><a href="view_cat.php">View Category</a></li>
            </ul>
          </li>
           <!--<li><a href="" class="parent">Sub-category</a>
           <ul>
              <li><a href="add.php">Add Sub-category</a></li>
              <li><a href="view.php">View Sub-category</a></li>
            </ul>
          </li>-->
          <li><a href="" class="parent">Products </a>
           <ul>
              <li><a href="add_product2.php">Add Products</a></li>
              <li><a href="view_pro.php">View Products</a></li>
               <!--<li><a href="viewproductsearch.php">Search Products</a></li>-->
            </ul>
          </li>
          
           <li><a href="view_tot_stock.php">Stock Products </a> </li>
           <li><a href="view_stock.php">Reorder Quantity </a> </li>
                  </ul>
      </li>
      <?php } ?>
      
  <!---------------------------------------------------------------------------------------->  
  <?php  if($purchase=='1'){  ?>      
      <li id="sale"><a class="top">Purchase</a>
        <ul>
        
          
          <li><a href="search_sup.php">Add Purchase</a></li>
          <li><a href="view_pur.php">View Purchase </a></li>
          <li><a href="purchase_return.php">Purchase Return</a></li>
           <li><a href="view_pur_return.php">View Purchase Return</a></li>
           <li><a href="view_pur_tax.php">View Purchase Tax</a></li>
        </ul>
      </li>
      <?php } ?>
  <!----------------------------------------------------------------------------------------> 
  <?php  if($sales=='1'){  ?>       
      <li id="system"><a class="top">Sales</a>
        <ul>
         <li><a href="" class="parent">Receipt </a>
           <ul>
              <li><a href="receipt_add.php">Add Receipt</a></li>
              <li><a href="view_receipt.php">View Receipt</a></li>
            </ul>
          </li>
          <li><a href="bulk_order.php">View Bulk Order</a></li>
           <li><a href="tot_purchase.php">Total Sales</a></li>
          <li><a href="sales_tax.php" >View Sales Profit</a> </li>
                     
          <li><a href="sales_tax1.php">view Sales Tax</a></li>
          
            <li><a href="sales_return.php">Add Sales Return</a></li>
            <li><a href="view_sales_return.php">View Sales Return</a></li>
            <li><a href="add_payment.php">Add Payment Status</a></li>
            <li><a href="add_awb.php" >Add AWB Number</a></li>
             <li><a href="add_delivery.php">Add Delivery Status</a></li>
          </ul>
      </li> 
      <?php } ?>
  <!---------------------------------------------------------------------------------------->
  <?php if($products=='1'){  ?>             
       <li id="system"><a class="top">Payment</a>
        <ul>
          <li><a href="payment.php">Add Payment</a></li>
          <li><a href="view_pay.php">View Payment</a> </li>
          <li><a href="view_havetopay.php">view Payable</a></li>
          </ul>
      </li>
      <?php } ?>
 <!---------------------------------------------------------------------------------------->  
 <?php  if($reports=='1'){  ?>       
      <li id="reports"><a class="top">Reports</a>
        <ul>
        
         <li><a href="search_cash.php">Cash Report</a></li>
              <li><a href="search_bank.php">Bank Report</a></li>
      
    </ul>
    <?php } ?>
<!----------------------------------------------------------------------------------------> 
<?php } ?>      
    </li>
  </div>
  </div>
  
  