Exemplo n.º 1
0
            echo ",";
        }
    }
    ?>
			]);
			vbar.Set('chart.scale.decimals', 2);
            vbar.Set('chart.ymax', 1.0);
			vbar.Set('chart.scale.formatter', myFormatter);
            vbar.Set('chart.gutter.left', 50);
            vbar.Set('chart.colors', ['green', 'blue', 'green', 'blue', 'green', 'blue', 'green', 'blue', 'green', 'blue']);
            vbar.Set('chart.colors.sequential', true);
            vbar.Set('chart.title', 'Voting Results');
            vbar.Set('chart.labels', [
            		<?php 
    for ($i = 1; $i <= GETnumberOfChoices(); $i++) {
        echo "'" . GETlabelFor($i) . "'";
        if ($i != GETnumberOfChoices()) {
            echo ",";
        }
    }
    ?>
            	]);
            vbar.Draw();
        }
    </script>
	<?php 
    echo "</br>" . tallyVotesFor("");
    if (tallyVotesFor("") == 1) {
        echo " Voter is still undecided.";
    } else {
        echo " Voters are still undecided.";
Exemplo n.º 2
0
						 </form>
					</ul>
					<script language="javascript" type="text/javascript">setTimeout("location.reload();",10000);</script>
				<?php 
    } else {
        ?>
					<span class="graytitle">Cast your vote:</span>
					<ul class="pageitem">
						<form name="castVote" action="index.php" method="post">
						<?php 
        //output a number of choices equal to the number set by the admin
        for ($i = 1; $i <= GETnumberOfChoices(); $i++) {
            ?>
 
							<li class="radiobutton"><span class="name"><?php 
            echo GETlabelFor($i);
            ?>
</span><input name="selection" type="radio" value="<?php 
            echo $i;
            ?>
" /></li> 
						<?php 
        }
        ?>
					<li class="button"><input name="castVoteButton" type="submit" value="Cast Vote" /></li>
				</form>
			</ul>
			
			<?php 
    }
}