<?php
require_once '../config/database.php';

// Log logout activity if user is logged in
if (isset($_SESSION['admin_id'])) {
    logActivity($_SESSION['admin_id'], 'logout', 'Admin logged out');
}

// Enhanced session destruction
destroySession();

// Redirect to login page
header('Location: ../login.php?logout=1');
exit;
?>
