56 lines
1.3 KiB
HTML
56 lines
1.3 KiB
HTML
<div id="panels">
|
|
<div id="left_panel">
|
|
Zde budou uživatelé.
|
|
</div>
|
|
<div id="right_panel">
|
|
<button onclick="remove_user()" id="remove_btn">Odstranit Uživatele</button>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
var right_panel_buffer = null;
|
|
var username = null;
|
|
|
|
$(document).ready(function()
|
|
{
|
|
$("#remove_btn").hide();
|
|
});
|
|
|
|
$.ajax
|
|
({
|
|
url: "./res/forum/api/list_users.php",
|
|
success: function(result)
|
|
{
|
|
$("#left_panel").html(result);
|
|
}
|
|
});
|
|
|
|
$("#left_panel").on("click", ".output", function(event)
|
|
{
|
|
$("#remove_btn").show();
|
|
if (right_panel_buffer == null) right_panel_buffer = document.getElementById("right_panel").innerHTML;
|
|
|
|
username = event.target.innerHTML;
|
|
|
|
$.ajax
|
|
({
|
|
url: "./res/forum/api/user_info.php?username=" + event.target.innerHTML,
|
|
success: function(result)
|
|
{
|
|
$("#right_panel").html(result + right_panel_buffer);
|
|
}
|
|
});
|
|
});
|
|
|
|
function remove_user()
|
|
{
|
|
$.ajax
|
|
({
|
|
url: "./res/forum/api/remove_user.php?username=" + username,
|
|
success: function(result)
|
|
{
|
|
//location.reload();
|
|
show("admin");
|
|
}
|
|
});
|
|
}
|
|
</script> |