Step 2/4 - Choose your vote\n"; $result .= "

".$election["question"]."

\n"; $result .= "

Possible answers:

\n"; $result .= "
\n"; if ($choices_nb == 1) { $result .= "

\n"; foreach ($choices as $choice) { $checked = ""; if ($choice["id"] == $vote) { $checked = " checked=\"checked\""; } $result .= " ".$choice["choice"]."
\n"; } $result .= "

\n"; } else { $result .= "

\n"; foreach ($choices as $choice) { $checked = ""; if (in_array ($choice["id"], $votes_array)) { $checked = " checked=\"checked\""; } $result .= " ".$choice["choice"]."
\n"; } $result .= "

\n"; } $result .= "
\n"; if ($choices_nb > 1) $result .= "

You can choose up to ".$choices_nb." answers.

\n"; return $result; } ?>