<?php
session_start();

$admin_id = $_SESSION['admin_id'] ?? null;

if($admin_id){

    include __DIR__.'/../database/search_log_config.php';
    include __DIR__.'/includes/activity_logger.php';

    logActivity($log_conn, $admin_id, "Logged Out");
}

$_SESSION = [];
session_unset();
session_destroy();

header("Location: login.php");
exit;