38474-vm/includes/header.php
Flatlogic Bot 980e61a17b sadiq
2026-02-17 08:20:26 +00:00

49 lines
2.3 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/../db/config.php';
require_once __DIR__ . '/auth.php'; // Ensure session is started and auth helpers are available
$projectTitle = "AFG_CARS - Supreme Automotive";
$projectDescription = "Elite car dealership management system. Premium marketplace, installments, and branch management.";
$current_page = basename($_SERVER['PHP_SELF']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?= htmlspecialchars($projectTitle) ?></title>
<meta name="description" content="<?= htmlspecialchars($projectDescription) ?>">
<link rel="stylesheet" href="assets/css/style.css?v=<?= time() ?>">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
<header>
<div class="logo">AFG_CARS<span>.</span></div>
<nav>
<ul>
<li><a href="index.php" <?= $current_page == 'index.php' ? 'class="active"' : '' ?>>Home</a></li>
<li><a href="marketplace.php" <?= $current_page == 'marketplace.php' ? 'class="active"' : '' ?>>Marketplace</a></li>
<li><a href="work.php" <?= $current_page == 'work.php' ? 'class="active"' : '' ?>>Work</a></li>
<li><a href="about.php" <?= $current_page == 'about.php' ? 'class="active"' : '' ?>>About</a></li>
<li><a href="contact.php" <?= $current_page == 'contact.php' ? 'class="active"' : '' ?>>Contact Us</a></li>
<?php if (isLoggedIn()): ?>
<?php
$dashboardLink = '/buyer/index.php'; // Default
if (isAdmin()) {
$dashboardLink = '/admin/index.php';
} elseif (isset($_SESSION['role']) && $_SESSION['role'] === 'Dealer') {
$dashboardLink = '/dealer/index.php';
}
?>
<li><a href="<?= $dashboardLink ?>" class="admin-link"><i class="fas fa-chart-line"></i> Dashboard</a></li>
<li><a href="/logout.php" class="admin-link"><i class="fas fa-sign-out-alt"></i> Logout</a></li>
<?php else: ?>
<li><a href="/login.php" class="admin-link"><i class="fas fa-user"></i> Login</a></li>
<?php endif; ?>
</ul>
</nav>
</header>