implemented user update api in admin

This commit is contained in:
Václav Šmejkal 2024-05-22 17:25:34 +02:00
parent c57a169134
commit edb5c241d9
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -4,7 +4,7 @@
</div> </div>
<div id="right_panel"> <div id="right_panel">
<div id="buttons"> <div id="buttons">
<button class="btn">Uložit Změny</button> <button onclick="update_user()" class="btn">Uložit Změny</button>
<button onclick="remove_user()" class="btn">Odstranit Uživatele</button> <button onclick="remove_user()" class="btn">Odstranit Uživatele</button>
</div> </div>
</div> </div>
@ -68,6 +68,24 @@
}); });
} }
function update_user()
{
$.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");
}
});
}
function selection(type, value) function selection(type, value)
{ {
return new Promise(function(resolve) return new Promise(function(resolve)