<?php
session_start();
require_once 'config/db.php';
$page = $_GET['page'] ?? '';
if ($page === 'login') {
    include_once __DIR__ . '/modules/login.php';
    exit;
}
if ($page === 'register') {
    include_once __DIR__ . '/modules/register.php';
    exit;
}
if ($page === 'logout') {
    session_destroy();
    header('Location: index.php');
    exit;
}
if (in_array($page, ['strategic_planning', 'competitor_review', 'site_evaluation', 'update_database'])) {
    $modFile = __DIR__ . '/modules/' . $page . '.php';
    if (file_exists($modFile)) {
        include_once $modFile;
    } else {
        echo '<div class="container mt-5"><div class="alert alert-danger">Module not found: ' . htmlspecialchars($page) . '</div></div>';
    }
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <style>
      body, html, .container, .card, .modal-content, .table, .form-control, .btn, .modal-title, .fw-bold, .text-primary, .text-light {
        font-family: 'Arial Unicode MS', Arial, Helvetica, sans-serif !important;
      }
    </style>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OOH Management :: Anh Tran</title>
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body style="margin:0;padding:0;">
    <?php require_once __DIR__ . '/modules/navbar.php'; ?>
    <div style="width:100vw;height:90vh;background:url('https://images.unsplash.com/photo-1464983953574-0892a716854b?auto=format&fit=crop&w=1500&q=80') center center/cover no-repeat;display:flex;align-items:center;justify-content:center;">
        <div style="background:rgba(0,0,0,0.5);padding:40px 60px;border-radius:16px;">
            <h1 class="display-4 mb-4 text-white text-center">Welcome to OOH Project Management</h1>
            <p class="lead text-white text-center">Manage your Out-of-Home advertising assets with ease and style.</p>
        </div>
    </div>
</body>
</html>
