cvs: pearweb /templates election-showresults.tpl.php

From: Date: Tue, 24 Apr 2007 20:17:50 +0000
Subject: cvs: pearweb /templates election-showresults.tpl.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-46132@lists.php.net to get a copy of this message
davidc Tue Apr 24 20:17:50 2007 UTC Modified files: /pearweb/templates election-showresults.tpl.php Log: - Just checking if we are before the election or after, if we are before then only display the turnout- - Bug #10831 http://cvs.php.net/viewvc.cgi/pearweb/templates/election-showresults.tpl.php?r1=1.8&r2=1.9&diff_format=u Index: pearweb/templates/election-showresults.tpl.php diff -u pearweb/templates/election-showresults.tpl.php:1.8 pearweb/templates/election-showresults.tpl.php:1.9 --- pearweb/templates/election-showresults.tpl.php:1.8 Wed Nov 29 03:58:59 2006 +++ pearweb/templates/election-showresults.tpl.php Tue Apr 24 20:17:50 2007 @@ -19,6 +19,13 @@ <th class="form-label_left">Voter turnout</th> <td class="form-input"><?php echo number_format($info['turnout'] * 100, 2) ?>%</td> </tr> + <?php + + $voteEnd = strtotime($info['voteend']); + $currentDate = strtotime(date('Y-m-d')); + + if ($voteEnd < $currentDate) { + ?> <tr> <th class="form-label_left">Results (<?php echo count($info['winners']) ?> winners)</th> <td class="form-input"> @@ -45,6 +52,17 @@ </table> </td> </tr> + <?php + } + + if ($voteEnd > $currentDate) { + $timeLeft = $info['voteend']; + ?> + <tr> + <th class="form-label_left">Status</th> + <td class="form-input">In Progress until : <?php echo date('l dS \of F Y \a\t m:iA', time($timeLeft)); ?></td> + </tr> + <?php } ?> </table> <a href="/election/"><< Back to elections list</a> <?php response_footer();

« previous php.pear.cvs (#46132) next »