diff --git a/res/forum/admin/admin.html b/res/forum/admin/admin.html index ceea4fe..3a532c1 100644 --- a/res/forum/admin/admin.html +++ b/res/forum/admin/admin.html @@ -35,24 +35,7 @@ username = event.target.innerHTML; - $.ajax - ({ - url: "./res/forum/api/user_info.php?username=" + event.target.innerHTML, - success: async function(result) - { - let admin_select = await selection("admin", result.admin); - let sex_select = await selection("sex", result.sex); - - let output = - `Uživatelské jméno:
- Přezdívka:
- Admin: ${admin_select}
- Pohlaví: ${sex_select}
- Bio:
`; - - $("#right_panel").html(output + right_panel_buffer); - } - }); + inject_info("#right_panel", username); }); function remove_user() @@ -101,4 +84,26 @@ }) }); } + + function inject_info(id, username) + { + $.ajax + ({ + url: "./res/forum/api/user_info.php?username=" + username, + success: async function(result) + { + let admin_select = await selection("admin", result.admin); + let sex_select = await selection("sex", result.sex); + + let output = + `Uživatelské jméno:
+ Přezdívka:
+ Admin: ${admin_select}
+ Pohlaví: ${sex_select}
+ Bio:
`; + + $(id).html(output + right_panel_buffer); + } + }); + } \ No newline at end of file