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

dbconnect();
if(isset($_SESSION['admin_login'])) {
    insert_alast($_SERVER['REMOTE_ADDR'], $_SESSION['admin_login']);
    admin_online($_SESSION['admin_login'], '0');
    log_info($_SERVER['REMOTE_ADDR'], $_SESSION['admin_login'], $_SESSION['admin_login'], 'Admin Successfully Signed Out');
    session_destroy();
    unset($_SESSION['admin_login']);
    redirect(LOGIN);
} else {
    redirect(LOGIN);
}
?>