<?php
include 'includes/db.php';

$member_id = $_POST['member_id'] ?? 0;

if (!$member_id) {
    http_response_code(400);
    echo "Missing member ID";
    exit;
}

mysqli_query($conn, "UPDATE members SET nfc_uid = NULL WHERE id = $member_id");
echo "Card unassigned successfully.";
