From 272404dac469736e24ae1226953101d511fabcd6 Mon Sep 17 00:00:00 2001 From: Vincent Calame Date: Wed, 8 Dec 2021 18:40:29 +0100 Subject: [PATCH] =?UTF-8?q?Erreur=20de=20calcul=20du=20total=20des=20?= =?UTF-8?q?=C3=A9v=C3=A8nements=20nationaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lef_fonctions.php | 6 +++++- modeles/agenda.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lef_fonctions.php b/lef_fonctions.php index f897d5b..0b68ca2 100644 --- a/lef_fonctions.php +++ b/lef_fonctions.php @@ -51,12 +51,16 @@ class LefPays { public function toArray() { $evenementsnationaux; + $totalevenementsnationaux = 0; if ($this->lieuxnationaux) { $evenementsnationaux = $this->lieuxnationaux->toArray(); + foreach($evenementsnationaux as $key => $array) { + $totalevenementsnationaux = $totalevenementsnationaux + count($array); + } } else { $evenementsnationaux = array(); } - return array("name" => $this->name, "code" => $this->code, "sousregions" => $this->regions, "evenementsnationaux" => $evenementsnationaux); + return array("name" => $this->name, "code" => $this->code, "sousregions" => $this->regions, "evenementsnationaux" => $evenementsnationaux, "totalevenementsnationaux" => $totalevenementsnationaux); } } diff --git a/modeles/agenda.html b/modeles/agenda.html index 30e479b..faaf895 100644 --- a/modeles/agenda.html +++ b/modeles/agenda.html @@ -2,7 +2,7 @@

#VALEUR{name}

-
[(#VALEUR{code}|=={internet}|?{'En ligne', 'À l’échelle nationale'})] ([(#VALEUR|count)]) +
[(#VALEUR{code}|=={internet}|?{'En ligne', 'À l’échelle nationale'})] ([(#VALEUR{totalevenementsnationaux})]) [
(#CLE)
]