comparison pages/vote.inc.php @ 972:c1738ee91f6a

Fix SQL for PostGres.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 29 Nov 2014 11:00:36 +0200
parents 24bbd1f89794
children 7d7bd913649c
comparison
equal deleted inserted replaced
971:d28f36ced178 972:c1738ee91f6a
119 " ".stGetFormHiddenInput("onerror", "noauthvote")."\n". 119 " ".stGetFormHiddenInput("onerror", "noauthvote")."\n".
120 stGetVoteButton(); 120 stGetVoteButton();
121 121
122 foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo) 122 foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo)
123 { 123 {
124 $esql = stPrepareSQL("FROM entries WHERE (flags & %d)=0 AND compo_id=%d ORDER BY show_id ASC", EFLAG_DISQUALIFIED, $compo["id"]); 124 $esql = stPrepareSQL("FROM entries WHERE (flags & %d)=0 AND compo_id=%d", EFLAG_DISQUALIFIED, $compo["id"]);
125 $nentries = stFetchSQLColumn("SELECT COUNT(*) ".$esql); 125 $nentries = stFetchSQLColumn("SELECT COUNT(*) ".$esql);
126 if ($nentries > 0) 126 if ($nentries > 0)
127 { 127 {
128 echo 128 echo
129 " <table class=\"vote\">\n". 129 " <table class=\"vote\">\n".
136 } 136 }
137 echo 137 echo
138 " </tr>\n"; 138 " </tr>\n";
139 139
140 $row = 0; 140 $row = 0;
141 foreach (stExecSQL("SELECT * ".$esql) as $entry) 141 foreach (stExecSQL("SELECT * ".$esql." ORDER BY show_id ASC") as $entry)
142 { 142 {
143 $eid = $entry["id"]; 143 $eid = $entry["id"];
144 echo 144 echo
145 " <tr class=\"".($row % 2 == 1 ? "rodd" : "reven")."\">\n". 145 " <tr class=\"".($row % 2 == 1 ? "rodd" : "reven")."\">\n".
146 " <td class=\"vshown\">".($entry["show_id"] > 0 ? $entry["show_id"] : "-")."</td>\n". 146 " <td class=\"vshown\">".($entry["show_id"] > 0 ? $entry["show_id"] : "-")."</td>\n".