<?php 
session_start();
include '../koneksi/koneksi.php';
if(!isset($_SESSION['admin'])){
	header('location:index.php');
}
$level = isset($_SESSION['level']) ? $_SESSION['level'] : '';
?>

<!DOCTYPE html>
<html>
<head>
	<title>Admin - Pasar Pagi UMKM Galeri3D</title>
	<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="../css/style.css">
	<link rel="stylesheet" type="text/css" href="../css/bootstrap-theme.css">
	<script  src="../js/jquery.js"></script>
	<script  src="../js/bootstrap.min.js"></script>
	<link rel="icon" href="../image/home/logo.ico" type="image/x-icon">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
</head>
<body>

	<nav class="navbar navbar-default" style="padding: 5px; background: linear-gradient(to right, #ffffff 0%, #FFF1E0 20%, #FFC973 70%, #FFA500 100%);">
		<div class="container">

			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="halaman_utama.php" style="display:flex; align-items:center;">
					<img src="../image/home/logo.png" alt="Logo" style="height:55px; margin-right:8px; object-fit:contain;">
				</a>
			</div>

			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav navbar-left">

					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-folder-close"></i> Data Master <span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="m_produk.php">Master Produk</a></li>
							<li><a href="m_customer.php">Master Customer</a></li>
							<?php if ($level === 'admin') { ?>
								<li><a href="m_admin.php">Master Admin</a></li>
							<?php } ?>
							<li><a href="m_qris.php">Master Qris</a></li>
						</ul>
					</li>

					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-retweet"></i> Data Transaksi <span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="produksi.php">Produksi</a></li>
							<li><a href="inventory.php">Inventory</a></li>
							
						</ul>
					</li>

					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-stats"></i> Laporan <span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="laporan_penjualan.php">Laporan Penjualan</a></li>
							<li><a href="laporan_profit.php">Laporan Profit</a></li>
							<li><a href="laporan_omset.php">Laporan Omset</a></li>
							<li><a href="laporan_pembatalan.php">Laporan Pembatalan	</a></li>
							<li><a href="laporan_inventory.php">Laporan Inventory</a></li>
							<li><a href="laporan_produksi.php">Laporan Produksi</a></li>
						</ul>
					</li>
					<li><a href="halaman_utama.php">Dashboard</a></li>

				</ul>

				<ul class="nav navbar-nav navbar-right">
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="glyphicon glyphicon-cog"></i> Pemeliharaan <span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li><a href="../DATABASE/backup.php">Backup Database</a></li>
							<li><a href="../DATABASE/retrieve.php">Retrieve Database</a></li>
						</ul>
					</li>


					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
							<i class="glyphicon glyphicon-user"></i> 
							<?= isset($_SESSION['username']) ? $_SESSION['username'] : 'Admin'; ?> 
							<span class="caret"></span>
						</a>
						<ul class="dropdown-menu">
							<li><a href="proses/logout.php">Log Out</a></li>
						</ul>
					</li>

				</ul>
			</div><!-- /.navbar-collapse -->
		</div><!-- /.container-fluid -->
	</nav>



