findById((int)($_POST['threadid'] ?? 0));
if (is_null($poll)) {
Error404::error();
}
if ($poll->isClosed()) {
Error403::error();
}
$vote = $poll->vote();
if (!isset($_POST['vote']) || !is_number($_POST['vote'])) {
?>
Please select an option.
addVote($Viewer, $response)) {
Error400::error('Cannot add your vote to the poll');
}
$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 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()) ?>