97 lines
3.5 KiB
PHP
97 lines
3.5 KiB
PHP
<?php
|
|
$level = $_SESSION['ss_LEVEL'] ?? 0;
|
|
$isLogin = ($_SESSION['ss_LOGIN'] ?? 0) == 1;
|
|
$userName = $_SESSION['ss_NAME'] ?? '';
|
|
|
|
// ---- Level Groups ----
|
|
$isAdmin = in_array($level, [1, 5]);
|
|
$isManager = in_array($level, [1, 5, 9]);
|
|
$canExport = in_array($level, [1, 5, 6, 7]);
|
|
$canOrder = ($level != 7);
|
|
$isCustomerOnly = ($level == 10);
|
|
?>
|
|
<body>
|
|
|
|
<header id="header" class="header fixed-top d-flex align-items-center">
|
|
<div class="container d-flex align-items-center justify-content-between">
|
|
|
|
<!-- Logo -->
|
|
<a href="/index_intranet.php" class="logo d-flex align-items-center me-auto me-lg-0">
|
|
<img src="assets/img/green-oil-logo-dark.jpg">
|
|
</a>
|
|
|
|
<!-- Navigation -->
|
|
<nav id="navbar" class="navbar">
|
|
<ul>
|
|
<?php if ($isCustomerOnly): ?>
|
|
<!-- Level 10: CUSTOMER only -->
|
|
<li><a href="/index_intranet.php?view=customer_list">CUSTOMER</a></li>
|
|
<?php else: ?>
|
|
|
|
<?php if ($isManager): ?>
|
|
<li><a href="/index_intranet.php?view=forecast">FORECAST</a></li>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($canOrder): ?>
|
|
<li><a href="/index_intranet.php?view=order_list">ORDER</a></li>
|
|
<?php endif; ?>
|
|
|
|
<?php if ($isManager): ?>
|
|
<li><a href="/index_intranet.php?view=map">MAP</a></li>
|
|
<?php endif; ?>
|
|
|
|
<li><a href="/index_intranet.php?view=customer_list">CUSTOMER</a></li>
|
|
<li><a href="/index_intranet.php?view=oilhistory_list">OIL HISTORY</a></li>
|
|
<li><a href="/index_intranet.php?view=receipt_list">RECEIPT</a></li>
|
|
|
|
<?php if ($canExport): ?>
|
|
<li class="dropdown">
|
|
<a href="#"><span>EXPORT</span> <i class="bi bi-chevron-down dropdown-indicator"></i></a>
|
|
<ul>
|
|
<li><a href="/index_intranet.php?view=export_customer">CUSTOMER DATA</a></li>
|
|
<li><a href="/index_intranet.php?view=export_oilhistory">OIL HISTORY DATA</a></li>
|
|
</ul>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
<li class="dropdown">
|
|
<a href="#"><span>REPORT</span> <i class="bi bi-chevron-down dropdown-indicator"></i></a>
|
|
<ul>
|
|
<li><a href="/index_intranet.php?view=report_expense">EXPENSE</a></li>
|
|
<li><a href="/index_intranet.php?view=report_iscccorsia">ISCC/CORSIA</a></li>
|
|
<li><a href="/index_intranet.php?view=report_yearly">YEARLY</a></li>
|
|
<li><a href="/index_intranet.php?view=report_monthly">MONTHLY</a></li>
|
|
<li><a href="/index_intranet.php?view=report_daily">DAILY</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<?php if ($isAdmin): ?>
|
|
<li class="dropdown">
|
|
<a href="#"><span>CONFIGURATION</span> <i class="bi bi-chevron-down dropdown-indicator"></i></a>
|
|
<ul>
|
|
<li><a href="/index_intranet.php?view=member_list">MEMBER</a></li>
|
|
<li><a href="/index_intranet.php?view=configure">CONFIGURATION</a></li>
|
|
</ul>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
<!-- User Info -->
|
|
<?php if ($isLogin): ?>
|
|
<a class="txt-user" data-toggle="modal" data-target="#member-detail-modal" style="cursor:pointer;">
|
|
User: <span class="txt-user-name"><?=htmlspecialchars($userName)?></span>
|
|
</a>
|
|
<a class="txt-logout" href="/lib/login_process.php?action=logout">Logout</a>
|
|
<?php endif; ?>
|
|
|
|
<!-- Mobile -->
|
|
<i class="mobile-nav-toggle mobile-nav-show bi bi-list"></i>
|
|
<i class="mobile-nav-toggle mobile-nav-hide d-none bi bi-x"></i>
|
|
|
|
</div>
|
|
</header>
|