From 5fceb9110f058b875a0571f0d96e28db0d1bb3e2 Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Wed, 29 Apr 2026 10:01:26 +0000 Subject: [PATCH] dert --- Controleur/ControleurAjaxsppolice.php | 9 ++++++--- Modele/Police.php | 10 ++++++++++ Vue/Ajaxsppolice/categorie.php | 5 ++++- Vue/Ajaxsppolice/college.php | 5 ++++- Vue/Ajaxsppolice/police.php | 22 ++++++++++++++++++++-- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/Controleur/ControleurAjaxsppolice.php b/Controleur/ControleurAjaxsppolice.php index ce13821..bfd3bdc 100644 --- a/Controleur/ControleurAjaxsppolice.php +++ b/Controleur/ControleurAjaxsppolice.php @@ -22,8 +22,9 @@ class ControleurAjaxsppolice extends Controleur $dj = date("Y-m-d"); $sppolice = $this->sppolice->getRapportSpPolicePol($idPolice, $dj); + $limiteConsommation = get_limite_consommation_police($idPolice); - $this->genererVueAjax(array('sppolice' => $sppolice)); + $this->genererVueAjax(array('sppolice' => $sppolice, 'limiteConsommation' => $limiteConsommation)); } public function categorie() @@ -33,8 +34,9 @@ class ControleurAjaxsppolice extends Controleur $dj = date("Y-m-d"); $sppolices = $this->sppolice->getRapportSpPoliceCat($idPolice, $dj); + $limiteConsommation = get_limite_consommation_police($idPolice); - $this->genererVueAjax(array('sppolices' => $sppolices)); + $this->genererVueAjax(array('sppolices' => $sppolices, 'limiteConsommation' => $limiteConsommation)); } public function college() @@ -44,7 +46,8 @@ class ControleurAjaxsppolice extends Controleur $dj = date("Y-m-d"); $sppolices = $this->sppolice->getRapportSpPoliceCol($idPolice, $dj); + $limiteConsommation = get_limite_consommation_police($idPolice); - $this->genererVueAjax(array('sppolices' => $sppolices)); + $this->genererVueAjax(array('sppolices' => $sppolices, 'limiteConsommation' => $limiteConsommation)); } } \ No newline at end of file diff --git a/Modele/Police.php b/Modele/Police.php index a2bf386..8205801 100644 --- a/Modele/Police.php +++ b/Modele/Police.php @@ -981,4 +981,14 @@ class Police extends Modele { return $liste->fetch(PDO::FETCH_ASSOC); } + + public function get_limite_consommation_police($idPolice) + { + $sql = 'SELECT fn_limite_consommation_police(?) AS limite_consommation'; + $resultat = $this->executerRequete($sql, array($idPolice)); + + $ligne = $resultat->fetch(PDO::FETCH_ASSOC); + + return $ligne['limite_consommation']; + } } \ No newline at end of file diff --git a/Vue/Ajaxsppolice/categorie.php b/Vue/Ajaxsppolice/categorie.php index 0c7e5bb..7a9af20 100644 --- a/Vue/Ajaxsppolice/categorie.php +++ b/Vue/Ajaxsppolice/categorie.php @@ -15,7 +15,9 @@ + "0") : ?> + @@ -46,10 +48,11 @@
- + "0") : ?> nettoyer($sppolice['rapportspgeneral']) ?> % + diff --git a/Vue/Ajaxsppolice/college.php b/Vue/Ajaxsppolice/college.php index 0ea1298..9807e50 100644 --- a/Vue/Ajaxsppolice/college.php +++ b/Vue/Ajaxsppolice/college.php @@ -15,7 +15,9 @@ + "0") : ?> + @@ -50,10 +52,11 @@ - + "0") : ?> nettoyer($sppolice['rapportspgeneral']) ?>% + diff --git a/Vue/Ajaxsppolice/police.php b/Vue/Ajaxsppolice/police.php index b70b63f..e17035c 100644 --- a/Vue/Ajaxsppolice/police.php +++ b/Vue/Ajaxsppolice/police.php @@ -39,12 +39,11 @@
+ "0") : ?>
80 ? 'danger' : ($sp_acquis > 60 ? 'warning' : 'success'); - - $limiteConsommation = $sppolice['limiteConsommation']; ?>
@@ -72,6 +71,25 @@
+ +
+ 80 ? 'danger' : ($sp_acquis > 60 ? 'warning' : 'success'); + ?> +
+
+
+
+

nettoyer($sppolice['rapportsp']) ?> %

+
+
+ +
+
+
+
+