36352-vm/logout.php
Flatlogic Bot a2059511fc t4
2025-11-27 10:08:20 +00:00

19 lines
498 B
PHP

<?php
session_start();
require_once 'db/config.php';
if (isset($_SESSION['attendance_id'])) {
$db = db();
$logout_time = date('Y-m-d H:i:s');
$attendance_stmt = $db->prepare("UPDATE attendance SET logout_time = :logout_time WHERE id = :id");
$attendance_stmt->bindParam(':logout_time', $logout_time);
$attendance_stmt->bindParam(':id', $_SESSION['attendance_id']);
$attendance_stmt->execute();
}
session_unset();
session_destroy();
header("Location: login.php");
exit();