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

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['voucher_code'])) {
    $voucher_code = $_POST['voucher_code'];
    $stmt = $pdo->prepare("UPDATE vouchers SET is_winner = 1 WHERE code = ?");
    $stmt->execute([$voucher_code]);
}
?>