<?php
// ============================
// Admin Authentication Check
// ============================

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// Redirect to login if not logged in as admin
if (!isset($_SESSION['admin_id'])) {
    header("Location: login.php");
    exit;
}