<?php
session_start();
include('includes/config.php');

date_default_timezone_set('Asia/Kolkata');

if (isset($_SESSION['primaryID'])) {
    $logoutTime = date('Y-m-d H:i:s');
    $sql = "UPDATE tblstudentlogs SET logoutTime = :logoutTime WHERE id = :primaryID";
    $query = $dbh->prepare($sql);
    $query->bindParam(':logoutTime', $logoutTime);
    $query->bindParam(':primaryID', $_SESSION['primaryID'], PDO::PARAM_INT);
    $query->execute();
}
?>


