$error .= "The specified election/referendum does not exist.<br />\n";
$step = 0;
} else if (!elec_election_is_current ($election)) {
$error .= "The voting period for the specified ".elec_election_get_type ($election)." starts on ".$election["voting_start"]." (UTC) and ends on ".$election["voting_end"]." (UTC). It is not possible to vote now.<br />\n";
$error .= "The vote you made is not valid: ".$res."<br />\n";
$step = 2;
}
}
if ($step == 4) {
/* vote has been confirmed */
require ("include/step4-commit.php");
$result = step4_do ();
} else if ($step == 3) {
/* confirm vote */
require ("include/step3-confirm.php");
$result = step3_do ();
} else if ($step == 2) {
/* choose vote */
require ("include/step2-choose.php");
$result = step2_do ();
} else if ($step == 1) {
/* login */
require ("include/step1-login.php");
$result = step1_do ();
} else {
if (!isset ($error) || $error == "")
$error = "Unknown error.<br />\n";
}
if (isset ($handle))
elec_sql_close ($handle);
if (isset ($error) && $error != "") {
echo "<div class=\"error\">".$error."</div>\n";;
echo "<p>If you don't understand the error, you should probably contact the Membership and Elections Committee, which can be reached at <a href=\"mailto:elections@gnome.org\">elections@gnome.org</a>.</p>\n";