84 lines
2.7 KiB
PHP
84 lines
2.7 KiB
PHP
|
<?php
|
||
|
require_once("database.php");
|
||
|
$db = new DB();
|
||
|
$db->closeVotes();
|
||
|
$page = is_numeric($_REQUEST['page'])?$_REQUEST['page']:1;
|
||
|
?>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>CAcert Board Decisions</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset='UTF-8'" />
|
||
|
<link rel="stylesheet" type="text/css" href="styles.css" />
|
||
|
</head>
|
||
|
<body>
|
||
|
<table class="list">
|
||
|
<tr>
|
||
|
<th>Status</th>
|
||
|
<th>Motion</th>
|
||
|
<th>Actions</th>
|
||
|
</tr>
|
||
|
<?php
|
||
|
$stmt = $db->getStatement("list decisions");
|
||
|
$stmt->execute(array($page));
|
||
|
$items = 0;
|
||
|
while ($row = $stmt->fetch()) {
|
||
|
$items++;
|
||
|
?><tr>
|
||
|
<td class="<?php switch($row['status']) { case 0: echo "pending"; break; case 1: echo "approved"; break; case -1: echo "declined"; break; }?>">
|
||
|
<?php
|
||
|
switch($row['status']) {
|
||
|
case 0: echo "Pending<br/><i>".$row['due']." UTC</i>"; break;
|
||
|
case 1: echo "Approved<br/><i>".$row['modified']." UTC</i>"; break;
|
||
|
case -1: echo "Declined<br/><i>".$row['modified']." UTC</i>"; break;
|
||
|
}
|
||
|
?>
|
||
|
</td>
|
||
|
<td>
|
||
|
<i><?php echo $row['tag'] ?></i><br/>
|
||
|
<b><?php echo $row['title']; ?></b><br/>
|
||
|
<pre><?php echo $row['content']; ?></pre>
|
||
|
<br/>
|
||
|
<i>Due: <?php echo($row['due']); ?> UTC</i><br/>
|
||
|
<i>Proposed: <?php echo($row['proposer']); ?> (<?php echo($row['proposed']); ?> UTC)</i><br/>
|
||
|
<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/>
|
||
|
</td><?php
|
||
|
?><td class="actions">
|
||
|
<?php
|
||
|
if ($row['status'] == 0) {
|
||
|
?>
|
||
|
<ul>
|
||
|
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&vote=1">Aye</a></li>
|
||
|
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&vote=0">Abstain</a></li>
|
||
|
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&vote=-1">Naye</a></li>
|
||
|
<li><a href="proxy.php?motion=<?php echo($row['id']); ?>">Proxy Vote</a></li>
|
||
|
<li><a href="motion.php?motion=<?php echo($row['id']); ?>">Modify</a></li>
|
||
|
</ul>
|
||
|
<?php
|
||
|
} else {
|
||
|
?>
|
||
|
|
||
|
<?php
|
||
|
}
|
||
|
?>
|
||
|
</td>
|
||
|
</tr><?php
|
||
|
}
|
||
|
?>
|
||
|
<tr>
|
||
|
<td colspan="2" class="navigation">
|
||
|
<?php if ($page>1) { ?><a href="?page=<?php echo($page-1); ?>"><</a><?php } else { ?> <?php } ?>
|
||
|
|
||
|
<?php if ($items>9) { ?><a href="?page=<?php echo($page+1); ?>">></a><?php } else { ?> <?php } ?>
|
||
|
</td>
|
||
|
<td class="actions">
|
||
|
<ul>
|
||
|
<li><a href="motion.php">New Motion</a></li>
|
||
|
</ul>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</body>
|
||
|
</html>
|