Dockplanner – patch (2025‑11‑17) Files included: - api/common/bootstrap_pdo.php - api/common/pdo.php - api/queue/count.php - api/booking/list_bookings.php - api/booking/sweep_expired.php Highlights: - Robust database bootstrap that accepts existing db.php/_db.php/_db_project.php and returns a PDO instance. Also installs JSON error handlers to prevent blank 500 responses. - queue/count: COUNT(DISTINCT) + explicit filters, always returns JSON. - list_bookings: safer mode handling and graceful handling when the hold table is missing. - sweep_expired: CREATE TABLE IF NOT EXISTS for archive + configurable threshold. How to apply: 1) Back up your current 'api' folder. 2) Copy the files from this zip over your current 'Dockplanner' directory (same structure). 3) Verify api/config.php contains the correct DB credentials for your server. 4) Hit: - /api/health.php - /api/queue/count.php?date=YYYY-MM-DD&flow=inbound - /api/booking/list_bookings.php?date=YYYY-MM-DD&mode=inbound - /api/booking/sweep_expired.php?date=YYYY-MM-DD&mode=inbound All should return JSON with ok=true.