62 lines
2.6 KiB
PHP
62 lines
2.6 KiB
PHP
<?php
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
require_once __DIR__ . '/../db/config.php';
|
|
|
|
$projectName = $_SERVER['PROJECT_NAME'] ?? 'AfgCars 2026';
|
|
$projectDesc = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Premium Car Marketplace Afghanistan';
|
|
|
|
// Get current page for active link
|
|
$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><?php echo htmlspecialchars($projectName); ?> | <?php echo htmlspecialchars($title ?? 'Premium Car Marketplace'); ?></title>
|
|
|
|
<!-- Meta Data -->
|
|
<meta name="description" content="<?php echo htmlspecialchars($projectDesc); ?>">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/style.css?v=<?php echo time(); ?>">
|
|
|
|
<!-- Hero / SEO Meta -->
|
|
<?php if (isset($_SERVER['PROJECT_IMAGE_URL'])): ?>
|
|
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL']); ?>">
|
|
<meta name="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL']); ?>">
|
|
<?php endif; ?>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="bg-hero"></div>
|
|
|
|
<nav class="navbar">
|
|
<div class="container">
|
|
<a href="index.php" class="logo">
|
|
<span>AFG</span> CARS
|
|
</a>
|
|
|
|
<ul class="nav-links">
|
|
<li><a href="index.php" <?php echo $current_page == 'index.php' ? 'class="active"' : ''; ?>>Home</a></li>
|
|
<li><a href="cars.php" <?php echo $current_page == 'cars.php' ? 'class="active"' : ''; ?>>Marketplace</a></li>
|
|
<li><a href="about.php" <?php echo $current_page == 'about.php' ? 'class="active"' : ''; ?>>About</a></li>
|
|
<li><a href="contact.php" <?php echo $current_page == 'contact.php' ? 'class="active"' : ''; ?>>Contact</a></li>
|
|
</ul>
|
|
|
|
<div class="nav-auth">
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<a href="user/dashboard.php" class="btn btn-outline">Dashboard</a>
|
|
<a href="logout.php" class="btn btn-primary">Logout</a>
|
|
<?php else: ?>
|
|
<a href="login.php" class="btn btn-outline">Login</a>
|
|
<a href="register.php" class="btn btn-primary">Register</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<main>
|