<?php
require_once __DIR__ . '/db.php';
header('Content-Type: application/json');

$d = json_decode(file_get_contents('php://input'), true);
if (!$d || empty($d['id'])) { echo json_encode(['ok'=>false,'error'=>'Missing id']); exit; }

$stmt = $pdo->prepare("DELETE FROM bol_fields WHERE id = ?");
$stmt->execute([(int)$d['id']]);

echo json_encode(['ok'=>true]);
