if (GETactive()) { //submit a NULL vote if it is the user's first visit // OR //submit a 'real' vote if the user makes a selection if (!haveIVoted() || $_POST["selection"]) { castVote($_POST["selection"]); } //if the user chooses to revote, submit a NULL vote if ($_POST["reVoteButton"] == "Change Vote") { castVote(""); } } //Decide to display the waiting page OR review page OR voting page //if the vote is inactive, load a waiting page //***NEEDS INTERFACE*** if (!GETactive()) { ?> <span class="graytitle">Waiting for a vote to begin.</span> <script language="javascript" type="text/javascript">setTimeout("location.reload();",10000);</script> <?php } else { if (haveIVoted()) { ?> <span class="graytitle">You voted for <?php echo haveIVoted(); ?> </span> <ul class="pageitem"> <form name="reVote" action="index.php" method="post"> <li class="button"><input name="reVoteButton" type="submit" value="Change Vote" /></li> </form>
function FLIPactive() { $currentActive = GETactive(); SETactive(!$currentActive); }
<?php if (GETchartType() == "pie") { ?> <option value="pie" selected="selected">Pie</option> <?php } else { ?> <option value="pie">Pie</option> <?php } ?> </select><span class="arrow"></ span> </li> <?php if (GETactive()) { ?> <!-- Buttons being enabled/disabled can be dictated by the 'disabled="disabled" tag --> <li class="button"><input name="startStop" type="submit" value="Start Vote" disabled="disabled"/></li> <li class="button"><input name="startStop" type="submit" value="Stop Vote" /></li> </ul> <ul class="graytitle"> <?php echo "</br>" . tallyVotesFor("") . " voter(s) undecided."; ?> <br> <?php echo "</br>" . tallyVotesFor(!"") . " vote(s) total."; ?> </ul> <?php