Election", "saisie_bureau", "saisie", "ico_saisie.png" ); } // $ent = "-> Election"; $erreur = false; if (!isset ($_SESSION['election']['election']) or $_SESSION['election']['election'] == NULL) { $erreur = true; $message = "Vous ne travaillez sur aucune election !"; } else { $ent .= " -> ".$_SESSION['election']['date']; $ent .= " -> ".$_SESSION['election']['libelle']; } // $f->setTitle ($ent); $f->setFlag (NULL); $f->show (); // if ($erreur) { echo $message; die (); } // Ouverture du conteneur spécifique de la page echo "\n\t
\n\n"; // echo "

"; echo "Saisie"; echo "

\n"; // $etats = array(); $sql_etats = "select election, bureau, etat from resultat "; $sql_etats .= "where election like '".$_SESSION['election']['election']."%'"; $res_etats = $f->db->query ($sql_etats); $f->databaseError ($res_etats); while ($row_etats =& $res_etats->fetchRow (DB_FETCHMODE_ASSOC)) { // if (!isset ($etats [$row_etats['election']])) { $etats [$row_etats['election']] = array (); } // $etats [$row_etats['election']][$row_etats['bureau']] = $row_etats['etat']; } $res_etats->free (); // $centaine1 = false; if (isset ($etats [$_SESSION['election']['election']."C"]) and $f->hasRight ("saisie-centaine1")) { $centaine1 = true; } // $centaine2 = false; if (isset ($etats [$_SESSION['election']['election']."D"]) and $f->hasRight ("saisie-centaine2")) { $centaine2 = true; } // $definitifs = false; if (isset ($etats [$_SESSION['election']['election']]) and $f->hasRight ("saisie-definitifs")) { $definitifs = true; } // echo "\n"; // $odd = true; $election_option_publication = '0'; if ($definitifs) { // Récupération du champ election_option_publication de l'élection $sql = "select election_option_publication from election where election='" . $_SESSION['election']['election'] . "'"; $res = $f->db->query($sql); if (DB::isError($res)) { die ($res->getMessage().$sql); } else { $row =& $res->fetchRow(); $election_option_publication = $row[0]; } } foreach ($_SESSION['election']['bureaux'] as $key => $bureau) { // HEAD (repete toutes les 10 lignes) if ($key % 10 == 0) { echo ""; echo ""; echo ""; if ($centaine1) echo ""; if ($centaine2) echo ""; if ($definitifs) { echo ""; if ($election_option_publication === '1') { echo ""; } } echo "\n"; } // echo ""; // echo ""; echo ""; // if ($centaine1) { echo ""; } // if ($centaine2) { echo ""; } // if ($definitifs) { echo ""; if ($election_option_publication === '1') { $publication = array(); $sql_publication = "select election, bureau, etat, publication from resultat "; $sql_publication .= "where election = '" . $_SESSION['election']['election'] . "'"; $sql_publication .= "AND bureau = '" . $bureau['code'] . "'"; $res_publication = $f->db->query ($sql_publication); $f->databaseError ($res_publication); while ($row_publication =& $res_publication->fetchRow (DB_FETCHMODE_ASSOC)) { // if (isset($generation_bureau_erreur) === true and $generation_bureau_erreur === false) { if (preg_match ("@nonarrive@", $row_publication['etat'])) { $publication[$row_publication['election']][$row_publication['bureau']]['arrive'] = '0'; } elseif (preg_match ("@erreur@", $row_publication['etat'])) { $publication[$row_publication['election']][$row_publication['bureau']]['arrive'] = '0'; } else { $publication[$row_publication['election']][$row_publication['bureau']]['arrive'] = '1'; } } else { if (!preg_match ("@nonarrive@", $row_publication['etat'])) { $publication[$row_publication['election']][$row_publication['bureau']]['arrive'] = '1'; } else { $publication[$row_publication['election']][$row_publication['bureau']]['arrive'] = '0'; } } $publication[$row_publication['election']][$row_publication['bureau']]['publication'] = $row_publication['publication']; } // echo ""; } } // echo "\n"; // $odd = !$odd; } echo "\n"; echo "
NoBureau de vote1ere centaine2eme centaineDefinitifsPublication
"; echo $bureau['code']; echo ""; echo $bureau['lib']; echo ""; echo ""; echo $etats[$_SESSION['election']['election']."C"][$bureau['code']]; echo ""; echo ""; echo ""; echo $etats[$_SESSION['election']['election']."D"][$bureau['code']]; echo ""; echo ""; echo ""; echo $etats[$_SESSION['election']['election']][$bureau['code']]; echo ""; echo ""; $is_checked = ""; $is_disabled = ""; $election = $_SESSION['election']['election']; // Si le bureau est publié if (isset($publication[$election][$bureau['code']]['publication']) === true && $publication[$election][$bureau['code']]['publication'] === '1') { // $is_checked = "checked"; } // Si le bureau n'est pas publiable/dépubliable if (isset($publication[$election][$bureau['code']]['arrive']) === false || $publication[$election][$bureau['code']]['arrive'] === '0' || $f->hasRight ("publication") === false) { // $is_disabled = "disabled"; } echo ""; echo "
\n"; // Fermeture du conteneur spécifique de la page echo "\n\t
\n"; ?>