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

dbconnect();
if(isset($_SESSION['user_login'])) {
    insert_last($_SERVER['REMOTE_ADDR'], $_SESSION['user_login']);
    online_status($_SESSION['user_login'], '0');
    log_info($_SERVER['REMOTE_ADDR'], $_SESSION['user_login'], $_SESSION['user_login'], 'User Successfully Signed Out');
    session_destroy();
    unset($_SESSION['user_login']);
    unset($_SESSION['user_number']);
    redirect(LOGIN);
} else {
    redirect(LOGIN);
}
?>
