diff --git a/res/forum/admin/admin.html b/res/forum/admin/admin.html index eb735ec..8ec6dc2 100644 --- a/res/forum/admin/admin.html +++ b/res/forum/admin/admin.html @@ -4,7 +4,7 @@
- +
@@ -51,21 +51,8 @@ }); } - function update_user() + function update() { - $.ajax - ({ - url: "./res/forum/api/update_user.php" + - "?old_username=" + username + - "&username=" + document.getElementById("username").value + - "&nickname=" + document.getElementById("nickname").value + - "&admin=" + document.getElementById("admin").value + - "&sex=" + document.getElementById("sex").value + - "&bio=" + document.getElementById("bio").value, - success: function(result) - { - show("admin"); - } - }); + update_user(username, document.getElementById("username").value, document.getElementById("nickname").value, document.getElementById("admin").value, document.getElementById("sex").value,document.getElementById("bio").value, "admin"); } \ No newline at end of file diff --git a/res/forum/script.js b/res/forum/script.js index 2a5b4bc..2d333a2 100644 --- a/res/forum/script.js +++ b/res/forum/script.js @@ -51,4 +51,22 @@ function inject_info(id, username, postfix) $(id).html(output + postfix); } }); +} + +function update_user(old_username, username, nickname, admin, sex, bio, refresh) +{ + $.ajax + ({ + url: "./res/forum/api/update_user.php" + + "?old_username=" + old_username + + "&username=" + username + + "&nickname=" + nickname + + "&admin=" + admin + + "&sex=" + sex + + "&bio=" + bio, + success: function(result) + { + show(refresh); + } + }); } \ No newline at end of file