From b2f0f050ef26bb63b491a0d721a22ba1a4e46726 Mon Sep 17 00:00:00 2001 From: "Chuck.D.Norris" Date: Tue, 17 Dec 2024 18:43:06 +0100 Subject: [PATCH] =?UTF-8?q?FUNCIONA=20CO=C3=91OOOO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/app/Controllers/Admin/EstadistiquesController.php | 5 ++--- app/src/app/Views/Admin/Grafics.php | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/app/Controllers/Admin/EstadistiquesController.php b/app/src/app/Controllers/Admin/EstadistiquesController.php index f8efc15..354ef74 100644 --- a/app/src/app/Controllers/Admin/EstadistiquesController.php +++ b/app/src/app/Controllers/Admin/EstadistiquesController.php @@ -12,20 +12,19 @@ public function index($queryParams = []) { // Obtenim les dades del model correcte $totalContractes = Contract::count(); - $totalTreeTypes = TreeType::count(); + $nomcontracts = Contract::findAll(); // Comprova si $grafiques és null i assegura't que sigui un array - $contracts = Contract::findAll(); // Renderitzem la vista amb les dades View::render([ 'view' => 'Admin/Grafics', 'title' => 'Grafiques', 'layout' => 'Admin/AdminLayout', - 'data' => ['totalContractes' => $totalContractes, 'totalTreeTypes' => $totalTreeTypes], + 'data' => ['totalContractes' => $totalContractes, 'nomsContractes' => $nomcontracts], ]); } } diff --git a/app/src/app/Views/Admin/Grafics.php b/app/src/app/Views/Admin/Grafics.php index c03b2c7..d637dd8 100644 --- a/app/src/app/Views/Admin/Grafics.php +++ b/app/src/app/Views/Admin/Grafics.php @@ -22,7 +22,10 @@ Seleccionar Contrato