Update: 2026-07-12 05:40:28
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// transit/org/browse.php — الراكب يتصفح المؤسسات المتاحة للتفعيل
|
||||
// POST: country?, type?, search?
|
||||
|
||||
require_once __DIR__ . '/../../transit/connect_app.php';
|
||||
|
||||
$country = filterRequest('country');
|
||||
$type = filterRequest('type');
|
||||
$search = filterRequest('search');
|
||||
|
||||
$where = "contract_status IN ('trial','active')";
|
||||
$params = [];
|
||||
|
||||
if ($country) { $where .= ' AND country = ?'; $params[] = strtoupper(substr($country, 0, 2)); }
|
||||
if ($type) { $where .= ' AND type = ?'; $params[] = $type; }
|
||||
if ($search) { $where .= ' AND (name_ar LIKE ? OR name_en LIKE ?)'; $params[] = "%$search%"; $params[] = "%$search%"; }
|
||||
|
||||
$st = $transit_con->prepare(
|
||||
"SELECT id, type, country, city, name_ar, name_en, logo_url
|
||||
FROM transit_orgs WHERE $where ORDER BY name_ar ASC LIMIT 200"
|
||||
);
|
||||
$st->execute($params);
|
||||
|
||||
jsonSuccess(['orgs' => $st->fetchAll()]);
|
||||
Reference in New Issue
Block a user