Add: add maestro
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
|
||||
let maestro_name = "";
|
||||
let isAvailableID = false;
|
||||
@@ -33,7 +33,8 @@ let isAvailableID = false;
|
||||
let password = "";
|
||||
let email = "";
|
||||
let accountType = 0;
|
||||
let selectedAccountTypeValue = "";
|
||||
let selectedAccountTypeValue = -1;
|
||||
let selectedAccountTypeText = "";
|
||||
|
||||
let tab1, tab2, tab3;
|
||||
|
||||
@@ -98,8 +99,10 @@ function check_data() {
|
||||
return;
|
||||
}
|
||||
|
||||
selectedAccountTypeValue = $("#account_type option:selected").text();
|
||||
selectedAccountTypeValue = $("#account_type option:selected").val();
|
||||
selectedAccountTypeText = $("#account_type option:selected").text();
|
||||
console.log(selectedAccountTypeValue);
|
||||
console.log(selectedAccountTypeText);
|
||||
|
||||
let isCheckAcceptClauses = $("#check_accept_clauses").is(":checked");
|
||||
if(!isCheckAcceptClauses) {
|
||||
@@ -111,8 +114,8 @@ function check_data() {
|
||||
$(".maestro_name").append(maestro_name);
|
||||
$(".password").append(password);
|
||||
$(".email").append(email);
|
||||
$(".account_type").append(selectedAccountTypeValue);
|
||||
$(".price_account").append(selectedAccountTypeValue);
|
||||
$(".account_type").append(selectedAccountTypeText);
|
||||
$(".price_account").append(selectedAccountTypeText);
|
||||
|
||||
$("#input_data").css("display", "none");
|
||||
$("#register_account").css("display", "block");
|
||||
@@ -127,6 +130,34 @@ function register_account() {
|
||||
|
||||
tab2.removeClass("activated");
|
||||
tab3.addClass("activated");
|
||||
|
||||
let xhr = new XMLHttpRequest(); //new로 생성.
|
||||
xhr.open('POST', './../server/maestro/add_maestro.php', true);
|
||||
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
xhr.send("maestro_name=" + maestro_name + "&password=" + password + "&email=" + email + "&account_type=" + selectedAccountTypeValue);
|
||||
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["Result"] !== undefined && replyJSON["Result"] === "ok") {
|
||||
// sessionStorage.setItem("maestroID", replyJSON["MaestroID"]);
|
||||
// location.href = './../maestro/main_menu.html';
|
||||
isAvailableID = true;
|
||||
} else {
|
||||
isAvailableID = false;
|
||||
$("#error_message").val(replyJSON["ERROR"]);
|
||||
$("#maestro_name").val("");
|
||||
$("#maestro_name").focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -146,15 +177,15 @@ function register_account() {
|
||||
|
||||
<div id="input_data">
|
||||
|
||||
(필수) 마에스트로 아이디 : <input type="text" id="maestro_name">
|
||||
(필수) 마에스트로 아이디 : <input type="text" id="maestro_name" value="test" >
|
||||
<button id="check_id" onClick="check_id()">중복 확인</button><br/>
|
||||
(필수) 암호 : <input id="password" type="password" name="password"><br/>
|
||||
(필수) 이메일 : <input id="email" name="email"><br/>
|
||||
(필수) 암호 : <input id="password" value="test" type="password" name="password"><br/>
|
||||
(필수) 이메일 : <input id="email" value="test@test.com" name="email"><br/>
|
||||
(필수) 학생 수 :
|
||||
<select id="account_type">
|
||||
<option name="account_type" value="1">20명 (1만원 / 1년)</option>
|
||||
<option name="account_type" value="1">50명 (2만원 / 1년)</option>
|
||||
<option name="account_type" value="1">100명 (3만원 / 1년)</option>
|
||||
<option name="account_type" value="2">50명 (2만원 / 1년)</option>
|
||||
<option name="account_type" value="3">100명 (3만원 / 1년)</option>
|
||||
</select>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
Reference in New Issue
Block a user