<?php
session_start();
require_once __DIR__ . '/../includes/db.php';

ini_set('display_errors', 1);
error_reporting(E_ALL);

$id = $_GET['id'] ?? '';
if ($id === '') {
  header('Location: documents.php');
  exit;
}

$stmt = $pdo->prepare("DELETE FROM bol_values WHERE bol_id = ?");
$stmt->execute([$id]);

$stmt = $pdo->prepare("DELETE FROM bol_documents WHERE id = ?");
$stmt->execute([$id]);

header('Location: documents.php');
exit;
