Mercurial > hg > fapweb
diff admajax.php @ 404:d454f7eebddd
Moar work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2013 15:59:28 +0200 |
parents | e6223ab525fc |
children | 9c60412228e9 |
line wrap: on
line diff
--- a/admajax.php Thu Dec 05 15:57:48 2013 +0200 +++ b/admajax.php Thu Dec 05 15:59:28 2013 +0200 @@ -226,8 +226,25 @@ } -function stGet() +function stGetInfoCurrEntryList() { + $sql = stPrepareSQL( + "SELECT * FROM entries WHERE compo_id=%d ORDER BY show_id ASC", + stGetDisplayVar("compoID")); + + $currShowID = stGetDisplayVar("compoCurrEntry"); + $str = ""; + if (($res = stExecSQL($sql)) !== false) + { + foreach ($res as $item) + { + $str .= + " ".stGetOptionListItem($item["id"], + ($item["show_id"] == $currShowID), + sprintf("%3d. %s by %s", $item["show_id"], $item["name"], $item["author"])); + } + } + return $str; } @@ -500,6 +517,10 @@ case "infoCurrEntryData": echo stGetInfoCurrEntryData(); break; + + case "infoCurrEntryList": + echo stGetInfoCurrEntryList(); + break; case "infoEditRotationList": echo @@ -655,24 +676,8 @@ echo "<div class=\"ctrlDBox1\">\n". - " ".stGetOptionListStart("ctrlEntryList"); - - $sql = stPrepareSQL( - "SELECT * FROM entries WHERE compo_id=%d ORDER BY show_id ASC", - $currCompoID); - - $currShowID = stGetDisplayVar("compoCurrEntry"); - if (($res = stExecSQL($sql)) !== false) - { - foreach ($res as $item) - { - echo " ".stGetOptionListItem($item["id"], - ($item["show_id"] == $currShowID), - sprintf("%3d. %s by %s", $item["show_id"], $item["name"], $item["author"])); - } - } - - echo + " ".stGetOptionListStart("ctrlEntryList"). + stGetInfoCurrEntryList(). " ".stGetOptionListEnd(). " <div class=\"ctrlButtons\">\n". " ".stGetFormButtonInput("setentry", "", "", "Set selected entry", "setSelectedEntry()")."\n".