<?php

require_once __DIR__ . '/../app/config/config.php';
require_once __DIR__ . '/../app/config/database.php';
require_once __DIR__ . '/../app/helpers/functions.php';
require_once __DIR__ . '/../app/helpers/auth.php';
require_once __DIR__ . '/../app/helpers/activity.php';

$currentAdmin = admin();

if ($currentAdmin) {
    log_admin_activity(
        'admin_logout',
        'Admin logged out: ' . $currentAdmin['email']
    );
}

logout_admin();

redirect(ADMIN_URL . '/login.php');