<!DOCTYPE html>
<html>

    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Manage your SPA, PARLOR & SALON.">
        <meta name="author" content="Mexyon">

        <!-- App Favicon -->
        <link rel="shortcut icon" href="<?php echo base_url(); ?>assets/images/favicon.ico">

        <!-- App title -->
        <title>SkedWise PDS</title>

        
         <!--calendar css-->
         <?php if(isset($calendar)){?>
        <link href="<?php echo base_url(); ?>assets/plugins/fullcalendar/dist/fullcalendar.css" rel="stylesheet" />
        <link href="<?php echo base_url(); ?>assets/plugins/fullcalendar/dist/scheduler.min.css" rel="stylesheet" />
         <?php } ?>
        <!-- DataTables -->
        <?php if(!isset($nodatatable)){ ?>
        <link href="<?php echo base_url(); ?>assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/plugins/datatables/buttons.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/plugins/datatables/fixedHeader.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/plugins/datatables/responsive.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/plugins/datatables/scroller.bootstrap.min.css" rel="stylesheet" type="text/css" />
        <?php } ?>
        
        <!-- App CSS -->
        <link href="<?php echo base_url(); ?>assets/plugins/select2/dist/css/select2.css" rel="stylesheet" type="text/css">
        <link href="<?php echo base_url(); ?>assets/plugins/select2/dist/css/select2-bootstrap.css" rel="stylesheet" type="text/css">
        
       
        
        <link href="<?php echo base_url(); ?>assets/plugins/toastr/toastr.min.css" rel="stylesheet" type="text/css">
        <link href="<?php echo base_url(); ?>assets/plugins/bootstrap-sweetalert/sweetalert-1/sweet-alert.css" rel="stylesheet" type="text/css">
        <!--<link href="<?php echo base_url(); ?>assets/plugins/bootstrap-sweetalert/sweetalert-2/sweetalert2.min.css" rel="stylesheet" type="text/css">-->
        <link href="<?php echo base_url(); ?>assets/plugins/fileuploads/css/dropify.min.css" rel="stylesheet" type="text/css">
        <link href="<?php echo base_url();?>assets/plugins/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css" rel="stylesheet" />
        <link href="<?php echo base_url(); ?>assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/css/core.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/css/components.css" rel="stylesheet" type="text/css" />
        <!--<link href="<?php echo base_url(); ?>assets/css/icons.css" rel="stylesheet" type="text/css" />-->
        
        <!--icons-->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@icon/themify-icons@1/themify-icons.min.css">
        
        
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
        
        
        <link href="<?php echo base_url(); ?>assets/css/pages.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/css/menu.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/css/responsive.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo base_url(); ?>assets/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
        <link href="<?php echo base_url(); ?>assets/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
        <link href="<?php echo base_url(); ?>assets/plugins/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" rel="stylesheet">
        <link href="<?php echo base_url(); ?>assets/plugins/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
        <link href="<?php echo base_url(); ?>assets/plugins/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css" rel="stylesheet">
        <?php if(isset($config) && $config!==null){
            echo $config->font_link;
         }?>
         <!-- X-editable css -->
        <!--<link type="text/css" href="<?php echo base_url(); ?>assets/plugins/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet">-->
        
        <!--Morris Chart css -->
<!--        <link type="text/css" href="<?php echo base_url(); ?>assets/plugins/morris/morris.css" rel="stylesheet">-->

        <!-- HTML5 Shiv and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->

        <script src="<?php echo base_url(); ?>assets/js/modernizr.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/jquery.min.js"></script>
        <!-- Jquery-Ui -->
        <script src="<?php echo base_url(); ?>assets/plugins/jquery-ui/jquery-ui.min.js"></script>
  
       
    </head>
   <?php 
        $csrf = array(
            'name' => $this->security->get_csrf_token_name(),
            'hash' => $this->security->get_csrf_hash()
        );
   ?>
    <body>
        <style>
            
            .divider {
                height: 1px;
                margin: 9px 0;
                overflow: hidden;
                background-color: #e5e5e5;
            }
            <?php if(isset($config) && $config!==null){?>
            
            
            html{
                background: <?php echo $config->body_background;?> !important;
            }
            body {
                background: <?php echo $config->body_background;?> !important;
                font-family: <?php echo $config->replacement_font;?> !important;
                color: <?php echo $config->body_color;?> !important;;
            }
            .btn-pink {
                background-color: <?php echo $config->pink_replacement; ?> !important;
                border: 1px solid <?php echo $config->pink_replacement; ?>  !important;
              }
              .btn-pink:hover,
              .btn-pink:focus,
              .btn-pink:active {
                background-color: #000 !important;
                border: 1px solid #000 !important;
              }

            .btn-purple {
                background-color: <?php echo $config->pink_replacement; ?>  !important;
                border: 1px solid <?php echo $config->pink_replacement; ?>  !important;
              }
              .btn-purple:hover,
              .btn-purple:focus,
              .btn-purple:active {
                background-color: #000 !important;
                border: 1px solid #000 !important;
              }
            h3{
                  color: <?php echo $config->heading_color;?> !important;
              }
            .text-pink {
                color:<?php echo $config->pink_replacement; ?>  !important;
                text-shadow: 2px 2px #fcfcfc;
                font-weight:bold;
            }
            <?php } ?>
        </style>
        <!-- Navigation Bar-->
        <header id="topnav">
            <div class="topbar-main" <?php if(isset($config) && $config!==null){ echo 'style="background-color:'.$config->header_color.' !important;"';  } ?>>
                <div class="container">

                    <!-- LOGO -->
                    <div class="topbar-left">
                       <?php if(isset($config) && $config!==null){?>
                        <a href="<?php echo base_url(); ?>" class="logo"><img width="150" src="<?php echo base_url(); ?>/assets/images/business/<?php echo $config->logo_image;?>" /></a>
                       <?php } else { ?>
                        <a href="<?php echo base_url(); ?>" class="logo"><img width="150" src="<?php echo base_url(); ?>/assets/images/skedwise.png" /><span class="hidden-xs">(<?php echo $this->session->userdata('business');?>)</span></a>
                       <?php } ?>
                       <input id="cook" type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
                    </div>
                    <!-- End Logo container-->
                    <div class="menu-extras">

                        <ul class="nav navbar-nav navbar-right pull-right">
                            <li class="hidden">
                                <form role="search" class="navbar-left app-search pull-left hidden-xs">
                                    <input type="text" placeholder="Search..." class="form-control">
                                    <a href="#"><i class="fa fa-search"></i></a>
                                </form>
                            </li>
                            <?php if($this->session->userdata('b_switch')=='Yes' && $this->session->userdata('role')=="Admin" ){?>
                            <li>
                                <div role="search"  class="navbar-left app-search pull-left ">
                                    <button onclick="b_switch();" class="btn btn-sm btn-pink btn-trans waves-effect waves-light">
                                        switch
                                    </button>
                                </div>
                            </li>
                            <?php } else if($this->session->userdata('role')=="Super User" || $this->session->userdata('role')=="HO"){ ?>
                            <li>
                                <div role="search"  class="navbar-left app-search pull-left ">
                                    <button onclick="b_switch();" class="btn btn-sm btn-pink btn-trans waves-effect waves-light">
                                        switch
                                    </button>
                                </div>
                            </li>
                                
                            <?php } ?>
                            <li>
                                <!-- Notification -->
                                <div class="notification-box">
                                    <ul class="list-inline m-b-0">
                                        <li>
                                            <a href="javascript:void(0);" class="right-bar-toggle">
                                                <i class="zmdi zmdi-notifications-none"></i>
                                            </a>
                                            <div class="noti-dot">
                                                <span class="dot"></span>
                                                <span class="pulse"></span>
                                            </div>
                                        </li>
                                    </ul>
                                </div>
                                <!-- End Notification bar -->
                            </li>

                            <li class="dropdown user-box">
                                <a href="#" class="dropdown-toggle waves-effect waves-light profile " data-toggle="dropdown" aria-expanded="true">
                                    <img src="<?php echo getUserProfileImage(); ?>" alt="user-img" class="img-circle user-img">
                                    <div class="user-status away"><i class="zmdi zmdi-dot-circle"></i></div>
                                </a>

                                <ul class="dropdown-menu">
                                    <li><a href="<?php echo base_url(); ?>user_profile"><i class="ti ti-user m-r-5"></i> Profile</a></li>
                                    
                                    <li><a href="javascript:void(0)"><i class="ti ti-lock m-r-5"></i> Lock screen</a></li>
                                    <li><a href="<?php echo base_url(); ?>logout"><i class="ti ti-power-off m-r-5"></i> Logout</a></li>
                                </ul>
                            </li>
                        </ul>
                        <div class="menu-item">
                            <!-- Mobile menu toggle-->
                            <a class="navbar-toggle">
                                <div class="lines">
                                    <span></span>
                                    <span></span>
                                    <span></span>
                                </div>
                            </a>
                            <!-- End mobile menu toggle-->
                        </div>
                    </div>

                </div>
            </div>
            
            <?php if(isset($menu) && $menu === 'hidden'){} else{ ?>
            <div class="navbar-custom">
                <div class="container">
                    <div id="navigation">
                        <!-- Navigation Menu-->
                        <ul class="navigation-menu clearfix">
                            <?php if( $this->session->userdata('role')=="Admin" || $this->session->userdata('role')=="Super User"){?>
                            <li <?php echo isset($nav) && $nav === 'dashboard' ? 'class="active"' : ''; ?>>
                                <a href="<?php echo base_url(); ?>dashboard"><i class="zmdi zmdi-chart"></i> <span> Dashboard </span> </a>
                            </li>
                            <?php } ?>
<!--                            <li>
                                <a href="<?php echo base_url(); ?>reception" class="active"><i class="zmdi zmdi-view-dashboard"></i> <span>Reception </span> </a>
                            </li>-->
                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Reception" || $this->session->userdata('role')==="Store Manager") {?>
                            <li <?php echo isset($nav) && $nav === 'scheduler' ? 'class="active"' : ''; ?>>
                                <a href="<?php echo base_url(); ?>pds_scheduler"><i class="zmdi zmdi-calendar"></i> <span>Scheduler </span> </a>
                            </li>
                            <?php } else if($this->session->userdata('role')==="HO") {?>
                            <li <?php echo isset($nav) && $nav === 'ho_view' ? 'class="active"' : ''; ?>>
                                <a href="<?php echo base_url(); ?>ho_view"><i class="zmdi zmdi-calendar"></i> <span>Home </span> </a>
                            </li>
                            <?php } ?>
                            <!-- <li>
                                <a href="<?php echo base_url(); ?>appointments" class="active"><i class="zmdi zmdi-alarm-check"></i> <span>Appointments </span> </a>
                            </li> -->
                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User") {?> 
                            <!--<li>
                                <a href="<?php echo base_url(); ?>birthdays" class="active"><i class="zmdi zmdi-phone-msg"></i> <span>Birthdays </span> </a>
                            </li>-->
                            <?php } ?>
                            
                            <?php  if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="HR") {?> 
                            
                           
                            <li class="has-submenu <?php echo isset($nav) && $nav === 'my_business' ? 'active' : ''; ?>">
                                <a href="#"><i class="zmdi zmdi-airline-seat-recline-extra"></i> <span> My Business </span> </a>
                                <ul class="submenu megamenu">
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager") {?> 
                                    <li>
                                        <ul>
                                            
                                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'customers' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>customer_list">Customers</a></li>
                                            <?php } ?>
                                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'item_types' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>pds_item_types">Item Types</a></li>
                                            <?php } ?>
                                           <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'items' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>pds_items">Items</a></li>
                                            <?php } ?>
                                        </ul>
                                    </li>
                                    <?php } ?>
                                    <li>
                                        <ul>
                                            
                                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'pds_properties' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>pds_properties">Properties</a></li>
                                            <?php } ?>
                                            
                                             <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'business_stores' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>pds_stores">Stores</a></li>
                                            <?php } ?>
                                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="HR") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'staff' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>pds_staff_list">Staff</a></li>
                                            <?php } ?>
                                            

                                        </ul>
                                    </li>
                                </ul>
                            </li>
                             <?php } ?>
                           
                            <?php if($this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="HR" || $this->session->userdata('role')==="Accountant") {?>                
                            <li class="has-submenu <?php echo isset($nav) && $nav === 'reports' ? 'active' : ''; ?>">
                                <a href="#"><i class="zmdi zmdi-view-dashboard"></i> <span>Reports </span> </a>
                                <ul class="submenu">
                                    <li <?php echo isset($subnav) && $subnav === 'reports' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>reports" >Reports</a></li>
                                    <?php if($this->session->userdata('role')!=="Store Manager"){?>
                                    <li <?php echo isset($subnav) && $subnav === 'salesdashboard' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>salesdashboard" >Sales Dashboard </a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'staff_sale' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>staff_sale" >Staff Chart </a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'retail_charts' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>retail_charts" >Retail Charts</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'service_chart' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>service/chart" >Service Chart</a></li>
                                    <li class="divider"></li>
                                    <li <?php echo isset($subnav) && $subnav === 'service_By_Staff' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>service-by-staff" >Days By Staff</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'marketing_report' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>marketing" >Monthly Staff Detail</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'marketing_report' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>attendancesheet" >Monthly Staff Attendance</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'repeatedcustomers' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>repeatedcustomers" >Repeated Customers</a></li>
<!--                                <li <?php echo isset($subnav) && $subnav === 'petty_cash_report' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>petty-cash-report" >Petty Cash Report</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'retail_Transaction' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>retail-transaction" >Retail Transaction</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'retail_Transaction_By_Item' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>retail-transaction-by-item" >Retail Transaction By Item</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'service_By_Item' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>service-by-item" >Service By Item</a></li>
                                    
                                    <!--<li <?php echo isset($subnav) && $subnav === 'marketing_summary' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>marketing-summary" >Monthly Staff Summary</a></li>-->
                                    
                                    <!--<li <?php echo isset($subnav) && $subnav === 'sales' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>sales" >Customized report</a></li>-->
                                    <?php } ?>
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User"){?>
                                     <li class="divider"></li>
                                     <li <?php echo isset($subnav) && $subnav === 'feedbackdash' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>feedbackdash" >FeedBack Dashboard</a></li>
                                    <?php } ?>
                                </ul>
                            </li>
                            
                            <?php } if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                            <li class="has-submenu <?php echo isset($nav) && $nav === 'procurement' ? 'active' : ''; ?>">
                                <a href="#"><i class="fa fa-shopping-cart" aria-hidden="true"></i> <span>Procurement </span> </a>
                                <ul class=" submenu">
                                    <?php if($this->session->userdata('role')==="Accountant") {?>
                                        <li <?php echo isset($subnav) && $subnav === 'supplier_list' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>supplier_list">Suppliers</a></li>
                                    <?php } ?>
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                                        <li <?php echo isset($subnav) && $subnav === 'business_brands' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>business_brands">Brands & Products</a></li>
                                    <?php } ?>
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                                        <li <?php echo isset($subnav) && $subnav === 'product_list' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>all_products">All Products List</a></li>
                                    <?php } ?>
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                                        <li <?php echo isset($subnav) && $subnav === 'product_list' ? 'class="active"' : ''; ?>><a class="text-danger" href="<?php echo base_url(); ?>product_list/threshold/0">Low On Stock</a></li>
                                    <?php } ?>    
                                    <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                                        <li <?php echo isset($subnav) && $subnav === 'product_list' ? 'class="active"' : ''; ?>><a class="text-danger" href="<?php echo base_url(); ?>product_list/expiring/0">About to Expire</a></li>
                                    <?php } ?>
                                    <?php if($this->session->userdata['common_products']=='Yes'){?>
                                        <?php if($this->session->userdata('ho')=='Yes' && $this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Store Manager" || $this->session->userdata('role')==="Accountant") {?>
                                            <li <?php echo isset($subnav) && $subnav === 'product_list' ? 'class="active"' : ''; ?>><a class="text-danger" href="<?php echo base_url(); ?>transfer">Inventory Transfer</a></li>
                                        <?php } ?>  
                                    <?php } ?>
                                    <li class="divider"></li>
                                    <li <?php echo isset($subnav) && $subnav === 'purchaseorder' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>purchase_orders" >Purchase Orders</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'transfer' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>transfer" >Transfer Notes</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'transfer' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>adjustments" >Adjustment Notes</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'transfer' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>receiving_notes" >Receiving Notes</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'transfer' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>return_notes" >Return Notes</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'dispatch' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>dispatch" >Dispatch</a></li>
                                    <?php if($this->session->userdata('ho')=='Yes') {?>
                                    <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>franchise_orders">Franchise Orders</a></li>
                                    <?php } ?>
                                </ul>
                            </li>
                            
                            <?php }?>
                             <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User" || $this->session->userdata('role')==="Accountant") {?>                
                            <li class="has-submenu megamenu">
                                <a href="#"><i class="zmdi zmdi-money"></i><span> Accounting </span> </a>
                                <ul class="submenu megamenu">
                                    <li>
                                        <ul>
                                           <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>coa">Chart of Accounts</a></li>                                           
                                        
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>account_vouchers">Account Vouchers</a></li>
                                        
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>general_ledger">General Ledger</a></li>
                                        
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>trial_balance">Trial Balance</a></li>
                                       
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>balacne_sheet">Balance Sheet</a></li>
                                        
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>profit_loss">Profit & loss Statement</a></li>
                                            <hr>
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>account_reports">Dashboard</a></li>
                                             <li <?php echo isset($subnav) && $subnav === 'dailysheet' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>todaydashboard" class="active"> Daily Sheet </a></li>
                                        </ul>
                                    </li>
                                
                                    <li>
                                        <ul>
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>franchise_orders">Franchise Orders</a></li>
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>franchises">Franchises</a></li>
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>franchise_aging">Franchise Aging Report</a></li>
                                            <hr>
                                           <!-- <li <?php //echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php //echo base_url(); ?>custom_invoices">Custom Invoicing</a></li>
                                            <li <?php //echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php //echo base_url(); ?>custom_payments">Custom Payments</a></li>-->
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>supplier_list">Suppliers</a></li>
                                            <li <?php echo isset($subnav) && $subnav === 'accounting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>staff_list">Staff</a></li>
                                            
                                        
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                            
                            <?php } ?>    
                            
                                
                            <?php if($this->session->userdata('role')==="Admin" || $this->session->userdata('role')=="Super User") {?>
                            <li class="has-submenu <?php echo isset($nav) && $nav === 'users' ? 'active' : ''; ?>">
                                <a href="#"><i class="fa fa-user" aria-hidden="true"></i> <span>Administration</span> </a>
                                <ul class=" submenu">
                                    <li <?php echo isset($subnav) && $subnav === 'users_list' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>users_list">User Management</a></li>
                                    <li class="divider"></li>
                                    <?php ?>
                                    <li <?php echo isset($subnav) && $subnav === 'shadow' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>shadow">Mark Invoices</a></li>
                                    <?php  ?>
                                </ul>
                            </li>
                            <?php } if($this->session->userdata('role')==="Super User") {?>
                            <li class="has-submenu <?php echo isset($nav) && $nav === 'users' ? 'active' : ''; ?>">
                                <a href="#"><i class="ti ti-medall" aria-hidden="true"></i> <span>Super User</span> </a>
                                <ul class=" submenu">
                                    <li <?php echo isset($subnav) && $subnav === 'Supervise Invoices' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>super_invoices">Supervise Invoices</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'Supervise Visits' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>super_visits">Supervise Visits</a></li>
                                    <!--<li <?php echo isset($subnav) && $subnav === 'customersuper' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>coa">Supervise Customers</a></li>-->
                                    <li class="divider"></li>
                                    <li <?php echo isset($subnav) && $subnav === 'Supervise Setting' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>supervise_setting">Supervise Setting</a></li>
                                    <li <?php echo isset($subnav) && $subnav === 'Supervise Visits' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>super_account_mapping">Supervise Account Mapping</a></li>
                                    <li class="divider"></li>
                                    <li <?php echo isset($subnav) && $subnav === 'Supervise Setup' ? 'class="active"' : ''; ?>><a href="<?php echo base_url(); ?>supervise_business_setup">Business Setup</a></li>
                                </ul>
                            </li>
                            <?php } ?>
                        </ul>
                        <!-- End navigation menu  -->
                    </div>
                </div>
            </div>
            <?php } ?>
        </header>
        <!-- End Navigation Bar-->
  <script>
        $(document).ready(function() {
            $.ajaxSetup({
              beforeSend: function(xhr, settings) {
                  if (settings.type == 'POST' || settings.type == 'PUT' || settings.type == 'DELETE') {
                      function getCookie(name) {
                          var cookieValue = null;
                          if (document.cookie && document.cookie != '') {
                              var cookies = document.cookie.split(';');
                              for (var i = 0; i < cookies.length; i++) {
                                  var cookie = jQuery.trim(cookies[i]);
                                  // Does this cookie string begin with the name we want?
                                  if (cookie.substring(0, name.length + 1) == (name + '=')) {
                                      cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                                      break;
                                  }
                              }
                          }
                          return cookieValue;
                      }
                      
                      //if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
                          // Only send the token to relative URLs i.e. locally.
                           xhr.setRequestHeader("X-Csrf-Token", getCookie('csrf_cookie_name'));
                           $("#cook").val(getCookie('csrf_cookie_name'));                       
                           var data = settings.data;

                           var extra = 'csrf_test_name='+$("#cook").val()+"&";
                           if(typeof data != 'undefined' && data.length>0){                           
                              
                              settings.data = extra+data;                           
                           } else {
                              
                              //var csrf={'csrf_test_name':$("#cook").val()};
                              settings.data='csrf_test_name='+$("#cook").val(); 
                              //settings.data=$.param(settings.data,false);
                           }
                      //}
                  }
              },
              complete: function() {
                  function getCookie(name) {
                          var cookieValue = null;
                          if (document.cookie && document.cookie != '') {
                              var cookies = document.cookie.split(';');
                              for (var i = 0; i < cookies.length; i++) {
                                  var cookie = jQuery.trim(cookies[i]);
                                  // Does this cookie string begin with the name we want?
                                  if (cookie.substring(0, name.length + 1) == (name + '=')) {
                                      cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                                      break;
                                  }
                              }
                          }
                          return cookieValue;
                      }                      
                      //if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) {
                          // Only send the token to relative URLs i.e. locally.
                           
                           $("#cook").val(getCookie('csrf_cookie_name'));                       
                          
                      //}
              }
           });
        });
  </script>
