From 9de4fba7e68baa4bfb21a72dcac8a305635d61d5 Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Tue, 30 Dec 2025 14:50:49 +0000 Subject: [PATCH] Charge --- .../ControleurAjaxgraphiquesinistres.php | 58 ++++++ Js/fonctions.js | 24 +++ Vue/Accueil/index.php | 156 +-------------- Vue/Ajaxgraphiquesinistres/index.php | 182 ++++++++++++++++++ Vue/gabarit.php | 2 +- 5 files changed, 271 insertions(+), 151 deletions(-) create mode 100755 Controleur/ControleurAjaxgraphiquesinistres.php create mode 100644 Vue/Ajaxgraphiquesinistres/index.php diff --git a/Controleur/ControleurAjaxgraphiquesinistres.php b/Controleur/ControleurAjaxgraphiquesinistres.php new file mode 100755 index 0000000..b80fbc5 --- /dev/null +++ b/Controleur/ControleurAjaxgraphiquesinistres.php @@ -0,0 +1,58 @@ +synthese = new Synthese(); + } + + public function index() { + + // Répartition sinistres + $claims = $this->synthese->getClaims(); + + $tabclaims = [ + 'claimsLabels' => array_column($claims, 'claimsLabels'), + 'claimsValues' => array_column($claims, 'claimsValues') + ]; + + $dataTabClaims = json_encode($tabclaims, JSON_NUMERIC_CHECK); + + + // Evolution des sinistres + $claimsMonth = $this->synthese->getClaimsMonth(); + $claimsSingleMonth = $this->synthese->getClaimsSingleMonth(); + + $tabclaimsMonth = [ + 'months' => array_column($claimsMonth, 'months'), + 'monthlyClaims' => array_column($claimsMonth, 'monthlyClaims'), + 'singleClaims' => array_column($claimsSingleMonth, 'singleClaims') + ]; + + $dataTabClaimsMonth = json_encode($tabclaimsMonth, JSON_NUMERIC_CHECK); + + // SINISTRALITÉ + $claimsLossRatio = $this->synthese->getClaimsLossRatio(); + + $tabLossRatio = [ + 'lossRatioLabels' => array_column($claimsLossRatio, 'months'), + 'lossRatioValues' => array_column($claimsLossRatio, 'ratio') + ]; + + $dataLossRatio = json_encode($tabLossRatio, JSON_NUMERIC_CHECK); + + $this->genererVueAjax( + array + ( + 'dataTabClaims' => $dataTabClaims, + 'dataTabClaimsMonth' => $dataTabClaimsMonth, + 'dataLossRatio' => $dataLossRatio + ) + ); + } +} diff --git a/Js/fonctions.js b/Js/fonctions.js index 2404060..4a1971f 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -803,4 +803,28 @@ function afficher_adherents_police() $("#div_liste_adherent").html(data); } }); +} + +function graphique_sinistre() +{ + $("#div_graphique").html(` +
+
+ Chargement... +
+

Affichage des graphiques en cours...

+
+ `); + + + $.ajax({ + url: $("#racineWeb").val()+"Ajaxgraphiquesinistres/", + type : 'post', + // data: donnees, + error: function(errorData) { + }, + success: function(data) { + $("#div_graphique").html(data); + } + }); } \ No newline at end of file diff --git a/Vue/Accueil/index.php b/Vue/Accueil/index.php index a97c776..15aa9ea 100644 --- a/Vue/Accueil/index.php +++ b/Vue/Accueil/index.php @@ -138,7 +138,11 @@
- + +
+
@@ -184,7 +188,7 @@
-

+

@@ -206,156 +210,8 @@
- - - - - - - - + + + + + + diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 9732711..d7fc924 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -599,7 +599,7 @@ $activeChildId = $menuData['child']; - +