Commit 7b9f7368 authored by Administrator's avatar Administrator

Update 4 files via Son of Anton

parent af73d3c0
Pipeline #23 canceled with stage
This diff is collapsed.
......@@ -5,5 +5,6 @@ use Engine\Core\Container;
$router = Container::getInstance()->resolve(Engine\Core\Router::class);
// SSE stream — only auth middleware, NO CSRF, NO audit (would flood the audit trail)
$router->get('/sse/stream', Engine\RealTime\SSEController::class, 'stream')
->middleware([Middleware\AuthenticationMiddleware::class]);
\ No newline at end of file
This diff is collapsed.
<?php
/** @var array $user */
/** @var string $content */
$notifCount = $unread_count ?? 0;
?>
<!DOCTYPE html>
<html lang="en" data-theme="<?= $__engine->e($user['theme_preference'] ?? 'light') ?>">
<html lang="en" data-theme="<?= htmlspecialchars($user['theme_preference'] ?? 'light') ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= $__engine->yield('title', 'AL-ARCADE HR Platform') ?></title>
<?= $__engine->csrfMeta() ?>
<meta name="csrf_token" content="<?= htmlspecialchars($_SESSION['csrf_token'] ?? '') ?>">
<meta name="user-id" content="<?= (int)($user['id'] ?? 0) ?>">
<title>The Grind — AL-ARCADE HR</title>
<link rel="stylesheet" href="/assets/css/app.css">
<?= $__engine->yield('head') ?>
<link rel="stylesheet" href="/assets/css/dark-mode.css">
</head>
<body class="<?= $__engine->yield('body_class', '') ?>">
<?php if (isset($user) && $user): ?>
<nav class="top-nav">
<div class="nav-brand">
<a href="/dashboard">🎮 The Grind</a>
</div>
<div class="nav-search">
<body class="logged-in <?= ($user['theme_preference'] ?? '') === 'dark' ? 'dark-mode' : '' ?>">
<header class="top-nav">
<div class="nav-left">
<a href="/dashboard" class="nav-brand">🎮 <span>The Grind</span></a>
<div class="search-bar">
<input type="text" id="global-search" placeholder="Search... (Ctrl+K)" autocomplete="off">
</div>
<div class="nav-actions">
<button class="nav-btn" id="notif-bell" title="Notifications">
🔔 <span class="badge" id="notif-count" style="display:none">0</span>
</button>
<a href="/messages" class="nav-btn" title="Messages">💬</a>
<div class="nav-user">
<span><?= $__engine->e($user['full_name_en']) ?></span>
<span class="role-badge"><?= $__engine->e(ucfirst(str_replace('_', ' ', $user['role']))) ?></span>
</div>
<form action="/logout" method="POST" style="display:inline">
<input type="hidden" name="_csrf_token" value="<?= $__engine->e($_COOKIE['csrf_token'] ?? '') ?>">
<button type="submit" class="nav-btn" title="Logout">🚪</button>
</form>
</div>
</nav>
<?php if (isset($user['role']) && $user['role'] === 'contractor' && in_array($user['status'] ?? '', ['active','on_pip','suspended']) && isset($hud)): ?>
<div class="hud" id="salary-hud" data-color="<?= $__engine->e($hud['color_class'] ?? 'hud-healthy') ?>">
<div class="hud-primary">
<span class="hud-month">💰 <?= $__engine->e($hud['month_label'] ?? date('F Y')) ?></span>
<div class="hud-bar-container">
<div class="hud-bar" style="width: <?= min(100, max(0, $hud['retention_pct'] ?? 100)) ?>%"></div>
</div>
<span class="hud-amount">
EGP <?= number_format($hud['live_salary'] ?? 0, 0) ?> / <?= number_format($hud['actual_salary'] ?? 0, 0) ?>
</span>
</div>
<div class="nav-right">
<a href="/notifications" class="nav-icon" title="Notifications">
🔔
<span class="notification-badge notif-count" style="<?= $notifCount > 0 ? '' : 'display:none' ?>"><?= $notifCount ?></span>
</a>
<a href="/messages" class="nav-icon" title="Messages">💬</a>
<div class="nav-user">
<span class="nav-user-name"><?= htmlspecialchars($user['full_name_en'] ?? 'User') ?></span>
<span class="nav-user-role"><?= strtoupper(str_replace('_', ' ', $user['role'] ?? '')) ?></span>
</div>
<div class="hud-secondary">
<?php if (($hud['deduction_count'] ?? 0) > 0): ?>
<span class="hud-deductions"><?= $hud['deduction_count'] ?> deductions (-<?= number_format($hud['total_deductions'] ?? 0, 0) ?>)</span>
<?php endif; ?>
<?php if (($hud['bounty_count'] ?? 0) > 0): ?>
<span class="hud-bounties"><?= $hud['bounty_count'] ?> bounties (+<?= number_format($hud['total_bounties'] ?? 0, 0) ?>)</span>
<a href="/users/<?= (int)($user['id'] ?? 0) ?>" class="nav-avatar" title="Profile">
<?php if (!empty($user['profile_photo_id'])): ?>
<img src="/uploads/photos/<?= (int)$user['profile_photo_id'] ?>" alt="Profile">
<?php else: ?>
🧑
<?php endif; ?>
<span class="hud-health"><?= $hud['health']['icon'] ?? '🟢' ?> <?= $hud['health']['label'] ?? 'Healthy' ?></span>
</div>
</a>
</div>
<?php endif; ?>
</header>
<nav class="sidebar">
<ul>
<li><a href="/dashboard" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/dashboard') === 0 ? 'active' : '' ?>">📊 Dashboard</a></li>
<li><a href="/boards" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/boards') === 0 ? 'active' : '' ?>">📋 Boards</a></li>
<li><a href="/reports/submit" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/reports') === 0 ? 'active' : '' ?>">📝 Reports</a></li>
<li><a href="/users" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/users') === 0 ? 'active' : '' ?>">👥 Directory</a></li>
<li><a href="/messages" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/messages') === 0 ? 'active' : '' ?>">💬 Messages</a></li>
<li><a href="/notifications" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/notifications') === 0 ? 'active' : '' ?>">🔔 Notifications</a></li>
<?php if (in_array($user['role'] ?? '', ['super_admin', 'admin'])): ?>
<li class="sidebar-divider"></li>
<li><a href="/deductions" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/deductions') === 0 ? 'active' : '' ?>">⚠️ Deductions</a></li>
<li><a href="/payroll" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/payroll') === 0 ? 'active' : '' ?>">💰 Payroll</a></li>
<li><a href="/evaluations" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/evaluations') === 0 ? 'active' : '' ?>">📊 Evaluations</a></li>
<li><a href="/pips" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/pips') === 0 ? 'active' : '' ?>">📈 PIPs</a></li>
<li><a href="/invites" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/invites') === 0 ? 'active' : '' ?>">📨 Invites</a></li>
<li><a href="/analytics" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/analytics') === 0 ? 'active' : '' ?>">📈 Analytics</a></li>
<?php endif; ?>
<?php if (($user['role'] ?? '') === 'super_admin'): ?>
<li class="sidebar-divider"></li>
<li><a href="/control-panel" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/control-panel') === 0 ? 'active' : '' ?>">⚙️ Control Panel</a></li>
<li><a href="/settings" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/settings') === 0 ? 'active' : '' ?>">🔧 Settings</a></li>
<li><a href="/audit-trail" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/audit-trail') === 0 ? 'active' : '' ?>">📜 Audit Trail</a></li>
<li><a href="/api-keys" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/api-keys') === 0 ? 'active' : '' ?>">🔑 API Keys</a></li>
<li><a href="/webhooks" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/webhooks') === 0 ? 'active' : '' ?>">🔗 Webhooks</a></li>
<li><a href="/system-health" class="<?= strpos($_SERVER['REQUEST_URI'] ?? '', '/system-health') === 0 ? 'active' : '' ?>">🏥 System Health</a></li>
<?php endif; ?>
<li class="sidebar-divider"></li>
<li>
<form action="/logout" method="POST" style="margin:0">
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token'] ?? '') ?>">
<button type="submit" class="sidebar-link-btn">🚪 Logout</button>
</form>
</li>
</ul>
</nav>
<main class="main-content">
<?= $__engine->content() ?>
</main>
<?php else: ?>
<?= $__engine->content() ?>
<?php endif; ?>
<main class="main-content">
<?= $content ?? '' ?>
</main>
<div id="toast-container"></div>
<div id="search-modal" class="modal" style="display:none"></div>
<div id="notif-dropdown" class="dropdown" style="display:none"></div>
<div id="toast-container"></div>
<script src="/assets/js/app.js"></script>
<?= $__engine->yield('scripts') ?>
<script src="/assets/js/app.js"></script>
<?php if (isset($extra_js)): ?>
<?php foreach ((array)$extra_js as $js): ?>
<script src="<?= htmlspecialchars($js) ?>"></script>
<?php endforeach; ?>
<?php endif; ?>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment