pages/voting.php

30 lines
739 B
PHP

<?php
$z = shell_exec('sudo /usr/local/bin/poll-votes 2>/dev/null');
$votes = explode("\n",$z);
include ('includes/header.php');
?>
<main>
<h3>Voting</h3>
<p>Welcome to tildevarsh's voting system. Currently it is a unique feature
of tildevarsh where users will be able to vote into important decisions related
to the tilde. This page will show ongoing motions that are
being voted to. </p>
<p>
Users can vote by running <code>vote</code> in their shell.
</p>
<hr>
<h4>Ongoing motions:</h4>
<?php
foreach($votes as $votearr){
$vote = explode("|",$votearr);
if(!empty($votearr)){
echo "<p>".$vote[0].") ".$vote[1]."<br>"."\n";
echo "Votes:".$vote[3].". Yes:".$vote[2].". No:".((int)$vote[3]-(int)$vote[2])."</p>";
}
}
?>
</main>