<?php

defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
  <title><?php echo $this->company;?> - Administrator area</title>
  <base href="<?php echo base_url();?>" />
  <!-- <link rel="manifest" href="manifest.json"> //-->
    
  <!-- Stylesheets -->
  <link rel="stylesheet" href="assets/css/style.css">
  <link rel="stylesheet" href="assets/css/bootstrap.min.css"/>
  <link rel="stylesheet" href="assets/css/font-awesome.min.css"/>
  <link rel="stylesheet" href="assets/css/owl.carousel.min.css"/>
  <link rel="stylesheet" href="assets/css/nice-select.css"/>
  <link rel="stylesheet" href="assets/css/magnific-popup.css"/>
  <link rel="stylesheet" href="assets/css/slicknav.min.css"/>
  <link rel="stylesheet" href="assets/css/animate.css"/>
    
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <link rel="apple-touch-icon" href="images/logo.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="theme-color" content="white">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Web App">
  <meta name="msapplication-TileImage" content="images/logo.png">
  <meta name="msapplication-TileColor" content="#FFFFFF">
  <?php
	if($main_content=="products" || $main_content=="manageproducts" || $main_content=="productsprice"  || $main_content=="purchase"   || $main_content=="managepurchase" || $main_content=="stockstatus" || $main_content=="outletsstock" || $main_content=="managestocktransfer" || $main_content=="itemledger" || $main_content=="managemergeitem" || $main_content=="o2ostocktransfer" || $main_content=="o2wstocktransfer" || $main_content=="manageo2ostocktransfer" || $main_content=="w2wstocktransfer" || $main_content=="managew2wstocktransfer" || $main_content=="itemstock" || $main_content=="projecteditemstock" || $main_content=="gifts" || $main_content=="managegifts" || $main_content=="itemsale" || $main_content=="wbilling" || $main_content=="managediscounts" || $main_content=="outletsummary" || $main_content=="billingpaytype")
	{
  ?>
<link rel="stylesheet" href="assets/css/select2.min.css"/>
  <?php
	}
  ?>
   <?php
	if($main_content=="managepages")
	{
  ?>
  <script type="text/javascript" src="assets/ckeditor/ckeditor/ckeditor.js"></script>
  <script type="text/javascript" src="assets/ckeditor/ckfinder/ckfinder.js"></script>
  <?php
	}
  ?>
  
  <!-- Add jQuery library -->
  <script type="text/javascript" src="assets/js/jquery-1.10.2.min.js"></script>

	<!-- Add fancyBox main JS and CSS files -->
	<script type="text/javascript" src="assets/js/jquery.fancybox.pack.js?v=2.1.5"></script>
	<link rel="stylesheet" type="text/css" href="assets/css/jquery.fancybox.css?v=2.1.5" media="screen" />
	<script type="text/javascript">
		$(document).ready(function() {
			$('.fancybox').fancybox();
			
			$("#fancybox-manual-b").click(function() {
				$.fancybox.open({
					type : 'iframe',
					padding : 0
				});
			});
			$('.fancybox2-reloadparent').fancybox(
			{
				type: 'iframe',
				afterClose: function () { // USE THIS IT IS YOUR ANSWER THE KEY WORD IS "afterClose"
				parent.location.reload(true);
				}
			});
		});
	</script>
	
	<script type="text/javascript" src="assets/account/js/common_function.js"></script>
  
</head>

<body class="m-0">
    <!-- Header Section -->
    <?php
    if($main_content=="products" || $main_content=="productsprice" || $main_content=="outletsummary" || $main_content=="billing") // for 100% width
    {
    ?>
  <div class="container_fluid mr-0 p-0">
     <div class="m-auto">
        <div class="header-info border-dark">
          <div class="row">
            <div class="col-md-6 d-sm-block col-sm-4"><a href="account/dashboard" class="d-block mt-2"><?php echo ADMLOGOTITLE;?></a></div>
        	<div class="p-0 d-sm-none d-flex ml-auto">
                <span class="usrnam ml-0 pt-3">Welcome <?php echo $this->lguserinfo["sessName"];?>! ( <?php echo $this->lguserinfo["sessType"];?> )</span><a href="account/logout" class="topright-bx" title="Logout"><span class="fa fa-power-off btn"></span></a>
             </div>
          </div>
        </div>
      </div>
     <?php
	}
	else
	{
     ?>
  <div class="container mr-0 p-0">    
     <div class="m-auto">
        <div class="header-info border-dark">
	        <a href="account/dashboard" class="d-block d-sm-block d-md-none mt-2"><?php echo ADMLOGOTITLE;?></a>
        	 <div class="p-0 d-sm-none d-flex ml-auto">
                <span class="usrnam ml-0 pt-3">Welcome <?php echo $this->lguserinfo["sessName"];?>! ( <?php echo $this->lguserinfo["sessType"];?> )</span><a href="account/logout" class="topright-bx" title="Logout"><span class="fa fa-power-off btn"></span></a>
             </div>
              <input type="checkbox" class="openSidebarMenu" id="openSidebarMenu">
              <label for="openSidebarMenu" class="sidebarIconToggle">
                <div class="spinner diagonal part-1"></div>
                <div class="spinner horizontal"></div>
                <div class="spinner diagonal part-2"></div>
              </label>
              <div id="sidebarMenu">
                <ul class="sidebarMenuInner">
                  <li class="logo d-sm-none border-bottom bg-light border-dark"><a href="account/dashboard"><h4 class="mb-0 mt-1"><?php echo ADMLOGOTITLE;?></h4></a></li>
	              <?php
					if(in_array("all", $this->userrights) || in_array("category", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/category">Manage Category </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("brand", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/brand">Manage Brand </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("zone", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/zone">Manage Zone </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("product", $this->userrights))
					{
	              ?>
                  <li><span class="material-icons">list</span><a href="account/products">Manage Products</a></li>
                  <li><span class="material-icons">list</span><a href="account/gifts">Manage Gifts</a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("price", $this->userrights))
					{
	              ?>
                  <li><span class="material-icons">list</span><a href="account/productsprice">Manage Products Price</a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("warehouse", $this->userrights))
					{
	              ?>
                  <li><span class="material-icons">list</span><a href="account/warehouse">Manage Warehouse </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("vendor", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/vendors">Manage Vendors </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("purchase", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/purchase">Manage Purchase </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("outlet", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/outlets">Manage Outlets </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("customer", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/customers">Manage Customers </a></li>		
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("billing", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/billing">Manage Billing</a></li>        
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("pendingwork", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/pendingwork">Pending Works</a></li>        
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("cancellation", $this->userrights))
					{
	              ?>
				  <li><span class="material-icons">list</span><a href="account/billing/cnclrqts">Cancellation Requests</a></li>        
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("stransfer", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/wbilling">Warehouse Billing</a></li>
	              <li><span class="material-icons">list</span><a href="account/stocktransfer">Stock Transfer - WH To Outlet </a></li>
	              <li><span class="material-icons">list</span><a href="account/o2wstocktransfer">Stock Transfer - Outlet To WH </a></li>
	              <li><span class="material-icons">list</span><a href="account/o2ostocktransfer">Stock Transfer - Outlet To Outlet </a></li>
	              <li><span class="material-icons">list</span><a href="account/w2wstocktransfer">Stock Transfer - WH To WH </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("sstatus", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/stockstatus">Stock Status </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("netstockstatus", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/netstockstatus">Total Stock Status </a></li>
	              <?php
					}
					if(in_array("averagesale", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/searchaveragesale">Sale - Warehouse & Outlets </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("stocks", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/stocks">Stock - Warehouse & Outlets </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("outletstatus", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/outletsstock">Outlets Status </a></li>
	              <?php
					}
	              if($_SERVER['HTTP_HOST']=="rohtak.liquorninja.in")
	              {
	              ?>
	              <li><span class="material-icons">list</span><a href="account/outletsummary">Outlets Summary </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("itemledger", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/itemledger">Item Ledger </a></li>
	              <li><span class="material-icons">list</span><a href="account/itemsale">Item Sale Report </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("itemstock", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/itemstock">Item Stock </a></li>
	              <?php
					}
					if(in_array("projecteditemstock", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/projecteditemstock">Projected Item Stock </a></li>
	              <?php
					}					
					if(in_array("all", $this->userrights) || in_array("sale", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/report/sale">Sale Report </a></li>
	              <?php
					}
					if($_SERVER['HTTP_HOST']=="faridabad.liquorninja.in" || $_SERVER['HTTP_HOST']=="localhost")
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/billing/paytype">Outlet Sale Payment Type Wise</a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("salescheme", $this->userrights))
					{
	              ?>
	              <li><span class="material-icons">list</span><a href="account/report/discountedsale">Sale Under Scheme </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("wdemand", $this->userrights))
					{
	              ?>
	              <!--<li><span class="material-icons">list</span><a href="account/wdemands">Warehouse Demands </a></li>//-->
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("odemand", $this->userrights))
					{
	              ?>
				   <!--<li><span class="material-icons">list</span><a href="account/odemands">Outlets Demands </a></li>//-->
	              <?php
					}
					if(in_array("all", $this->userrights) || in_array("dayoff", $this->userrights))
					{
	              ?>
				   <li><span class="material-icons">list</span><a href="account/dayoff">Day Off </a></li>
	              <?php
					}
					if(in_array("all", $this->userrights))
					{
	              ?>
                  <li><span class="material-icons">manage_accounts</span><a href="account/staff">Manage Staff</a></li>
                  <?php
					}
                  ?>
                  <li><span class="material-icons">manage_accounts</span><a href="account/updateinfo">Update Info.</a></li>
                  <li><span class="material-icons">password</span><a href="account/changepass">Change Password</a></li>
                  <li><span class="material-icons">cloud_download</span><a href="account/dbbackup">Database Backup</a></li>				                
                  <li><span class="material-icons">logout</span><a href="account/logout">Logout</a></li>
                </ul>
              </div>
        </div>
      </div>
      <?php
	}
      ?>
        <?php $this->load->view("account/" . $main_content); ?>
        
        <div class="clearfix">&nbsp;</div>
      <footer>
    	© <?php echo date("Y");?>, <?php echo WEBNAME;?>
    </footer>
	</div>
    <div class="clearfix"></div>
	
    <!-- <script src="js/main.js"></script> //-->
<?php
	if($this->router->fetch_method()=="report" || $this->router->fetch_method()=="orders" || $main_content=="storders"|| $main_content=="stockstatus"  || $main_content=="outletsstock" || $main_content=="billing" || $main_content=="purchase" || $main_content=="stocktransfer" || $main_content=="managestocktransfer" || $main_content=="customers"  || $main_content=="wdemands" || $main_content=="odemands" || $main_content=="dayoff" || $main_content=="itemledger" || $main_content=="managemergeitem" || $main_content=="o2ostocktransfer" || $main_content=="o2wstocktransfer" || $main_content=="manageo2ostocktransfer" || $main_content=="w2wstocktransfer" || $main_content=="managew2wstocktransfer" || $main_content=="itemstock" || $main_content=="projecteditemstock" || $main_content=="gifts" || $main_content=="managegifts" || $main_content=="itemsale" || $main_content=="wbilling" || $main_content=="managediscounts" || $main_content=="outletsummary" || $main_content=="searchaveragesale" || $main_content=="billingpaytype") // include date for specific criteria
	{
?>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
    <script>
  	// INCLUDE JQUERY & JQUERY UI 1.12.1
		$( function() {
			$( ".datepicker" ).datepicker({
				dateFormat: "dd-mm-yy",
				maxDate: "<?php echo date("d-m-Y");?>",
				duration: "fast"
			});
			$( ".datepickerfuture" ).datepicker({
				dateFormat: "dd-mm-yy",
				minDate: "<?php echo date("d-m-Y");?>",
				duration: "fast"
			});
		} );
		
	$(document).ready(function() {
    $('.js-example-basic-single').select2();
});
    </script>
    <script src="assets/js/select2.min.js"></script>
    
<?php
	}
?>
    
    <script>
    		$(document).ready(function() {
			$('.minus').click(function () {
				var $input = $(this).parent().find('input');
				var count = parseInt($input.val()) - 1;
				count = count < 1 ? 1 : count;
				$input.val(count);
				$input.change();
				return false;
			});
			$('.plus').click(function () {
				var $input = $(this).parent().find('input');
				$input.val(parseInt($input.val()) + 1);
				$input.change();
				return false;
			});
		});
    </script>
<?php
		if($main_content=="products" || $main_content=="manageproducts" || $main_content=="productsprice"  || $main_content=="purchase"   || $main_content=="managepurchase" || $main_content=="stockstatus" || $main_content=="outletsstock" || $main_content=="billingpaytype")
	{
?>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>//-->
<script>
$(document).ready(function() {
$('.js-example-basic-single').select2();
//$('.js-example-basic-multiple').select2();
});
</script>
<script src="assets/js/select2.min.js"></script>
<?php
	}
?>
</body>
</html>
