77 lines
3.5 KiB
PHP
77 lines
3.5 KiB
PHP
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title><?= e($title ?? 'Office Canteen Lunch Hub') ?> - CanteenHub</title>
|
||
<link rel="stylesheet" href="/assets/css/style.css">
|
||
<!-- Alpine.js -->
|
||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.14.8/dist/cdn.min.js"></script>
|
||
</head>
|
||
<body>
|
||
|
||
<!-- Header Navigation -->
|
||
<header class="navbar">
|
||
<div class="navbar-container">
|
||
<a href="/" class="navbar-brand">
|
||
<div class="navbar-brand-icon">🍱</div>
|
||
<span>CanteenHub</span>
|
||
</a>
|
||
|
||
<?php if (\App\Core\Auth::check()): ?>
|
||
<?php $loggedUser = \App\Core\Auth::user(); ?>
|
||
<nav>
|
||
<ul class="nav-links">
|
||
<li><a href="/" class="nav-link <?= ($_SERVER['REQUEST_URI'] ?? '') === '/' ? 'active' : '' ?>">🍱 Active Sessions</a></li>
|
||
<li><a href="/sessions/create" class="nav-link <?= str_starts_with($_SERVER['REQUEST_URI'] ?? '', '/sessions/create') ? 'active' : '' ?>">➕ Start Session</a></li>
|
||
<li><a href="/sessions/history" class="nav-link <?= str_contains($_SERVER['REQUEST_URI'] ?? '', '/history') ? 'active' : '' ?>">📅 Archive</a></li>
|
||
<li><a href="/employees" class="nav-link <?= str_starts_with($_SERVER['REQUEST_URI'] ?? '', '/employees') ? 'active' : '' ?>">👥 Coworkers</a></li>
|
||
</ul>
|
||
</nav>
|
||
|
||
<div class="nav-actions">
|
||
<div style="display: flex; align-items: center; gap: 0.75rem;">
|
||
<div style="text-align: right; font-size: 0.85rem;">
|
||
<strong><?= e($loggedUser['name']) ?></strong>
|
||
<div style="color: var(--text-muted); font-size: 0.75rem;">@<?= e($loggedUser['username']) ?></div>
|
||
</div>
|
||
<form method="POST" action="/logout" style="display: inline;">
|
||
<?= \App\Core\View::csrfField() ?>
|
||
<button type="submit" class="btn btn-secondary btn-sm" style="color: var(--danger);">Logout</button>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<?php else: ?>
|
||
<div class="nav-actions">
|
||
<a href="/login" class="btn btn-secondary btn-sm">Login</a>
|
||
<a href="/register" class="btn btn-primary btn-sm">Register</a>
|
||
</div>
|
||
<?php endif; ?>
|
||
</div>
|
||
</header>
|
||
|
||
<!-- Main Content Body -->
|
||
<main class="main-container">
|
||
|
||
<!-- Flash Messages -->
|
||
<?php foreach (\App\Core\View::getFlashes() as $type => $messages): ?>
|
||
<?php foreach ($messages as $msg): ?>
|
||
<div class="alert alert-<?= $type === 'error' ? 'error' : 'success' ?>" x-data="{ show: true }" x-show="show">
|
||
<span><?= e($msg) ?></span>
|
||
<button type="button" @click="show = false" style="background:none; border:none; cursor:pointer; font-size:1.1rem; color:inherit;">×</button>
|
||
</div>
|
||
<?php endforeach; ?>
|
||
<?php endforeach; ?>
|
||
|
||
<?= $content ?>
|
||
|
||
</main>
|
||
|
||
<!-- Footer -->
|
||
<footer class="footer">
|
||
<p>© <?= date('Y') ?> CanteenHub • Zero Framework PHP • Native CSS & Alpine.js</p>
|
||
</footer>
|
||
|
||
</body>
|
||
</html>
|