Mercurial > hg > fapweb
changeset 381:0ae6d3fb5688
Interface improvements.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 04 Dec 2013 09:11:33 +0200 |
parents | 0c7b301742bd |
children | ea68c1b081b2 |
files | admajax.php |
diffstat | 1 files changed, 19 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Tue Dec 03 21:09:48 2013 +0200 +++ b/admajax.php Wed Dec 04 09:11:33 2013 +0200 @@ -360,6 +360,10 @@ $nenabled = stFetchSQLColumn("SELECT COUNT(*) FROM compos WHERE visible=0 AND voting<>0"); if ($nenabled > 0) echo "<li>".$nenabled." competitions that are NOT visible, but are enabled for voting?</li>\n"; + + $entries = stFetchSQL("SELECT COUNT(*) AS nentries, COUNT(DISTINCT compo_id) AS ncompos FROM entries"); + if ($entries !== FALSE) + echo "<li><b>".$entries["nentries"]."</b> compo entries in system in <b>".$entries["ncompos"]."</b> compos.</li>\n"; if ($errors == 0) echo "<li>No errors/warnings detected.</li>\n"; @@ -649,8 +653,11 @@ $id = intval(stGetRequestItem("id", 0)); if (($compo = stFetchSQL("SELECT * FROM compos WHERE id=".$id)) !== false) { + $nentries = stFetchSQLColumn("SELECT COUNT(*) FROM entries WHERE compo_id=".$id); + $prefix = "ne"; echo - "<h1 style=\"margin-bottom: 0px;\">#".$id." - ".chentities($compo["name"])."</h1>\n". + "<h1 style=\"margin-bottom: 0px;\">#".$id." - ".chentities($compo["name"]). + " (".$nentries." entries)</h1>\n". "<form>\n". " <table class=\"misc\">\n". " <tr>\n". @@ -660,7 +667,17 @@ " <th>Filename</th>\n". " <th>Info</th>\n". " <th>Actions</th>\n". - " </tr>\n"; + " </tr>\n". + " <tr>\n". + " <td></td>\n". + " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_NAME, "name", $id, $prefix, "")."</td>\n". + " <td>".stGetFormTextInput(15, SET_LEN_ENTRY_AUTHOR, "author", $id, $prefix, "")."</td>\n". + " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_FILENAME, "filename", $id, $prefix, "")."</td>\n". +// " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_INFO, "info", $id, $prefix, "")."</td>\n". + " <td>".stGetFormTextArea(2, 30, "info", $id, $prefix, "")."</td>\n". + " <td>".stGetFormButtonInput("add", $id, $prefix, "Add new", "addEntry(".$id.")")."</td>\n". + " </tr>\n". + " <tr><td colspan=\"6\"><hr /></td></tr>\n"; foreach (stExecSQL("SELECT * FROM entries WHERE compo_id=".$id) as $entry) { @@ -670,17 +687,7 @@ " </tr>\n"; } - $prefix = "ne"; echo - " <tr>\n". - " <td></td>\n". - " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_NAME, "name", $id, $prefix, "")."</td>\n". - " <td>".stGetFormTextInput(15, SET_LEN_ENTRY_AUTHOR, "author", $id, $prefix, "")."</td>\n". - " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_FILENAME, "filename", $id, $prefix, "")."</td>\n". -// " <td>".stGetFormTextInput(20, SET_LEN_ENTRY_INFO, "info", $id, $prefix, "")."</td>\n". - " <td>".stGetFormTextArea(2, 30, "info", $id, $prefix, "")."</td>\n". - " <td>".stGetFormButtonInput("add", $id, $prefix, "Add new", "addEntry(".$id.")")."</td>\n". - " </tr>\n". " </table>\n". "</form>\n"; }