<?php
session_start();
include 'cfg.php';

if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['voucher_code'])) {
    $voucher_code = $_POST['voucher_code'];
    $is_winner_game = isset($_POST['is_winner']) ? (int)$_POST['is_winner'] : 0;
    
    $stmt = $pdo->prepare("UPDATE game_state SET game_over = 1 WHERE voucher_code = ?");
    $stmt->execute([$voucher_code]);
}
?>