summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-05-29 03:21:23 +0000
committercommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-05-29 03:21:23 +0000
commit8094fd2df48244899e0e76fc4cce4c586aa1ce67 (patch)
treed479165d8450a7d3cb05ea6bf0323aa47d9e7e7c
parentea4bee9a277053dd15f86d6119d553214056108b (diff)
downloadcacert-boardvoting-8094fd2df48244899e0e76fc4cce4c586aa1ce67.tar.gz
cacert-boardvoting-8094fd2df48244899e0e76fc4cce4c586aa1ce67.tar.xz
cacert-boardvoting-8094fd2df48244899e0e76fc4cce4c586aa1ce67.zip
add withdrawl motion option
git-svn-id: http://svn.cacert.cl/Software/Voting/vote@43 d4452222-2f33-11de-9270-010000000000
-rw-r--r--motions.php42
-rw-r--r--styles.css3
2 files changed, 41 insertions, 4 deletions
diff --git a/motions.php b/motions.php
index fe91f39..7784e23 100644
--- a/motions.php
+++ b/motions.php
@@ -18,23 +18,33 @@
<th>Actions</th>
</tr>
<?php
- if ($_REQUEST['id']) {
+ if ($_REQUEST['withdrawl'] && $_REQUEST['confirm'] && $_REQUEST['id']) {
+ $stmt = $db->getStatement("close decision");
+ $status = -2;
+ $stmt->bindParam(":status",$status);
+ $stmt->bindParam(":decision",$_REQUEST['id']);
+ $stmt->execute();
+ }
+ if ($_REQUEST['motion']) {
$stmt = $db->getStatement("list decision");
- $stmt->execute(array($_REQUEST['id']));
+ $stmt->execute(array($_REQUEST['motion']));
} else {
$stmt = $db->getStatement("list decisions");
$stmt->execute(array($page));
}
$items = 0;
+ $id = -1;
while ($row = $stmt->fetch()) {
$items++;
+ $id = $row['id'];
?><tr>
- <td class="<?php switch($row['status']) { case 0: echo "pending"; break; case 1: echo "approved"; break; case -1: echo "declined"; break; }?>">
+ <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; }?>">
<?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;
+ case -2: echo "Withdrawn<br/><i>".$row['modified']." UTC</i>"; break;
}
?>
</td>
@@ -58,7 +68,7 @@
echo "<i>".$vrow['name']." ".$state[$vrow['vote']+1]."</i><br/>";
}
} else {
- echo '<i><a href="motions.php?id='.$row['tag'].'&showvotes=1">Show Votes</a></i><br/>';
+ echo '<i><a href="motions.php?motion='.$row['tag'].'&showvotes=1">Show Votes</a></i><br/>';
}
?>
</td>
@@ -72,6 +82,7 @@
<li><a href="vote.php?motion=<?php echo($row['id']); ?>&amp;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>
+ <li><a href="motions.php?motion=<?php echo($row['tag']); ?>&amp;withdrawl=1">Withdrawl</a></li>
</ul>
<?php
} else {
@@ -96,6 +107,29 @@
</ul>
</td>
</tr>
+ <?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&amp;confirm=1&amp;id=<?php echo $id;?>" method="post">
+ <input type="submit" value="Withdrawl">
+ </form>
+ <?php
+ }
+ ?>
+ </td>
+ </tr>
+ <?php
+ }
+ ?>
</table>
</body>
</html>
diff --git a/styles.css b/styles.css
index 0610148..1cf3d72 100644
--- a/styles.css
+++ b/styles.css
@@ -16,6 +16,9 @@ td.approved {
td.declined {
color:red;
}
+td.withdrawn {
+ color:red;
+}
td.pending {
color:blue;
}