setFlag("htmlonly"); } $f->display(); if ($menu==0) {// html only $f->displayStartContent(); }// db $sql= "select * from ".DB_PREFIXE."election where workflow LIKE 'Simulation' OR workflow LIKE 'Saisie' OR workflow LIKE 'Finalisation'"; $res=$f->db->query($sql); $f->isDatabaseError($res); while ($row =& $res->fetchRow(DB_FETCHMODE_ASSOC)) { $election = true; // election_unite $sql= "select candidat.libelle as candidat, election_resultat.resultat,election_unite.exprime as exprime, "; $sql .= " election_unite.votant as votant,election_unite.nul as nul,election_unite.blanc as blanc,election_unite.inscrit as inscrit "; $sql .= " from ".DB_PREFIXE."election_resultat "; $sql .= " left join ".DB_PREFIXE."election_unite on election_unite.election_unite=election_resultat.election_unite "; $sql .= " left join ".DB_PREFIXE."election_candidat on election_candidat.election_candidat=election_resultat.election_candidat "; $sql .= " inner join ".DB_PREFIXE."candidat on election_candidat.candidat=candidat.candidat "; $sql .= " where election_unite.election =".$row['election']; $sql .= " and election_unite.unite =".$idx; $res1=$f->db->query($sql); $f->isDatabaseError($res1); $i=0; while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)) { $existe = true; $i++; if ($i==1) { echo "
"; } if (! $election) { $msg = "Aucune élection en cours"; $f->displayMessage("Valid", $msg); } elseif (! $existe) { $msg = "Aucun résultat enregistré pour l'unite ".$idx; $f->displayMessage("Valid", $msg); } ?>