Initial commit

This commit is contained in:
Porawit Dongwang
2026-09-16 23:20:08 +07:00
commit 0041668dbb
32577 changed files with 3687927 additions and 0 deletions
@@ -0,0 +1,21 @@
<?php
session_start();
require_once '../includes/db.php';
require_once '../includes/api_helper.php';
if (!isset($_SESSION['user_id'])) {
jsonResponse(false, 'Unauthorized', [], 401);
}
$vehicle_id = $_GET['vehicle_id'] ?? null;
if (!$vehicle_id) jsonResponse(false, 'Missing vehicle_id');
try {
$stmt = $pdo->prepare("SELECT * FROM vehicle_documents WHERE vehicle_id = ? ORDER BY id DESC");
$stmt->execute([$vehicle_id]);
$docs = $stmt->fetchAll(PDO::FETCH_ASSOC);
jsonResponse(true, 'Success', $docs);
} catch (PDOException $e) {
jsonResponse(false, 'DB Error: ' . $e->getMessage());
}
?>