Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. include('inc/inc.php');
  3. if (!$user->loggedin()) {
  4. header('Location: /login.php');
  5. die();
  6. }
  7. if (!$user->voterId()) {
  8. header('Location: /login.php?denied');
  9. die();
  10. }
  11. $header = new Header("Michigan Flyers Election");
  12. $header->addStyle("/styles/style.css");
  13. $header->addScript("/js/jquery-1.11.3.min.js");
  14. $header->addScript("/js/search.js");
  15. $header->setAttribute('title', 'Michigan Flyers');
  16. $header->setAttribute('tagline', 'Online Ballot');
  17. $header->output();
  18. $candidates = $db->fetchAssoc('select skymanager_id, name, username, md5(coalesce(email, "")) as `gravatar_hash` from members where voting_id is not null');
  19. $votes = $db->fetchAssoc("select position from votes where member_id={$user->voterId()}");
  20. $position = $db->fetchRow("select position as code, description as label from positions where active<>0 limit 1");
  21. foreach ($votes as &$vote) {
  22. $vote = $vote['position'];
  23. }
  24. unset($vote);
  25. ?>
  26. <?php if (empty($position)): ?>
  27. <h3>There are no active votes. Reload this page once voting starts.</h3>
  28. <?php else: ?>
  29. <script type="text/javascript">
  30. var candidates = <?= json_encode($candidates); ?>;
  31. </script>
  32. <form action="vote.php" method="POST">
  33. <div class="form-row">
  34. <div class="selector">
  35. <label class="radio">
  36. <input type="radio" id="vote-<?= $position['code']; ?>" name="ballot"
  37. value="<?= $position['code']; ?>" checked />
  38. <span class="radio-button-label"><?= $position['label'] ?></span>
  39. </label>
  40. </div>
  41. </div>
  42. <div class="form-row">
  43. <input type="text" placeholder="Candidate Search" id="searchbox" name="searchbox" value="" />
  44. <div id="results"></div>
  45. <input type="hidden" name="candidate" id="candidate-input" value="0" />
  46. <div id="selectedCandidate" class="selected candidate">
  47. <span class="placeholder">No Candidate Selected</span>
  48. </div>
  49. </div>
  50. <div class="form-row">
  51. <input class="submit" type="submit" name="submit" value="Submit Ballot" />
  52. </div>
  53. </form>
  54. <?php
  55. endif;
  56. $footer = new Footer();
  57. $footer->output();