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,20 @@
<?php
require_once '../includes/db.php';
require_once '../includes/api_helper.php';
try {
// Fetch unique brands
$stmtBrands = $pdo->query("SELECT DISTINCT brand FROM vehicles WHERE brand IS NOT NULL AND brand != '' ORDER BY brand");
$brands = $stmtBrands->fetchAll(PDO::FETCH_COLUMN);
// Fetch unique models
$stmtModels = $pdo->query("SELECT DISTINCT model FROM vehicles WHERE model IS NOT NULL AND model != '' ORDER BY model");
$models = $stmtModels->fetchAll(PDO::FETCH_COLUMN);
echo jsonResponse(true, 'Suggestions loaded', [
'brands' => $brands,
'models' => $models
]);
} catch (PDOException $e) {
echo jsonResponse(false, 'Database error: ' . $e->getMessage());
}