diff --git a/src/web/module/maestro_section_main.html b/src/web/module/maestro_section_main.html index 543fbbd..ccc5556 100644 --- a/src/web/module/maestro_section_main.html +++ b/src/web/module/maestro_section_main.html @@ -15,6 +15,55 @@ display: none; } +.player_list { + overflow: hidden; +} + +#add_player { + float: left; + line-height: 2em; + width: 400px; + padding: 10px; + background-color: #aaaaff; +} + +#player_list_result { + float: right; + line-height: 2em; + width: 500px; + padding: 10px; + background-color: #ffaaaa; +} + +#player_list_result_contents { + vertical-align: top; +} + +#registered_player_list { + list-style: none; +} + +#registered_player_list > li { + display: inline-block; + vertical-align: middle; + text-align: center; +} + +#registered_player_list .registered_player_list_name { + width: 200px; + background-color: #ffdddd; +} + +#registered_player_list .registered_player_list_entercode { + width: 200px; + background-color: #ddffdd; +} + +#registered_player_list .registered_player_update { + width: 200px; + background-color: #ddddff; +} + @@ -57,6 +106,56 @@ function tabClicked(tabNo) { } } +function addPlayer() { + let maestroID = sessionStorage.getItem("maestroID"); + let playerName = $("#add_player_name").val(); + let enterCode = $("#add_player_enter_code").val(); + + if(playerName.length === 0) { + $("#add_player_notice").val("학생 이름을 입력하세요."); + $("#add_player_name").focus(); + } else if(enterCode.length === 0) { + $("#add_player_notice").val("엔터 코드를 입력하세요."); + $("#add_player_enter_code").focus(); + } + + let xhr = new XMLHttpRequest(); //new로 생성. + xhr.open('POST', './../server/user/add_player.php', true); + xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr.send("maestro_id=" + maestroID + "&player_name=" + playerName + "&enter_code=" + enterCode); + xhr.onload = function() { + if(xhr.readyState === 4 && xhr.status === 200) { + // console.log(xhr.responseText); + // console.log(xhr.responseText.length); + if(xhr.responseText.length === 0 || xhr.responseText === null) { + console.log("no data from server"); + return; + } + + let replyJSON = JSON.parse(xhr.responseText); + // console.log(replyJSON); + + if(replyJSON === null) { + console.log("no data from server"); + return; + } + + if(replyJSON["ERROR"] !== undefined || replyJSON["RESULT"] === undefined) { + console.log(replyJSON["ERROR"]); + return; + } + + if(replyJSON["RESULT"] === "fail") { + console.log(replyJSON["RESULT"]); + return; + } + + console.log("update player list"); + } + } + +} + @@ -73,46 +172,54 @@ function tabClicked(tabNo) {
-

추가

+ +

추가

-

1명 추가

+

1명 추가

-
- - - -
+
+ 학생 이름
+ 입장 코드 + +
- + -

단체 추가

+

단체 추가

-
- - -
+ + + - + +
- -

목록

- -
+ 목록 - -
+
+ +
+