[openresultat-Commits] r474 - in branches/2.x: . obj

0 views
Skip to first unread message

fray...@hephaestos.ovh.adullact.org

unread,
Jan 30, 2020, 4:17:19 AM1/30/20
to openmairie-...@googlegroups.com
Author: fraynaud
Date: 2020-01-30 10:17:18 +0100 (Thu, 30 Jan 2020)
New Revision: 474

Modified:
branches/2.x/HISTORY.txt
branches/2.x/obj/election_bureau.class.php
Log:
ajout affichage resultat dans election_bureau




Modified: branches/2.x/HISTORY.txt
===================================================================
--- branches/2.x/HISTORY.txt 2020-01-27 10:35:46 UTC (rev 473)
+++ branches/2.x/HISTORY.txt 2020-01-30 09:17:18 UTC (rev 474)
@@ -17,6 +17,13 @@
- dépouillement des centaines sur smartphone
- outil paramétrable d'extraction

+version 2.0.0b3 publiée le ---------------------------------------------
+
+(+) ajout de l'affichage des résultats des candidats dans election_bureau
+ (onglet bureau d'election) 30/01/2020 - fr
+
+
+
version 2.0.0b2 publiée le 27/01/2020 --------------------------------

Version publiée suite aux tests de janvier 2020

Modified: branches/2.x/obj/election_bureau.class.php
===================================================================
--- branches/2.x/obj/election_bureau.class.php 2020-01-27 10:35:46 UTC (rev 473)
+++ branches/2.x/obj/election_bureau.class.php 2020-01-30 09:17:18 UTC (rev 474)
@@ -692,8 +692,63 @@
}


+ // =================================================================
+ // affichage des resultats
+ // =================================================================


+ function afterSousFormSpecificContent() {
+ $maj=$this->getParameter("maj");
+ if($maj==3){
+ $election_bureau=$this->getVal('election_bureau');
+ echo "<div id=\"affichage_article\" class=\"formEntete ui-corner-all\">";
+ $this->affiche_data($election_bureau);
+ echo "</div>";
+ }
+ }

+ function affiche_data($election_bureau){
+ $sql = "select election_candidat.ordre, candidat.libelle, ";
+ $sql .= " election_resultat.resultat ";
+ $sql .= " from ".DB_PREFIXE."election_resultat ";
+ $sql .= " left join ".DB_PREFIXE."election_candidat on election_resultat.election_candidat=election_candidat.election_candidat " ;
+ $sql .= " left join ".DB_PREFIXE."candidat on candidat.candidat=election_candidat.candidat " ;
+ $sql .= " where election_resultat.election_bureau = ".$election_bureau;
+ $sql .= " order by election_candidat.ordre ";
+ $res=$this->db->query($sql);
+ if (database::isError($res))
+ die($res->getDebugInfo()." ".$sql);
+ else {
+ $temp = _("Liste des Candidats");
+ echo "<fieldset class=\"cadre ui-corner-all ui-widget-content\"><legend>".$temp."</legend>";
+ echo "<table class=\"tab-tab\">";
+ echo "<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">";
+ // affichage des entetes
+ echo "<th class=\"title\">"._("ordre")."</th>";
+ echo "<th class=\"title\">"._("candidat")."</th>";
+ echo "<th class=\"title\">"._("voix")."</th>";
+ echo "</tr>";
+ $i=0;
+ $oddeven=array("odd","even");
+ $exprime=0;
+ while ($line=$res->fetchrow(DB_FETCHMODE_ASSOC)) {
+ echo "<tr class=\"tab-data ".$oddeven[$i%2]."\">";
+ echo '<td>'.$line['ordre'].'</td>';
+ echo '<td>'.$line['libelle'].'</td>';
+ echo '<td style="text-align:right">'.$line['resultat'].'</td>';
+ echo "</tr>";
+ $exprime=$exprime+$line['resultat'];
+ $i++;
+ }
+ echo "<tr class=\"tab-data ".$oddeven[$i%2]."\">";
+ echo '<td></td><td>'._("Total exprime").'</td><td style="text-align:right">'.$exprime.'</td></tr>';
+ echo "</table>";
+ echo "</fieldset>";
+ }
+
+ }
+
+
+

}

Reply all
Reply to author
Forward
0 new messages