diff pages/vote.inc.php @ 598:ba84d8e35d6b

Do not count entries that have been flagged as disqualified.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 26 Oct 2014 22:09:32 +0200
parents ce11ea112a65
children 4fdb61f40946
line wrap: on
line diff
--- a/pages/vote.inc.php	Wed Oct 22 19:48:03 2014 +0300
+++ b/pages/vote.inc.php	Sun Oct 26 22:09:32 2014 +0200
@@ -120,7 +120,12 @@
   foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo)
   {
     $cid = $compo["id"];
-    $nentries = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$cid);
+    $esql = 
+      "FROM entries "
+      "WHERE (flags & ".EFLAG_DISQUALIFIED.")=0 ".
+      "AND compo_id=".$cid;
+
+    $nentries = stFetchSQLColumn("SELECT COUNT(*) ".$esql);
     if ($nentries > 0)
     {
       echo
@@ -140,7 +145,7 @@
       "  </tr>\n";
 
       $row = 0;
-      foreach (stExecSQL("SELECT * FROM entries WHERE compo_id=".$cid) as $entry)
+      foreach (stExecSQL("SELECT * ".$esql) as $entry)
       {
         $eid = $entry["id"];
         echo