From 8357add7632bdbbbb3e6f4fc8feccbf7a246af5c Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Mon, 4 May 2026 00:09:02 +0300 Subject: [PATCH] Update: 2026-05-04 00:09:02 --- app/modules_app/companies/index.php | 6 ++++- public/shell.php | 39 ++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/modules_app/companies/index.php b/app/modules_app/companies/index.php index 9937c14..a6009cd 100644 --- a/app/modules_app/companies/index.php +++ b/app/modules_app/companies/index.php @@ -12,7 +12,11 @@ $db = Database::getInstance(); // 1. Super Admin sees ALL companies if ($decoded['role'] === 'super_admin') { - $stmt = $db->query("SELECT * FROM companies WHERE deleted_at IS NULL"); + $stmt = $db->prepare("SELECT c.*, t.name as tenant_name + FROM companies c + LEFT JOIN tenants t ON c.tenant_id = t.id + WHERE c.deleted_at IS NULL ORDER BY c.created_at DESC"); + $stmt->execute(); } // 2. Admin sees all companies in their tenant else if ($decoded['role'] === 'admin') { diff --git a/public/shell.php b/public/shell.php index 4ad9500..9e2bedd 100644 --- a/public/shell.php +++ b/public/shell.php @@ -54,20 +54,35 @@
-
-
-

إجمالي الفواتير

-

+ + +