<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Set session maximum lifetime to 8 hours (28800 seconds)
ini_set('session.gc_maxlifetime', 28800);

// Start the session
session_start();

if (!isset($_SESSION['admin']) && !isset($_SESSION['user']) && !isset($_SESSION['office']) && basename($_SERVER['PHP_SELF']) != 'login.php') {
    // Redirect to the login page
    header("Location: login.php");
    exit(); // Stop executing the script
}
?>




