<?php

    require "../config/configDB.php"; 
    session_start();
    $user_id = $_SESSION['user_id'];
    $sql_update = "UPDATE admin_login SET loginstatus='2' WHERE id='$user_id' ";

    mysqli_query($conn,$sql_update);

    mysqli_close($conn);
    
    session_destroy();
    
    unset($_SESSION['username'], $_SESSION['loggedin_time'],$_SESSION['user_id'],$_SESSION['login_status']);

    $url = "index.php";

	header("Location:$url");
    
?>