Update: 2026-07-12 05:40:28

This commit is contained in:
Hamza-Ayed
2026-07-12 05:40:28 +03:00
parent 1fa517acc9
commit 24fb56f08f
75 changed files with 5051 additions and 9 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
// Admin/transit/org/admins_list.php — قائمة مشرفي مؤسسة (لفريق سيرو)
// POST/GET: org_id
require_once __DIR__ . '/../../../connect.php';
if ($role !== 'admin' && $role !== 'super_admin') {
jsonError('Unauthorized: Admin access required', 403);
}
try { $transit_con = Database::get('transit'); }
catch (Exception $e) { jsonError('Transit service unavailable', 503); }
$orgId = filterRequest('org_id', 'int');
if (!$orgId) jsonError('org_id is required', 400);
$st = $transit_con->prepare(
"SELECT id, name, phone, role, is_active, created_at
FROM transit_org_admins WHERE org_id=? ORDER BY created_at ASC"
);
$st->execute([$orgId]);
$admins = $st->fetchAll();
foreach ($admins as &$a) {
if (!empty($a['phone'])) {
$a['phone'] = $encryptionHelper->decryptData($a['phone']) ?: null;
}
}
unset($a);
jsonSuccess(['admins' => $admins]);