SpreadQuiz/game_manager_frame.php
2024-03-06 11:21:18 +01:00

68 lines
2.5 KiB
PHP

<?php
require_once "globals.php";
require_once "autologin.php";
$user_data = get_autologin_user_data();
if (!get_autologin_state() || (($user_data["privilege"] !== PRIVILEGE_CREATOR) && ($user_data["privilege"] !== PRIVILEGE_QUIZMASTER))) {
exit(); // this page is only available for quizmasters
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SpreadQuiz</title>
<script src="js/req.js"></script>
<script src="js/spreadquiz.js"></script>
<script src="js/o.js"></script>
<script src="js/hintbox.js"></script>
<script src="js/usermgr.js"></script>
<script src="js/gamemgr.js"></script>
<link rel="stylesheet" href="style/spreadquiz.css"/>
</head>
<body>
<section id="table_section">
<table class="management">
<thead>
<tr>
<th></th>
<th>Név</th>
<th>Leírás</th>
<th>Tulajdonos</th>
</tr>
</thead>
<tbody id="game_manager_table">
</tbody>
</table>
</section>
<section>
<input type="button" value="Új játék" onclick="create_edit_game();">
<input type="button" value="Játék(ok) törlése" onclick="delete_games()">
</section>
<section class="window" shown="false" id="game_editor_window">
<section class="window-inner">
<section style="text-align: right">
<span>Név: <input type="text" id="game_name"></span><br>
<span>Leírás: <input type="text" id="game_description"></span><br>
<span>Tulajdonos: <input type="text" id="game_owner" readonly></span><br>
<section id="additional_controls">
<span>Szerkesztők: <input type="text" id="game_contributors"></span><br>
<span>Kérdés-fájl: <input type="button" id="download_challenges_btn" value="Letöltés CSV-ként" shown="false" onclick="download_challenges()">
<input type="button" value="Új feltöltése" id="show_game_file_upload" onclick="show_hide_gamefile_upload(true)">
<input type="file" id="game_file" shown="false">
<input type="button" value="Mégse" id="cancel_game_file_upload" shown="false" onclick="show_hide_gamefile_upload(false);"></span><br>
<span>Csoportok: <input type="text" id="game_groups"></span><br>
</section>
</section>
<span><input type="button" value="" id="game_editor_submit_btn"><input type="button" value="Mégse" onclick="hide('game_editor_window')"></span>
</section>
</section>
<script>
list_all_games();
</script>
</body>
</html>