إجمالي الفواتير
- + +إجمالي فواتير المنصة
+ +المكاتب النشطة
+ +قيد المعالجة
- + + + +إجمالي الفواتير
+ +قيد المعالجة
+ +تم الاعتماد
+ +تم الاعتماد
- -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 @@
إجمالي الفواتير
- + +إجمالي فواتير المنصة
+ +المكاتب النشطة
+ +قيد المعالجة
- + + + +إجمالي الفواتير
+ +قيد المعالجة
+ +تم الاعتماد
+ +تم الاعتماد
- -