findById((int)($_POST['threadid'] ?? 0));
if (is_null($poll)) {
error(404, true);
}
if ($poll->isClosed()) {
error(403, true);
}
$vote = $poll->vote();
if (!isset($_POST['vote']) || !is_number($_POST['vote'])) {
?>
Please select an option.
addVote($Viewer->id(), $response)) {
error(0, true);
}
$vote = $poll->vote(); // need to refresh the results to take the vote into account
if ($response !== 0) {
$vote[$response]['answer'] = '=> ' . $vote[$response]['answer'];
}
?>
hasRevealVotes()) {
$staffVote = $poll->staffVote(new Gazelle\Manager\User);
foreach ($staffVote as $response => $info) {
if ($response !== 'missing') {
?>
- =empty($info['answer']) ? 'Abstain' : display_str($info['answer'])?> =
count ($info['who']) ? (" \xE2\x80\x93 " . implode(', ', array_map(fn($u) => $u->link(), $info['who']))) : "none"
?>
- Missing: = implode(', ', array_map(fn($u) => $u->link(), $staffVote['missing']['who'])) ?>
- =display_str($choice['answer'])?> (=number_format($choice['percent'], 2)?>%)
-
Votes: = number_format($poll->total()) ?>