<?php

if ( is_logged_in() ) {
    if($this->session->userdata('ss_user_id')!=37 && $this->session->userdata('ss_user_id')!=21){
        //echo "<script>alert(".$this->session->userdata('ss_user_id').")</script>";
        
        if($this->session->userdata('ss_group_id')==6)
    	redirect( base_url("bar"), 'refresh' );
    }
    
} else {
	redirect( base_url(), 'refresh' );
	exit();
}
$Common_Model = new Common_Model();
$usr_permtn_pubvr = $Common_Model->is_avalable_for_use_this_link_for_user( $this->session->userdata( 'ss_group_id' ), 'users' );

if($this->session->userdata['ss_user_id'] != 111){

//echo  "<br><br><br><br><pre>";

    //print_r($usr_permtn_pubvr[0]);

//echo  "</pre>";

$nav_items = $Common_Model->get_all_navs();
/*
 
echo  "<pre>";
print_r($nav_items);
echo  "</pre>";


*/
// $o=array();
// $a=array("name"=>"products","url"=>"");
// $b=array("sub_name"=>"list_products","url"=>"products/list");

// array_push($a,$b);
// array_push($o,$a);

// $c=array("name"=>"sales","url"=>"");
// $d=array("sub_name"=>"list_sales","url"=>"sales/list");

// array_push($c,$d);
// array_push($o,$c);

// echo "<pre>";
// print_r($o);
// echo "</pre>";

?>

<div class="main-navigation navbar-collapse collapse">

	<!-- start: MAIN MENU TOGGLER BUTTON -->
	<div class="navigation-toggler"> <i class="clip-chevron-left"></i> <i class="clip-chevron-right"></i> </div>
	<!-- end: MAIN MENU TOGGLER BUTTON -->
	<!-- start: MAIN NAVIGATION MENU -->
	<ul class="main-navigation-menu">
	    <!--NAV DYNAMIC START-->
	    <?php
	    foreach($nav_items as $nav){//start foreach nav
    	    if($nav["url"]){
    	    ?>
    	    <li <?php if($main_menu_name==$nav["main_menu_name"] ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url($nav["url"]); ?>"><?php echo $nav["display_name"]; ?><span class="selected"></span></a> </li>
    	    <?php
    	    }else{
    	    ?>
    	    
    	    <li <?php if($main_menu_name==$nav["main_menu_name"] ) {echo 'class="active open"';} ?>><a href="javascript:void(0)"><?php echo $nav["display_name"]; ?><i class="icon-arrow"></i><span class="selected"></span></a>
    			<ul class="sub-menu">
    			    <?php
    			    foreach($nav["subs"] as $key=>$sub){
    			        if(($sub["url"]) == "#"){
    			        ?>
    			        <li><?php echo $sub["display_name"]; ?></li>
    			        <?php    
    			        }
    			        else{
    			            
    			        ?>
    				    <li <?php if($sub_menu_name== $sub["sub_menu_name"] ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url($sub["url"]) ?>"><?php echo $sub["display_name"]; ?></a></li>
    			        
    			        <?php
    			   
    			        }
    			        
    			    }
    			    ?>
    			</ul>
    		</li>
    	    
    	    <?php
    	    }
	        
	    }//end foreach nav
	    ?>
        <!--NAV DYNAMIC END-->
	</ul>
	
	<!-- end: MAIN NAVIGATION MENU -->
</div>

<?php  }//end id ssuser == 1
else {
?>


<div class="main-navigation navbar-collapse collapse">

	<!-- start: MAIN MENU TOGGLER BUTTON -->
	<div class="navigation-toggler"> <i class="clip-chevron-left"></i> <i class="clip-chevron-right"></i> </div>
	<!-- end: MAIN MENU TOGGLER BUTTON -->
	<!-- start: MAIN NAVIGATION MENU -->
	<ul class="main-navigation-menu">

		<!--	dashbord -------------------------- -->
		<li <?php if($main_menu_name=='dashboard' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('dashboard?s='.rand()); ?>"><i class="clip-home-3"></i> <span class="title"> Dashboard </span><span class="selected"></span> </a> </li>
		<!--	dashbord -------------------------- -->

		<!--	product -------------------------- -->
		<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3 || $this->session->userdata('ss_user_id') == 52 || $this->session->userdata('ss_user_id') == 53){ ?><li <?php if($main_menu_name=='products' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="fa fa-barcode"></i> <span class="title"> Products </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
				<li <?php if($sub_menu_name=='products' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('products?s='.rand()); ?>"><i class="fa fa-reorder"></i><span class="title"> List Products</span></a>
				</li>
				<li <?php if($sub_menu_name=='add_products' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('products/add?s='.rand()); ?>"><i class="fa fa-plus"></i><span class="title"> Add Products</span></a>
				</li>
                <li <?php if($sub_menu_name=='brands' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('brands'); ?>"><i class="fa fa-plus"></i><span class="title"> Product Brands</span></a>
				</li>
			</ul>
		</li>
		<?php } ?>
		<!--	product -------------------------- -->

		<!-- start: delivery arrange-->
        	<?php 
			
			if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3){ ?>
		<li <?php if($main_menu_name=='marketing_delivery_process' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-truck"></i> <span class="title"> Arrange Delivery </span>  <i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">

				<li <?php if($sub_menu_name=='delivery_list' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('marketing_delivery_process/delivery_pending_list'); ?>"><i class="fa fa-reorder"></i> <span class="title"> List Pending Delivery</span></a>
				</li>
				<li <?php if($sub_menu_name=='add_new_delivery' ) {echo 'class="active open"';} ?>>
					<a href="<?php echo base_url('marketing_delivery_process/add_new_delivery'); ?>"><i class="fa fa-plus"></i> <span class="title"> Arrange New Delivery </span></a>
				</li>
			</ul>
		</li>
		<?php } ?>
		<!-- end: delivery arrange -->


		<!-- -------------------------------------------------------------------- product order -->
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3){ ?>
		<li <?php if($main_menu_name=='customer_order_process' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="fa fa-male"></i> <span class="title"> Customer Order </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
				<li <?php if($sub_menu_name=='customer_order_process' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('customer_order_process?s='.rand()); ?>"><i class="fa fa-reorder"></i><span class="title"> Pending Orders </span></a>
				</li>
				<li <?php if($sub_menu_name=='cus_loaded' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('customer_order_process/cus_loaded?s='.rand()); ?>"><i class="fa fa-reorder"></i><span class="title"> Loaded Orders</span></a>
				</li>
				<li <?php if($sub_menu_name=='manage' ) {echo 'class="active open"';} ?>>
					<?php $sale_rep_issue_id =0 //For add issue sale ?>
					<a href="<?php echo base_url('customer_order_process/manage/'.$sale_rep_issue_id."/ ".rand()); ?>"> <i class="fa fa-plus"></i> <span class="title"> Add new order </span></a>
				</li>
			</ul>
		</li>
		<?php } ?>
		<!-- ----------------------------------- loading section>    

		<!-- start: delivery ongoing-->
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3){ ?>
		<li <?php if($main_menu_name=='marketing_ongoing' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-truck"></i> <span class="title"> Ongoing Delivery </span>  <i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">

				<li <?php if($sub_menu_name=='marketing_ongoing' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('marketing_delivery_process/ongoing_delivery_list'); ?>"><i class="fa fa-reorder"></i> <span class="title">Ongoing Delivery </span></a>
				</li>
			</ul>
		</li>
		<?php } ?>
		<!-- end: delivery ongoing-->

		<!-- start: unloading-->
        	<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2 /*||$this->session->userdata('ss_group_id')==3*/ ){ ?>
		<li <?php if($main_menu_name=='unloading_delivery_list' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-truck"></i> <span class="title"> Unload Delivery </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">

				<li <?php if($sub_menu_name=='unloading_delivery_list' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('marketing_delivery_process/unloading_delivery_list'); ?>"><i class="fa fa-reorder"></i> <span class="title"> List unloading</span></a>
				</li>
				<?php /*?><li <?php if($sub_menu_name=='unloading_delivery_slist' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('marketing_delivery_process/unloading_delivery_list'); ?>"><i class="fa fa-reorder"></i> <span class="title"> List unloaded</span></a>
				</li><?php */?>
			</ul>
		</li>
		<?php } ?>
		<!-- end: unloading-->
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3 || $this->session->userdata('ss_user_id')==21 || $this->session->userdata('ss_user_id')==37){ ?>
        <li <?php if($main_menu_name=='hw' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-cart "></i> <span class="title"> Hardware </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
			    <?php if($this->session->userdata('ss_user_id')!=21) {?>
				<li <?php if($sub_menu_name=='list' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('pos/hw_list'); ?>"> <span class="title"> List Invoices</span></a></li>
				<li <?php if($sub_menu_name=='sales_return_hw' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales_return/sales_return_hw?s='.rand()); ?>"> <span class="title"> List Return Invoice</span></a>
				</li>
				<?php }?>
				<li <?php if($sub_menu_name=='stn' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('store_notes'); ?>"> <span class="title"> Store Notes</span></a></li>
					<li <?php if($sub_menu_name=='list_2' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('hw_delivery/hw_list'); ?>"> <span class="title"> List Store Invoices </span></a></li>
			</ul>
		</li>
        <?php } ?>
        	<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
		<li <?php if($main_menu_name=='direct' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-cart "></i> <span class="title"> Direct Invoices </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
				<li <?php if($sub_menu_name=='list_direct' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales/listdirect?s='.rand()); ?>"> <span class="title"> List direct Invoices</span></a>
				</li>
				<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3){ ?>
				<li <?php if($sub_menu_name=='add_direct' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales/direct?s='.rand()); ?>"> <span class="title"> New direct Invoice</span></a>
				</li>
                <?php } ?>
				<?php /*?>
				<li <?php if($sub_menu_name=='sales_return' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales_return?s='.rand()); ?>"> <span class="title"> List Return Invoice</span></a>
				</li>
				<?php */?>

			</ul>
		</li>
		<?php } ?>
		<!-- --------------------------------------------------------------------->
        	<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
		<li <?php if($main_menu_name=='sales' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-cart "></i> <span class="title"> Distribution Invoices </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
				<li <?php if($sub_menu_name=='sales' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales?s='.rand()); ?>"> <span class="title"> List Invoices</span></a>
				</li>
				<li style="display:none" <?php if($sub_menu_name=='sales_add' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales/add_sales?s='.rand()); ?>"> <span class="title"> New Invoice</span></a>
				</li>
				<?php /*?>
				<li <?php if($sub_menu_name=='sales_return' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sales_return?s='.rand()); ?>"> <span class="title"> List Return Invoice</span></a>
				</li>
				<?php */?>
			</ul>
		</li>
		<?php } ?>
		<!-- --------------------------------------------------------------------->
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_user_id')==24||$this->session->userdata('ss_user_id')==1)
			{ ?>
		  <li <?php if($main_menu_name=='sale_multiple_payment') {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="fa fa-money"></i> <span class="title">Distribution Payment </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
      
      <ul class="sub-menu">
          
        <li <?php if($sub_menu_name=='sale_multiple_payment_list') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sale_multiple_payment'); ?>"> <span class="title"> List Distribution Payment</span></a></li>
        <li <?php if($sub_menu_name=='sale_multiple_payment_add') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('sale_multiple_payment/manage/0'); ?>"> <span class="title"> Add Distribution Payment</span></a></li>
        <li <?php if($sub_menu_name=='payment_process') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('payment_process'); ?>"> <span class="title"> List Payment Returned</span></a></li>
         <li <?php if($sub_menu_name=='manage') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('payment_process/manage'); ?>"> <span class="title"> Cheque return settlement</span></a></li>
         <li <?php if($sub_menu_name=='over_payment_settlment') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('payment_process/over_payment_settlment/0'); ?>"> <span class="title"> Over Payment Settlemet</span></a></li>
      </ul>
    </li>
    <?php if ($this->session->userdata('ss_group_id')==9 ){ ?>
    <li <?php if($main_menu_name=='supplier_multiple_payment') {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="fa fa-money"></i> <span class="title">Supplier Multiple Payments </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
      <ul class="sub-menu">
        <li <?php if($sub_menu_name=='supplier_multiple_payment') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('multiple_payments/supplier/list'); ?>"> <span class="title"> List Supplier Payment</span></a></li>
        <li <?php if($sub_menu_name=='supplier_multiple_payment_add') {echo 'class="active open"';} ?>> <a href="<?php echo base_url('multiple_payments/supplier/add'); ?>"> <span class="title"> Add Supplier Payment</span></a></li>
      </ul>
    </li>
    <?php } ?>
    <?php } ?>
	<!-- --------------------------------------------------------------------->	
		<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2){ ?>
		<li <?php if($main_menu_name=='management' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-folder-upload "></i> <span class="title"> Management</span><i class="icon-arrow"></i> <span class="selected"></span> </a>
			<ul class="sub-menu">
				<li <?php if($sub_menu_name=='delivery_list' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('management/pending_delivery_approval'); ?>"> <span class="title"> Delivery Approval</span></a>
				</li>

				<li <?php if($sub_menu_name=='pending_credit_approval' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('management/pending_credit_approval'); ?>"> <span class="title"> Order Credit Approval</span></a>
				</li>
				
					<li <?php if($sub_menu_name=='customer_pending_credit_approval' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('management/customer_pending_credit_approval'); ?>"> <span class="title"> Credit Rejected Customers</span></a>
				</li>
					<li <?php if($sub_menu_name=='credit_approved_customers' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('management/credit_approved_customers'); ?>"> <span class="title"> Credit Approved Customers</span></a>
				</li>

			</ul>
			
		</li>
		<?php } ?>

			<?php /*?>
			<li <?php if($main_menu_name=='quotations' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class=" clip-file-2 "></i> <span class="title"> Quotations </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<li <?php if($sub_menu_name=='quotations' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('quotations'); ?>"> <span class="title"> List Quotation</span></a>
					</li>
					<li <?php if($sub_menu_name=='quotations_add' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('quotations/add'); ?>"> <span class="title"> Add Quotation</span></a>
					</li>
				</ul>
			</li>
			<?php */?>

        	<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3|| $this->session->userdata('ss_user_id') == 52 || $this->session->userdata('ss_user_id') == 53){ ?>
			<li <?php if($main_menu_name=='purchases' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class=" clip-enter"></i> <span class="title"> GRN </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<li <?php if($sub_menu_name=='list_purchases' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('purchases?s='.rand()); ?>"> <span class="title"> List GRN </span> </a> </li>
					<li <?php if($sub_menu_name=='add_purchases' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('purchases/add?s='.rand()); ?>"> <span class="title"> Add GRN </span> </a> </li>
				
				</ul>
			</li>
			<?php } ?>
				<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2/*||$this->session->userdata('ss_group_id')==3*/){ ?>
			<li <?php if($main_menu_name=='transfer' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-transfer"></i> <span class="title"> Transfers </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<li <?php if($sub_menu_name=='list_transfer' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('transfer'); ?>"> <span class="title"> List Transfers </span> </a> </li>
					<li <?php if($sub_menu_name=='transfer_add' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('transfer/add'); ?>"> <span class="title"> Add Transfer </span> </a> </li>
				</ul>
			</li>
			<?php } ?>
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3 || $this->session->userdata('ss_user_id') == 52 || $this->session->userdata('ss_user_id') == 53){ ?>
			<li <?php if($main_menu_name=='product_damage' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="f clip-remove "></i> <span class="title"> Damage Products </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<li <?php if($sub_menu_name=='list_product_damage' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('product_damage'); ?>"> <span class="title"> List Damage Product </span></a>
					</li>
					<li <?php if($sub_menu_name=='product_damage_add' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('product_damage/add'); ?>"> <span class="title"> Add Damage Product</span></a> </li>
					<li <?php if($sub_menu_name=='product_damage_add_customer' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('product_damage_customer/product_damage_add'); ?>"> <span class="title"> Add Damage Customer</span></a> </li>
					<li <?php if($sub_menu_name=='return_damage_cus' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('return_damage_cus/index'); ?>"> <span class="title"> List Damage Customer</span></a> </li>
				</ul>
			</li>
            <?php } ?>
			<?php /**/ ?>
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2/*||$this->session->userdata('ss_group_id')==3*/){ ?>
			<li <?php if($main_menu_name=='expenses' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-banknote"></i> <span class="title">Expenses</span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<li <?php if($sub_menu_name=='expenses' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('expenses'); ?>"> <span class="title"> List Expenses</span></a>
					</li>

					<li <?php if($sub_menu_name=='expenses_add' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('expenses/manage/0'); ?>"> <span class="title"> Add Expenses</span></a>
					</li>
					
					 <li <?php if($sub_menu_name=='transactions_list') {echo 'class="active open"';} ?>><a href="<?php echo base_url('transactions'); ?>"><span class="title">  Transactions</span>	</a></li>

				</ul>
			</li>
			<?php ?>
			<?php } ?>

        <?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3|| $this->session->userdata('ss_user_id') == 52 || $this->session->userdata('ss_user_id') == 53){ ?>
			<li <?php if($main_menu_name=='people' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-users-3"></i> <span class="title"> People </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">

					<li <?php if($sub_menu_name=='users' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('users'); ?>"> <span class="title">List Users</span> </a> </li>

					<?php //if(in_multiarray("usrgp_permission_page","users", $usr_permtn_pubvr,"usrgp_permission_add",1))
			{?>
					<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2){ ?>
					<li <?php if($sub_menu_name=='create_user' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('users/create_user'); ?>"> <span class="title">Add Users</span> </a> </li>
					<?php }} ?>
					<?php 
			//if(in_multiarray("usrgp_permission_page","customer", $usr_permtn_pubvr,"usrgp_permission_view",1))
			{?>
					<li <?php if($sub_menu_name=='customers' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('customers'); ?>"> <span class="title"> List Customer</span> </a> </li>
					<?php }?>
					<?php 
		//if(in_multiarray("usrgp_permission_page","customer", $usr_permtn_pubvr,"usrgp_permission_add",1))
		{?>
					<li> <a href="#" data-toggle="modal" id="modal_ajax_customers_btn"> <span class="title">Add Customer</span> </a> </li>
					<?php }?>
					<li <?php if($sub_menu_name=='suppliers' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('suppliers'); ?>"> <span class="title"> List Suppliers</span> </a> </li>
					<li><a id="modal_ajax_suppliers_btn" data-toggle="modal" href="#"> <span class="title"> Add Suppliers</span> </a> </li>
				</ul>
			</li>
            <?php } ?>
			<?php if ($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_user_id')==2){ ?>
			<li <?php if($main_menu_name=='' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-key"></i> <span class="title"> Specical permission </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<?php if ($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2){ ?>
			    	<li <?php if($sub_menu_name=='specical_permission' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('specical_permission'); ?>">cancel invoice</a> </li>
					<li <?php if($sub_menu_name=='specical_permission_cancel' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('specical_permission/cancelled_invoices'); ?>">cancelled invoices</a> </li>
					<?php }?>
				</ul>
			</li>
			<?php }?>
			<?php if ($this->session->userdata('ss_group_id')==0){ ?>
			<li <?php if($main_menu_name=='notifications' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('notifications'); ?>"><i class="clip-notification"></i> <span class="title">Notifications</span> <span class="selected"></span> </a> </li>
			<?php }?>
			
			
			<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3|| $this->session->userdata('ss_user_id') == 52 || $this->session->userdata('ss_user_id') == 53){ ?>
			<li <?php if($main_menu_name=='settings' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-cog-2"></i> <span class="title"> Settings </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">

					<!--<li <?php if($sub_menu_name=='system_settings') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('system_settings'); ?>">
										<span class="title">  System Settings </span>
									</a>
								</li>-->
					<li <?php if($sub_menu_name=='categories' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('system_settings/categories'); ?>"> <span class="title"> Categories </span> </a> </li>
					<!-- <li <?php if($sub_menu_name=='locations') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('locations'); ?>">
										<span class="title">Locations</span>
									</a>
								</li>-->
					<li <?php if($sub_menu_name=='warehouse' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('warehouse'); ?>"> <span class="title">Warehouse</span> </a> </li>
					<!-- <li <?php if($sub_menu_name=='tax_rates') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('tax_rates'); ?>">
										<span class="title"> Tax Rates </span>
									</a>
								</li>-->

					<li <?php if($sub_menu_name=='route' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('route'); ?>"> <span class="title"> Route </span> </a> </li>

					<li <?php if($sub_menu_name=='route_assign' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('route_assign'); ?>"> <span class="title"> Define Area </span> </a> </li>
					<li <?php if($sub_menu_name=='vehicle' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('vehicle'); ?>"> <span class="title"> Vehicle </span> </a> </li>

					<li <?php if($sub_menu_name=='area' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('area'); ?>"> <span class="title"> Area </span> </a> </li>

					<li <?php if($sub_menu_name=='unit' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('unit'); ?>"> <span class="title"> Unit </span> </a> </li>
					<li <?php if($sub_menu_name=='user_groups' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('system_settings/user_groups'); ?>"> <span class="title"> Group Permissions </span> </a> </li>
					<!--  <li <?php if($sub_menu_name=='backups') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('backups'); ?>">
										<span class="title">  Backups </span>
									</a>
								</li>	-->
				</ul>
			</li>
			<?php }?>
		<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
			<li <?php if($main_menu_name=='reports_marketing' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="	clip-stats "></i> <span class="title"> Marketing Reports </span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					
					<?php if($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
					
					<?php if ($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
					<li <?php if($sub_menu_name=='daily_sales_note' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/daily_sales_note'); ?>">Daily Sales Report</a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
					<li <?php if($sub_menu_name=='sales_note_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/sales_note_report'); ?>"> Sales Report</a> </li>
					<?php }?>
					
						<?php if ($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3){ ?>
					<li <?php if($sub_menu_name=='sales_item_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/sales_item_report'); ?>"> Sales Item Report</a> </li>
					<?php }?>
				
					<?php if ($this->session->userdata('ss_group_id')!=4){ ?>
					<li <?php if($sub_menu_name=='daily_delivery_summary' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/daily_delivery_summary'); ?>">Delivery Report</a> </li>
					<?php }?>
					
						<?php if ($this->session->userdata('ss_group_id')!=4){ ?>
					<li <?php if($sub_menu_name=='daily_cash_note' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/daily_cash_note'); ?>">Payment Report</a> </li>
					<?php }?>
					
					<?php if ($this->session->userdata('ss_group_id')!=4){ ?>
					<li <?php if($sub_menu_name=='cus_order_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/cus_order_report'); ?>">Customer Order Report</a> </li>
					<?php }?>
					
					<?php }?>
					
					
					
						<?php if ($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
					<li <?php if($sub_menu_name=='customer_outstanding_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/customer_outstanding_report'); ?>">Customer Outstanding </a> </li>
					<?php }?>

					<?php if ($this->session->userdata('ss_group_id')==1 ||$this->session->userdata('ss_group_id')==2||$this->session->userdata('ss_group_id')==3||$this->session->userdata('ss_group_id')==4){ ?>
					<li <?php if($sub_menu_name=='customer_payment_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/customer_payment_report'); ?>">Customer Payment Report </a> </li>
					<?php }?>
					
					
						<?php if($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2){ ?>
					
						<?php if ($this->session->userdata('ss_group_id')!=6){ ?>
					<li <?php if($sub_menu_name=='customer_due_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/cus_due_report'); ?>">Customer Due Report </a> </li>
					<?php }?>
					
						<?php if ($this->session->userdata('ss_group_id')!=4){ ?>
					<li <?php if($sub_menu_name=='sales_rep_commition_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/sales_rep_commition_report'); ?>">Rep Commission Report</a> </li>
					<li <?php if($sub_menu_name=='sales_rep_commition_report_breakdown' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/sales_rep_commition_report_breakdown'); ?>">Rep Commission Breakdown</a> </li>
					<?php }?>
					
					<?php }?>
					
					
					<li <?php if($sub_menu_name=='bin_card' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports_marketing/bin_card'); ?>">Bin Card</a> </li>
				</ul>
			</li>
			<?php }?>
			<?php if ($this->session->userdata('ss_group_id')!=5&&$this->session->userdata('ss_group_id')!=4 && $this->session->userdata('ss_group_id')!= 8|| $this->session->userdata('ss_user_id')==39){
			if($this->session->userdata('ss_user_id')!=21 && $this->session->userdata('ss_user_id') != 52 && $this->session->userdata('ss_user_id') != 53){ ?>
			<li <?php if($main_menu_name=='reports' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-bars"></i> <span class="title">Reports</span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<?php if ($this->session->userdata('ss_group_id')!=3 || $this->session->userdata('ss_group_id')!= 8){ ?>
					<li <?php if($sub_menu_name=='daily_sales' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/daily_sales'); ?>"> <span class="title"> Daily Sales Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')!=3){ ?>
					<li <?php if($sub_menu_name=='sales' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/sales'); ?>"> <span class="title"> Sales Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==10){ ?>
					<li <?php if($sub_menu_name=='sales_rep_report' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/sales_rep_wice'); ?>"> <span class="title"> Rep Sales</span> </a> </li>
					<?php }?>
					<?php /*?>
					<li <?php if($sub_menu_name=='reports/payments' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/payments'); ?>"> <span class="title"> Cash Report</span> </a> </li>
					<?php */?>
					<?php if ($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2){ ?>
					<li <?php if($sub_menu_name=='customer_receivable' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/customer_receivable'); ?>"> <span class="title"> Customer Receivable</span> </a> </li>
					<li <?php if($sub_menu_name=='cheque' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/cheque'); ?>"> <span class="title">Cheque Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1|| $this->session->userdata('ss_user_id')==39){ ?>
					<li <?php if($sub_menu_name=='suppliers' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/suppliers'); ?>"> <span class="title"> Suppliers Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1){ ?>
					<li <?php if($sub_menu_name=='grn' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/grn'); ?>"> <span class="title"> GRN Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1){ ?>
					<li <?php if($sub_menu_name=='products' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/products'); ?>"> <span class="title"> Products Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1){ ?>
					<li <?php if($sub_menu_name=='products_quantity' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/products_quantity'); ?>"> <span class="title"> Products Quantity Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1|| $this->session->userdata('ss_user_id')==39){ ?>
					<li <?php if($sub_menu_name=='reports/damage_products' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/damage_products'); ?>"> <span class="title"> Damage Products Report </span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1){ ?>
					<li <?php if($sub_menu_name=='supplier_products' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/supplier_products'); ?>"> <span class="title"> Supplier Products Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1){ ?>
					<li <?php if($sub_menu_name=='print_product_code' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/print_product_code'); ?>"> <span class="title"> Products Code Print</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')!=3){ ?>
					<li <?php if($sub_menu_name=='user_activitie' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/user_activitie'); ?>"> <span class="title"> User Activitie</span> </a> </li>
					<?php }?>
					
					
					<li <?php if($sub_menu_name=='user_activitie' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/alert_quantity'); ?>"> <span class="title"> Alert Quantity</span> </a> </li>
				
				
				</ul>
			</li>
	        <?php }}?>
	        
	        
	        <?php if ($this->session->userdata('ss_group_id')!=5&&$this->session->userdata('ss_group_id')!=4 && $this->session->userdata('ss_group_id')!= 8){
	        if($this->session->userdata('ss_user_id')!=21 && $this->session->userdata('ss_user_id') != 52 && $this->session->userdata('ss_user_id') != 53){
	        ?>
			<li <?php if($main_menu_name=='hardware_reports' ) {echo 'class="active open"';} ?>> <a href="javascript:void(0)"><i class="clip-bars"></i> <span class="title">Retail Reports</span><i class="icon-arrow"></i> <span class="selected"></span> </a>
				<ul class="sub-menu">
					<?php if ($this->session->userdata('ss_group_id')!=3 || $this->session->userdata('ss_group_id')!= 8 || $this->session->userdata('ss_user_id')==39){ ?>
					<li <?php if($sub_menu_name=='daily_sales_hw' ){echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/daily_sales_hw'); ?>"> <span class="title"> Daily Sales Report</span> </a> </li>
					<?php }?>
					<?php if ($this->session->userdata('ss_group_id')==1||$this->session->userdata('ss_group_id')==2|| $this->session->userdata('ss_user_id')==39){ ?>
					<li <?php if($sub_menu_name=='customer_receivable' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/customer_receivable_hw'); ?>"> <span class="title"> Customer Receivable</span> </a> </li>
					<li <?php if($sub_menu_name=='cheque' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/cheque'); ?>"> <span class="title">Cheque Report</span> </a> </li>
					<?php }?>
					<?php /*if ($this->session->userdata('ss_group_id')==1)*/{ ?>
					<li <?php if($sub_menu_name=='products_hw' ) {echo 'class="active open"';} ?>> <a href="<?php echo base_url('reports/hw_products'); ?>"> <span class="title"> Products Report</span> </a> </li>
					<?php }?>
				</ul>
			</li>
	        <?php }}?>
	        
	</ul>
	
	<!-- end: MAIN NAVIGATION MENU -->
</div>

<?php  }
?>