Files
gravity/ส่งออกข้อมูลประชากร HOSxP/topbar.php
T
2026-09-16 23:20:08 +07:00

26 lines
2.2 KiB
PHP

<?php
$topbar_text = getSystemSetting('topbar_text', 'HOSxP Mapping Data');
$current_page = basename($_SERVER['PHP_SELF']);
?>
<nav class="bg-green-700 shadow-md">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex justify-between h-16">
<div class="flex items-center">
<img src="assets/img/logo.png" alt="Logo" class="h-11 w-11 mr-3 bg-white rounded-full p-0.5 object-contain" onerror="this.style.display='none'">
<span class="text-white font-semibold text-lg"><?php echo htmlspecialchars($topbar_text); ?></span>
</div>
<div class="flex items-center space-x-4">
<a href="index.php" class="<?php echo ($current_page == 'index.php') ? 'text-white bg-green-800' : 'text-green-200 hover:text-white'; ?> px-3 py-2 rounded-md text-sm font-medium">นำเข้าข้อมูล</a>
<a href="history.php" class="<?php echo ($current_page == 'history.php') ? 'text-white bg-green-800' : 'text-green-200 hover:text-white'; ?> px-3 py-2 rounded-md text-sm font-medium">ประวัติการทำงาน</a>
<a href="manual.php" class="<?php echo ($current_page == 'manual.php') ? 'text-white bg-green-800' : 'text-green-200 hover:text-white'; ?> px-3 py-2 rounded-md text-sm font-medium">คู่มือการใช้งาน</a>
<?php if (isset($_SESSION['is_admin']) && $_SESSION['is_admin'] === true): ?>
<a href="settings.php" class="<?php echo (in_array($current_page, ['settings.php', 'admins.php', 'profiles.php', 'system_logs.php', 'general_settings.php'])) ? 'text-white bg-green-800' : 'text-green-200 hover:text-white'; ?> px-3 py-2 rounded-md text-sm font-medium">ตั้งค่าระบบ</a>
<?php endif; ?>
<div class="border-l border-green-600 h-6 mx-2"></div>
<span class="text-green-100 text-sm">ผู้ใช้งาน: <?php echo htmlspecialchars($_SESSION['fullname'] ?? ''); ?></span>
<a href="logout.php" class="text-red-300 hover:text-red-100 text-sm font-medium ml-4">ออกจากระบบ</a>
</div>
</div>
</div>
</nav>