Mercurial > hg > fapweb
comparison admajax.php @ 1116:d5847f016de5
Merge.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 Oct 2019 10:34:06 +0300 |
parents | 51f24cb35fc8 0eca3f1b1d48 |
children | a4daa7ea7479 |
comparison
equal
deleted
inserted
replaced
1115:24e6915fc0fb | 1116:d5847f016de5 |
---|---|
1277 "<div class=\"ctrlBox\" id=\"ctrlCompoControl\">\n". | 1277 "<div class=\"ctrlBox\" id=\"ctrlCompoControl\">\n". |
1278 " <div class=\"ctrlTitle\">Competition control:</div>\n". | 1278 " <div class=\"ctrlTitle\">Competition control:</div>\n". |
1279 " <div class=\"ctrlInfo\">Controls for competition showing mode. Select and activate desired compo, then ". | 1279 " <div class=\"ctrlInfo\">Controls for competition showing mode. Select and activate desired compo, then ". |
1280 "hit 'Next entry' to activate the first entry to show. <b>Notice! You need to have generated 'show positions' ". | 1280 "hit 'Next entry' to activate the first entry to show. <b>Notice! You need to have generated 'show positions' ". |
1281 "before starting compos!</b></div>\n". | 1281 "before starting compos!</b></div>\n". |
1282 " <div class=\"ctrlDBox1\">\n". | 1282 " <div class=\"ctrlDBox1\">\n"; |
1283 stGetFormOptionListStart("ctrlCompoList", " ", TRUE); | |
1284 | 1283 |
1285 $sql = | 1284 $sql = |
1286 "SELECT compos.*, ". | 1285 "SELECT compos.*, ". |
1287 "COUNT(DISTINCT entries.id) AS nentries ". | 1286 "COUNT(DISTINCT entries.id) AS nentries ". |
1288 "FROM compos LEFT JOIN entries ON compos.id=entries.compo_id ". | 1287 "FROM compos LEFT JOIN entries ON compos.id=entries.compo_id ". |
1291 "ORDER BY compos.id DESC"; | 1290 "ORDER BY compos.id DESC"; |
1292 | 1291 |
1293 $currCompoID = stGetDisplayVar("compoID"); | 1292 $currCompoID = stGetDisplayVar("compoID"); |
1294 if (($res = stExecSQL($sql)) !== FALSE) | 1293 if (($res = stExecSQL($sql)) !== FALSE) |
1295 { | 1294 { |
1295 echo stGetFormOptionListStart("ctrlCompoList", " ", TRUE); | |
1296 foreach ($res as $item) | 1296 foreach ($res as $item) |
1297 { | 1297 { |
1298 echo stGetFormOptionListItem(" ", $item["id"], | 1298 echo stGetFormOptionListItem(" ", $item["id"], |
1299 ($item["id"] == $currCompoID), | 1299 ($item["id"] == $currCompoID), |
1300 sprintf("%-20s (%d entries)", substr($item["name"], 0, 20), $item["nentries"])); | 1300 sprintf("%-20s (%d entries)", substr($item["name"], 0, 20), $item["nentries"])); |
1301 } | 1301 } |
1302 } | 1302 echo stGetFormOptionListEnd(" ", TRUE); |
1303 } | |
1304 else | |
1305 echo "ERROR"; | |
1303 | 1306 |
1304 echo | 1307 echo |
1305 stGetFormOptionListEnd(" ", TRUE). | |
1306 " <div class=\"ctrlButtons\">\n". | 1308 " <div class=\"ctrlButtons\">\n". |
1307 " ".stGetFormButtonInput("setcompo", "", "", "Change compo", "activateCompo()")."\n". | 1309 " ".stGetFormButtonInput("setcompo", "", "", "Change compo", "activateCompo()")."\n". |
1308 " </div>\n". | 1310 " </div>\n". |
1309 " </div>\n". | 1311 " </div>\n". |
1310 " <div class=\"ctrlDBox1\">\n". | 1312 " <div class=\"ctrlDBox1\">\n". |
1332 " ".stGetFormButtonInput("", "", "", "Clear", "this.form.reset()")."\n". | 1334 " ".stGetFormButtonInput("", "", "", "Clear", "this.form.reset()")."\n". |
1333 "</form>\n". | 1335 "</form>\n". |
1334 "<hr />\n"; | 1336 "<hr />\n"; |
1335 | 1337 |
1336 $sql = "SELECT * FROM news ORDER BY utime DESC"; | 1338 $sql = "SELECT * FROM news ORDER BY utime DESC"; |
1337 foreach (stExecSQL($sql) as $item) | 1339 if (($res = stExecSQL($sql)) !== false) |
1338 { | 1340 { |
1339 echo | 1341 foreach ($res as $item) |
1340 "<div id=\"news".$item["id"]."\" class=\"newsItem\">\n". | 1342 { |
1341 stGetNewsItemData($item["id"], $item, "ne"). | 1343 echo |
1342 "</div>\n"; | 1344 "<div id=\"news".$item["id"]."\" class=\"newsItem\">\n". |
1343 } | 1345 stGetNewsItemData($item["id"], $item, "ne"). |
1346 "</div>\n"; | |
1347 } | |
1348 } | |
1349 else | |
1350 echo "ERROR"; | |
1344 break; | 1351 break; |
1345 | 1352 |
1346 case "newsitem": | 1353 case "newsitem": |
1347 $res = stFetchSQL(stPrepareSQL("SELECT * FROM news WHERE id=%D", "id")); | 1354 $res = stFetchSQL(stPrepareSQL("SELECT * FROM news WHERE id=%D", "id")); |
1348 if ($res !== FALSE) | 1355 if ($res !== FALSE) |