Update: 2026-07-25 18:40:38
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
// Admin/v2/quality/blacklist_manager.php
|
||||
require_once __DIR__ . '/../../../connect.php';
|
||||
require_once __DIR__ . '/../../../encrypt_decrypt.php';
|
||||
require_once __DIR__ . '/../security/audit_logs_helper.php'; // إذا كان متاحاً، وإلا سننفذ الإدخال مباشرة
|
||||
|
||||
if ($role !== 'admin' && $role !== 'super_admin') {
|
||||
jsonError("Unauthorized", 403);
|
||||
|
||||
@@ -10,7 +10,22 @@ if ($role !== 'admin' && $role !== 'super_admin') {
|
||||
|
||||
$driver_id = filterRequest('driver_id');
|
||||
if (!$driver_id) {
|
||||
jsonError("Missing driver_id", 400);
|
||||
try {
|
||||
$stmt = $con->prepare("SELECT id, first_name, last_name, phone, status FROM driver ORDER BY id DESC LIMIT 20");
|
||||
$stmt->execute();
|
||||
$drivers = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach ($drivers as &$d) {
|
||||
if (!empty($d['first_name'])) $d['first_name'] = $encryptionHelper->decryptData($d['first_name']) ?: $d['first_name'];
|
||||
if (!empty($d['last_name'])) $d['last_name'] = $encryptionHelper->decryptData($d['last_name']) ?: $d['last_name'];
|
||||
if (!empty($d['phone'])) $d['phone'] = $encryptionHelper->decryptData($d['phone']) ?: $d['phone'];
|
||||
}
|
||||
unset($d);
|
||||
jsonSuccess($drivers);
|
||||
exit;
|
||||
} catch (Throwable $e) {
|
||||
jsonSuccess([]);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user