Complete port of all 163 API endpoints from Lucee/CFML to PHP 8.3. Shared helpers in api/helpers.php (DB, auth, request/response, security). PDO prepared statements throughout. Same JSON response shapes as CFML.
20 lines
517 B
PHP
20 lines
517 B
PHP
<?php
|
|
require_once __DIR__ . '/../helpers.php';
|
|
runAuth();
|
|
|
|
try {
|
|
$rows = queryTimed("
|
|
SELECT tt_AddressTypeID AS ID, tt_AddressType AS Label
|
|
FROM tt_AddressTypes ORDER BY tt_AddressTypeID
|
|
", []);
|
|
|
|
$types = [];
|
|
foreach ($rows as $r) {
|
|
$types[] = ['ID' => (int) $r['ID'], 'Label' => $r['Label']];
|
|
}
|
|
|
|
jsonResponse(['OK' => true, 'TYPES' => $types]);
|
|
|
|
} catch (Exception $e) {
|
|
jsonResponse(['OK' => false, 'ERROR' => 'server_error', 'MESSAGE' => $e->getMessage()]);
|
|
}
|