<?php  

		if(is_logged_in()){
			
		}else {
			redirect(base_url(),'refresh');
			exit();
		}
//print_r($this->session->all_userdata()); 




$rand_txt = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz", 5)), 0, 5);


$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');
	//echo "<pre>";
//echo print_r($usr_permtn_pubvr);	
				
?>
				<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">
						<li <?php if($main_menu_name=='dashboard') {echo 'class="active open"';} ?>>
							<a href="<?php echo base_url('dashboard'); ?>"><i class="clip-home-3"></i>
								<span class="title"> Dashboard </span><span class="selected"></span>
							</a>
						</li>
						
                        <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">
                            <?php 
							//if($usr_permtn_pubvr['usrgp_permission_view'])
							{
							?>
								<li <?php if($sub_menu_name=='products') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('products'); ?>">
										<span class="title"> List Products</span></a></li>
                                <?php }?>
                                <?php if ($this->session->userdata('ss_group_id')!=3){ ?>
								<li <?php if($sub_menu_name=='add_products') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('products/add'); ?>">
									<span class="title"> Add Products</span></a></li> <?php }?>
							</ul>
						</li>
                        <li <?php if($main_menu_name=='sales') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa fa-heart"></i>
								<span class="title"> Sales </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'); ?>">
										<span class="title"> List Sales</span></a></li>
								<li <?php if($sub_menu_name=='add_sales') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('sales/add'); ?>">
										<span class="title"> Add Sales</span></a></li>
                                        <li <?php if($sub_menu_name=='sales_return') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('sales/sales_return'); ?>">
                                    <span class="title"> List Return Sales</span></a></li>
							</ul>
						</li>
                        
                       <!-- <li <?php if($main_menu_name=='pricing') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa fa-group"></i>
								<span class="title"> Group Pricing </span><i class="icon-arrow"></i>
								<span class="selected"></span>
							</a>
							<ul class="sub-menu">
								<li <?php if($sub_menu_name=='pricing') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('cus_pricing'); ?>">
										<span class="title">List Groups</span></a></li>
								<li <?php if($sub_menu_name=='add_cus_pricing') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('cus_pricing/add_pricing'); ?>">
										<span class="title">Add Products</span></a></li>
                                       <?php /*?> <li <?php if($sub_menu_name=='sales_return') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('sales/sales_return'); ?>">
                                    <span class="title"> List Return Sales</span></a></li><?php */?>
                                    <li style="display:none">
									<a href="#" data-toggle="modal" id="modal_ajax_group_btn">
										<span class="title">Add Group</span>
									</a>
								</li>
							</ul>
						</li>-->
                         <?php if ($this->session->userdata('ss_group_id')!=3){ ?>
                        <li <?php if($main_menu_name=='quotations') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="clip-heart"></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 }?>
                        
                        <li <?php if($main_menu_name=='purchases_order') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa fa-star"></i>
								<span class="title">  Purchase Order  </span><i class="icon-arrow"></i>
								<span class="selected"></span>
							</a>
							<ul class="sub-menu">
                            
								<li <?php if($sub_menu_name=='list_purchases_order') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('purchases_order'."/itemlist/$rand_txt"); ?>">
										<span class="title"> List Purchase Order </span>
									</a>
								</li>
						
								<li <?php if($sub_menu_name=='purchases_order_add') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url("purchases_order/manage/0/$rand_txt"); ?>">
										<span class="title"> Add Purchase Order </span>
									</a>
								</li>	
                               		
							</ul>
						</li>
                        
                         <?php if ($this->session->userdata('ss_group_id')!=3){ ?>
						<li <?php if($main_menu_name=='purchases') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa fa-star"></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'); ?>">
										<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'); ?>">
										<span class="title"> Add GRN </span>
									</a>
								</li>							
							</ul>
						</li>
                        <?php }?>
                        
                         <li <?php if($main_menu_name=='service') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa fa-cogs"></i>
								<span class="title">  Services </span><i class="icon-arrow"></i>
								<span class="selected"></span>
							</a>
							<ul class="sub-menu">
								<li <?php if($sub_menu_name=='list_service') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('service'); ?>">
										<span class="title">  Services</span>
									</a>
								</li>

								<li <?php if($sub_menu_name=='service_add') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('service/manage/0'); ?>">
										<span class="title"> Add Services</span>
									</a>
								</li>							
							</ul>
						</li>
                        
                         <li <?php if($main_menu_name=='expenses') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="clip-heart"></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>
                                                                <?php 
//if(in_multiarray("usrgp_permission_page","petty_cash", $usr_permtn_pubvr,"usrgp_permission_add",1))
{
?>
								<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>	
                                        <?php }?>
							</ul>
						</li>
                         <?php if ($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="fa fa-star-o"></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')!=3){ ?>
                         <li <?php if($main_menu_name=='product_damage') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="fa clip-puzzle-3"></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>							
							</ul>
						</li>
						<?php }?>
                         <?php if ($this->session->userdata('ss_group_id')!=3){ ?>
						<li <?php if($main_menu_name=='people') {echo 'class="active open"';} ?>>
							<a href="javascript:void(0)"><i class="clip-user-3"></i>
								<span class="title"> People </span><i class="icon-arrow"></i>
								<span class="selected"></span>
							</a>
							<ul class="sub-menu">
                            
                            <?php 
							//if(in_multiarray("usrgp_permission_page","users", $usr_permtn_pubvr,"usrgp_permission_view",1))
							{
							?>
								<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 }?>  
                                <?php 
								if(in_multiarray("usrgp_permission_page","users", $usr_permtn_pubvr,"usrgp_permission_add",1))
								{?>
								<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')!=3){ ?>
						<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 }?>
                        <!--<li <?php if($main_menu_name=='fixed_assets') {echo 'class="active open"';} ?>>
							
                            <a href="javascript:void(0)"><i class="fa fa-tasks"></i>
								<span class="title">Fixed Assets</span><i class="icon-arrow"></i>
								<span class="selected"></span>
							</a>
                            <ul class="sub-menu">
                            <li <?php if($sub_menu_name=='create_fixed_assets') {echo 'class="active open"';} ?>>
									<a href="#" data-toggle="modal" id="modal_ajax_fixed_assets_btn">
										<span class="title">Add Fixed Assets</span>
									</a>
							</li>
                            <li <?php if($sub_menu_name=='fixed_assets_list') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('fixed_assets'); ?>">
										<span class="title">Fixed Assets List</span>
									</a>
						    </li>
                            </ul>
						</li>-->
                         <?php if ($this->session->userdata('ss_group_id')!=3){ ?>
                        <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=='fixed_assets_list') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('fixed_assets'); ?>">
										<span class="title">  Assets/Liabilities </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>
                               
                                
								<!--<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=='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')!=3){ ?>
						<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">
                            <li <?php if($sub_menu_name=='sales_rep') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('reports/sales_rep'); ?>">
										<span class="title"> Sales Rep. Sales Summary</span>
									</a>
								</li>
                                <li <?php if($sub_menu_name=='sales_rep_comm') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('reports/sales_rep_comm'); ?>">
										<span class="title"> Sales Rep. Commission</span>
									</a>
								</li>
                                 <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=='balance_sheet') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('balance_sheet'); ?>">
										<span class="title">  Balance Sheet</span>
									</a>
								</li>-->
                                <li <?php if($sub_menu_name=='trial_balance') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('trial_balance'); ?>">
										<span class="title"> Trial Balance</span>
									</a>
								</li>
                                 <!--<li <?php if($sub_menu_name=='customer_summery_balance') {echo 'class="active open"';} ?>>
									<a href="<?php echo base_url('reports/customer_balance_summery'); ?>">
										<span class="title">Customer Balance Summery</span>
									</a>
								</li>-->
                                
                            <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>
                            	<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>
                                 <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>
								<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>
								 <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>
                                <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>
                              <!--  <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>-->
                                <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>
                                 <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>
								 <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>
                                <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 }?>
                       
  </ul>
					<!-- end: MAIN NAVIGATION MENU -->
				</div>
