86 lines
5.1 KiB
PHP
86 lines
5.1 KiB
PHP
<!-- Sidebar -->
|
|
<div class="bg-gray-800 text-white w-64 flex-shrink-0 flex flex-col hidden md:flex">
|
|
<div class="h-16 flex items-center justify-center border-b border-gray-700">
|
|
<h1 class="text-xl font-bold flex items-center">
|
|
<div class="shiny-logo mr-2">
|
|
<img src="assets/img/logo.png" alt="Logo" class="w-8 h-8 object-contain">
|
|
</div>
|
|
ระบบแจ้งเตือน
|
|
</h1>
|
|
</div>
|
|
|
|
<div class="flex-1 overflow-y-auto py-4">
|
|
<nav class="px-2 space-y-1">
|
|
<?php $currentPage = basename($_SERVER['PHP_SELF']); ?>
|
|
|
|
<a href="dashboard.php" class="<?= $currentPage == 'dashboard.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md">
|
|
<i class="fas fa-tachometer-alt mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
หน้าแรก (Dashboard)
|
|
</a>
|
|
|
|
<?php if (isAdmin()): ?>
|
|
<a href="assignments.php" class="<?= $currentPage == 'assignments.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md mt-1">
|
|
<i class="fas fa-tasks mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
จัดการงาน
|
|
</a>
|
|
|
|
<a href="users.php" class="<?= $currentPage == 'users.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md mt-1">
|
|
<i class="fas fa-users mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
จัดการผู้ใช้
|
|
</a>
|
|
|
|
<a href="settings.php" class="<?= $currentPage == 'settings.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md mt-1">
|
|
<i class="fas fa-cog mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
ตั้งค่าระบบ
|
|
</a>
|
|
<?php else: ?>
|
|
<a href="my_assignments.php" class="<?= $currentPage == 'my_assignments.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md mt-1">
|
|
<i class="fas fa-tasks mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
งานของฉัน
|
|
</a>
|
|
<?php endif; ?>
|
|
|
|
<div class="pt-4 mt-4 border-t border-gray-700"></div>
|
|
|
|
<a href="manual.php" class="<?= $currentPage == 'manual.php' ? 'bg-gray-900 text-white' : 'text-gray-300 hover:bg-gray-700 hover:text-white' ?> group flex items-center px-2 py-2 text-sm font-medium rounded-md">
|
|
<i class="fas fa-book mr-3 text-lg text-gray-400 group-hover:text-gray-300"></i>
|
|
คู่มือการใช้งาน
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<div class="p-4 border-t border-gray-700">
|
|
<div class="flex items-center">
|
|
<div>
|
|
<img class="inline-block h-9 w-9 rounded-full" src="https://ui-avatars.com/api/?name=<?= urlencode($_SESSION['name']) ?>&background=0D8ABC&color=fff" alt="">
|
|
</div>
|
|
<div class="ml-3">
|
|
<p class="text-sm font-medium text-white"><?= htmlspecialchars($_SESSION['name']) ?></p>
|
|
<p class="text-xs font-medium text-gray-400 group-hover:text-gray-300"><?= ucfirst($_SESSION['role']) ?></p>
|
|
</div>
|
|
</div>
|
|
<a href="logout.php" class="mt-4 block text-center bg-red-600 hover:bg-red-700 text-white py-2 px-4 rounded text-sm transition duration-150 ease-in-out">
|
|
<i class="fas fa-sign-out-alt mr-1"></i> ออกจากระบบ
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main Content wrapper -->
|
|
<div class="flex-1 flex flex-col overflow-hidden">
|
|
|
|
<!-- Mobile header -->
|
|
<div class="md:hidden bg-gray-800 text-white h-16 flex items-center justify-between px-4">
|
|
<h1 class="text-xl font-bold flex items-center">
|
|
<div class="shiny-logo mr-2">
|
|
<img src="assets/img/logo.png" alt="Logo" class="w-8 h-8 object-contain">
|
|
</div>
|
|
ระบบแจ้งเตือน
|
|
</h1>
|
|
<button id="mobile-menu-button" class="text-gray-300 hover:text-white focus:outline-none focus:text-white">
|
|
<i class="fas fa-bars text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Main content -->
|
|
<main class="flex-1 overflow-x-hidden overflow-y-auto bg-gray-100 p-6">
|