add showvotes functionality and remove notification when people vote
[cacert-boardvoting.git] / motions.php
index 27d1632..bbf1825 100644 (file)
                                                <i>Required Votes: <?php echo($row['quorum']); ?></i><br/>
                                                <i>Majority: <?php echo($row['majority']); ?>%</i><br/>
                                                <i>Aye|Naye|Abstain: <?php echo($row['ayes']); ?>|<?php echo($row['nayes']); ?>|<?php echo($row['abstains']); ?></i><br/>
+                                       <?php
+                                               if ($row['status'] ==0 || $_REQUEST['showvotes']) {
+                                                       $state = array('Naye','Abstain','Aye');
+                                                       $vstmt = $db->getStatement("list votes");
+                                                       $vstmt->execute(array($row['id']));
+                                                       echo "<i>Votes:</i><br/>";
+                                                       while ($vrow = $vstmt->fetch()) {
+                                                               echo "<i>".$vrow['name']." ".$state[$vrow['vote']+1]."</i><br/>";
+                                                       }
+                                               }
+                                       ?>
                                                </td><?php
                                        ?><td class="actions">
                                                <?php