Fix: player list manager

This commit is contained in:
2018-07-04 09:28:43 +09:00
parent 8d9e48af39
commit 4413f0de0b
10 changed files with 175 additions and 138 deletions
+6 -38
View File
@@ -7,7 +7,7 @@ $(document).ready(function() {
// searchPlayerList = new PlayerList($("#search_player_list"));
// searchPlayerListNavigator = new PlayerListNavigator($("#search_player_list_navigator > #page_no_area"));
searchPlayerListManager.updateSearchPlayerListPage(1);
searchPlayerListManager.setupSearchPlayerList("");
});
@@ -20,40 +20,7 @@ function searchPlayer() {
$("#add_player_name").focus();
}
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/user/search_player.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&player_name=" + playerName);
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;
}
loadPlayerListPage(1);
}
}
searchPlayerListManager.setupSearchPlayerList(playerName);
}
</script>
@@ -61,9 +28,10 @@ function searchPlayer() {
<span id="search_player">
검색
아이디
<input type="text" id="search_name"><button>찾기</button><br/>
<h1>검색</h1>
학생 이름
<input type="text" id="search_name"><input type="submit" name="찾기" onClick="searchPlayer()"><br/>
<br/>
<!--