Fix: add player css, error_message css

This commit is contained in:
2018-07-13 20:14:51 +09:00
parent ab8ebb9ca1
commit 4edd637b05
10 changed files with 157 additions and 444 deletions
-3
View File
@@ -126,9 +126,6 @@
</header> </header>
<section id="section"> <section id="section">
<div id="error_message">
</div>
<div> <div>
<span id="search_maestro_name"> <span id="search_maestro_name">
<h1>검색</h1> <h1>검색</h1>
+2 -10
View File
@@ -1,11 +1,5 @@
@charset "utf-8"; @charset "utf-8";
<style type="text/css">
.hide {
display: none;
}
#section_add_player { #section_add_player {
overflow: hidden; overflow: hidden;
} }
@@ -93,11 +87,9 @@
background-color: #ffaaaa; background-color: #ffaaaa;
} }
/* /*
#mouse_app_list { #mouse_app_list {
overflow: hidden; overflow: hidden;
} }
*/ */
</style>
+17 -4
View File
@@ -1,7 +1,5 @@
@charset "utf-8"; @charset "utf-8";
<style type="text/css">
html { } html { }
body { } body { }
@@ -41,6 +39,22 @@ footer {
.hide {
display: none;
}
#error_message {
line-height: 1.5em;
width: 1004px;
padding: 10px;
margin: 10px;
background-color: #aaffff;
}
/* /*
#page-tabs { #page-tabs {
width: 1024px; width: 1024px;
@@ -107,5 +121,4 @@ label{
input[type="checkbox"]:checked + label{ input[type="checkbox"]:checked + label{
background-position: 0 -15px; background-position: 0 -15px;
} }
</style>
+1 -1
View File
@@ -28,7 +28,7 @@ function tabClicked(tabNo) {
$("#section_add_player").addClass("hide"); $("#section_add_player").addClass("hide");
$("#search_player_name").val(""); $("#search_player_name").val("");
searchPlayerListManager.setupSearchPlayerList(""); // searchPlayerListManager.setupSearchPlayerList("");
$("#search_player").removeClass("hide"); $("#search_player").removeClass("hide");
$("#mouse_app_list").addClass("hide"); $("#mouse_app_list").addClass("hide");
+14 -4
View File
@@ -12,9 +12,9 @@
class PlayerList { class PlayerList {
constructor(tagDiv, parent) { constructor(tagDiv, playerListManager) {
let self = this; let self = this;
this.parent = parent; this.playerListManager = playerListManager;
// console.log(tagDiv); // console.log(tagDiv);
this.playerCount = 0; this.playerCount = 0;
@@ -36,11 +36,11 @@ class PlayerList {
this.disableItem(this.listRows[i]); this.disableItem(this.listRows[i]);
$(id_list[i]).siblings(".player_edit").click(function() { $(id_list[i]).siblings(".player_edit").click(function() {
parent.editPlayer(this); playerListManager.editPlayer(this);
}) })
$(id_list[i]).siblings(".player_delete").click(function() { $(id_list[i]).siblings(".player_delete").click(function() {
parent.deletePlayer(this); playerListManager.deletePlayer(this);
}) })
// console.log(this.listRows[i].playerName.val()); // console.log(this.listRows[i].playerName.val());
// console.log(this.listRows[i]); // console.log(this.listRows[i]);
@@ -64,6 +64,16 @@ class PlayerList {
updatePlayerList(jsonData) { updatePlayerList(jsonData) {
// console.log(jsonData); // console.log(jsonData);
if(jsonData === null) {
for(let i = 0; i < 10; i++) {
$(this.listRows[i].playerName).val("");
$(this.listRows[i].enterCode).val("");
this.disableItem(this.listRows[i]);
}
return;
}
for(let i = 0; i < 10; i++) { for(let i = 0; i < 10; i++) {
$(this.listRows[i].playerID).empty(); $(this.listRows[i].playerID).empty();
+1 -304
View File
@@ -6,12 +6,12 @@
this.docNav = docNav; this.docNav = docNav;
this.list = new PlayerList(this.docList, this); this.list = new PlayerList(this.docList, this);
this.list.updatePlayerList(null);
this.listNavigator = new PlayerListNavigator(this.docNav); this.listNavigator = new PlayerListNavigator(this.docNav);
this.playerCount = 0; this.playerCount = 0;
this.activePageNo = 1; this.activePageNo = 1;
this.lastPageNo = 0; this.lastPageNo = 0;
} }
@@ -38,48 +38,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/registered_player_count.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
self.playerCount = jsonData["Count"];
self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
self.activePageNo = 1;
self.loadAddPlayerListPage(self.activePageNo);
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
}
}
*/
} }
loadAddPlayerListPage(pageNo) { loadAddPlayerListPage(pageNo) {
@@ -106,47 +64,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/registered_player_list.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&start_no=" + startNo + "&end_no=" + endNo);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
// console.log(jsonData["PlayerList"]);
// updatePlayerListPage(jsonData["PlayerList"]);
self.list.updatePlayerList(jsonData["PlayerList"]);
self.playerCount = jsonData["PlayerList"].length;
}
}
*/
} }
@@ -175,52 +92,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/registered_player_list.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&start_no=" + startNo + "&end_no=" + endNo);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
// console.log(jsonData["PlayerList"]);
self.list.updatePlayerList(jsonData["PlayerList"]);
self.playerCount = jsonData["PlayerList"].length;
// console.log(self.playerCount);
// self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
// self.activePageNo = 1;
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
}
}
*/
} }
@@ -247,47 +118,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/search_player_count.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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
self.playerCount = jsonData["Count"];
self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
self.activePageNo = 1;
self.updateSearchPlayerListPage(playerName, 1);
}
}
*/
} }
updateSearchPlayerListPage(playerName, pageNo) { updateSearchPlayerListPage(playerName, pageNo) {
@@ -315,51 +145,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/search_player_list.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&player_name=" + playerName + "&start_no=" + startNo + "&end_no=" + endNo);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
// console.log(jsonData["PlayerList"]);
self.list.updatePlayerList(jsonData["PlayerList"]);
self.playerCount = jsonData["PlayerList"].length;
// self.lastPageNo = Math.ceil( (self.playerCount + 1) / 10 );
// self.activePageNo = 1;
self.listNavigator.updateNavigator(self.activePageNo, self.lastPageNo);
}
}
*/
} }
@@ -429,50 +214,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/edit_player.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID + "&player_name=" + playerName + "&enter_code=" + playerEnterCode);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
console.log(clickedObjectID);
if(clickedObjectID === "add_player_list") {
self.setupAddPlayerList();
} else if(clickedObjectID === "search_player_list") {
let playerName = $("#search_name").val();
self.setupSearchPlayerList(playerName);
}
}
}
*/
} }
deletePlayer(inputButton) { deletePlayer(inputButton) {
@@ -506,50 +247,6 @@
} }
); );
/*
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/player/delete_player.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_id=" + maestroID + "&player_id=" + playerID);
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 jsonData = JSON.parse(xhr.responseText);
// console.log(jsonData);
if(jsonData === null) {
console.log("no data from server");
return;
}
if(jsonData["ERROR"] !== undefined || jsonData["RESULT"] === undefined) {
console.log(jsonData["ERROR"]);
return;
}
if(jsonData["RESULT"] === "fail") {
console.log(jsonData["RESULT"]);
return;
}
console.log(clickedObjectID);
if(clickedObjectID === "add_player_list") {
self.setupAddPlayerList();
} else if(clickedObjectID === "search_player_list") {
let playerName = $("#search_name").val();
self.setupSearchPlayerList(playerName);
}
}
}
*/
} }
getClickedObjectID(clickedObject) { getClickedObjectID(clickedObject) {
+117 -114
View File
@@ -54,124 +54,127 @@ function addPlayer() {
</div> </div>
<span id="add_player"> <div>
<h2>추가</h2> <span id="add_player">
<h2>추가</h2>
<h3>1명 추가</h3> <h3>1명 추가</h3>
<div> <div>
학생 이름 <input type="text" name="name" id="add_player_name"><br/> 학생 이름 <input type="text" name="name" id="add_player_name"><br/>
입장 번호 <input type="text" name="entercode" id="add_player_enter_code"> 입장 번호 <input type="text" name="entercode" id="add_player_enter_code">
<input type='button' value="추가"" onClick="addPlayer()" > <input type='button' value="추가"" onClick="addPlayer()" >
</div> </div>
<!-- <!--
<h3>단체 추가</h3> <h3>단체 추가</h3>
<form action="/action_page.php" method="get" id="add_players"> <form action="/action_page.php" method="get" id="add_players">
<textarea> <textarea>
엑셀에서 아래와 같이 셀에 입력한 후에 복사하고 붙여넣기 엑셀에서 아래와 같이 셀에 입력한 후에 복사하고 붙여넣기
학생 이름 | 입장 코드 학생 이름 | 입장 코드
학생 이름 | 입장 코드 학생 이름 | 입장 코드
... ...
</textarea> </textarea>
<button type="submit" form="add_players">추가</button> <button type="submit" form="add_players">추가</button>
</form> </form>
<textarea> <textarea>
학생 이름 : (한글) 10글자, (영문) 20글자까지 입력 가능 학생 이름 : (한글) 10글자, (영문) 20글자까지 입력 가능
입장 코드 : 숫자 1~6자리 수 입장 코드 : 숫자 1~6자리 수
</textarea> </textarea>
--> -->
</span> </span>
<span id="search_result"> <span id="search_result">
학생 목록 학생 목록
<div id="player_list_result_contents"> <div id="player_list_result_contents">
<ul id="add_player_list" class="player_list"> <ul id="add_player_list" class="player_list">
<li> <li>
<span class="player_name">이름</span> <span class="player_name">이름</span>
<span class="player_entercode">입장 코드</span> <span class="player_entercode">입장 코드</span>
<input type='button' value='전체 삭제' onClick="deletePlayer('all')"> <input type='button' value='전체 삭제' onClick="deletePlayer('all')">
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name" value="test"> <input type='text' class="player_name" value="test">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name" value="test"> <input type='text' class="player_name" value="test">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
<li> <li>
<span class="player_id"></span> <span class="player_id"></span>
<input type='text' class="player_name"> <input type='text' class="player_name">
<input type='text' class="player_entercode"> <input type='text' class="player_entercode">
<input type='button' class="player_edit" value='수정'> <input type='button' class="player_edit" value='수정'>
<input type='button' class="player_delete" value='삭제'> <input type='button' class="player_delete" value='삭제'>
</li> </li>
</ul> </ul>
</div> </div>
<div id="add_player_list_navigator" class="player_list_navigator"> <div id="add_player_list_navigator" class="player_list_navigator">
<span><a onClick="onClickPlayerListPage(this, 'first')"></a></span> <span><a onClick="onClickPlayerListPage(this, 'first')"></a></span>
<span><a onClick="onClickPlayerListPage(this, 'prev')"> </a></span> <span><a onClick="onClickPlayerListPage(this, 'prev')"> </a></span>
<span id="page_no_area"></span> <span id="page_no_area"></span>
<span><a onClick="onClickPlayerListPage(this, 'next')"> </a></span> <span><a onClick="onClickPlayerListPage(this, 'next')"> </a></span>
<span><a onClick="onClickPlayerListPage(this, 'last')"></a></span> <span><a onClick="onClickPlayerListPage(this, 'last')"></a></span>
</div> </div>
</span> </span>
</div>
+3 -2
View File
@@ -6,7 +6,8 @@ $(document).ready(function() {
$("#search_player_list_navigator > #page_no_area") $("#search_player_list_navigator > #page_no_area")
); );
searchPlayerListManager.setupSearchPlayerList(""); // searchPlayerListManager.setupSearchPlayerList("");
console.log("search - ready");
}); });
@@ -17,6 +18,7 @@ function searchPlayer() {
if(playerName.length === 0) { if(playerName.length === 0) {
// $("#search_name_notice").val("학생 이름을 입력하세요."); // $("#search_name_notice").val("학생 이름을 입력하세요.");
$("#search_name").focus(); $("#search_name").focus();
return;
} }
searchPlayerListManager.setupSearchPlayerList(playerName); searchPlayerListManager.setupSearchPlayerList(playerName);
@@ -25,7 +27,6 @@ function searchPlayer() {
</script> </script>
<span id="search_player_name"> <span id="search_player_name">
<h1>검색</h1> <h1>검색</h1>
@@ -22,7 +22,7 @@ exit;
function getPlayerCount($maestroID, $playerName) { function getPlayerCount($maestroID, $playerName) {
global $db_conn; global $db_conn;
$query = "SELECT COUNT(PlayerID) FROM moty_player WHERE MaestroID = ? AND Name = ?"; $query = "SELECT COUNT(PlayerID) FROM moty_player WHERE MaestroID = ? AND Name LIKE CONCAT('%', ?, '%')";
$stmt = $db_conn->prepare($query); $stmt = $db_conn->prepare($query);
$stmt->bind_param("is", $maestroID, $playerName); $stmt->bind_param("is", $maestroID, $playerName);
$stmt->execute(); $stmt->execute();
+1 -1
View File
@@ -27,7 +27,7 @@ function get_player_list_page($maestroID, $playerName, $startNo, $endNo) {
$query = " $query = "
SELECT PlayerID, Name, EnterCode FROM moty_player SELECT PlayerID, Name, EnterCode FROM moty_player
WHERE MaestroID=? AND Name=? WHERE MaestroID = ? AND Name LIKE CONCAT('%', ?, '%')
ORDER BY PlayerID DESC ORDER BY PlayerID DESC
LIMIT ?, 10; LIMIT ?, 10;
"; ";