<?php
require_once dirname(__DIR__) . '/config.php';

header('Content-Type: application/json');

$user_id = $_SESSION['user_id'] ?? 0;
$version = $_GET['version'] ?? '';

if ($user_id <= 0 || empty($version)) {
    echo json_encode(['reminded' => false]);
    exit;
}

$reminded = $db->fetchOne("SELECT id FROM user_version_reminders WHERE user_id = $user_id AND version = '$version'");
echo json_encode(['reminded' => $reminded ? true : false]);
?>