<?php
if(isset($_GET['logout']) || !$_SESSION['id_user']){
	session_destroy();
	header('location: '.getConfig($connect, 'base_url'));
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<title><?php echo getTitle($_GET['page']);?> - Bluepos</title>
<link rel="icon" href="<?php echo getConfig($connect, 'base_url');?>assets/images/icon.png" type="image/x-icon">
<link href="<?php echo getConfig($connect, 'base_url');?>assets/css/style.css.php" rel="stylesheet" type="text/css">
<link href="<?php echo getConfig($connect, 'base_url');?>assets/css/themes/all-themes.min.css" rel="stylesheet" type="text/css">
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery/jquery.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<style>
th{
	text-align:center !important;
}
.img-view{
	margin:5px 5px 5px 5px !important;
}
.h-icon{
  -webkit-box-shadow: 0px 0px 3px 3px rgba(255,255,255,1);
  -moz-box-shadow: 0px 0px 3px 3px rgba(255,255,255,1);
  box-shadow: 0px 0px 3px 3px rgba(255,255,255,1);
  float:left; 
  margin-right:20px;
  margin-top:-10px;
  height:40px;
  width:auto;
  border-radius:100%;
}
</style>
</head>
<body class="theme-blue-grey">
<div class="overlay"></div>
<nav class="navbar">
  <div class="container-fluid">
    <div class="navbar-header"> <a href="./" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false"></a> <a href="javascript:void(0);" class="bars"></a> <a class="navbar-brand" href="<?php echo getConfig($connect, 'base_url');?>#home"><img src="assets/images/icon.png" alt="Bluepos Logo" class="h-icon"> <small class="ttl"><?php echo getTitle($_GET['page']);?></small></a> </div>
  	<div class="collapse navbar-collapse" id="navbar-collapse">
      <ul class="nav navbar-nav navbar-right">
      	<?php if($_SESSION['level']=='eksekutif'){?>
        	<li><a href="<?php echo getConfig($connect, 'base_url');?>?logout" class="logout" title="Logout"> <i class="material-icons">exit_to_app</i> <span class="label-count bg-red"></span> </a></li>
        <?php }else{ ?>
        <li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="material-icons">notifications</i> <span class="label-count bg-red"></span> </a>
          <ul class="dropdown-menu">
            <li class="header">NOTIFICATIONS</li>
            <li class="body">
              <ul class="menu notif-list">
                
              </ul>
            </li>
          </ul>
        </li>
        <?php } ?>
      </ul>
    </div>
  </div>
</nav>
<section>
  <aside id="leftsidebar" class="sidebar">
    <div class="user-info">
      <div class="image"><img src="assets/images/placeholder.png" data-src="<?php echo getConfig($connect, 'base_url');?>image.php?t=<?php echo $_SESSION['level'];?>&id=<?php echo $_SESSION['id_user'];?>" width="48" height="48" alt="User" class="img" /> </div>
      <div class="info-container">
        <div class="name col-white" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?php echo $_SESSION['nama_user'];?></div>
        <div class="email col-white"><?php echo $_SESSION['email_user'];?></div>
        <div class="btn-group user-helper-dropdown col-white"> <i class="material-icons" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">keyboard_arrow_down</i>
          <ul class="dropdown-menu pull-right">
            <li><a href="<?php echo getConfig($connect, 'base_url');?>?page=profile"><i class="material-icons">person</i>Profile</a></li>
            <li><a href="<?php echo getConfig($connect, 'base_url');?>?logout" class="logout"><i class="material-icons">input</i>Logout</a></li>
          </ul>
        </div>
      </div>
    </div>
    <div class="menu">
      <ul class="list">
        <li <?php echo ($_GET['page']=='home' || !$_GET['page']) ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=home"> <i class="material-icons">dashboard</i> <span>Dashboard</span> </a> </li>
		<?php if($_SESSION['level']=='user'){?>
        <li <?php echo ($_GET['page']=='validasi-transaksi') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=validasi-transaksi"> <i class="material-icons">done_all</i> <span>Transaction Validation</span> </a> </li>
        <?php } ?>
        <li <?php echo ($_GET['page']=='transaksi') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=transaksi"> <i class="material-icons">multiline_chart</i> <span>Transaction</span> </a> </li>
        <li <?php echo ($_GET['page']=='toko') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=toko"> <i class="material-icons">store_mall_directory</i> <span>Store</span> </a> </li>
        <?php if($_SESSION['level']=='user'){?>
        <li> <a href="javascript:void(0);" class="menu-toggle <?php echo (substr($_GET['page'],-6)=='produk') ? 'toggled' : '';?>"> <i class="material-icons">book</i> <span>Product</span> </a>
            <ul class="ml-menu">
                <li <?php echo ($_GET['page']=='data-produk') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=data-produk"> <span>Data Product</span> </a> </li>
                <li <?php echo ($_GET['page']=='stock-produk') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=stock-produk"> <span>Stock Product</span> </a> </li>
            </ul>
        </li>
        <?php }elseif($_SESSION['level']=='admin'){?>
        	<li <?php echo ($_GET['page']=='data-produk') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=data-produk"> <i class="material-icons">book</i> <span>Data Product</span> </a> </li>
        <?php } ?>
        <?php if($_SESSION['level']=='admin'){?>
        	<li <?php echo ($_GET['page']=='user') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=users"> <i class="material-icons">group</i> <span>User</span> </a> </li>
            <li <?php echo ($_GET['page']=='admin-login') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=admin-login"> <i class="material-icons">person</i> <span>Admin Login</span> </a> </li>
		<?php }else{?>
        	<li <?php echo ($_GET['page']=='kasir') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=kasir"> <i class="material-icons">people</i> <span>Operator</span> </a> </li>
        <?php }?>
        <li class="header">Bluepos Online mobile POS</li>
        <li> <a href="https://codecanyon.net/user/hmstech" target="_blank" class="url"> <i class="material-icons">code</i> <span>Source Code Bluepos</span> </a> </li>
        <li> <a href="https://hmstudio.co.id/bluepos/app-debug.apk" target="_blank" class="url"> <i class="material-icons">android</i> <span>Download Bluepos Apk</span> </a> </li>
        <li <?php echo ($_GET['page']=='kritik') ? 'class=active' : '';?>> <a href="<?php echo getConfig($connect, 'base_url');?>?page=kritik"> <i class="material-icons">comment</i> <span>Cricitism &amp; Suggestion</span> </a> </li>
        </ul>
    </div>
  </aside>
</section>
<section class="content" <?php echo ($_SESSION['level']=='eksekutif')?'style="margin:100px 0 0 0 !important"':'';?>>
  <div class="container-fluid" id="hasil" style="padding:0 !important;">
  	<?php
		require_once('route_ajax.php');
	?>
  </div>
</section>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/jquery.dataTables.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/skin/bootstrap/js/dataTables.bootstrap.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/dataTables.buttons.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/buttons.flash.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/jszip.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/pdfmake.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/vfs_fonts.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/buttons.html5.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-datatable/extensions/export/buttons.print.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-slimscroll/jquery.slimscroll.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/node-waves/waves.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/sweetalert/sweetalert.min.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/bootstrap-notify/bootstrap-notify.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/momentjs/moment.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/bootstrap-datepicker/bootstrap-datepicker.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/select2/js/select2.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/pace/pace.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/lazyload/lazyload.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/plugins/jquery-validation/jquery.validate.min.js"></script>
<script src="<?php echo getConfig($connect, 'base_url');?>assets/js/admin.js?v=1.5"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/js/script.js"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/js/form_ajax.js?v=1.0"></script> 
<script src="<?php echo getConfig($connect, 'base_url');?>assets/js/util.js.php?v=1.3"></script> 
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-106598025-2"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-106598025-2');
</script>
</body>
</html>