Mercurial > hg > fapweb
comparison print.php @ 1020:2a259e243350
Don't use a HTML table for the votekeys.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Nov 2015 19:22:11 +0200 |
parents | ffacd904fd1f |
children | 7da8bde9b7be |
comparison
equal
deleted
inserted
replaced
1019:22b6442d5cb3 | 1020:2a259e243350 |
---|---|
86 $sql = "SELECT * FROM votekeys ORDER BY id ASC"; | 86 $sql = "SELECT * FROM votekeys ORDER BY id ASC"; |
87 if (($res = stExecSQL($sql)) !== FALSE) | 87 if (($res = stExecSQL($sql)) !== FALSE) |
88 { | 88 { |
89 cmPrintPageHeader("Votekeys"); | 89 cmPrintPageHeader("Votekeys"); |
90 $keyLen = stGetSetting("userKeyLength"); | 90 $keyLen = stGetSetting("userKeyLength"); |
91 echo "<table class=\"votekeys\">\n"; | 91 echo "<div class=\"votekeys\">\n"; |
92 $index = 0; | |
93 foreach ($res as $item) | 92 foreach ($res as $item) |
94 { | 93 { |
95 if ($index == 0) | |
96 echo "<tr>\n"; | |
97 | |
98 // This funny code is to ensure that the cells are of uniform width | 94 // This funny code is to ensure that the cells are of uniform width |
99 printf("<td><span class=\"keyid\">%03d</span> : ". | 95 printf("<div class=\"votekey\"><span class=\"keyid\">%03d</span> : ". |
100 "<span class=\"keycode\">%s</span></td>\n", | 96 "<span class=\"keycode\">%s</span></div>\n", |
101 $item["id"], | 97 $item["id"], |
102 str_repeat(" ", $keyLen - strlen($item["key"])).$item["key"]); | 98 str_repeat(" ", $keyLen - strlen($item["key"])).$item["key"]); |
103 | |
104 if ($index++ >= 5) | |
105 { | |
106 echo "</tr>\n"; | |
107 $index = 0; | |
108 } | |
109 } | 99 } |
110 if ($index > 0) | |
111 echo "</tr>\n"; | |
112 | 100 |
113 echo "</table>\n"; | 101 echo "</div>\n"; |
114 cmPrintPageFooter(); | 102 cmPrintPageFooter(); |
115 } | 103 } |
116 break; | 104 break; |
117 | 105 |
118 default: | 106 default: |