<?php 
	ob_start();
	session_start();
	$base_url=""; $assets="assets/";
	$error=0; $warning=0; $message=0;
	$current_page = basename($_SERVER['PHP_SELF']);
	include "config/config.php";
	include "config/session.php";
	
	$theme_color="#3c8dbc;";
	$theme_text_color="color:#10152e;";
	
	if(!isset($session)) {
		header('location: login.php'); 
		exit;
	}else{
	    $allPermissions = $_SESSION['permission'];
	}
	
	$session_id = $session['id'];
	
$currentMonth = date('m');
$currentYear = date('Y');
$startMonthDate = date('Y-m-01', strtotime("$currentYear-$currentMonth-01"));
$endMonthDate = date('Y-m-t', strtotime("$currentYear-$currentMonth-01"));

$statement_settings = $pdo->prepare("SELECT * FROM `tbl_settings`");
$statement_settings->execute();
$setting = $statement_settings->fetchAll(PDO::FETCH_ASSOC); 
$settings_totals = $statement_settings->rowCount();
if($settings_totals==0){ 
    header("location: create-panel-info.php"); 
}else{
    $site_name = $setting[0]['name'];
    $site_logo = $setting[0]['logo'];
    $site_favicon = $setting[0]['favicon'];
    $site_short_name = $setting[0]['short_name'];
}


$statements_price = $pdo->prepare("SELECT * FROM `tbl_prices` WHERE status=1");
$statements_price->execute();
$price_results = $statements_price->fetchAll(PDO::FETCH_ASSOC);
$price_totalDatas = $statements_price->rowCount();


$today_price_updates = $pdo->prepare("SELECT * FROM `tbl_prices_reports` WHERE status=1 AND date=CURDATE()");
$today_price_updates->execute();
$today_price_results = $today_price_updates->fetchAll(PDO::FETCH_ASSOC);
$today_price_totalDatas = $today_price_updates->rowCount();

$page_not_access = <<<HTML
<center style="margin-top: 20px;"><b style="color:red; font-size: 22px;">Invalid Access</b></center>
HTML;

$no_records_found = <<<HTML
<center style="margin-top: 20px;"><b style="color:red; font-size: 22px;">No Records Found</b></center>
HTML;


if($session_id==1 || $session_user_type==1){
    $branch_conditions = "";
}else{
    $branch_conditions = " and id IN ($session_branch_ids)";
}


$today_date = date('Y-m-d');

$currentMonth = date('m');
$currentYear = date('Y');
$startDate = date('Y-m-01', strtotime("$currentYear-$currentMonth-01"));
$endDate = date('Y-m-t', strtotime("$currentYear-$currentMonth-01"));

?>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Dashboard | <?=$site_name?></title>
		<link rel="shortcut icon" href="<?=$site_favicon?>"/>
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
		<link href="<?=$assets?>dist/css/styles.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
		<!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">-->
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
		 <!-- Toastr CSS -->
        <link rel="stylesheet" href="asst/css/toastr.css"> 
		
    </head>
	<style>
		.center-screen {
    		display: flex;
    		justify-content: center;
    		align-items: center;
    		text-align: center;
    		min-height: 100vh;
		}
		
	table.table tbody tr:hover td {
        background-color: #abe2eb !important;
    }
    
    	    @media only screen and (min-width: 998px){
                body.pos1 {
                    min-width: 1024px;
                    overflow: visible;
                }
                .pos1 {
                    min-width: 1020px;
                }
            }
            
	</style>
	<!-- Like POS -> skin-blue sidebar-collapse sidebar-mini pos1-->
	<!--skin-green sidebar-collapse sidebar-mini pos-->
	<!--<body class="skin-blue fixed sidebar-mini" style="background:white;">-->
	<!--skin-blue fixed sidebar-mini sidebar-collapse-->
	<style>
	    /*@media only screen and (max-width: 998px){
            body.pos {
    min-width: 1024px;
    overflow: visible;
        }
            }
        }*/
	</style>
	
	<?php
    /*if($current_page=="bookings-create.php" || $current_page=="bookings-update.php" || $current_page=="bookings-passenger-info.php" || $current_page=="bookings-list.php" || $current_page=="booking-tickets-list.php")
    {
        $class="skin-blue sidebar-collapse sidebar-mini pos1";
    }else{
        $class="skin-blue fixed sidebar-mini";
    }*/
    
    
    
    if($current_page=="barcode.php" || $current_page=="pos.php" || $current_page=="pos-edit.php" || $current_page=="sales-list.php" || $current_page=="advance-voucher-list.php" || $current_page=="customers-scheme-list.php"){
        $class="skin-blue sidebar-mini sidebar-collapse pos";
    }else{
        $class="skin-blue fixed sidebar-mini";
    }
	?>
	
	<body class="<?=$class?>" style="background:white;">
		<div class="wrapper rtl rtl-inv">
		<header class="main-header">
			<a href="<?=$base_url?>" class="logo" style="background-color:<?=$theme_color?>">
			<span class="logo-mini"><b><?=$site_short_name?></b></span>
			<span class="logo-lg"><b><?=$site_name?></b></span>
			</a>
			<nav class="navbar navbar-static-top" role="navigation">
				<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
				<span class="sr-only">Toggle navigation</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				</a>
				<div class="navbar-custom-menu">
				 
		            <ul class="nav navbar-nav">   
				    <div class="box-body">
                    <a class="btn btn-quick" href="pos.php" title="POS">
                        <i class="fa fa-th"></i>
                    </a>
                                        
                    <a class="btn btn-quick" href="customers.php" title="Customers">
                        <i class="fa fa-users"></i>
                    </a>
                    <a class="btn btn-quick" href="sales-list.php" title="Sales">
                        <i class="fa fa-shopping-cart"></i>
                    </a>
                    
                    
                    <!--<a class="btn btn-quick" href="https://mm-tailor-billing.selectionsilks.com/incomes" title="Incomes">
                        <i class="fa fa-inr"></i> <b>Inc</b>
                    </a>
                    <a class="btn btn-quick" href="https://mm-tailor-billing.selectionsilks.com/expenses" title="Expenses">
                        <i class="fa fa-inr"></i> <b>Exp</b>
                    </a>
                    
                    <a class="btn btn-quick" href="https://mm-tailor-billing.selectionsilks.com/material_usage" title="Material Usage">
                        <i class="fa fa-scissors"></i>
                    </a>-->
                    
                    <!--<a class="btn btn-quick" href="https://mm-tailor-billing.selectionsilks.com/products" title="Products">
                        <i class="fa fa-barcode"></i>
                    </a>
                    
                    <a class="btn btn-quick" href="https://mm-tailor-billing.selectionsilks.com/categories" title="Categories">
                        <i class="fa fa-folder-open"></i>
                    </a>-->
                    
                    <a class="btn btn-quick" href="reports-sales.php" title="Sales Reports">
                        <i class="fa fa-bar-chart-o"></i>
                    </a>
                                        
                </div>
                <style>
                    .btn-quick {
                        position: relative;
                        padding: 4px 0px;
                        margin: 0px 0 0px 6px;
                        min-width: 50px;
                        height: 30px;
                        text-align: center;
                        color: #666;
                        border: 1px solid #ddd;
                        background-color: #f4f4f4;
                        font-size: 15px;
                    }
                </style>
                <!-- Quick Links Ends Here -->
        </ul>
                            
                            
                            
					<ul class="nav navbar-nav">
					    
					<li style="margin-top: 8px;width: 250px;">
                        <input name="search_cus_details" class="form-control" placeholder="Search Customer Details" style="width:100%;" id="search_cus_details" />
                    </li>
                    <li style="margin-top: 8px;">
                        <button type="submit" id="cus_submit" class="btn btn-info" style="padding: 9px;"><i class="fa fa-search"></i></button>
                    </li>
                    
                    
                    
                    <li class="hidden-xs"><a href="price-update.php" data-toggle="tooltip" data-placement="bottom" title="Today Price"><i class="fa fa-inr" style="margin-top: 5px;"></i></a></li>
                    <li class="hidden-xs"><a href="index.php" data-toggle="tooltip" data-placement="bottom" title="Dashboard"><i class="fa fa-dashboard" style="margin-top: 5px;"></i></a></li>
                    <li><a href="pos.php" data-toggle="tooltip" data-placement="bottom" title="POS"><i class="fa fa-th" style="margin-top: 5px;"></i></a></li>
                    
                    
                    
                    
                    
                    <!--<li class="hidden-xs"><a href="https://mm-tailor-billing.selectionsilks.com/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs"></i></a></li>-->
                    
                    
                    
                    
                    
                    
                    <!--<li class="hidden-xs"><a href="https://mm-tailor-billing.selectionsilks.com/settings" data-toggle="tooltip" data-placement="bottom" title="Settings"><i class="fa fa-cogs"></i></a></li>
                    <li><a href="https://mm-tailor-billing.selectionsilks.com/pos/view_bill" target="_blank" data-toggle="tooltip" data-placement="bottom" title="Customer Display"><i class="fa fa-desktop"></i></a></li>-->
                    
                                                         
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
					    
					    <?php if($session_id!=1){ ?>
    						<!--<li class="hidden-xs" id="checkin_li" style="display: none;">
    							<a href="ownattendance.php"  class="blinking" data-toggle="tooltip" data-placement="bottom" title="Checkin Now"><i  style="background: green;padding: 3px;border-radius: 7px 7px 7px 7px;" class="fa fa-check"></i><span class="label label-warning" id="alert_checkin"></span> Click here to Checkin</a>
    						</li>
    						<li class="hidden-xs" id="checkout_li" style="display: none;">
    							<a href="ownattendance.php"  class="blinking" data-toggle="tooltip" data-placement="bottom" title="Checkin Now"><i  style="background: red;padding: 3px;border-radius: 7px 7px 7px 7px;" class="fa fa-check"></i><span class="label label-warning" id="alert_checkout"></span> Click here to Check Out</a>
    						</li>-->
						<?php }?>
						
						
						<li class="hidden-xs hidden-sm"><a href="../spm_hrm" style="padding: 15px 10px;"><b>HRM</b></a></li>
						<li class="hidden-xs hidden-sm"><a href="#" style="padding: 15px 8px;"><?=date('d-m-Y')?></a></li>
						<li class="hidden-xs hidden-sm"><a href="#" style="padding: 15px 10px;" class="clock"></a></li>
						
						
						
						<?php if($session_id==1){ ?>
    						<li class="hidden-xs">
    							<a href="notifications.php" data-toggle="tooltip" data-placement="bottom" title="Notifications"><i class="fa fa-bell-o" style="margin-top: 5px;"></i><span class="label label-warning" id="notifications_count">0</span></a>
    						</li>
						<?php }?>
						
						
						
						<li class="dropdown user user-menu" style="padding-right:5px;">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
    							<img src="<?=$site_logo?>" class="user-image" alt="<?=$session['name']?>" style="background: white;"/>
    							<span class="hidden-xs"><?=$session['name']?></span>
							</a>
							<ul class="dropdown-menu" style="padding-right:3px;">
								<li class="user-header">
									<img src="<?=$site_logo?>" alt="Avatar" style="width: 220px;border:0px;" />
									<p>
										<?=$session['name']?>  <small></small>
									</p>
								</li>
								<li class="user-footer">
									<div class="pull-left">
										<a href="profile.php" class="btn btn-warning btn-sm"><i class="fa fa-user" aria-hidden="true"></i> Profile</a>
									</div>
									<div class="pull-right">
										<a href="logout.php" class="btn btn-danger btn-sm "><i class="fa fa-sign-out" aria-hidden="true"></i> Sign Out</a>
									</div>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</nav>
		</header>
		
		
		
		
		
		<aside class="main-sidebar" style="background: linear-gradient(45deg, #303f9f, #1976d2) !important;">
			<section class="sidebar" style="">
				<ul class="sidebar-menu" style="">
				    
				    
					<li class="mm_welcome <?php if($current_page=="index.php"){echo "active";}?>">
					    <a href="index.php"><i class="fa fa-dashboard"></i> &nbsp;<span>Dashboard</span></a>
					</li>
				
	<?php if($session_id==1 || $session_user_type==1 || $allPermissions['customers']['read']==1 || $allPermissions['customers']['create']==1){ ?>				
				<li class="treeview mm_categories <?php if($current_page=="customers.php" || $current_page=="customers-add.php" || $current_page=="customers-scheme-add.php" || $current_page=="customers-scheme-list.php" || $current_page=="customers-scheme-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="fa fa-users"></i>
                        <span>Schemes</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                    
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['customers']['read']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="customers.php"){echo "active";}?>">
                            <a href="customers.php"><i class="fa fa-th"></i> <span>Customers List</span></a>
                        </li>
                    <?php } ?>
                    
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['customers']['create']==1){ ?>
                        <!--<li class="mm_employees <?php if($current_page=="customers-add.php"){echo "active";}?>">
                            <a href="customers-add.php"><i class="fa fa-th"></i> <span>Customer Add</span></a>
                        </li>-->
                    <?php } ?>
                    
                    
                        <li class="mm_employees <?php if($current_page=="customers-scheme-list.php"){echo "active";}?>">
                            <a href="customers-scheme-list.php"><i class="fa fa-th"></i> <span>Scheme List</span></a>
                        </li>
                        <li class="mm_employees <?php if($current_page=="customers-scheme-add.php"){echo "active";}?>">
                            <a href="customers-scheme-add.php"><i class="fa fa-th"></i> <span>Scheme Add</span></a>
                        </li>
                    </ul>
                </li>
    <?php } ?>
				
			
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['advance_voucher']['read']==1 || $allPermissions['advance_voucher']['create']==1){ ?>            
				<li class="treeview mm_categories <?php if($current_page=="advance-voucher-list.php" || $current_page=="advance-voucher-add.php"|| $current_page=="advance-voucher-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-badge-ad-fill"></i>
                        <span>&nbsp;Advance</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['advance_voucher']['read']==1){ ?>   
                        <li class="mm_employees <?php if($current_page=="advance-voucher-list.php"){echo "active";}?>">
                            <a href="advance-voucher-list.php"><i class="fa fa-th"></i> <span>Advance List</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['advance_voucher']['create']==1){ ?>   
                        <li class="mm_employees <?php if($current_page=="advance-voucher-add.php"){echo "active";}?>">
                            <a href="advance-voucher-add.php"><i class="fa fa-th"></i> <span>Advance Add</span></a>
                        </li>
                <?php } ?>
                    </ul>
                </li>
    <?php } ?>
    
    
    
                
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['repair_voucher']['read']==1 || $allPermissions['repair_voucher']['create']==1){ ?>             
                <li class="treeview mm_categories <?php if($current_page=="repair-voucher-list.php" || $current_page=="repair-voucher.php"|| $current_page=="repair-voucher-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="fa fa-registered"></i>
                        <span>Repair</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['repair_voucher']['read']==1){ ?>  
                        <li class="mm_employees <?php if($current_page=="repair-voucher-list.php"){echo "active";}?>">
                            <a href="repair-voucher-list.php"><i class="fa fa-th"></i> <span>Repair List</span></a>
                        </li>
                    <?php } ?>
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['repair_voucher']['create']==1){ ?>  
                        <li class="mm_employees <?php if($current_page=="repair-voucher.php"){echo "active";}?>">
                            <a href="repair-voucher.php"><i class="fa fa-th"></i> <span>Repair Add</span></a>
                        </li>
                    <?php } ?>
                    </ul>
                </li>
    <?php } ?>
                
                
                
                
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['sales']['read']==1 || $allPermissions['sales']['create']==1){ ?>            
				<li class="treeview mm_categories <?php if($current_page=="pos.php" || $current_page=="sales-list.php"|| $current_page=="pos-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-cart-check-fill"></i>
                        <span>&nbsp;Sales</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['sales']['read']==1){ ?>  
                        <li class="mm_employees <?php if($current_page=="sales-list.php"){echo "active";}?>">
                            <a href="sales-list.php"><i class="fa fa-th"></i> <span>Sales List</span></a>
                        </li>
                    <?php } ?>
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['sales']['create']==1){ ?>  
                        <li class="mm_employees <?php if($current_page=="pos.php"){echo "active";}?>">
                            <a href="pos.php"><i class="fa fa-th"></i> <span>Sales Add</span></a>
                        </li>
                    <?php } ?>
                    
                    
                        <li class="mm_employees <?php if($current_page=="quotation-list.php"){echo "active";}?>">
                            <a href="quotation-list.php"><i class="fa fa-th"></i> <span>Quotation List</span></a>
                        </li>
                        <li class="mm_employees <?php if($current_page=="pos.php?status=Quotation"){echo "active";}?>">
                            <a href="pos.php?status=Quotation"><i class="fa fa-th"></i> <span>Quotation Add</span></a>
                        </li>
                        
                    </ul>
                </li>
    <?php } ?>
                
                
                
                <!--<li class="treeview mm_categories <?php if($current_page=="quotation-list.php"){echo "active";}?>">
                    <a href="#">
                        <i class="fa fa-file"></i><span>Quotation</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        
                    </ul>
                </li>-->
                
                
				
	
	<?php if($session_id==1 || $session_user_type==1 || $allPermissions['stock_transfer']['read']==1 || $allPermissions['stock_transfer']['create']==1){ ?>			
				<li class="treeview mm_categories <?php if($current_page=="quotation-list.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-recycle"></i>&nbsp;
                        <span>Stock Transfer</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['stock_transfer']['read']==1){ ?>	
                        <li class="mm_employees <?php if($current_page=="stock-transfer-list.php"){echo "active";}?>">
                            <a href="stock-transfer-list.php"><i class="fa fa-th"></i> <span>Stock Transfer List</span></a>
                        </li>
                <?php } ?>
                
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['stock_transfer']['create']==1){ ?>	
                        <li class="mm_employees <?php if($current_page=="stock_transfers_add.php"){echo "active";}?>">
                            <a href="stock_transfers_add.php"><i class="fa fa-th"></i> <span>Stock Transfer Add</span></a>
                        </li>
                <?php } ?>
                
                    </ul>
                </li>
    <?php } ?>
				
                
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['products']['read']==1 || $allPermissions['products']['create']==1){ ?>    
                <li class="treeview mm_categories <?php if($current_page=="products-add.php" || $current_page=="products-list.php"|| $current_page=="products-edit.php" || $current_page=="stocks-list.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-box-fill"></i>
                        <span>&nbsp;Products</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['products']['read']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="stocks-list.php"){echo "active";}?>">
                            <a href="stocks-list.php"><i class="fa fa-th"></i> <span>Stocks List</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['products']['read']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="products-list.php"){echo "active";}?>">
                            <a href="products-list.php"><i class="fa fa-th"></i> <span>Products List</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['products']['create']==1){ ?> 
                        <li class="mm_employees <?php if($current_page=="products-add.php"){echo "active";}?>">
                            <a href="products-add.php"><i class="fa fa-th"></i> <span>Products Add</span></a>
                        </li>
                <?php } ?>
                    </ul>
                </li>
    <?php  } ?>
                
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['suppliers']['read']==1 || $allPermissions['suppliers']['create']==1 || $allPermissions['purchases']['create']==1 || $allPermissions['purchases']['read']==1){ ?>            
                <li class="treeview mm_categories <?php if($current_page=="purchases-add.php" || $current_page=="purchases-list.php"|| $current_page=="purchases-edit.php" || $current_page=="suppliers.php" || $current_page=="suppliers-add.php" || $current_page=="suppliers-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-bag-check-fill"></i>
                        <span>&nbsp;Purchases</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                    
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['purchases']['read']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="purchases-list.php"){echo "active";}?>">
                           <a href="purchases-list.php"><i class="fa fa-th"></i> <span>Purchases List</span></a>
                        </li>
                    <?php } ?>
                    
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['purchases']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="purchases-add.php"){echo "active";}?>">
                           <a href="purchases-add.php"><i class="fa fa-th"></i> <span>Purchases Add</span></a>
                        </li>
                    <?php } ?>
                    
                    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['suppliers']['read']==1){ ?>
        			    <li class="mm_employees <?php if($current_page=="suppliers.php"){echo "active";}?>">
        			       <a href="suppliers.php"><i class="fa fa-th"></i> <span>Suppliers List</span></a>
        			    </li>
        			<?php } ?>
        			
        			<?php if($session_id==1 || $session_user_type==1 || $allPermissions['suppliers']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="suppliers-add.php"){echo "active";}?>">
                           <a href="suppliers-add.php"><i class="fa fa-th"></i> <span>Suppliers Add</span></a>
                        </li>
                    <?php } ?>
                    
                    
                    </ul>
                </li>
    <?php } ?>
                
    
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['reports']['all']==1){ ?>	             
                <li class="treeview mm_categories <?php if($current_page=="reports-customers.php" || $current_page=="reports-sales.php" || $current_page=="reports-purchases.php" || $current_page=="reports-suppliers.php" || 
                            $current_page=="reports-tax-sales.php" || $current_page=="reports-tax-purchases.php" || $current_page=="reports-barcode.php"  || $current_page=="reports-scheme.php" || $current_page=="reports-users.php" ){echo "active";}?>">
                            
                            <a href="#">
                                <i class="bi bi-graph-up"></i> &nbsp;<span>Reports</span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li class="mm_employees <?php if($current_page=="reports-users.php"){echo "active";}?>">
                                   <a href="reports-users.php"><i class="fa fa-th"></i> <span>Users Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-barcode.php"){echo "active";}?>">
                                   <a href="reports-barcode.php"><i class="fa fa-th"></i> <span>Barcode Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-sales.php"){echo "active";}?>">
                                   <a href="reports-sales.php"><i class="fa fa-th"></i> <span>Sales Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-purchases.php"){echo "active";}?>">
                                   <a href="reports-purchases.php"><i class="fa fa-th"></i> <span>Purchases Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-customers.php"){echo "active";}?>">
                                   <a href="reports-customers.php"><i class="fa fa-th"></i> <span>Customers Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-suppliers.php"){echo "active";}?>">
                                   <a href="reports-suppliers.php"><i class="fa fa-th"></i> <span>Suppliers Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-tax-sales.php"){echo "active";}?>">
                                   <a href="reports-tax-sales.php"><i class="fa fa-th"></i> <span>Sales Tax Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-tax-purchases.php"){echo "active";}?>">
                                   <a href="reports-tax-purchases.php"><i class="fa fa-th"></i> <span>Purchase Tax Reports</span></a>
                                </li>
                                <li class="mm_employees <?php if($current_page=="reports-scheme.php"){echo "active";}?>">
                                   <a href="reports-scheme.php"><i class="fa fa-th"></i> <span>Scheme Reports</span></a>
                                </li>
                            </ul>
                </li>
    <?php } ?>
                
                
				
	<?php if($session_id==1 || $session_user_type==1 || $allPermissions['expenses']['read']==1 || $allPermissions['expenses_category']['read']==1){ ?>	
				<li class="treeview mm_categories <?php if($current_page=="expenses_list.php" || $current_page=="expenses-category.php"|| $current_page=="expenses_add.php"){echo "active";}?>">
                    <a href="#">
                        <i class="fa fa-inr"></i>
                        <span>Expenses</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
        <?php if($session_id==1 || $session_user_type==1 || $allPermissions['expenses']['read']==1){ ?>	
                        <li class="mm_employees <?php if($current_page=="expenses_list.php"){echo "active";}?>">
                            <a href="expenses_list.php"><i class="fa fa-th"></i> <span>Expenses List</span></a>
                        </li>
        <?php } ?>
        
        <?php if($session_id==1 || $session_user_type==1 || $allPermissions['expenses']['create']==1){ ?>	
                        <li class="mm_employees <?php if($current_page=="expenses_add.php"){echo "active";}?>">
                            <a href="expenses_add.php"><i class="fa fa-th"></i> <span>Expenses Add</span></a>
                        </li>
        <?php } ?>
        
        <?php if($session_id==1 || $session_user_type==1 || $allPermissions['expenses_category']['read']==1){ ?>	
                        <li class="mm_employees <?php if($current_page=="expenses-category.php"){echo "active";}?>">
                            <a href="expenses-category.php"><i class="fa fa-th"></i> &nbsp;<span>Expenses Category</span></a>
                        </li>
        <?php } ?>
        
                    </ul>
                </li>
    <?php } ?>
				
                
			
				
				
			
				
				
	<?php if($session_id==1 || $session_user_type==1 || $allPermissions['role']['read']==1 || $allPermissions['users']['read']==1){ ?>	
	
				<li class="treeview mm_categories <?php if($current_page=="users-list.php" || $current_page=="users.php"|| $current_page=="users-edit.php" || $current_page=="role.php" || $current_page=="role-add.php" || $current_page=="role-edit.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-people-fill"></i>
                        <span>&nbsp;Users</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        
                    <!--</?php if($session_id==1 || $session_user_type==1 || $allPermissions['users']['read']==1){ ?>-->
                    <!--    <li class="mm_employees <?php if($current_page=="users-list.php"){echo "active";}?>">-->
                    <!--      <a href="users-list.php"><i class="fa fa-th"></i> <span>Users List</span></a>-->
                    <!--    </li>-->
                    <!--</?php } ?>-->
                    
                    <!--</?php if($session_id==1 || $session_user_type==1 || $allPermissions['users']['create']==1){ ?>-->
                    <!--    <li class="mm_employees <?php if($current_page=="users.php"){echo "active";}?>">-->
                    <!--      <a href="users.php"><i class="fa fa-th"></i> <span>Users Add</span></a>-->
                    <!--    </li>-->
                    <!--</?php } ?>-->
                
                
                        <!-- Role Management Starts Here -->
        				<?php if($session_id==1 || $session_user_type==1 || $allPermissions['role']['read']==1 || $allPermissions['role']['create']==1){ ?>
        				    <li class="mm_employees <?php if($current_page=="role.php" || $current_page=="role-add.php" || $current_page=="role-edit.php"){echo "active";}?>">
        				        <a href="role.php"><i class="bi bi-person-check-fill"></i> &nbsp; <span>Role Management</span></a>
        				    </li>
        				<?php } ?>
        				<!-- Role Management Endsss Here -->
				
				    </ul>
                </li>
    <?php } ?>
				
				
				
				
				
				
	<?php if($session_id==1 || $session_user_type==1 || 
	        $allPermissions['category']['read']==1 || $allPermissions['sub_category']['read']==1 || 
	        $allPermissions['gst']['read']==1 || $allPermissions['wastage']['read']==1 || 
	        $allPermissions['purity']['read']==1 || $allPermissions['products_name']['read']==1 || $allPermissions['scheme_name']['read']==1){ ?>				
                <li class="treeview mm_categories <?php if($current_page=="category-list.php" || $current_page=="category-add.php"|| $current_page=="sub-category-list.php" || $current_page=="sub-category-add.php" || $current_page=="gst-list.php" || 
                                                        $current_page=="purity-list.php" || $current_page=="wastage-list.php" || $current_page=="wastage-add.php" || $current_page=="product-name-list.php" || $current_page=="scheme-list.php"){echo "active";}?>">
                    <a href="#">
                        <i class="bi bi-grid"></i>
                        <span>&nbsp;Customs</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        
                
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['category']['read']==1 || $allPermissions['category']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="category-list.php"){echo "active";}?>">
                          <a href="category-list.php"><i class="fa fa-th"></i> <span>Category</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['sub_category']['read']==1 || $allPermissions['sub_category']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="sub-category-list.php"){echo "active";}?>">
                          <a href="sub-category-list.php"><i class="fa fa-th"></i> <span>Sub Category</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['gst']['read']==1 || $allPermissions['gst']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="gst-list.php"){echo "active";}?>">
                          <a href="gst-list.php"><i class="fa fa-th"></i> <span>GST (%)</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['wastage']['read']==1 || $allPermissions['wastage']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="wastage-list.php"){echo "active";}?>">
                          <a href="wastage-list.php"><i class="fa fa-th"></i> <span>Wastage</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['purity']['read']==1 || $allPermissions['purity']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="purity-list.php"){echo "active";}?>">
                          <a href="purity-list.php"><i class="fa fa-th"></i> <span>Purity</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['products_name']['read']==1 || $allPermissions['products_name']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="product-name-list.php"){echo "active";}?>">
                          <a href="product-name-list.php"><i class="fa fa-th"></i> <span>Products</span></a>
                        </li>
                <?php } ?>
                <?php if($session_id==1 || $session_user_type==1 || $allPermissions['scheme_name']['read']==1 || $allPermissions['scheme_name']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="scheme-list.php"){echo "active";}?>">
                          <a href="scheme-list.php"><i class="fa fa-th"></i> <span>Scheme</span></a>
                        </li>
                <?php } ?>
                
                 <?php if($session_id==1 || $session_user_type==1 || $allPermissions['model']['read']==1 || $allPermissions['model']['create']==1){ ?>
                        <li class="mm_employees <?php if($current_page=="scheme-list.php"){echo "active";}?>">
                          <a href="model-list.php"><i class="fa fa-th"></i> <span>Model</span></a>
                        </li>
                <?php } ?>
                
                
                    </ul>
                </li>
    <?php } ?>
    
                
    
    <?php if($session_id==1 || $session_user_type==1 || $allPermissions['branch']['read']==1){ ?>	            
                <li class="mm_welcome <?php if($current_page=="business_locations_list.php"){echo "active";}?>">
					<a href="business_locations_list.php"><i class="fa fa-building"></i>&nbsp;<span>Locations</span></a>
				</li>
	<?php } ?>
				
				
		
				
					
			</ul>
			</section>
		</aside>
		
		<style>
			.blinking{
			    animation:blinkingText 1.0s infinite;
			}
			@keyframes blinkingText{
    			0%{		color: green;	}
    			40%{	color: yellow;	}
    			50%{	color: pink;	}
    			99%{	color:red;	}
    			100%{	color: #000;	}
			}
		</style>
		
		
<style>
.mm_welcome .a{
        color: white;
}
.sidebar{
    background: linear-gradient(45deg, #303f9f, #1976d2) !important;
}
.skin-blue .main-header .navbar {
    background: linear-gradient(45deg, #7b1fa2, #7c4dff) !important;
}
.skin-blue .sidebar-menu>li.active>a, .skin-blue .sidebar-menu>li:hover>a {
    color: #fff;
    border-left-color: #3c8dbc;
    box-shadow: 0 6px 20px 0 rgb(47 50 52 / 50%);
    border-radius: 0px 20px 20px 0px;
    background: linear-gradient(45deg, #8e24aa, #ff6e40) !important;
}

@media (min-width: 768px) {
.sidebar-mini.sidebar-collapse .sidebar-menu>li:not(.treeview)>a>span {
    border-bottom-right-radius: 4px;
    color: #fff;
    background: linear-gradient(45deg, #8e24aa, #ff6e40) !important;
    box-shadow: 0 6px 20px 0 rgb(47 50 52 / 50%);
}

}
.skin-blue .sidebar-menu>li>.treeview-menu {
    margin: 0 1px;
    /*background: linear-gradient(45deg, #303f9f, #1976d2) !important;*/
    background: #3c8dbc !important;
}
.mm_employees>a:active, .mm_employees>a:focus, .mm_employees>a:hover {
    outline: 0;
    text-decoration: none;
    color: #72afd2;
    background: #a486b1;
    border-radius: 5px;
    box-shadow: 0 6px 20px 0 rgb(47 50 52 / 50%);
}
.skin-blue .sidebar a {
    color: white;
}
.sidebar-menu .treeview-menu>li>a {
    color: cornsilk;
}

.activesss{
    outline: 0;
    text-decoration: none;
    color: #72afd2;
    background: #a486b1;
    border-radius: 5px;
    box-shadow: 0 6px 20px 0 rgb(47 50 52 / 50%);
}
.skin-blue .treeview-menu>li.active>a, .skin-blue .treeview-menu>li>a:hover {
    color: white !important;
    outline: 0;
    text-decoration: none;
    color: #72afd2;
    background: #a486b1;
    border-radius: 5px;
    box-shadow: 0 6px 20px 0 rgb(47 50 52 / 50%);
}


@media (min-width: 768px) {
    .sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>.treeview-menu, .sidebar-mini.sidebar-collapse .sidebar-menu>li:hover>a>span:not(.pull-right) {
        display: block !important;
        position: absolute;
        width: 210px;
        left: 50px;
        background: cornflowerblue;
        font-weight: 800;
    }
}
</style>