Add: admin pages

This commit is contained in:
2018-07-09 11:51:29 +09:00
parent 2d4143fca3
commit 9a8b8fc417
10 changed files with 416 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
<html>
<head>
<title>관리자 페이지</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="./../css/module.css">
<link rel="stylesheet" type="text/css" href="./../css/color_button.css">
<script type="text/javascript" src="./../../../resources/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="./../js/main.js"></script>
<script type="text/javascript">
$(document).ready(function() {
sessionStorage.setItem("maestroID", -1);
$("#section").load("admin_section.html");
});
function login() {
let name = $("#maestro_name").val();
let password = $("#password").val();
let xhr = new XMLHttpRequest(); //new로 생성.
xhr.open('POST', './../server/maestro/login.php', true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("maestro_name=" + name + "&password=" + password);
xhr.onload = function() {
if(xhr.readyState === 4 && xhr.status === 200) {
let replyJSON = JSON.parse(xhr.responseText);
// console.log(replyJSON);
// if(replyJSON !== null)
// console.log(replyJSON);
// if(replyJSON["MaestroID"] !== undefined)
// console.log(replyJSON["MaestroID"]);
if(replyJSON !== null && replyJSON["MaestroID"] !== undefined && replyJSON["MaestroID"] !== null) {
maestroID = replyJSON["MaestroID"];
sessionStorage.setItem("maestroID", maestroID);
location.href = 'admin_register_list.html';
} else {
$("#error_message").val(replyJSON["ERROR"]);
}
}
}
}
</script>
</head>
<body bgcolor="white">
<div>
관리자 아이디
<input type="text" id="maestro_name" name="maestro_name"><br/>
암호
<input type="password" id="password" name="password"><br/>
</div>
<div class="col alignCenter">
<a id="login" class="btn btn-sea width400" onClick="login()">로그인</a>
</div>
</body>
</html>