Update: 2026-05-04 00:27:42

This commit is contained in:
Hamza-Ayed
2026-05-04 00:27:42 +03:00
parent cd85fcf2bd
commit b4ac1e8775
3 changed files with 117 additions and 100 deletions

View File

@@ -14,15 +14,20 @@ if ($decoded['role'] !== 'super_admin') {
$db = Database::getInstance();
$stmt = $db->query("SELECT id, name, email, phone, status, created_at FROM tenants ORDER BY created_at DESC");
$tenants = $stmt->fetchAll();
try {
$stmt = $db->query("SELECT id, name, email, phone, status, created_at FROM tenants ORDER BY created_at DESC");
$tenants = $stmt->fetchAll();
foreach ($tenants as &$t) {
$decName = \App\Core\Encryption::decrypt($t['name']);
$t['name'] = $decName !== false ? $decName : $t['name'];
foreach ($tenants as &$t) {
$decName = \App\Core\Encryption::decrypt($t['name']);
$t['name'] = $decName !== false ? $decName : $t['name'];
$decEmail = \App\Core\Encryption::decrypt($t['email']);
$t['email'] = $decEmail !== false ? $decEmail : $t['email'];
$decEmail = \App\Core\Encryption::decrypt($t['email']);
$t['email'] = $decEmail !== false ? $decEmail : $t['email'];
}
json_success($tenants);
} catch (\Exception $e) {
json_error('SQL Error in Tenants List: ' . $e->getMessage(), 500);
}
json_success($tenants);