diff admajax.php @ 1038:2e1a9b564674

Add votekey information blurb.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 20 Nov 2015 08:38:38 +0200
parents b67fa444099e
children f188caaedf0f
line wrap: on
line diff
--- a/admajax.php	Fri Nov 20 07:54:48 2015 +0200
+++ b/admajax.php	Fri Nov 20 08:38:38 2015 +0200
@@ -392,6 +392,14 @@
 }
 
 
+function stGetVoteKeyInfo()
+{
+  $nkeys = stFetchSQLColumn("SELECT COUNT(*) FROM votekeys WHERE active=1");
+  $totalKeys = stFetchSQLColumn("SELECT COUNT(*) FROM votekeys");
+  return "Info: <b>".$nkeys."</b> of <b>".$totalKeys."</b> votekeys are activated.";
+}
+
+
 function stGetVoteKeyItemData($id, $item, $prefix)
 {
   global $setVoteKeyMode, $setVoteKeyLen;
@@ -1370,6 +1378,10 @@
           stError("No such attendee ID!");
         break;
 
+      case "votekeyinfo":
+        echo stGetVoteKeyInfo();
+        break;
+
       case "votekey":
       case "votekeyclass":
         switch ($setVoteKeyMode)
@@ -1426,6 +1438,7 @@
           "</div>\n".
           "<div class=\"tabHeadersSub\">\n".
           "<a href=\"print.php?type=votekeys\" target=\"_blank\">Show printable key list</a>\n".
+          "<div id=\"vkeyInfo\">".stGetVoteKeyInfo()."</div>\n".
           "</div>\n";
 
         switch ($setVoteKeyMode)