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

Source for file new-step1.tpl.php

Documentation is available at new-step1.tpl.php

  1. <?php
  2. response_header('Election :: ' ucfirst($new));
  3. ?>
  4. <h1><?php echo ucfirst($new?> Election [Step 1]</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="2" />
  14. <?php if ($new == 'edit')?>
  15. <input type="hidden" name="election_id" value="<?php echo $election_id ?>" />
  16. <?php endif; // if ($new == 'edit'): ?>
  17.  <table>
  18.   <tr>
  19.    <th class="form-label_left" colspan="2">(All entries are required)</th>
  20.   </tr>
  21.   <tr>
  22.    <th class="form-label_left">Eligible Voters</th>
  23.    <td class="form-input">
  24.     <select name="eligiblevoters">
  25.     <?php
  26.      if ($info['eligiblevoters'== '1'{
  27.          $ev1 ' selected="true"';
  28.          $ev2 '';
  29.      else {
  30.          $ev2 ' selected="true"';
  31.          $ev1 '';
  32.      }
  33.     ?>
  34.      <option value="1"<?php echo $ev1 ?>>PEAR Developers</option>
  35.      <option value="2"<?php echo $ev2 ?>>General PHP Public</option>
  36.     </select>
  37.    </td>
  38.   </tr>
  39.   <tr>
  40.    <th class="form-label_left">Election Purpose (summary)</th>
  41.    <td class="form-input">
  42.     <input type="text" name="purpose" size="100" maxlength="100" value="<?php
  43.         echo htmlspecialchars($info['purpose']?>" />
  44.    </td>
  45.   </tr>
  46.   <tr>
  47.    <th class="form-label_left">Number of items to choose from (items created in step 2)</th>
  48.    <td class="form-input">
  49.     <select name="choices">
  50. <?php
  51.     for ($i = 2; $i <= 20; $i++{
  52.         if ($info['choices'== $i{
  53.             $sel ' selected="selected"';
  54.         else {
  55.             $sel '';
  56.         }
  57.         echo '    <option' $sel '>' $i '</option>' "\n";
  58.     ?>
  59.     </select>
  60.    </td>
  61.   </tr>
  62.   <tr>
  63.    <th class="form-label_left">Election detail (wiki markup)</th>
  64.    <td class="form-input">
  65.     <textarea name="detail" rows="20" cols="75"><?php echo $info['detail'?></textarea>
  66.    </td>
  67.   </tr>
  68.   <tr>
  69.    <th class="form-label_left">Election start date <?php if ($new == 'new')?>
  70.    (must be at least 30 days from now)
  71.    <?php endif; // if ($new == 'new') ?>
  72.    </th>
  73.    <td class="form-input">
  74.     <select name="year">
  75.     <?php
  76.     foreach ($years as $year{
  77.         if ($info['year'== $year{
  78.             $sel ' selected="selected"';
  79.         else {
  80.             $sel '';
  81.         }
  82.         echo '    <option' $sel '>' $year '</option>' "\n";
  83.     ?>
  84.     </select>-<select name="month">
  85.     <?php
  86.     for ($i = 1; $i <= 12; $i++{
  87.         if ($info['month'== $i{
  88.             $sel ' selected="selected"';
  89.         else {
  90.             $sel '';
  91.         }
  92.         echo '    <option' $sel '>' $i '</option>' "\n";
  93.     ?>
  94.     </select>-<select name="day">
  95.     <?php
  96.     for ($i = 1; $i <= 31; $i++{
  97.         if ($info['day'== $i{
  98.             $sel ' selected="selected"';
  99.         else {
  100.             $sel '';
  101.         }
  102.         echo '    <option' $sel '>' $i '</option>' "\n";
  103.     ?>
  104.     </select>
  105.    </td>
  106.   </tr>
  107.   <tr>
  108.    <th class="form-label_left">Length of election in days</th>
  109.    <td class="form-input">
  110.     <select name="length">
  111.     <?php
  112.     for ($i = 1; $i <= 14; $i++{
  113.         if ($info['length'== $i{
  114.             $sel ' selected="selected"';
  115.         else {
  116.             $sel '';
  117.         }
  118.         echo '    <option' $sel '>' $i '</option>' "\n";
  119.     ?>
  120.     </select>
  121.    </td>
  122.   </tr>
  123.   <tr>
  124.    <th class="form-label_left" colspan="2">
  125.     The next two sections relate to the number of items
  126.     that a single voter can choose.  For most elections, voters
  127.     should choose only one (minimum=maximum=1).  For some
  128.     elections, like QA group, the voter should choose up to 5
  129.     developers to populate the QA group (minimum=1,maximum=5), and
  130.     so on.
  131.    </th>
  132.   </tr>
  133.   <tr>
  134.    <th class="form-label_left">Minimum votes needed</th>
  135.    <td class="form-input">
  136.     <select name="minimum">
  137.     <?php
  138.     for ($i = 1; $i <= 19; $i++{
  139.         if ($info['minimum'== $i{
  140.             $sel ' selected="selected"';
  141.         else {
  142.             $sel '';
  143.         }
  144.         echo '    <option' $sel '>' $i '</option>' "\n";
  145.     ?>
  146.     </select>
  147.    </td>
  148.   </tr>
  149.   <tr>
  150.    <th class="form-label_left">Maximum votes allowed</th>
  151.    <td class="form-input">
  152.     <select name="maximum">
  153.     <?php
  154.     for ($i = 1; $i <= 19; $i++{
  155.         if ($info['maximum'== $i{
  156.             $sel ' selected="selected"';
  157.         else {
  158.             $sel '';
  159.         }
  160.         echo '    <option' $sel '>' $i '</option>' "\n";
  161.     ?>
  162.     </select>
  163.    </td>
  164.   </tr>
  165.  </table>
  166.  <input type="submit" name="newelection" value="Save Election" />
  167. </form>
  168. <?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.