2009-05-21 11:20:15 +00:00
|
|
|
<?php
|
|
|
|
require_once("database.php");
|
|
|
|
$db = new DB();
|
|
|
|
$db->closeVotes();
|
|
|
|
$page = is_numeric($_REQUEST['page'])?$_REQUEST['page']:1;
|
2009-05-29 08:06:52 +00:00
|
|
|
$user = $db->auth();
|
2009-05-29 04:07:07 +00:00
|
|
|
|
|
|
|
if ($_REQUEST['withdrawl'] && $_REQUEST['confirm'] && $_REQUEST['id']) {
|
2009-05-29 08:06:52 +00:00
|
|
|
if (!$user) {
|
2009-05-29 04:07:07 +00:00
|
|
|
header("HTTP/1.0 302 Redirect");
|
|
|
|
header("Location: denied.php");
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
$stmt = $db->getStatement("get decision");
|
|
|
|
$stmt->bindParam(":decision",$_REQUEST['id']);
|
|
|
|
if ($stmt->execute() && ($decision=$stmt->fetch())) {
|
|
|
|
$name = $user['name'];
|
|
|
|
$tag = $decision['tag'];
|
|
|
|
$title = $decision['title'];
|
|
|
|
$content = $decision['content'];
|
|
|
|
$body = <<<BODY
|
|
|
|
Dear Board,
|
|
|
|
|
|
|
|
$name has withdrawn the motion $tag that was as follows:
|
|
|
|
|
|
|
|
$title
|
|
|
|
$content
|
|
|
|
|
|
|
|
Kind regards,
|
|
|
|
the voting system
|
|
|
|
BODY;
|
2009-05-29 05:14:50 +00:00
|
|
|
$db->notify("Re: $tag - $title - withdrawn",$body,$tag);
|
2009-05-29 04:07:07 +00:00
|
|
|
}
|
|
|
|
$stmt = $db->getStatement("close decision");
|
|
|
|
$status = -2;
|
|
|
|
$stmt->bindParam(":status",$status);
|
|
|
|
$stmt->bindParam(":decision",$_REQUEST['id']);
|
|
|
|
$stmt->execute();
|
|
|
|
}
|
2009-05-21 11:20:15 +00:00
|
|
|
?>
|
|
|
|
<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>
|
2009-05-29 08:06:52 +00:00
|
|
|
<?php
|
|
|
|
if ($user) echo '<a href="?unvoted=1">Show my outstanding votes</a><br/>';
|
|
|
|
?>
|
2009-05-21 11:20:15 +00:00
|
|
|
<table class="list">
|
|
|
|
<tr>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Motion</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
2009-05-29 03:21:23 +00:00
|
|
|
if ($_REQUEST['motion']) {
|
2009-05-27 05:39:41 +00:00
|
|
|
$stmt = $db->getStatement("list decision");
|
2009-05-29 03:21:23 +00:00
|
|
|
$stmt->execute(array($_REQUEST['motion']));
|
2009-05-27 05:39:41 +00:00
|
|
|
} else {
|
2009-05-29 08:06:52 +00:00
|
|
|
if ($user && $_REQUEST['unvoted']) {
|
|
|
|
$stmt = $db->getStatement("list my unvoted decisions");
|
|
|
|
$stmt->bindParam(":id",$user['id']);
|
|
|
|
} else {
|
|
|
|
$stmt = $db->getStatement("list decisions");
|
|
|
|
}
|
|
|
|
$stmt->bindParam(":page",$page);
|
|
|
|
$stmt->execute();
|
2009-05-27 05:39:41 +00:00
|
|
|
}
|
2009-05-21 11:20:15 +00:00
|
|
|
$items = 0;
|
2009-05-29 03:21:23 +00:00
|
|
|
$id = -1;
|
2009-05-21 11:20:15 +00:00
|
|
|
while ($row = $stmt->fetch()) {
|
|
|
|
$items++;
|
2009-05-29 03:21:23 +00:00
|
|
|
$id = $row['id'];
|
2009-05-21 11:20:15 +00:00
|
|
|
?><tr>
|
2009-05-29 03:21:23 +00:00
|
|
|
<td class="<?php switch($row['status']) { case 0: echo "pending"; break; case 1: echo "approved"; break; case -1: echo "declined"; break; case -2: echo "withdrawn"; break; }?>">
|
2009-05-21 11:20:15 +00:00
|
|
|
<?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;
|
2009-05-29 03:21:23 +00:00
|
|
|
case -2: echo "Withdrawn<br/><i>".$row['modified']." UTC</i>"; break;
|
2009-05-21 11:20:15 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<td>
|
2009-05-30 02:57:39 +00:00
|
|
|
<i><a href="motions.php?motion=<?php echo $row['tag'].'">'.$row['tag']; ?></a></i><br/>
|
2009-06-12 01:30:05 +00:00
|
|
|
<b><?php echo htmlspecialchars($row['title']); ?></b><br/>
|
2009-05-27 07:14:23 +00:00
|
|
|
<pre><?php echo htmlspecialchars($row['content']); ?></pre>
|
2009-05-21 11:20:15 +00:00
|
|
|
<br/>
|
|
|
|
<i>Due: <?php echo($row['due']); ?> UTC</i><br/>
|
|
|
|
<i>Proposed: <?php echo($row['proposer']); ?> (<?php echo($row['proposed']); ?> UTC)</i><br/>
|
2009-05-30 02:57:39 +00:00
|
|
|
<i>Vote type: <?php echo(!$row['votetype']?'motion':'veto'); ?></i><br/>
|
2009-05-21 11:20:15 +00:00
|
|
|
<i>Aye|Naye|Abstain: <?php echo($row['ayes']); ?>|<?php echo($row['nayes']); ?>|<?php echo($row['abstains']); ?></i><br/>
|
2009-05-26 03:19:11 +00:00
|
|
|
<?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/>";
|
|
|
|
}
|
2009-05-27 05:39:41 +00:00
|
|
|
} else {
|
2009-05-29 03:21:23 +00:00
|
|
|
echo '<i><a href="motions.php?motion='.$row['tag'].'&showvotes=1">Show Votes</a></i><br/>';
|
2009-05-26 03:19:11 +00:00
|
|
|
}
|
|
|
|
?>
|
2009-05-27 05:39:41 +00:00
|
|
|
</td>
|
|
|
|
<td class="actions">
|
2009-05-21 11:20:15 +00:00
|
|
|
<?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>
|
2009-05-29 03:21:23 +00:00
|
|
|
<li><a href="motions.php?motion=<?php echo($row['tag']); ?>&withdrawl=1">Withdrawl</a></li>
|
2009-05-21 11:20:15 +00:00
|
|
|
</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>
|
2009-05-29 03:21:23 +00:00
|
|
|
<?php
|
|
|
|
if ($_REQUEST['withdrawl']) {
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td colspan="3">
|
|
|
|
<?php
|
|
|
|
if ($_REQUEST['confirm'] && $_REQUEST['id']) {
|
|
|
|
?>
|
|
|
|
<a href="motions.php">Motion Withdrawn</a>
|
|
|
|
<?php
|
|
|
|
} else {
|
|
|
|
?>
|
|
|
|
<form action="?withdrawl=1&confirm=1&id=<?php echo $id;?>" method="post">
|
|
|
|
<input type="submit" value="Withdrawl">
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2009-05-21 11:20:15 +00:00
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|