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

Source for file new-step2.tpl.php

Documentation is available at new-step2.tpl.php

  1. <?php
  2. response_header('Election :: ' ucfirst($new));
  3. ?>
  4. <h1><?php echo ucfirst($new?> Election [Step 2]</h1>
  5. <?php
  6. if ($error{
  7.     foreach ($error as $err{
  8.         echo '<div class="errors">' htmlspecialchars($err'</div>';
  9.     }
  10. }
  11. ?>
  12. <form name="newelection" action="/election/<?php echo $new ?>.php" method="post">
  13. <input type="hidden" name="step" value="3" />
  14. <?php if ($new == 'edit')?>
  15. <input type="hidden" name="election_id" value="<?php echo $election_id ?>" />
  16. <?php endif; // if ($new == 'edit'): ?>
  17. <input type="hidden" name="choices" value="<?php echo $info['choices'?>" />
  18.  <table>
  19.  <?php for ($i = 1; $i <= $info['choices']$i++)?>
  20.   <tr>
  21.    <th class="form-label_left">Choice #<?php echo $i ?></th>
  22.    <td class="form-input">
  23.     Summary:<br /><input name="summary<?php echo $i ?>" value="<?php echo htmlspecialchars($info['summary' $i]?>" size="100" maxlength="100" /><br />
  24.     Link to more info:<br /><input name="summary_link<?php echo $i ?>" value="<?php echo htmlspecialchars($info['summary_link' $i]?>" size="100" maxlength="255" />
  25.    </td>
  26.   </tr>
  27.  <?php endfor; // for ($i = 1; $i < $info['choices']; $i++): ?>
  28.   <tr>
  29.    <td colspan="2">
  30.     <input type="submit" name="add1choice" value="Add another choice" />
  31.     <?php if ($info['choices'> 2)?>
  32.     <input type="submit" name="delete1choice" value="Remove last choice" />
  33.     <?php endif; ?>
  34.    </td>
  35.   </tr>
  36.   <tr>
  37.    <th class="form-label_left" colspan="2">Entered data (can be edited later)</th>
  38.   </tr>
  39.   <tr>
  40.    <th class="form-label_left">Eligible Voters</th>
  41.    <td class="form-input">
  42.     <input type="hidden" name="eligiblevoters" value="<?php echo $info['eligiblevoters'?>" />
  43.     <?php if ($info['eligiblevoters'== 1{
  44.         echo 'PEAR Developers';
  45. else {
  46.         echo 'General PHP Public';
  47. ?>
  48.    </td>
  49.   </tr>
  50.   <tr>
  51.    <th class="form-label_left">Election Purpose</th>
  52.    <td class="form-input">
  53.     <input type="hidden" name="purpose" value="<?php echo htmlspecialchars($info['purpose'])?>" />
  54.     <?php echo htmlspecialchars($info['purpose']?>
  55.    </td>
  56.   </tr>
  57.   <tr>
  58.    <th class="form-label_left">Election detail</th>
  59.    <td class="form-input">
  60.     <input type="hidden" name="detail" value="<?php echo htmlspecialchars($info['detail'])?>" />
  61.     <?php echo htmlspecialchars($info['detail']?>
  62.    </td>
  63.   </tr>
  64.   <tr>
  65.    <th class="form-label_left">Election start date</th>
  66.    <td class="form-input">
  67.     <input type="hidden" name="year" value="<?php echo date('Y'strtotime($info['year'])) ?>" />
  68.     <input type="hidden" name="month" value="<?php echo date('m'strtotime($info['year''-' $info['month''-' $info['day'])) ?>" />
  69.     <input type="hidden" name="day" value="<?php echo date('d',
  70.         strtotime($info['year''-' $info['month''-' $info['day']))?>" />
  71.     <?php echo $info['year''-' $info['month''-' $info['day'?>
  72.    </td>
  73.   </tr>
  74.   <tr>
  75.    <th class="form-label_left">Length of election in days</th>
  76.    <td class="form-input">
  77.     <input type="hidden" name="length" value="<?php echo $info['length'?>" />
  78.     <?php echo $info['length']?>
  79.    </td>
  80.   </tr>
  81.   <tr>
  82.    <th class="form-label_left">Minimum votes needed</th>
  83.    <td class="form-input">
  84.     <input type="hidden" name="minimum" value="<?php echo $info['minimum'?>" />
  85.     <?php echo $info['minimum'?>
  86.    </td>
  87.   </tr>
  88.   <tr>
  89.    <th class="form-label_left">Maximum votes allowed</th>
  90.    <td class="form-input">
  91.     <input type="hidden" name="maximum" value="<?php echo $info['maximum'?>" />
  92.     <?php echo $info['maximum'?>
  93.    </td>
  94.   </tr>
  95.  </table>
  96.  <input type="submit" name="newelection" value="Save Election" />
  97. </form>
  98. <?php response_footer();

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