<?php
	$admin = Session::getSession('userDbUser');
	$linkCheck = isset($_GET['url']) ? $_GET['url'] : null;
	$arrayLinkCheck = explode('/',trim($linkCheck,'/'));
	$functionCheck = isset($arrayLinkCheck[1]) ? $arrayLinkCheck[1] : 'index';
?>

<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Unli Database Updater</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="<?= URL ?>public/css/bootstrap.css">
		<link rel="stylesheet" href="<?= URL ?>public/font-awesome/css/font-awesome.css">
		<link rel="stylesheet" href="<?= URL ?>public/css/style-me.css">
		<link rel="stylesheet" href="<?= URL ?>public/pixeden/pe-icon-7-stroke/css/pe-icon-7-stroke.css">
		<link rel="stylesheet" href="<?= URL ?>public/pixeden/pe-icon-7-stroke/css/helper.css">
		<link rel="stylesheet" href="<?= URL ?>public/css/loading.css">
		<link rel="stylesheet" href="<?= URL ?>public/css/loading.2.css">
		<link rel="stylesheet" href="<?= URL ?>public/datepicker/datepicker.css">
		<script src="<?= URL ?>public/js/jquery.js"></script>
		<script src="<?= URL ?>public/datepicker/jquery-ui.js"></script>
		<script src="<?= URL ?>public/js/bootstrap.js"></script>
		<script src="<?= URL ?>public/js/jquery-me.js"></script>
		<script src="<?= URL ?>public/datepicker/bootstrap-datepicker.js"></script>
		<script>
			var URL = '<?=URL?>';
		</script>
	</head>
	<body class="agm-standard <?= !empty($admin) ? 'agm-standard-body' : ''?>">
		<?php if($admin):?>
			
			
			<div id="wrapper">
				<div id="sidebar-wrapper">
					<ul id="sidebar_menu" class="sidebar-nav">
						<li class="sidebar-brand text-right"><a href="<?=URL?>">UDU</a></li>
					</ul>
					<ul class="sidebar-nav" id="sidebar">
						<li><a href="<?=URL?>report/report" title="Report" class="<?= $functionCheck == 'report' ? 'active' : ''?>"><span class="sub_icon pe-7s-monitor text-size-17"></span></a></li>
						<li><a href="<?=URL?>report/create" title="Create Database" class="<?= $functionCheck == 'create' ? 'active' : ''?>"><span class="sub_icon pe-7s-server text-size-17"></span></a></li>
						<li><a href="<?=URL?>report/logs" title="Logs" class="<?= $functionCheck == 'logs' ? 'active' : ''?>"><span class="sub_icon pe-7s-note text-size-17"></span></a></li>
						<li><a href="<?=URL?>index/user" title="Users" class="<?= $functionCheck == 'user' ? 'active' : ''?><?= $admin['status'] == 'admin' ? '' : 'hidden'?>"><span class="sub_icon pe-7s-users text-size-17"></span></a></li>
						<li><a href="<?=URL?>report/clientLogs" title="Client Logs" class="<?= $functionCheck == 'clientLogs' ? 'active' : ''?><?= $admin['status'] == 'admin' ? '' : 'hidden'?>"><span class="sub_icon pe-7s-wine text-size-17"></span></a></li>
						
						<!--loading-->
						<div class="row cssload-holder">
							<div class="cssload-container2">
								<div class="cssload-lt"></div>
								<div class="cssload-rt"></div>
								<div class="cssload-lb"></div>
								<div class="cssload-rb"></div>
							</div>
						</div>
						
					</ul>
				</div>
				
				<div id="page-content-wrapper">
					<nav class="navbar navbar-default">
						<div class="container-fluid">
							<div class="navbar-header">
								<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
							</div>
							<div class="collapse navbar-collapse" id="myNavbar">
								<ul class="nav navbar-nav navbar-right">
									<li><a href="<?=URL?>index/logout" title="Logout"><span class="pe-7s-power text-size-17"></span></a></li>
								</ul>
							</div>
						</div>
					</nav>
					<div class="row-side">
						<div class="container-fluid">
		<?php endif;?>