<?php
require_once("../includes/session.php");
require_once("../includes/config.php");

header('Content-Type: application/json');

$id = intval($_GET['id'] ?? 0);

$rec = mysqli_fetch_assoc(mysqli_query($ahk_conn, "SELECT vehicle_photo FROM puc_requests WHERE id=$id"));

if ($rec && !empty($rec['vehicle_photo'])) {
    echo json_encode(['success' => true, 'photo' => $rec['vehicle_photo']]);
} else {
    echo json_encode(['success' => false]);
}
?>