pearweb_election
[ class tree: pearweb_election ] [ index: pearweb_election ] [ all elements ]

Source for file dovote.tpl.php

Documentation is available at dovote.tpl.php

  1. <?php response_header('Vote :: ' . htmlspecialchars($info['purpose'])); ?>
  2. <?php
  3. if ($info['maximum_choices'] > 1) {
  4.     $inputtype = 'checkbox';
  5.     $inputname = 'vote[]';
  6.     if ($info['minimum_choices'] > 1) {
  7.         if ($info['minimum_choices'] != $info['maximum_choices']) {
  8.             $pleasechoose = 'from ' . $info['minimum_choices'] . ' to ' .
  9.                 $info['maximum_choices'] . ' choices';
  10.         } else {
  11.             $pleasechoose = 'exactly ' . $info['maximum_choices'] . ' choices';
  12.         }
  13.     } else {
  14.         if ($info['minimum_choices'] != $info['maximum_choices']) {
  15.             $pleasechoose = 'up to ' . $info['maximum_choices'];
  16.         } else {
  17.             $pleasechoose = 'exactly ' . $info['maximum_choices'] . ' choices';
  18.         }
  19.     }
  20. } else {
  21.     $inputtype = 'radio';
  22.     $inputname = 'vote';
  23.     $pleasechoose = 'one';
  24. }
  25. ?>
  26. <h1>Vote in PEAR Election :: <?php echo htmlspecialchars($info['purpose']); ?></h1>
  27.  
  28. <?php if (isset($error)): ?>
  29. <div class="errors"><?php echo $error; ?></div>
  30. <?php endif; // if (isset($error)): ?>
  31. <h2>Detail on the election</h2>
  32. <?php echo $info['detail']; ?>
  33. <h2>Please choose <?php echo $pleasechoose; ?>:</h2>
  34. <form action="/election/info.php" method="post">
  35. <input type="hidden" name="confirm" value="1" />
  36. <input type="hidden" name="election" value="<?php echo $info['id']; ?>" />
  37. <table>
  38.  <tr>
  39.   <td>
  40.    <?php foreach ($info['choices'] as $choice): ?>
  41.    <input type="<?php echo $inputtype; ?>" name="<?php echo $inputname; ?>" value="<?php echo $choice['choice']; ?>" id="<?php echo $inputname . $choice['choice'] ?>"/>
  42.    <label for="<?php echo $inputname . $choice['choice'] ?>"><?php echo htmlspecialchars($choice['summary']); ?></label> <a href="<?php echo $choice['summary_link']; ?>">(more info)</a><br />
  43.    <?php endforeach; // foreach ($info['choices'] as $choice): ?>
  44.   </td>
  45.  </tr>
  46. </table>
  47. <table border="0" width="400">
  48.  <tr>
  49.   <td><input type="submit" name="votesubmit" value="Vote" /></td>
  50.   <td align="center"><input type="submit" name="abstain" value="Abstain (pass)" /></td>
  51.  </tr>
  52. </table>
  53. </form>

Documentation generated on Mon, 11 Mar 2019 15:34:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.