<?php
session_start();

// Check if admin_id and username session variables are set
if (!isset($_SESSION['user_id']) || !isset($_SESSION['email'])) {
    // Redirect to index.php
    header("Location: index.php");
    exit; // Stop further execution
}

// If session variables are set, you can use them as needed in this file
$user_id = $_SESSION['user_id'];
$email = $_SESSION['email'];
$user_role = $_SESSION['role'];

// Other code here...
?>
