Add: Maestro AccoutType 0 = experience account

This commit is contained in:
2018-08-10 07:14:05 +09:00
parent be02c06f3d
commit ade28a3334
4 changed files with 38 additions and 5 deletions
+1
View File
@@ -31,6 +31,7 @@ class MaestroInfo {
getMaxPlayerCount() { getMaxPlayerCount() {
switch(this.accountType) { switch(this.accountType) {
case 0:
case 1: case 1:
return 20; return 20;
case 2: case 2:
+16 -1
View File
@@ -5,7 +5,7 @@ let isAvailableIDName = false;
let registeredMaestroIDName = ""; let registeredMaestroIDName = "";
let registeredEmail = ""; let registeredEmail = "";
let registeredPassword = ""; let registeredPassword = "";
let registeredAccountType = -1;
let newMaestroIDName = ""; let newMaestroIDName = "";
let newEmail = ""; let newEmail = "";
@@ -34,6 +34,8 @@ function loadMaestroInfo(maestroID) {
registeredEmail = jsonData.email; registeredEmail = jsonData.email;
$("#email").val(registeredEmail); $("#email").val(registeredEmail);
registeredAccountType = jsonData.accountType;
}, },
(errorMessage, errorCode) => { (errorMessage, errorCode) => {
@@ -85,6 +87,11 @@ function checkMaestroIDName() {
} }
function changeMaestroInfo() { function changeMaestroInfo() {
if(registeredAccountType === 0) {
showErrorMessage("체험 계정은 정보 수정이 불가능합니다.", "error");
return;
}
newMaestroIDName = $("#maestro_id").val(); newMaestroIDName = $("#maestro_id").val();
if(newMaestroIDName.length === 0) { if(newMaestroIDName.length === 0) {
showErrorMessage("변경할 아이디를 입력해 주세요.", "error"); showErrorMessage("변경할 아이디를 입력해 주세요.", "error");
@@ -130,6 +137,14 @@ function changeMaestroInfo() {
} }
function checkPassword() { function checkPassword() {
if(registeredAccountType === 0) {
showErrorMessage("체험 계정은 암호 수정이 불가능합니다.", "error");
$('html, body').animate({
scrollTop: $("#message_box").offset().top + 'px'
}, 'fast');
return;
}
registeredPassword = $("#prev_password").val(); registeredPassword = $("#prev_password").val();
if(registeredPassword.length === 0) { if(registeredPassword.length === 0) {
showErrorMessage("현재 암호를 입력해 주세요.", "error"); showErrorMessage("현재 암호를 입력해 주세요.", "error");
+17
View File
@@ -28,6 +28,23 @@ function loadMaestroInfo(maestroID) {
function updateCards(accountType) { function updateCards(accountType) {
console.log(accountType); console.log(accountType);
switch(accountType) { switch(accountType) {
case 0:
$("#account_type_1").addClass("border-warning");
$("#account_type_1_btn").addClass("btn-secondary disabled");
$("#account_type_1_footer").addClass("text-danger");
$("#account_type_1_footer").text("체험 계정은 업그레이드가 불가능합니다.");
$("#account_type_2").addClass("border-warning");
$("#account_type_2_btn").addClass("btn-secondary disabled");
$("#account_type_2_footer").addClass("text-danger");
$("#account_type_2_footer").text("체험 계정은 업그레이드가 불가능합니다.");
$("#account_type_3").addClass("border-warning");
$("#account_type_3_btn").addClass("btn-secondary disabled");
$("#account_type_3_footer").addClass("text-danger");
$("#account_type_3_footer").text("체험 계정은 업그레이드가 불가능합니다.");
break;
case 1: case 1:
$("#account_type_1").addClass("border-warning"); $("#account_type_1").addClass("border-warning");
$("#account_type_1_btn").addClass("btn-secondary disabled"); $("#account_type_1_btn").addClass("btn-secondary disabled");
@@ -5,7 +5,7 @@ include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php"; include "./../setup/connect_db.php";
$maestro_experience_id = get_maestro_experience_id("test"); $maestro_experience_id = get_maestro_experience_id();
if($maestro_experience_id === null) { if($maestro_experience_id === null) {
set_error_message("등록된 마에스트로 관리자 계정이 없습니다."); set_error_message("등록된 마에스트로 관리자 계정이 없습니다.");
send_result_fail(); send_result_fail();
@@ -33,16 +33,16 @@ send_result_success();
exit; exit;
function get_maestro_experience_id($maestro_name) { function get_maestro_experience_id() {
global $db_conn; global $db_conn;
$query = " $query = "
SELECT MaestroID SELECT MaestroID
FROM moty_maestro FROM moty_maestro
WHERE Name = ? WHERE AccountType = 0
"; ";
$stmt = $db_conn->prepare($query); $stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $maestro_name); // $stmt->bind_param("s", $maestro_name);
$stmt->execute(); $stmt->execute();
$stmt->bind_result($maestro_experience_id); $stmt->bind_result($maestro_experience_id);
// while($stmt->fetch()) { // while($stmt->fetch()) {