1
0
mirror of https://git.cant.at/Madeorsk/PollVerlaine synced 2024-12-22 22:47:55 +01:00
PollVerlaine/views/poll.php
Madeorsk 7b0a619b0e Multiple choices and redirections
+ Now possible to allow multiple choices;
* Add partial settings support;
* Fixed and moved some redirections to appropriate pages;
* CSS adjustments.
2018-08-16 14:09:37 +02:00

14 lines
655 B
PHP

<h1 class="poll"><?= $poll->title ?></h1>
<main>
<form action="/polls/<?= $poll->id ?>/vote" method="POST" id="poll">
<?php foreach ($poll->options as $id => $option): ?>
<div class="option">
<input type="<?= $poll->settings->multiple_choices ? "checkbox" : "radio" ?>" name="options[]" value="<?= $id ?>" id="option-<?= $id ?>" />
<label for="option-<?= $id ?>" class="check"></label>
<label for="option-<?= $id ?>"><?= $option->label ?></label>
</div>
<?php endforeach; ?>
<input type="submit" value="Vote" />
</form>
<a class="button margin" href="/polls/<?= $poll->id ?>/results">Jump to results</a>
</main>