From fb76aab8cffbc3d251fb635ae8e986c7138d8d68 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 4 Aug 2013 17:41:39 +0200 Subject: tu_details.php: Display vote result This adds an field that indicates whether the vote was accepted or rejected, based on the rules specified in the TU Bylaws. Signed-off-by: Lukas Fleischer --- web/template/tu_details.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'web/template/tu_details.php') diff --git a/web/template/tu_details.php b/web/template/tu_details.php index 61abab79..c09e30c4 100644 --- a/web/template/tu_details.php +++ b/web/template/tu_details.php @@ -3,9 +3,18 @@ $yes = $row["Yes"]; $no = $row["No"]; $abstain = $row["Abstain"]; $active_tus = $row["ActiveTUs"]; +$quorum = $row["Quorum"]; $total = $yes + $no + $abstain; $participation = $total / $active_tus; + +if ($yes > $active_tus / 2) { + $vote_accepted = true; +} elseif ($participation > $quorum && $yes > $no) { + $vote_accepted = true; +} else { + $vote_accepted = false; +} ?>

@@ -30,6 +39,17 @@ $participation = $total / $active_tus;
: + +
+ : + + + + + + + +

-- cgit v1.2.3-24-g4f1b