Mercurial > hg > fapweb
changeset 320:a0a6131c37b4
Vote key activation.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 27 Nov 2013 17:26:17 +0200 |
parents | 623acd958944 |
children | 9462a59d3ab3 |
files | admajax.php admin.php |
diffstat | 2 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/admajax.php Wed Nov 27 16:26:58 2013 +0200 +++ b/admajax.php Wed Nov 27 17:26:17 2013 +0200 @@ -138,7 +138,7 @@ if ($voteKeyMode == VOTE_ACTIVATE) { $str .= stGetFormCheckBoxInput("active", $id, $prefix, $item["active"], FALSE, - "class=\"keyactive\" onClick=\"voteKeyToggle(".$id.")\"", "")."\n"; + "class=\"keyactive\" onClick=\"voteKeySetActive(".$id.")\"", ""); } return $str; @@ -363,7 +363,7 @@ echo "<div class=\"votekey\" id=\"vkey".$item["id"]."\">". stGetVoteKeyItemData($item["id"], $item, "vk"). - "</div>"; + "</div>\n"; } break; @@ -747,6 +747,8 @@ case "active": // Autobots activate! + $sql = stPrepareSQL("UPDATE votekeys SET active=%B WHERE id=%D", "active", "id"); + stExecSQLCond($sql, "Votekey status changed."); break; } }
--- a/admin.php Wed Nov 27 16:26:58 2013 +0200 +++ b/admin.php Wed Nov 27 17:26:17 2013 +0200 @@ -386,9 +386,9 @@ } -function voteKeyToggle(id) +function voteKeySetActive(id) { - var args = makePostArgs({"active":2}, "vk", id); + var args = makePostArgs({"active":3}, "vk", id); var msuccess = function(txt) {