<?php
require '../includes/db.php';
$template = $_GET['template'] ?? 'bill_of_lading';
$stmt = $pdo->prepare("SELECT name, label FROM bol_fields WHERE template = ? ORDER BY id");
$stmt->execute([$template]);
echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));
