implemented update_user in user panel

This commit is contained in:
Václav Šmejkal 2024-05-22 18:46:05 +02:00
parent 497ed6e093
commit 67f704d19e
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -1,5 +1,5 @@
<div id="info_pane"> <div id="info_pane">
<button onclick="update_user()" id="save_btn" class="btn">Uložit Změny</button> <button onclick="update()" id="save_btn" class="btn">Uložit Změny</button>
</div> </div>
<script> <script>
var button_buffer = document.getElementById("info_pane").innerHTML; var button_buffer = document.getElementById("info_pane").innerHTML;
@ -12,4 +12,16 @@
inject_info("#info_pane", result.username, button_buffer); inject_info("#info_pane", result.username, button_buffer);
} }
}) })
function update()
{
$.ajax
({
url: "./res/forum/api/get_username.php",
success: function(result)
{
update_user(result.username, document.getElementById("username").value, document.getElementById("nickname").value, document.getElementById("admin").value, document.getElementById("sex").value,document.getElementById("bio").value, "user");
}
})
}
</script> </script>