<?php
include 'config.php';

if (!isset($_SESSION['admin_logged_in']) && basename($_SERVER['PHP_SELF']) != 'login.php') {
    header("Location: login.php");
    exit();
}

if (isset($_SESSION['admin_logged_in'])) {
    $admin_id = $_SESSION['admin_id'];
    $result = $conn->query("SELECT * FROM dafdir_admin WHERE id = $admin_id");
    $admin = $result->fetch_assoc();
}
?>