<?php
session_start();
require_once '../config/database.php';
require_once '../includes/functions.php';

if (isset($_SESSION['user_id'])) {
    $pdo = getPDO();
    logAction($pdo, $_SESSION['user_id'], 'deconnexion_admin');
}
session_destroy();
header('Location: ../index.php');
exit;