Source for file vote.tpl.php
Documentation is available at vote.tpl.php
<?php response_header ('Vote'); ?>
<h1>Vote in a PEAR Election</h1>
<?php if (isset ($error) && !empty ($error)): ?>
<div class="errors"> <?php echo $error; ?></div>
<?php endif; // if (isset($error)): ?>
<?php if (isset ($info) && !empty ($info)): ?>
<div class="success"> <?php echo $info; ?></div>
<?php endif; // if (isset($info)): ?>
Current date is <strong> <?php echo date('Y-m-d'); ?></strong>
<?php if (count($currentelections)): ?>
<h2>Current Elections:</h2>
<th class="form-label_top">Active</th>
<th class="form-label_top">Election Issue</th>
<th class="form-label_top">Election dates</th>
<th class="form-label_top">Have you voted?</th>
foreach ($currentelections as $election):
$class = $election['active'] == 'yes' ? 'vote-active' : 'vote-inactive';
if ($election['voted'] == 'yes') {
$class = 'vote-complete';
<td class=" <?php echo $class; ?>"> <?php echo $election['active']; ?></td>
<?php if ($election['voted'] == 'yes'): ?>
<td class=" <?php echo $class; ?>"> <?php echo htmlspecialchars($election['purpose']); ?></td>
<?php else: // if ($election['voted'] == 'yes'): ?>
<td class=" <?php echo $class; ?>"><a href="/election/info.php?election= <?php
echo $election['id']; ?>&vote=1"> <?php echo htmlspecialchars($election['purpose']); ?></a></td>
<?php endif; // if ($election['voted'] == 'yes'): ?>
<td class=" <?php echo $class; ?>"> <?php echo $election['votestart'] . ' until ' .
$election['voteend']; ?></td>
<td class=" <?php echo $class; ?>"> <?php echo $election['voted']; ?></td>
endforeach; // foreach ($currentelections as $election):
<?php endif; // if (count($currentelections))
require PEARWEB_TEMPLATEDIR . '/election/results.tpl.php';
if (count($allelections)):
if ($retrieval && isset ($info)): ?>
<h3>Your vote information:</h3>
<?php foreach ($info['choices'] as $choice): ?>
<?php if (in_array($choice['choice'], $info['vote'], true )): ?>
<input type="hidden" name="vote[]" value=" <?php echo $choice['choice']; ?>" />
<td><strong>X</strong></td>
<?php else: // if (in_array($choice['choice'], $info['vote'], true)): ?>
<?php endif; // if (in_array($choice['choice'], $info['vote'], true)): ?>
<?php endforeach; // foreach ($info['choices'] as $choice): ?>
if ($info['vote'] == array ('(abstain)')) {
echo '<p><strong>(ABSTAIN)</strong></p>';
endif; // if ($retrieval && isset($info)) ?>
<h3>Retrieve your vote in an election:</h3>
<form name="checkvote" action="/election/index.php" method="post">
<th class="form-label_top">Election Issue</th>
<th class="form-label_top">Vote Salt (was emailed to you)</th>
<?php foreach ($allelections as $election): ?>
<option value=" <?php echo $election['id']; ?>"> <?php echo htmlspecialchars($election['purpose']); ?></option>
<?php endforeach; // foreach ($allelections as $elections): ?>
<input type="text" size="17" name="salt" value=" <?php echo date('YmdHis') . mt_rand(1 ,999 ) ?>"/>
<input type="submit" value="Retrieve Vote" />
<?php endif; // if (count($allelections))
Documentation generated on Mon, 11 Mar 2019 15:34:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|