<?php

include 'connect.php';
if(!isset($_SESSION)){
    session_start();
}
if(isset($_SESSION['adminemail']))
{
$user=$_SESSION['adminemail'];

$usrtyp=mysqli_query($conn,"select * from admin where username='$user'");
$usrtyp1=mysqli_fetch_assoc($usrtyp);


$sett=mysqli_query($conn,"select * from settings");
$settnum=mysqli_num_rows($sett);
$sett1=mysqli_fetch_assoc($sett);


if($settnum>0)
{

$compname=strtoupper($sett1['company_name']);

}

else

{

$compname='AGRO INDUSTIRES';

}


$sel=mysqli_query($conn,"select * from admin where username='$user'");
$nmrw=mysqli_num_rows($sel);
$sel1=mysqli_fetch_assoc($sel);

if($nmrw>0)
{

?>


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
      <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><?php echo $compname; ?></title>
	<!-- BOOTSTRAP STYLES-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FONTAWESOME STYLES-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
        <!-- CUSTOM STYLES-->
    <link href="assets/css/custom.css" rel="stylesheet" />
     <!-- GOOGLE FONTS-->
   <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
     
           
          
    <div id="wrapper">
         <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="adjust-nav">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <div class="navbar-header pull-left">
					<a href="index.php" class="navbar-brand">
						<small style="text-transform:uppercase; font-size:16px; color:white;"><img src="assets/images/icon.png" style="padding:0; margin-top:-7px;" /><?php echo $compname; ?></small>
					</a>
				</div>
                </div>
              
                 <span class="logout-spn" >
                  <a href="logout.php" style="color:#fff;">LOGOUT</a>
				  </span>
				   <ul class="nav user_menu pull-left">          
                   <li class="grey"><a href="viewcustomer.php" style="margin-left:30px; margin-top: 20px;"><i class="ace-icon fa fa-book" style=" font-size:20px;"></i> <span style=" font-size:16px;">Customer</span></a></li>
				   </ul>
				   <ul class="nav user_menu pull-left">          
                      <li class="grey"><a href="viewsupplier.php" style=" font-size:16px; margin-top: 20px;"><i class="ace-icon fa fa-calendar" style=" font-size:20px;"></i>  Supplier</a></li>
				   </ul>
				   <ul class="nav user_menu pull-left">          
                     <li class="grey dropdown-modal">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#" style=" font-size:16px; margin-top: 20px;">
								<i class="ace-icon fa fa-tasks" style=" font-size:20px;"></i>
								Product
							</a>
                            
							<ul class="dropdown-menu-left dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
								<li class="dropdown">
									<a href="viewproduct_category.php" ></i>Product Category</a>
								</li>
                                <li class="dropdown">
									<a href="viewproduct.php"></i>Product</a>
								</li>
							</ul>								

						</li>
				   </ul>
				    <ul class="nav user_menu pull-left">          
                      <li class="grey"><a href="viewfactory.php" style=" font-size:16px; margin-top: 20px;"><i class="ace-icon fa fa-group" style=" font-size:20px;"></i> Factory</a></li>
				   </ul>
				   <ul class="nav user_menu pull-left">          
                       <li class="grey"><a href="viewbank.php" style=" font-size:16px; margin-top: 20px;"><i class="ace-icon fa fa-bank" style=" font-size:20px;"></i> Bank</a></li>
				   </ul>
				   <ul class="nav user_menu pull-left">          
                       <li class="grey dropdown-modal">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#" style=" font-size:16px; margin-top: 20px;">
								<i class="ace-icon fa fa-tasks" style=" font-size:20px;"></i>
								Tools
							</a>
                            
							<ul class="dropdown-menu-left dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
								<li class="dropdown">
									<a href="viewdepartment.php">Department</a>
								</li>
                                <li class="dropdown">
									<a href="viewdesignation.php">esignation</a>
								</li>
								<li class="dropdown">
									<a href="viewusers.php">Users</a>
								</li>
							</ul>

						</li>
				   </ul>
				   <ul class="nav user_menu pull-left">          
                       <li class="grey"><a href="settings.php" style=" font-size:16px; margin-top: 20px;"><i class="ace-icon fa fa-cogs" style=" font-size:20px;"></i> Settings</a></li>
				   </ul>
                
            </div>
        </div>
        <!-- /. NAV TOP  -->

		<nav class="navbar-default navbar-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="main-menu">
                 


                     <li> 
                        <a href="index.php" ><i class="fa fa-desktop "></i>Dashboard </a>
                    </li>
                   
                    
                    <li class="">
                        <a href="viewestimation.php"><i class="fa fa-table "></i>Estimation  </a>
                    </li>
					
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Purchase <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewpurchaseorder.php">Purchase Order</a></li>
                      <li><a href="viewpurchase.php">Purchase</a></li>
                    </ul>
                    </li>

                     <li>
                        <a href="viewproduction.php"><i class="fa fa-qrcode "></i>Production</a>
                    </li>
					
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Sales <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewsalesorder.php">Sales Order</a></li>
                      <li><a href="viewinvoice.php">Sales</a></li>
                    </ul>
                    </li>
                    <li>
                        <a href="stock.php"><i class="fa fa-bar-chart-o"></i>Stock</a>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Vouchers <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewpayment.php">Payment</a></li>
                      <li><a href="viewreceipt.php">Receipt</a></li>
                    </ul>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Accounts <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="daybook.php">Daybook</a></li>
                      <li><a href="debitor_ledger.php">Customers Ledger</a></li>
                      <li><a href="creditor_ledger.php">Suppliers Ledger</a></li>
                      <li><a href="cash_ledger.php">Cash Ledger</a></li>
                      <li><a href="bank_ledger.php">Bank Ledger</a></li>
                      <li><a href="outstandings.php">Outstandings</a></li>
                    </ul>
                    </li>

                    <li>
                        <a href="routewisereport.php"><i class="fa fa-edit "></i>Routewise Report </a>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Expense <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewexpense_category.php">Expense Category</a></li>
                      <li><a href="viewexpense.php">Expense</a></li>
                      <li><a href="expenseledger.php">Expense Ledger</a></li>                      
                    </ul>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Imprest <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewimprest.php">Create / View</a></li>
                      <li><a href="imprestledger.php">Imprest Ledger</a></li>                    
                    </ul>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Employee <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewemployee.php">Employees</a></li>
                      <li><a href="viewattendance.php">Attendance</a></li>                    
                      <li><a href="viewotattendance.php">OT Attendance</a></li>                    
                      <li><a href="viewadvance.php">Advance</a></li>                    
                      <li><a href="salary.php">Generate Payslip</a></li>                    
                      <li><a href="kpi.php">KPI</a></li>                    
                      <li><a href="kpireport.php">KPI Report</a></li>                    
                      <li><a href="salarysheet.php">Salary Sheet</a></li>                    
                    </ul>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> Transport <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewtransport.php">Transport</a></li>
                      <li><a href="viewdelivery.php">Delivery</a></li>                    
                      <li><a href="viewfuel.php">Fuel</a></li>                    
                      <li><a href="fuel_report.php">Fuel Report</a></li>                                          
                    </ul>
                    </li>
					<li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" >
                    <i class="fa fa-table"></i> CRM <span class="badge"></span>
                        <b class="caret"></b>
                       </a>
                    <ul class="dropdown-menu" style="width: 260px;">
                      <li><a href="viewcrmcustomer.php">Farmer Data</a></li>
                      <li><a href="viewteam.php">CRM Team Allocate</a></li>                    
                      <li><a href="premiumcustomer.php">Premium Customers</a></li>                    
                      <li><a href="followup.php">New - Follow Up</a></li>                    
                      <li><a href="todaysfollowup.php">Today's Follow Up</a></li>                    
                      <li><a href="followupreport.php">Follow Up Report</a></li>                    
                      <li><a href="executivereport.php">Executives Report</a></li>                    
                      <li><a href="executivesummary.php">Executive Summary</a></li>                    
                      <li><a href="teamwisereport.php">Teamwise Report</a></li>                    
                    </ul>
                    </li>
                    <li>
                        <a href="viewnewproject.php"><i class="fa fa-table "></i>New Project</a>
                    </li>
                     <li>
                        <a href="viewcoconutproject.php"><i class="fa fa-edit "></i>Coconut Project </a>
                    </li>
					
                </ul>
                            </div>

        </nav>
        <!-- /. NAV SIDE  -->			
			</div>
        
        
        
        
<?php

}

else
{

$empd=mysqli_query($conn,"select * from employee where username='$user'");
$empd1=mysqli_fetch_assoc($empd);

$usr=$empd1['ID'];


$c1=mysqli_query($conn,"select * from menu where menu='customer' and username='$usr'");
$d1=mysqli_num_rows($c1);


$c2=mysqli_query($conn,"select * from menu where menu='supplier' and username='$usr'");
$d2=mysqli_num_rows($c2);


$c3=mysqli_query($conn,"select * from menu where menu='productcategory' and username='$usr'");
$d3=mysqli_num_rows($c3);


$c4=mysqli_query($conn,"select * from menu where menu='product' and username='$usr'");
$d4=mysqli_num_rows($c4);


$c5=mysqli_query($conn,"select * from menu where menu='factory' and username='$usr'");
$d5=mysqli_num_rows($c5);


$c6=mysqli_query($conn,"select * from menu where menu='bank' and username='$usr'");
$d6=mysqli_num_rows($c6);


$c7=mysqli_query($conn,"select * from menu where menu='department' and username='$usr'");
$d7=mysqli_num_rows($c7);


$c8=mysqli_query($conn,"select * from menu where menu='designation' and username='$usr'");
$d8=mysqli_num_rows($c8);


$c9=mysqli_query($conn,"select * from menu where menu='settings' and username='$usr'");
$d9=mysqli_num_rows($c9);


$c10=mysqli_query($conn,"select * from menu where menu='purchaseorder' and username='$usr'");
$d10=mysqli_num_rows($c10);


$c11=mysqli_query($conn,"select * from menu where menu='purchase' and username='$usr'");
$d11=mysqli_num_rows($c11);


$c12=mysqli_query($conn,"select * from menu where menu='production' and username='$usr'");
$d12=mysqli_num_rows($c12);


$c13=mysqli_query($conn,"select * from menu where menu='salesorder' and username='$usr'");
$d13=mysqli_num_rows($c13);


$c14=mysqli_query($conn,"select * from menu where menu='sales' and username='$usr'");
$d14=mysqli_num_rows($c14);


$c15=mysqli_query($conn,"select * from menu where menu='stock' and username='$usr'");
$d15=mysqli_num_rows($c15);


$c16=mysqli_query($conn,"select * from menu where menu='payment' and username='$usr'");
$d16=mysqli_num_rows($c16);


$c17=mysqli_query($conn,"select * from menu where menu='receipt' and username='$usr'");
$d17=mysqli_num_rows($c17);


$c18=mysqli_query($conn,"select * from menu where menu='daybook' and username='$usr'");
$d18=mysqli_num_rows($c18);


$c19=mysqli_query($conn,"select * from menu where menu='customerledger' and username='$usr'");
$d19=mysqli_num_rows($c19);


$c20=mysqli_query($conn,"select * from menu where menu='supplierledger' and username='$usr'");
$d20=mysqli_num_rows($c20);


$c21=mysqli_query($conn,"select * from menu where menu='cashledger' and username='$usr'");
$d21=mysqli_num_rows($c21);


$c22=mysqli_query($conn,"select * from menu where menu='bankledger' and username='$usr'");
$d22=mysqli_num_rows($c22);


$c23=mysqli_query($conn,"select * from menu where menu='outstandings' and username='$usr'");
$d23=mysqli_num_rows($c23);


$c24=mysqli_query($conn,"select * from menu where menu='expensecategory' and username='$usr'");
$d24=mysqli_num_rows($c24);


$c25=mysqli_query($conn,"select * from menu where menu='expense' and username='$usr'");
$d25=mysqli_num_rows($c25);


$c26=mysqli_query($conn,"select * from menu where menu='imprest' and username='$usr'");
$d26=mysqli_num_rows($c26);


$c27=mysqli_query($conn,"select * from menu where menu='employees' and username='$usr'");
$d27=mysqli_num_rows($c27);


$c28=mysqli_query($conn,"select * from menu where menu='attendance' and username='$usr'");
$d28=mysqli_num_rows($c28);


$c29=mysqli_query($conn,"select * from menu where menu='advance' and username='$usr'");
$d29=mysqli_num_rows($c29);


$c30=mysqli_query($conn,"select * from menu where menu='generatepayslip' and username='$usr'");
$d30=mysqli_num_rows($c30);


$c31=mysqli_query($conn,"select * from menu where menu='kpi' and username='$usr'");
$d31=mysqli_num_rows($c31);


$c32=mysqli_query($conn,"select * from menu where menu='kpireport' and username='$usr'");
$d32=mysqli_num_rows($c32);


$c33=mysqli_query($conn,"select * from menu where menu='salarysheet' and username='$usr'");
$d33=mysqli_num_rows($c33);


$c34=mysqli_query($conn,"select * from menu where menu='transport' and username='$usr'");
$d34=mysqli_num_rows($c34);


$c35=mysqli_query($conn,"select * from menu where menu='delivery' and username='$usr'");
$d35=mysqli_num_rows($c35);


$c36=mysqli_query($conn,"select * from menu where menu='fuel' and username='$usr'");
$d36=mysqli_num_rows($c36);


$c37=mysqli_query($conn,"select * from menu where menu='fuelreport' and username='$usr'");
$d37=mysqli_num_rows($c37);


$c38=mysqli_query($conn,"select * from menu where menu='crmcustomer' and username='$usr'");
$d38=mysqli_num_rows($c38);


$c39=mysqli_query($conn,"select * from menu where menu='crmteamallocate' and username='$usr'");
$d39=mysqli_num_rows($c39);


$c40=mysqli_query($conn,"select * from menu where menu='followup' and username='$usr'");
$d40=mysqli_num_rows($c40);


$c41=mysqli_query($conn,"select * from menu where menu='followupreport' and username='$usr'");
$d41=mysqli_num_rows($c41);


$c42=mysqli_query($conn,"select * from menu where menu='executivesreport' and username='$usr'");
$d42=mysqli_num_rows($c42);


$c43=mysqli_query($conn,"select * from menu where menu='otattendance' and username='$usr'");
$d43=mysqli_num_rows($c43);


$c44=mysqli_query($conn,"select * from menu where menu='todaysfollowup' and username='$usr'");
$d44=mysqli_num_rows($c44);


$c45=mysqli_query($conn,"select * from menu where menu='teamwisereport' and username='$usr'");
$d45=mysqli_num_rows($c45);


$c46=mysqli_query($conn,"select * from menu where menu='newproject' and username='$usr'");
$d46=mysqli_num_rows($c46);

$c47=mysqli_query($conn,"select * from menu where menu='premiumcustomers' and username='$usr'");
$d47=mysqli_num_rows($c47);

$c48=mysqli_query($conn,"select * from menu where menu='coconutproject' and username='$usr'");
$d48=mysqli_num_rows($c48);


?>

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title><?php echo $compname; ?></title>

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- BOOTSTRAP STYLES-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FONTAWESOME STYLES-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
        <!-- CUSTOM STYLES-->
    <link href="assets/css/custom.css" rel="stylesheet" />
     <!-- GOOGLE FONTS-->
   <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
   
		<!-- bootstrap & fontawesome -->

		<link rel="stylesheet" href="assets/css/bootstrap.min.css" />

		<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />



		<!-- page specific plugin styles -->



		<!-- text fonts -->

		<link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" />

		<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
        
        <link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
        
        <link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />

		<!-- ace styles -->
        
        <link rel="stylesheet" href="assets/css/select2.min.css" />

		<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
        
        <link rel="stylesheet" href="assets/css/fullcalendar.min.css" />

		<!--[if lte IE 9]>

			<link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" />

		<![endif]-->

		<!--<link rel="stylesheet" href="assets/css/ace-skins.min.css" />

		<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />-->



		<!--[if lte IE 9]>

		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />

		<![endif]-->



		<!-- inline styles related to this page -->



		<!-- ace settings handler -->

		<script src="assets/js/ace-extra.min.js"></script>



		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->



		<!--[if lte IE 8]>

		<script src="assets/js/html5shiv.min.js"></script>

		<script src="assets/js/respond.min.js"></script>

		<![endif]-->

        
<style>

ul.navbar-nav li
{
	border-left:none;
	border-right:none;
}

input[type="text"]
{
	width:220px;
	height:30px;
}

</style>        
        
	</head>
	
	

	<body class="no-skin">
	    <div id="wrapper">
		<div class="navbar navbar-inverse navbar-fixed-top">
			<div class="adjust-nav">
			    <div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
					<span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="index.php" class="navbar-brand">
						<small style="text-transform:uppercase; font-size:16px; color:white;"><img src="assets/images/icon.png" style="padding:0; margin-top:-7px;" /><?php echo $compname; ?></small>
					</a>
				</div>
				</div>

				<span class="logout-spn" >
                  <a href="logout.php" style="color:#fff;">LOGOUT</a>
				  </span>
                
                
                <nav class="navbar-default navbar-side" role="navigation">
                <div class="sidebar-collapse">
					
					<?php
					
					if($d1>0 || $d2>0 || $d3>0 || $d4>0 || $d5>0 || $d6>0 || $d7>0 || $d8>0 || $d9>0)
					{
						
					echo'<ul class="nav" id="main-menu">';

						if($d1>0)
						{
                        echo'<li class="grey"><a href="viewcustomer.php"><i class="fa fa-desktop "></i> <span>Customer</span></a></li>';
						}
						if($d2>0)
						{
                        echo'<li class="grey"><a href="viewsupplier.php"><i class="ace-icon fa fa-calendar"></i> Supplier</a></li>';
						}
                        
						if($d3>0 || $d4>0)
						{
                        echo'<li class="grey dropdown-modal">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="ace-icon fa fa-tasks"></i>
								Product
							</a>
                            
							<ul class="dropdown-menu-left dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
								<li class="dropdown-header">';
								
								if($d3>0)
								{
									echo'<a href="viewproduct_category.php"><i class="ace-icon fa fa-check"></i>Product Category</a>';
								}
									
								echo'</li>
                                <li class="dropdown-header">';
								
								if($d4>0)
								{
									echo'<a href="viewproduct.php"><i class="ace-icon fa fa-check"></i>Product</a>';
								}
									
								echo'</li>
							</ul>								

						</li>';
						}
                        
						if($d5>0)
						{
                        echo'<li class="grey"><a href="viewfactory.php"><i class="ace-icon fa fa-group"></i> Factory</a></li>';
						}
                        
						if($d6>0)
						{
                        echo'<li class="grey"><a href="viewbank.php"><i class="ace-icon fa fa-bank"></i> Bank</a></li>';
						}
                        
						if($d7>0 || $d8>0)
						{
                        echo'<li class="grey dropdown-modal">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<i class="ace-icon fa fa-tasks"></i>
								Tools
							</a>
                            
							<ul class="dropdown-menu-left dropdown-navbar dropdown-menu dropdown-caret dropdown-close">';
							
							if($d7>0)
							{
								echo'<li class="dropdown-header">
									<a href="viewdepartment.php"><i class="ace-icon fa fa-check"></i>Department</a>
								</li>';
							}
							if($d8>0)
							{
                                echo'<li class="dropdown-header">
									<a href="viewdesignation.php"><i class="ace-icon fa fa-check"></i>Designation</a>
								</li>';
							}
							
							echo'</ul>

						</li>';
						}
                        
						if($d9>0)
						{
                        echo'<li class="grey"><a href="settings.php"><i class="ace-icon fa fa-cogs"></i> Settings</a></li>';
						}
						
					echo'</ul>';
					
					}
					
					?>
					
				</div>
				</nav>

			</div><!-- /.navbar-container -->
		</div>
        
        
        
        <div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
			</script>

			<div id="sidebar" class="sidebar responsive ace-save-state">
				<script type="text/javascript">
					try{ace.settings.loadState('sidebar')}catch(e){}
				</script>

				<ul class="nav nav-list">				
				
					<li class="">
						<a href="index.php">
							<i class="menu-icon fa fa-tachometer"></i>
							<span class="menu-text"> Dashboard </span>
						</a>

					</li>
				
				<?php
				

				if($d10>0 || $d11>0)
				{
					echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-book"></i>
							<span class="menu-text">
								Purchase
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
							
							if($d10>0)
							{
							echo'<li class="">
								<a href="viewpurchaseorder.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Purchase Order
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d11>0)
							{
                            echo'<li class="">
								<a href="viewpurchase.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Purchase
								</a>

								<b class="arrow"></b>
							</li>';
							}

						echo'</ul>
					</li>';
				}
                    
				if($d12>0)
				{
                    echo'<li class="">
						<a href="viewproduction.php">
							<i class="menu-icon fa fa-leaf"></i>
							<span class="menu-text"> Production </span>
						</a>
						<b class="arrow"></b>
					</li>';
				}
                    
				if($d13>0 || $d14>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-list"></i>
							<span class="menu-text">
								Sales
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
							
							if($d13>0)
							{
							echo'<li class="">
								<a href="viewsalesorder.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Sales Order
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d14>0)
							{
                            echo'<li class="">
								<a href="viewinvoice.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Sales
								</a>

								<b class="arrow"></b>
							</li>';
							}
							
						echo'</ul>
					</li>';
				}
                
                if($d15>0)
				{
                    echo'<li class="">
						<a href="stock.php">
							<i class="menu-icon fa fa-leaf"></i>
							<span class="menu-text"> Stock </span>
						</a>
						<b class="arrow"></b>
					</li>';
				}
                    
				if($d16>0 || $d17>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-pencil"></i>
							<span class="menu-text">
								Vouchers
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
							
							if($d16>0)
							{
							echo'<li class="">
								<a href="viewpayment.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Payment
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d17>0)
							{
                            echo'<li class="">
								<a href="viewreceipt.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Receipt
								</a>

								<b class="arrow"></b>
							</li>';
							}
							
						echo'</ul>
					</li>';
					
				}
                    
				if($d18>0 || $d19>0 || $d20>0 || $d21>0 || $d22>0 || $d23>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-file"></i>
							<span class="menu-text">
								Accounts
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
							
							if($d18>0)
							{
							echo'<li class="">
								<a href="daybook.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Daybook
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d19>0)
							{
                            echo'<li class="">
								<a href="debitor_ledger.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Customers Ledger
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d20>0)
							{
                            echo'<li class="">
								<a href="creditor_ledger.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Suppliers Ledger
								</a>

								<b class="arrow"></b>
							</li>';
							}
							
                            if($d21>0)
							{
                            echo'<li class="">
								<a href="cash_ledger.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Cash Ledger
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d22>0)
							{
                            echo'<li class="">
								<a href="bank_ledger.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Bank Ledger
								</a>

								<b class="arrow"></b>
							</li>';
							}
							
							if($d23>0)
							{
							echo'<li class="">
								<a href="outstandings.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Outstandings
								</a>

								<b class="arrow"></b>
							</li>';
							}

						echo'</ul>
					</li>';
				}
                    
				if($d24>0 || $d25>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-pencil"></i>
							<span class="menu-text">
								Expense
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
							
							if($d24>0)
							{
							echo'<li class="">
								<a href="viewexpense_category.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Expense Category
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d25>0)
							{
                            echo'<li class="">
								<a href="viewexpense.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Expense
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
						echo'</ul>
					</li>';
				}
                    
				if($d26>0)
				{
                    echo'<li class="">
						<a href="viewimprest.php">
							<i class="menu-icon fa fa-leaf"></i>
							<span class="menu-text"> Imprest </span>
						</a>
						<b class="arrow"></b>
					</li>';
				}
                    
				if($d27>0 || $d28>0 || $d29>0 || $d30>0 || $d31>0 || $d32>0 || $d33>0 || $d43>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-users"></i>
							<span class="menu-text">
								Employee
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';

						if($d27>0)
						{
                            echo'<li class="">
								<a href="viewemployee.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Employees
								</a>

								<b class="arrow"></b>
							</li>';
						}
                            
						if($d28>0)
						{
                            echo'<li class="">
								<a href="viewattendance.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Attendance
								</a>

								<b class="arrow"></b>
							</li>';
						}
						
						if($d43>0)
						{
                            echo'<li class="">
								<a href="viewattendance.php">
									<i class="menu-icon fa fa-caret-right"></i>
									OT Attendance
								</a>

								<b class="arrow"></b>
							</li>';
						}
                        
						if($d29>0)
						{
                            echo'<li class="">
								<a href="viewadvance.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Advance
								</a>

								<b class="arrow"></b>
							</li>';
						}
                            
						if($d30>0)
						{
                            echo'<li class="">
								<a href="salary.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Generate Payslip
								</a>

								<b class="arrow"></b>
							</li>';
						}
							
						if($d31>0)
						{
							echo'<li class="">
								<a href="kpi.php">
									<i class="menu-icon fa fa-caret-right"></i>
									KPI
								</a>

								<b class="arrow"></b>
							</li>';
						}
							
						if($d32>0)
						{
							echo'<li class="">
								<a href="kpireport.php">
									<i class="menu-icon fa fa-caret-right"></i>
									KPI Report
								</a>

								<b class="arrow"></b>
							</li>';
						}
						
						if($d33>0)
						{							
							echo'<li class="">
								<a href="salarysheet.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Salary Sheet
								</a>

								<b class="arrow"></b>
							</li>';
						}
                            
						echo'</ul>
					</li>';
				}
                    
                if($d34>0 || $d35>0 || $d36>0 || $d37>0)
				{
					
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-list"></i>
							<span class="menu-text">
								Transport
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
                            
							if($d34>0)
							{
                            echo'<li class="">
								<a href="viewtransport.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Transport
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d35>0)
							{
                            echo'<li class="">
								<a href="viewdelivery.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Delivery
								</a>

								<b class="arrow"></b>
							</li>';
							}
                            
							if($d36>0)
							{
                            echo'<li class="">
								<a href="viewfuel.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Fuel
								</a>

								<b class="arrow"></b>
							</li>';
							}

							if($d37>0)
							{
                            echo'<li class="">
								<a href="fuel_report.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Fuel Report
								</a>

								<b class="arrow"></b>
							</li>';
							}


						echo'</ul>
					</li>';
				}
                    
                if($d38>0 || $d39>0 || $d40>0 || $d41>0 || $d42>0 || $d44>0 || $d47>0)
				{
                    echo'<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-list"></i>
							<span class="menu-text">
								CRM
							</span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">';
                        
						if($d38>0)
						{
                        	echo'<li class="">
								<a href="viewcrmcustomer.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Farmer Data
								</a>

								<b class="arrow"></b>
							</li>';
						}

if($d47>0)
						{
                        	echo'<li class="">
								<a href="premiumcustomer.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Premium Customers
								</a>

								<b class="arrow"></b>
							</li>';
						}
							
						if($d39>0)
						{
							echo'<li class="">
								<a href="viewteam.php">
									<i class="menu-icon fa fa-caret-right"></i>
									CRM Team Allocate
								</a>

								<b class="arrow"></b>
							</li>';
						}
                            
						if($d40>0)
						{
                            echo'<li class="">
								<a href="followup.php">
									<i class="menu-icon fa fa-caret-right"></i>
									New - Follow Up
								</a>

								<b class="arrow"></b>
							</li>';
						}
						
						if($d44>0)
						{
                            echo'<li class="">
								<a href="todaysfollowup.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Todays Follow Up
								</a>

								<b class="arrow"></b>
							</li>';
						}
                        
						if($d41>0)
						{
                            echo'<li class="">
								<a href="followupreport.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Follow Up Report
								</a>

								<b class="arrow"></b>
							</li>';
						}
                        
						if($d42>0)
						{
                            echo'<li class="">
								<a href="executivereport.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Executives Report
								</a>

								<b class="arrow"></b>
							</li>';
						}
						
						if($d45>0)
						{
                            echo'<li class="">
								<a href="teamwisereport.php">
									<i class="menu-icon fa fa-caret-right"></i>
									Teamwise Report
								</a>

								<b class="arrow"></b>
							</li>';
						}


						echo'</ul>
					</li>';
				}
				
				if($d46>0)
				{
				echo'<li class="">
						<a href="viewnewproject.php">
							<i class="menu-icon fa fa-leaf"></i>
							<span class="menu-text"> New Project </span>
						</a>
						<b class="arrow"></b>
				</li>';
				}

if($d48>0)
				{
				echo'<li class="">
						<a href="viewcoconutproject.php">
							<i class="menu-icon fa fa-leaf"></i>
							<span class="menu-text"> Coconut Project </span>
						</a>
						<b class="arrow"></b>
				</li>';
				}

				?>
				
				</ul>

			
			</div>


<?php


}


}


?>