<?php
declare(strict_types=1);

session_start();

require_once __DIR__.'/db.php';

if (empty($_SESSION['employee_id'])) {
    exit;
}

$pdo = db();

$employeeId = (int)$_SESSION['employee_id'];

try {

    $st = $pdo->prepare("
        UPDATE employees
        SET last_activity = NOW()
        WHERE id = ?
        LIMIT 1
    ");

    $st->execute([$employeeId]);

} catch (Throwable $e) {
}