초코어드민으로 분리된 관리자 기능 삭제

관리자 기능이 초코어드민 프로젝트로 분리되어 운영 중이므로
chocomae에 남아있던 관련 코드를 제거한다.

- src/web/admin (관리자 HTML 8개) 삭제
- src/web/server/admin (관리자 PHP 엔드포인트 9개) 삭제
- src/web/css/admin.css 삭제
- AGENTS.md, README.md에서 관리자 관련 안내 정리

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
jisangsandClaude Sonnet 5.5 committed 2026-11-02 18:13:43 +09:00
1 parent c268f0bb25
commit 50aee3bb4e
20 files changed
+1 -2353

No files matched your search

+1 -3
View File
@@ -45,7 +45,6 @@ src/
│ ├── js/ # 프론트엔드 JavaScript │ ├── js/ # 프론트엔드 JavaScript
│ ├── css/ # 스타일시트 │ ├── css/ # 스타일시트
│ ├── server/ # PHP 백엔드 엔드포인트 │ ├── server/ # PHP 백엔드 엔드포인트
│ ├── admin/ # 관리자 패널 HTML
│ ├── popup/ # 팝업/모달 HTML │ ├── popup/ # 팝업/모달 HTML
│ └── sql/ # 데이터베이스 스키마 및 시드 파일 │ └── sql/ # 데이터베이스 스키마 및 시드 파일
├── php-cli/ # PHP 배치 스크립트 (cron으로 실행) ├── php-cli/ # PHP 배치 스크립트 (cron으로 실행)
@@ -67,7 +66,6 @@ test/ # 수동 테스트용 HTML/JS 파일 (자동화된 테스트
- `player/` — 플레이어 계정 CRUD - `player/` — 플레이어 계정 CRUD
- `record/` — 게임 결과 및 랭킹 저장/조회 - `record/` — 게임 결과 및 랭킹 저장/조회
- `maestro/` — 교사 학급 관리 (17개 엔드포인트) - `maestro/` — 교사 학급 관리 (17개 엔드포인트)
- `admin/` — 관리자 운영 (11개 엔드포인트)
- `license_timer/` — 구독/라이선스 관리 - `license_timer/` — 구독/라이선스 관리
- `mail/` — PHPMailer + Gmail SMTP를 통한 이메일 발송 - `mail/` — PHPMailer + Gmail SMTP를 통한 이메일 발송
- `lib/` — 공용 PHP 라이브러리 (`send_reply_json.php`, `db_maestro.php` 등) - `lib/` — 공용 PHP 라이브러리 (`send_reply_json.php`, `db_maestro.php` 등)
@@ -86,7 +84,7 @@ test/ # 수동 테스트용 HTML/JS 파일 (자동화된 테스트
|------|-------------| |------|-------------|
| Player | 게임을 플레이하는 최종 사용자 (무료 또는 유료) | | Player | 게임을 플레이하는 최종 사용자 (무료 또는 유료) |
| Maestro | 학생 플레이어 그룹을 관리하는 교사 | | Maestro | 학생 플레이어 그룹을 관리하는 교사 |
| Admin | 전체 권한을 가진 시스템 관리자 | | Admin | 전체 권한을 가진 시스템 관리자 (별도 프로젝트인 초코어드민에서 운영) |
### Python 배치 스크립트 ### Python 배치 스크립트
-1
View File
@@ -7,7 +7,6 @@
- 초코마에 어드민 - 초코마에 어드민
- https://chocoadmin.jinaju.com/ - https://chocoadmin.jinaju.com/
- 계정 정보: jisangs / friends - 계정 정보: jisangs / friends
- (구) http://chocomae.jinaju.com/mouse_typing/src/web/admin/login.html
## 스테이지 서버 ## 스테이지 서버
-188
View File
@@ -1,188 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<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" src="./../js/request_server.js"></script>
<script type="text/javascript" src="./../../game/lib/util/number_util.js"></script>
<script type="text/javascript" src="./../js/lib/account_info.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#search_name").keydown(function(key) {
if(key.keyCode == 13) {
searchMaestro();
}
});
$("#header").load("admin_header.html");
loadMaestroList("");
});
function searchMaestro() {
var maestroName = $("#search_name").val();
console.log("searchMaestro : " + maestroName);
if(maestroName.length === 0) {
showErrorMessage("검색할 마에스트로 아이디를 입력하세요.", "error");
$("#search_name").focus();
}
loadMaestroList(maestroName);
}
function loadMaestroList(maestroName) {
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/maestro_all_list.php",
"maestro_name=" + maestroName,
function(jsonData) {
updateMaestroList(jsonData["maestroList"]);
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessag, "error");
}
);
}
function updateMaestroList(jsonList) {
$("#maestro_list_result_contents").empty();
printContents(jsonList);
}
function printContents(jsonList) {
if(jsonList === undefined || jsonList.length === 0) {
$("#maestro_list_result_contents").append(
"<div class='alert alert-danger text-center' role='alert'>"
+ "마에스트로 계정 정보가 없습니다."
+ "</div>"
);
return;
}
for(var i = 0; i < jsonList.length; i++) {
var maestroInfo = jsonList[i];
var status = accountStatus(jsonList[i].accountType, jsonList[i].activateStatus);
var statusColorClass = accountStatusColorClass(status);
var type = accountType(jsonList[i].accountType);
var registerDate = jsonList[i].acceptClausesDateTime.substring(0, 10);
var availableDate = jsonList[i].availableActivateDateTime.substring(0, 10);
if(availableDate.charAt(0) == '0')
availableDate = "";
$("#maestro_list_result_contents").append(
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_id d-none' value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='col-sm-1 text-right" + statusColorClass + "' value='" + status + "'>"
+ " <input type='text' class='col-sm text-left' value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='col-sm text-right' value='" + type + "'>"
+ " <input type='text' class='col-sm text-right' value='" + registerDate + "'>"
+ " <input type='text' class='col-sm text-right' value='" + availableDate + "'>"
+ " <input type='text' class='col-sm-1 text-right' value='" + jsonList[i].playerCount + "'>"
+ " <input type='button' class='col-sm-1' disabled value='-' onClick=';'>"
+ "</div>"
);
}
}
function register(inputButton) {
// var id = $(inputButton).siblings(".maestro_id d-none");
// var maestroID = id.text();
var children = inputButton.parentElement.childNodes;
var maestroID = "";
for (var i=0; i < children.length; i++) {
// console.log(children);
if (children[i].className == "maestro_id d-none") {
maestroID = children[i].value;
break;
}
}
// console.log(maestroID);
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/register_maestro.php",
"maestro_id=" + maestroID,
function(jsonData) {
showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">마에스트로 전체 목록</h3>
</div>
<div id="message_box"></div>
<div class="row mx-1">
<div class="col">
<h5 class="my-3">마에스트로 검색</h5>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="search_name">마에스트로 아이디</label>
</div>
<input type="text" class="form-control" id="search_name" placeholder="Input maestro ID here" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button type="button" class="btn btn-primary" onClick="searchMaestro()">검색 실행</button>
</div>
</div>
</div>
</div>
<div class="row mx-1">
<div class="col border border-warning rounded" style="background-color: #ffeab6">
<h5 class="my-3">검색 결과</h5>
<form id="search_player_list">
<div class="form-group row mx-2 mb-0 font-weight-bold">
<label class="col-form-label col-sm-1 text-center">타입</label>
<label class="col-form-label d-none">ID</label>
<label class="col-form-label col-sm text-left">마에스트로 아이디</label>
<label class="col-form-label col-sm text-right">요금제</label>
<label class="col-form-label col-sm text-right">등록일</label>
<label class="col-form-label col-sm text-right">유효기간</label>
<label class="col-form-label col-sm-1 text-right">학생수</label>
<label class="col-form-label col-sm-1 text-center">비활성화</label>
</div>
<div id="maestro_list_result_contents"></div>
</form>
</div> <!-- 학생 목록 -->
</div>
</div> <!-- container -->
</body>
</html>
-76
View File
@@ -1,76 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<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() {
$("#header").load("admin_header.html");
});
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">계정 유효기간 만료 목록</h3>
</div>
<div id="message_box"></div>
<div class="row mx-1">
<div class="col">
<h5 class="my-3">마에스트로 검색</h5>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="search_name">마에스트로 아이디</label>
</div>
<input type="text" class="form-control" id="search_name" placeholder="Input maestro ID here" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button type="button" class="btn btn-primary">검색 실행</button>
</div>
</div>
</div>
</div>
<div class="row mx-1">
<div class="col border border-warning rounded" style="background-color: #ffeab6">
<h5 class="my-3">검색 결과</h5>
<form id="search_player_list">
<div class="form-group row mx-2 mb-0 font-weight-bold">
<label class="col-form-label d-none">Upgrade ID</label>
<label class="col-form-label col-sm text-center">아이디</label>
<label class="col-form-label col-sm text-center">현재 계정</label>
<label class="col-form-label col-sm text-center">업그레이드</label>
<label class="col-form-label col-sm text-center">추가 금액</label>
<label class="col-form-label col-sm text-center">요청 날짜</label>
<label class="col-form-label col-sm-1 text-center"></label>
</div>
<div id="maestro_list_result_contents"></div>
</form>
</div> <!-- 학생 목록 -->
</div>
</div> <!-- container -->
</body>
</html>
-248
View File
@@ -1,248 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="./../../../resources/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="./../../game/lib/util/number_util.js"></script>
<script type="text/javascript" src="./../js/main.js"></script>
<script type="text/javascript" src="./../js/maestro_available_date.js"></script>
<script type="text/javascript" src="./../js/request_server.js"></script>
<script type="text/javascript" src="./../js/lib/account_info.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#search_name").keydown(function(key) {
if(key.keyCode == 13) {
searchMaestroExtension();
}
});
$("#header").load("admin_header.html");
loadMaestroExtensionList("");
});
function loadMaestroExtensionList(maestroName) {
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/maestro_extension_list.php",
"maestro_name=" + maestroName,
function(jsonData) {
updateMaestroExtensionList(jsonData["maestroExtensionList"]);
},
function(errorMessage, errorCode) {
console.log(errorMessage);
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
}
function updateMaestroExtensionList(jsonList) {
$("#maestro_list_result_contents").empty();
printContents(jsonList);
}
function printContents(jsonList) {
if(jsonList === undefined || jsonList.length === 0) {
$("#maestro_list_result_contents").append(
"<div class='alert alert-danger text-center' role='alert'>"
+ "마에스트로 계정 정보가 없습니다."
+ "</div>"
);
return;
}
for(var i = 0; i < jsonList.length; i++) {
if(jsonList[i].status == 1) {
$("#maestro_list_result_contents").append(
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_extension_id d-none' disabled value='" + jsonList[i].maestroExtensionID + "'>"
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='maestro_name col-sm' disabled value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='registered_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
+ " <input type='text' class='availableDate col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
// + " <input type='text' class='new_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>"
// + " <input type='text' class='col-sm text-right' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
+ " <input type='text' class='col-sm' disabled value='" + status(jsonList[i].status) + "'>"
+ " <input type='button' class='col-sm-1' value='↑' onClick='extend(this)'>"
+ "</div>"
);
} else {
$("#maestro_list_result_contents").append(
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_extension_id d-none' disabled value='" + jsonList[i].maestroExtensionID + "'>"
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='maestro_name col-sm text-success' disabled value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='registered_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
+ " <input type='text' class='availableDate col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
// + " <input type='text' class='new_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
+ " <input type='text' class='col-sm text-success text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>"
// + " <input type='text' class='col-sm text-success' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
+ " <input type='text' class='col-sm text-success' disabled value='" + status(jsonList[i].status) + "'>"
+ " <input type='button' class='col-sm-1' disabled value='Ω' onClick='extend(this)'>"
+ "</div>"
);
}
}
}
function searchMaestroExtension() {
var maestroName = $("#search_name").val();
if(maestroName.length === 0) {
$("#error_message").text("마에스트로 아이디를 입력하세요.");
$("#search_name").focus();
}
loadMaestroExtensionList(maestroName);
}
function extend(inputButton) {
// var extensionID = $(inputButton).siblings(".maestro_extension_id");
// var maestroExtensionID = extensionID.text();
// var maestroID = $(inputButton).siblings(".maestro_id");
// var id = maestroID.text();
// var accountType = $(inputButton).siblings(".requested_account_type");
var children = inputButton.parentElement.childNodes;
var maestroExtensionID;
var maestroID;
var maestroName;
var availableDate;
var registeredAccountType;
for (var i=0; i < children.length; i++) {
// console.log(children);
if (children[i].className == "maestro_extension_id d-none") {
maestroExtensionID = children[i].value;
continue;
} else if (children[i].className == "maestro_id d-none") {
maestroID = children[i].value;
continue;
} else if (children[i].className == "maestro_name col-sm") {
maestroName = children[i].value;
continue;
} else if (children[i].className == "maestro_name col-sm text-success") {
maestroName = children[i].value;
continue;
} else if (children[i].className == "availableDate col-sm text-right") {
availableDate = children[i].value;
continue;
} else if (children[i].className == "registered_account_type col-sm text-right") {
registeredAccountType = accountTypeValue(children[i].value);
continue;
}
}
var availableDateArray = availableDate.split("-");
// console.log("year : " + availableDateArray[0]);
// console.log("month : " + availableDateArray[1]);
// console.log("day : " + availableDateArray[2]);
var endDate = new Date(availableDateArray[0], availableDateArray[1] - 1, availableDateArray[2]);
// console.log("endDate : " + endDate);
var maestroAvailableDate = new MaestroAvailableDate();
maestroAvailableDate.setEndDate(endDate);
newAvailableDate = maestroAvailableDate.getNewAvailableDate();
// console.log("newAvailableDate : " + newAvailableDate);
// console.log(maestroExtensionID);
// console.log(maestroID);
// console.log(maestroName);
// // console.log(availableDate);
// console.log(newAvailableDate);
// console.log(registeredAccountType);
// return;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/extension_maestro.php",
// $maestro_name, $new_available_date, $maestro_email
"maestro_extension_id=" + maestroExtensionID
+ "&maestro_id=" + maestroID
+ "&maestro_name=" + maestroName
+ "&new_available_date=" + newAvailableDate
+ "&registered_account_type=" + registeredAccountType,
function(jsonData) {
loadMaestroExtensionList("");
$("#error_message").text(jsonData.maestroName + " 계정의 유효 기간이 1년 연장되었습니다.");
},
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
}
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">마에스트로 유효 기간 연장 목록</h3>
</div>
<div id="message_box"></div>
<div class="row mx-1">
<div class="col">
<h5 class="my-3">마에스트로 검색</h5>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="search_name">마에스트로 아이디</label>
</div>
<input type="text" class="form-control" id="search_name" placeholder="Input maestro ID here" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button type="button" class="btn btn-primary" onClick="searchMaestroExtension()">검색 실행</button>
</div>
</div>
</div>
</div>
<div class="row mx-1">
<div class="col border border-warning rounded" style="background-color: #ffeab6">
<h5 class="my-3">검색 결과</h5>
<form id="search_player_list">
<div class="form-group row mx-2 mb-0 font-weight-bold">
<label class="col-form-label d-none">Extension ID</label>
<label class="col-form-label col-sm text-left">아이디</label>
<label class="col-form-label col-sm text-right">요금제</label>
<label class="col-form-label col-sm text-right">유효기간</label>
<label class="col-form-label col-sm text-right">연장 신청일</label>
<label class="col-form-label col-sm text-left">상태</label>
<label class="col-form-label col-sm-1 text-center">승인</label>
</div>
<div id="maestro_list_result_contents"></div>
</form>
</div> <!-- 학생 목록 -->
</div>
</div> <!-- container -->
</body>
</html>
-47
View File
@@ -1,47 +0,0 @@
<!DOCTYPE html>
<style>
.home {
display: inline-block;
float: left;
padding: 0px;
margin: 0px;
}
.header_menu {
float: right;
padding: 0px;
margin: 0px;
}
.header_menu li {
float: left;
list-style: none;
}
</style>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark py-3">
<div class="container">
<div class="navbar-header">
<a class="btn btn-warning btn-lg vertical-align: middle; align-items-center" href="./../main/index.html">
<img src="./../../../resources/image/icon/icon_chocomae.png" style="position: relative; bottom: 2px; width: 24px; height: auto;">
&nbsp;초코마에
</a>
</div>
<div class="eyebrow ml-auto mt-0 d-md-flex align-items-center">
<a class="btn btn-outline-warning btn-lg mr-2" href="./../admin/admin_all_list.html">전체</a>
<a class="btn btn-outline-warning btn-lg mr-2" href="./../admin/admin_register_list.html">신규 등록</a>
<a class="btn btn-outline-warning btn-lg mr-2" href="./../admin/admin_extension_list.html">연장</a>
<a class="btn btn-outline-warning btn-lg mr-2" href="./../admin/admin_upgrade_list.html">업그레이드</a>
<a class="btn btn-outline-warning btn-lg mr-2" href="./../admin/admin_expiration_list.html">계정 만료</a>
<a class="btn btn-primary btn-lg" href="./../admin/admin_send_email.html">이메일 발송</a>
</div>
</div> <!-- container -->
</nav>
-175
View File
@@ -1,175 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<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" src="./../js/request_server.js"></script>
<script type="text/javascript" src="./../../game/lib/util/number_util.js"></script>
<script type="text/javascript" src="./../js/lib/account_info.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#search_name").keydown(function(key) {
if(key.keyCode == 13) {
searchMaestro();
}
});
$("#header").load("admin_header.html");
loadMaestroList("");
});
function searchMaestro() {
var maestroName = $("#search_name").val();
console.log("searchMaestro : " + maestroName);
if(maestroName.length === 0) {
showErrorMessage("검색할 마에스트로 아이디를 입력하세요.", "error");
$("#search_name").focus();
}
loadMaestroList(maestroName);
}
function loadMaestroList(maestroName) {
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/maestro_registered_list.php",
"maestro_name=" + maestroName,
function(jsonData) {
updateMaestroList(jsonData["maestroList"]);
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessag, "error");
}
);
}
function updateMaestroList(jsonList) {
$("#maestro_list_result_contents").empty();
printContents(jsonList);
}
function printContents(jsonList) {
if(jsonList === undefined || jsonList.length === 0) {
$("#maestro_list_result_contents").append(
"<div class='alert alert-danger text-center' role='alert'>"
+ "마에스트로 계정 정보가 없습니다."
+ "</div>"
);
return;
}
for(var i = 0; i < jsonList.length; i++) {
$("#maestro_list_result_contents").append(
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_id d-none' value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='col-sm' value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='col-sm text-right' value='" + accountType(jsonList[i].accountType) + "'>"
+ " <input type='text' class='col-sm text-right' value='" + jsonList[i].acceptClausesDateTime.substring(0, 10) + "'>"
+ " <input type='button' class='col-sm-1' value='+' onClick='register(this)'>"
+ " <input type='button' class='col-sm-1' disabled value='-'>"
+ "</div>"
);
}
}
function register(inputButton) {
// var id = $(inputButton).siblings(".maestro_id d-none");
// var maestroID = id.text();
var children = inputButton.parentElement.childNodes;
var maestroID = "";
for (var i=0; i < children.length; i++) {
// console.log(children);
if (children[i].className == "maestro_id d-none") {
maestroID = children[i].value;
break;
}
}
// console.log(maestroID);
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/register_maestro.php",
"maestro_id=" + maestroID,
function(jsonData) {
showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">신규 마에스트로 등록 목록</h3>
</div>
<div id="message_box"></div>
<div class="row mx-1">
<div class="col">
<h5 class="my-3">마에스트로 검색</h5>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="search_name">마에스트로 아이디</label>
</div>
<input type="text" class="form-control" id="search_name" placeholder="Input maestro ID here" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button type="button" class="btn btn-primary" onClick="searchMaestro()">검색 실행</button>
</div>
</div>
</div>
</div>
<div class="row mx-1">
<div class="col border border-warning rounded" style="background-color: #ffeab6">
<h5 class="my-3">검색 결과</h5>
<form id="search_player_list">
<div class="form-group row mx-2 mb-0 font-weight-bold">
<label class="col-form-label d-none">ID</label>
<label class="col-form-label col-sm text-left">마에스트로 아이디</label>
<label class="col-form-label col-sm text-right">요금제</label>
<label class="col-form-label col-sm text-right">등록일</label>
<label class="col-form-label col-sm-1 text-center">승인</label>
<label class="col-form-label col-sm-1 text-center">삭제</label>
</div>
<div id="maestro_list_result_contents"></div>
</form>
</div> <!-- 학생 목록 -->
</div>
</div> <!-- container -->
</body>
</html>
-320
View File
@@ -1,320 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<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" src="./../js/request_server.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#header").load("admin_header.html");
});
function sendNaverMail() {
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/mail/send_mail_test.php",
"",
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailRegisterBankInfo() {
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailRegisterBankInfo" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailRegisterDone() {
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailRegistered" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailUpgradeBankInfo() {
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
var upgradeAccountType = 3;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailUpgradeBankInfo" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType + "&upgrade_account_type=" + upgradeAccountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailUpgradeDone() {
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
var upgradeAccountType = 3;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailUpgradeDone" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType + "&upgrade_account_type=" + upgradeAccountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailUpdateMaestroName() {
var maestroNamePrev = "삼화초전전전";
var maestroName = "삼화초후후후";
var email = "jisangs@daum.net";
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailUpdateMaestroName" + "&maestro_name=" + maestroName + "&maestro_name_prev=" + maestroNamePrev + "&email=" + email,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailUpdateMaestroEmail() {
var maestroName = "삼화초";
var emailPrev = "jisangs@daum.net";
var email = encodeURIComponent("support+chocomae.automail@jinaju.com"); // "jisangs@gmail.com";
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailUpdateMaestroEmail" + "&maestro_name=" + maestroName + "&email=" + email + "&email_prev=" + emailPrev,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailExtensionBankInfo() {
var maestroName = "삼화초";
var maestroEmail = "jisangs@daum.net";
var availableDate = "2019-11-16";
var newAvailableDate = "2020-11-16";
var registeredAccountType = 3;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/mail/send_mail_test.php",
"type=sendMailExtensionBankInfo"
// $maestro_name, $available_date, $new_available_date, $maestro_email, $registered_account_type
+ "&maestro_name=" + maestroName
+ "&available_date=" + availableDate
+ "&new_available_date=" + newAvailableDate
+ "&email=" + maestroEmail
+ "&registered_account_type=" + registeredAccountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function sendMailExtensionDone() {
var maestroName = "삼화초";
var maestroEmail = "jisangs@daum.net";
var newAvailableDate = "2020-11-16";
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
"type=sendMailExtensionDone"
// $maestro_name, $new_available_date, $maestro_email
+ "&maestro_name=" + maestroName
+ "&email=" + maestroEmail
+ "&new_available_date=" + newAvailableDate,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
function getMaestroData() {
var maestroID = 1;
var maestroName = "삼화초";
var email = "jisangs@daum.net";
var accountType = 1;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
// "./../server/mail/send_mail_bank_info.php",
"./../server/mail/send_mail_test.php",
// "type=get_maestro_data" + "&maestro_id=" + maestroID,
"type=get_maestro_data" + "&maestro_id=" + maestroID + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType,
function(jsonData) {
console.log(jsonData);
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
// loadMaestroList("");
},
function(errorMessage, errorCode) {
showErrorMessage(errorMessage, "error");
}
);
}
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">이메일 발송</h3>
</div>
<div id="message_box"></div>
<button type="button" class="btn btn-primary" onClick="sendNaverMail()">네이버 메일 발송</button>
<br/>
<br/>
<button type="button" class="btn btn-primary" onClick="sendMailRegisterBankInfo()">[ 마에 ] 입금 계좌 안내 메일 발송</button>
<button type="button" class="btn btn-primary" onClick="sendMailRegisterDone()">[ 마에 ] 등록 완료 메일 발송</button>
<br/>
<br/>
<button type="button" class="btn btn-primary" onClick="sendMailUpgradeBankInfo()">[ 마에 ] 업그레이드 - 입금 계좌 안내 메일 발송</button>
<button type="button" class="btn btn-primary" onClick="sendMailUpgradeDone()">[ 마에 ] 업그레이드 완료 메일 발송</button>
<br/>
<br/>
<button type="button" class="btn btn-primary" onClick="sendMailUpdateMaestroName()">[ 마에 ] 정보 변경 - 아이디</button>
<button type="button" class="btn btn-primary" onClick="sendMailUpdateMaestroEmail()">[ 마에 ] 정보 변경 - 이메일</button>
<br/>
<br/>
<button type="button" class="btn btn-primary" onClick="sendMailExtensionBankInfo()">[ 마에 ] 연장 신청</button>
<button type="button" class="btn btn-primary" onClick="sendMailExtensionDone()">[ 마에 ] 연장 승인</button>
<br/>
<br/>
<button type="button" class="btn btn-secondary" onClick="getMaestroData()">마에스트로 데이터 테스트</button>
</div> <!-- container -->
</body>
</html>
-256
View File
@@ -1,256 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>마우스 타자 관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="./../../../resources/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="./../../game/lib/util/number_util.js"></script>
<script type="text/javascript" src="./../js/main.js"></script>
<script type="text/javascript" src="./../js/request_server.js"></script>
<script type="text/javascript" src="./../js/lib/account_info.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#search_name").keydown(function(key) {
if(key.keyCode == 13) {
searchMaestroUpgrade();
}
});
$("#header").load("admin_header.html");
loadMaestroUpgradeList("");
});
function loadMaestroUpgradeList(maestroName) {
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/maestro_upgrade_list.php",
"maestro_name=" + maestroName,
function(jsonData) {
updateMaestroUpgradeList(jsonData["maestroUpgradeList"]);
},
function(errorMessage, errorCode) {
console.log(errorMessage);
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
}
function updateMaestroUpgradeList(jsonList) {
$("#maestro_list_result_contents").empty();
printContents(jsonList);
}
function printContents(jsonList) {
if(jsonList === undefined || jsonList.length === 0) {
$("#maestro_list_result_contents").append(
"<div class='alert alert-danger text-center' role='alert'>"
+ "마에스트로 계정 정보가 없습니다."
+ "</div>"
);
return;
}
for(var i = 0; i < jsonList.length; i++) {
if(jsonList[i].status == 1) { // 요청
var tableRowString =
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_upgrade_id d-none' disabled value='" + jsonList[i].maestroUpgradeID + "'>"
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='col-sm' disabled value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='registered_activate_status col-sm text-right' disabled value='" + activateStatus(jsonList[i].registeredActivateStatus) + "'>";
if(jsonList[i].registeredActivateStatus == 1) { // 체험
tableRowString +=
" <input type='text' class='registered_account_type col-sm text-right' disabled value='" + trialAccountType(jsonList[i].registeredAccountType) + "'>";
} else { // 0: 미승인, 2: 활성화, 100: 환불
tableRowString +=
" <input type='text' class='registered_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
}
tableRowString +=
" <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
+ " <input type='text' class='new_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>";
if(jsonList[i].registeredActivateStatus == 1) { // 체험
tableRowString +=
" <input type='text' class='col-sm text-right' disabled value='" + NumberUtil.numberWithCommas(accountTypePrice(jsonList[i].requestedAccountType)) + "'>";
} else { // 0: 미승인, 2: 활성화, 100: 환불
tableRowString +=
" <input type='text' class='col-sm text-right' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>";
}
tableRowString +=
" <input type='text' class='col-sm' disabled value='" + status(jsonList[i].status) + "'>"
+ " <input type='button' class='col-sm-1' value='↑' onClick='upgrade(this)'>"
+ "</div>";
$("#maestro_list_result_contents").append(tableRowString);
}
/*
else { // status == 2: 취소, 3: 업그레이드 적용
$("#maestro_list_result_contents").append(
"<div class='form-group player-list row mx-2 mb-1'>"
+ " <input type='text' class='maestro_upgrade_id d-none' disabled value='" + jsonList[i].maestroUpgradeID + "'>"
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
+ " <input type='text' class='col-sm text-success' disabled value='" + jsonList[i].maestroName + "'>"
+ " <input type='text' class='registered_account_type col-sm text-right text-success' disabled value='" + activateStatus(jsonList[i].registeredActivateStatus) + "'>"
+ " <input type='text' class='registered_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
+ " <input type='text' class='new_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
+ " <input type='text' class='col-sm text-success text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>"
+ " <input type='text' class='col-sm text-success' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
+ " <input type='text' class='col-sm text-success' disabled value='" + status(jsonList[i].status) + "'>"
+ " <input type='button' class='col-sm-1' disabled value='Ω' onClick='upgrade(this)'>"
+ "</div>"
);
}
*/
}
}
function searchMaestroUpgrade() {
var maestroName = $("#search_name").val();
if(maestroName.length === 0) {
$("#error_message").text("마에스트로 아이디를 입력하세요.");
$("#search_name").focus();
}
loadMaestroUpgradeList(maestroName);
}
function upgrade(inputButton) {
// var upgradeID = $(inputButton).siblings(".maestro_upgrade_id");
// var maestroUpgradeID = upgradeID.text();
// var maestroID = $(inputButton).siblings(".maestro_id");
// var id = maestroID.text();
// var accountType = $(inputButton).siblings(".requested_account_type");
// var upgradeAccountType = accountTypeValue(accountType.val());
var children = inputButton.parentElement.childNodes;
var maestroUpgradeID;
var maestroID;
var registeredActiveStatus;
var registeredAccountType;
var upgradeAccountType;
for (var i=0; i < children.length; i++) {
// console.log(children);
if (children[i].className == "maestro_upgrade_id d-none") {
maestroUpgradeID = children[i].value;
continue;
} else if (children[i].className == "maestro_id d-none") {
maestroID = children[i].value;
continue;
} else if (children[i].className == "registered_activate_status col-sm text-right") {
// upgradeAccountType = children[i].value;
registeredActiveStatus = activateStatusValue(children[i].value);
continue;
} else if (children[i].className == "registered_account_type col-sm text-right") {
// upgradeAccountType = children[i].value;
registeredAccountType = accountTypeValue(children[i].value);
continue;
} else if (children[i].className == "new_account_type col-sm text-right") {
// upgradeAccountType = children[i].value;
upgradeAccountType = accountTypeValue(children[i].value);
continue;
}
}
// console.log(maestroUpgradeID);
// console.log(maestroID);
// console.log(registeredAccountType);
// console.log(upgradeAccountType);
// return;
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/upgrade_maestro.php",
"maestro_upgrade_id=" + maestroUpgradeID
+ "&maestro_id=" + maestroID
+ "&registered_activate_status=" + registeredActiveStatus
+ "&registered_account_type=" + registeredAccountType
+ "&upgrade_account_type=" + upgradeAccountType,
function(jsonData) {
loadMaestroUpgradeList("");
$("#error_message").text("마에스트로 계정이 정상적으로 업그레이드되었습니다.");
},
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
}
</script>
</head>
<body style="background-color: white">
<header id="header"></header>
<div class="container mt-3">
<div class="row mx-1">
<h3 class="my-3">마에스트로 업그레이드 목록</h3>
</div>
<div id="message_box"></div>
<div class="row mx-1">
<div class="col">
<h5 class="my-3">마에스트로 검색</h5>
<div class="input-group mb-3">
<div class="input-group-prepend">
<label class="input-group-text" for="search_name">마에스트로 아이디</label>
</div>
<input type="text" class="form-control" id="search_name" placeholder="Input maestro ID here" aria-label="Recipient's username" aria-describedby="basic-addon2">
<div class="input-group-append">
<button type="button" class="btn btn-primary" onClick="searchMaestroUpgrade()">검색 실행</button>
</div>
</div>
</div>
</div>
<div class="row mx-1">
<div class="col border border-warning rounded" style="background-color: #ffeab6">
<h5 class="my-3">검색 결과</h5>
<form id="search_player_list">
<div class="form-group row mx-2 mb-0 font-weight-bold">
<label class="col-form-label d-none">Upgrade ID</label>
<label class="col-form-label col-sm text-left">아이디</label>
<label class="col-form-label col-sm text-right">현 활성화 상태</label>
<label class="col-form-label col-sm text-right">현 요금제</label>
<label class="col-form-label col-sm text-right">유효기간</label>
<label class="col-form-label col-sm text-right">Upg 요금제</label>
<label class="col-form-label col-sm text-right">Upg 신청일</label>
<label class="col-form-label col-sm text-right">추가 금액</label>
<label class="col-form-label col-sm text-left">상태</label>
<label class="col-form-label col-sm-1 text-center">승인</label>
</div>
<div id="maestro_list_result_contents"></div>
</form>
</div> <!-- 학생 목록 -->
</div>
</div> <!-- container -->
</body>
</html>
-84
View File
@@ -1,84 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<title>관리자 페이지</title>
<link rel="icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/mouse_typing/resources/image/icon/favicon.ico" type="image/x-icon" />
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<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" src="./../js/request_server.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#password").keydown(function(key) {
if(key.keyCode == 13) {
login();
}
});
$("#section").load("admin_section.html");
});
function login() {
var name = $("#admin_name").val();
var password = $("#password").val();
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
"./../server/admin/login.php",
"admin_name=" + name + "&password=" + password,
function(jsonData) {
location.href = 'admin_all_list.html';
},
function(errorMessage, errorCode) {
if($("#error_message").length) {
$("#error_message").text(errorMessage);
}
}
);
}
</script>
</head>
<body style="background-color: white">
<div class="container">
<div class="border border-primary rounded px-5 py-4 my-3">
<h4 class="mb-4">로그인</h4>
<div id="message_box"></div>
<form class="mx-4">
<div class="form-group row">
<label for="maestro_name" class="col-sm-2 col-form-label">* 관리자 아이디</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="admin_name" placeholder="아이디 입력">
</div>
</div>
<div class="form-group row">
<label for="password" class="col-sm-2 col-form-label">* 암호</label>
<div class="col-sm-4">
<input type="password" class="form-control" id="password" placeholder="Password">
<p><br/></p>
<button type="button" class="btn btn-primary btn-lg px-5" onClick="login()">로그인</button>
</div>
</div>
</form>
</div>
</div>
</body>
</html>
-103
View File
@@ -1,103 +0,0 @@
@charset "utf-8";
<style type="text/css">
.hide {
display: none;
}
#section_add_maestro {
overflow: hidden;
}
#add_maestro {
float: left;
line-height: 2em;
width: 400px;
padding: 10px;
background-color: #aaaaff;
}
#maestro_list_result {
float: right;
line-height: 2em;
width: 600px;
padding: 10px;
background-color: #ffaaaa;
}
#maestro_list_result_contents {
vertical-align: top;
}
.maestro_list {
list-style: none;
}
.maestro_list > li > span {
line-height: normal;
}
.maestro_list > li > .maestro_id {
display: none;
}
.maestro_list .maestro_id {
background-color: #ffffff;
}
.maestro_list .maestro_name {
width: 200px;
background-color: #ffdddd;
}
.maestro_list .maestro_account_type {
width: 200px;
background-color: #ddffdd;
}
.maestro_list .maestro_update {
width: 200px;
background-color: #ddddff;
}
.maestro_list_navigator {
text-align: center;
}
.maestro_list_navigator > span {
line-height: normal;
}
.maestro_list_navigator > span > a {
cursor: pointer;
}
#search_maestro {
overflow: hidden;
}
#search_maestro_name {
float: left;
line-height: 2em;
width: 400px;
padding: 10px;
background-color: #aaaaff;
}
#search_result {
float: right;
line-height: 2em;
width: 600px;
padding: 10px;
background-color: #ffaaaa;
}
/*
#mouse_app_list {
overflow: hidden;
}
*/
</style>
-29
View File
@@ -1,29 +0,0 @@
<?php
// header('Content-Type: application/json');
include "send_error_code.php";
$active_stage_list = $_POST['active_stage'];
$cnt = count($active_stage_list);
include "./connect_db.php";
$query = "UPDATE afterschool_activated_stage SET Activated = 0";
$result = $db_conn->query($query);
for($i = 0; $i < $cnt; $i++) {
$array_item = $active_stage_list[$i];
$query = "UPDATE afterschool_activated_stage SET Activated = 1 WHERE StageName = ?";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('s', $array_item);
$stmt->execute();
if($stmt->affected_rows > 0) {
echo($array_item." : activated<br/>");
} else {
echo $array_item." : db error<br/>";
}
}
?>
@@ -1,84 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
// include "./../mail/mail_setting.php";
// include "./../mail/send_mail.php";
include './../mail/mail_setting.php';
include './../mail/mail_contents.php';
include './../lib/maestro_account_info.php';
include "./../mail/send_jinaju_mail.php";
$maestro_extension_id = $_POST["maestro_extension_id"];
$maestro_id = $_POST["maestro_id"];
$maestro_name = $_POST["maestro_name"];
$new_available_date = $_POST["new_available_date"];
$registered_account_type = $_POST["registered_account_type"];
extension_maestro($maestro_id, $new_available_date);
change_extension_request_status_to_close($maestro_id);
change_extension_request_status_to_applied($maestro_extension_id);
$maestro_data = get_maestro_data($maestro_id);
// $maestro_name, $new_available_date, $maestro_email
sendMailExtensionDone($maestro_data["name"], $new_available_date, $maestro_data["email"]);
insertMaestroLog("extension_maestro", $maestro_id, $maestro_name."(".$registered_account_type.")");
// set_data("maestro_extension_id", $maestro_extension_id);
// set_data("maestro_id", $maestro_id);
set_data("maestroName", $maestro_name);
send_result_success();
exit;
function extension_maestro($maestro_id, $new_available_date) {
global $db_conn;
// $query = "
// UPDATE maestro
// SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(AvailableActivateDateTime, INTERVAL 1 YEAR)
// WHERE MaestroID = ?;
// ";
$query = "
UPDATE maestro
SET ActivateStatus = 2, AvailableActivateDateTime = DATE_FORMAT(?, '%Y-%m-%d')
WHERE MaestroID = ?;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("si", $new_available_date, $maestro_id);
$stmt->execute();
}
function change_extension_request_status_to_close($maestro_id) {
global $db_conn;
$query = "
UPDATE maestro_extension
SET Status = 2
WHERE MaestroID = ? AND Status = 1;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestro_id);
$stmt->execute();
}
function change_extension_request_status_to_applied($maestro_extension_id) {
global $db_conn;
$query = "
UPDATE maestro_extension
SET Status = 3
WHERE MaestroExtensionID = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestro_extension_id);
$stmt->execute();
}
?>
-89
View File
@@ -1,89 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$adminName = $_POST["admin_name"];
$password = $_POST["password"];
$maestroID = get_admin_id($adminName);
if($maestroID === null) {
set_error_code("not_registered_id");
set_error_message("등록되지 않은 서비스 관리자 아이디입니다.");
send_result_fail();
exit;
}
$loginData = login($adminName, $password);
if($loginData === null) {
set_error_code("no_data");
set_error_message("로그인하지 못했습니다.");
send_result_fail();
exit;
} else if($loginData["activateStatus"] === 0) {
set_error_code("not_activated");
set_error_message("서비스 관리자 계정이 아직 활성화되지 않았습니다.");
send_result_fail();
exit;
} else if($loginData["adminID"] === null) {
set_error_code("wrong_password");
set_error_message("비밀번호가 틀렸습니다.");
send_result_fail();
exit;
}
set_data("adminID", $loginData["adminID"]);
set_data("accountType", $loginData["accountType"]);
set_data("activateStatus", $loginData["activateStatus"]);
send_result_success();
exit;
function get_admin_id($adminName) {
global $db_conn;
$query = "
SELECT AdminID
FROM admin
WHERE Name = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $adminName);
$stmt->execute();
$stmt->bind_result($maestroID);
// while($stmt->fetch()) {
// ;
// }
$stmt->fetch();
$stmt->close();
return $maestroID;
}
function login($adminName, $password) {
global $db_conn;
$query = "
SELECT AdminID, AccountType, ActivateStatus
FROM admin
WHERE Name = ? AND Password = PASSWORD(?)
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("ss", $adminName, $password);
$stmt->execute();
$stmt->bind_result($adminID, $accountType, $activateStatus);
// while($stmt->fetch())
$stmt->fetch();
$stmt->close();
$result["adminID"] = $adminID;
$result["accountType"] = $accountType;
$result["activateStatus"] = $activateStatus;
return $result;
}
?>
-80
View File
@@ -1,80 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestroName = $_POST["maestro_name"];
$maestroList = null;
if(strlen($maestroName) === 0)
$maestroList = get_maestro_list();
else
$maestroList = get_maestro_list_by_name($maestroName);
set_data("maestroList", $maestroList);
send_result_success();
exit;
function get_maestro_list() {
global $db_conn;
$query = "
SELECT MaestroID, Name, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
FROM maestro
ORDER BY MaestroID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
// $stmt->bind_param("ii", $maestroName, $startNo);
$stmt->execute();
$stmt->bind_result($maestroID, $name, $accountType, $activateStatus, $availableActivateDateTime , $acceptClausesDateTime, $playerCount);
$maestroList = array();
while($stmt->fetch()) {
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $name;
$maestro["accountType"] = $accountType;
$maestro["activateStatus"] = $activateStatus;
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
$maestro["playerCount"] = $playerCount;
array_push($maestroList, $maestro);
}
return $maestroList;
}
function get_maestro_list_by_name($maestroName) {
global $db_conn;
$query = "
SELECT MaestroID, Name, AccountType, ActivateStatus, AcceptClausesDateTime, PlayerCount
FROM maestro
WHERE Name LIKE CONCAT('%', ?, '%')
ORDER BY MaestroID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
$stmt->bind_param("s", $maestroName);
$stmt->execute();
$stmt->bind_result($maestroID, $name, $accountType, $activateStatus, $acceptClausesDateTime, $playerCount);
$maestroList = array();
while($stmt->fetch()) {
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $name;
$maestro["accountType"] = $accountType;
$maestro["activateStatus"] = $activateStatus;
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
$maestro["playerCount"] = $playerCount;
array_push($maestroList, $maestro);
}
return $maestroList;
}
?>
@@ -1,81 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestroName = $_POST["maestro_name"];
$maestroExtensionList = null;
if(strlen($maestroName) === 0)
$maestroExtensionList = get_maestro_extension_list();
else
$maestroExtensionList = get_maestro_extension_list_by_name($maestroName);
set_data("maestroExtensionList", $maestroExtensionList);
send_result_success();
exit;
function get_maestro_extension_list() {
global $db_conn;
$query = "
SELECT E.MaestroExtensionID, E.MaestroID, M.Name, E.AccountType, E.RequestedDateTime, M.AvailableActivateDateTime, E.Status
FROM maestro_extension E, maestro M
WHERE E.Status < 2 AND E.MaestroID = M.MaestroID
ORDER BY E.MaestroExtensionID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
// $stmt->bind_param("ii", $maestroName, $startNo);
$stmt->execute();
$stmt->bind_result($maestroExtensionID, $maestroID, $maestroName, $registeredAccountType, $requestedDateTime, $availableActivateDateTime, $status);
$maestroExtensionList = array();
while($stmt->fetch()) {
$maestro["maestroExtensionID"] = $maestroExtensionID;
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $maestroName;
$maestro["registeredAccountType"] = $registeredAccountType;
$maestro["requestedDateTime"] = $requestedDateTime;
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
$maestro["status"] = $status;
array_push($maestroExtensionList, $maestro);
}
return $maestroExtensionList;
}
function get_maestro_extension_list_by_name($searchMaestroName) {
global $db_conn;
$query = "
SELECT E.MaestroExtensionID, E.MaestroID, M.Name, E.AccountType, E.RequestedDateTime, M.AvailableActivateDateTime, E.Status
FROM maestro_extension E, maestro M
WHERE M.Name LIKE CONCAT('%', ?, '%') AND E.MaestroID = M.MaestroID
ORDER BY E.MaestroExtensionID DESC
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $searchMaestroName);
$stmt->execute();
$stmt->bind_result($maestroExtensionID, $maestroID, $maestroName, $registeredAccountType, $requestedDateTime, $availableActivateDateTime, $status);
$maestroExtensionList = array();
while($stmt->fetch()) {
$maestro["maestroExtensionID"] = $maestroExtensionID;
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $maestroName;
$maestro["registeredAccountType"] = $registeredAccountType;
$maestro["requestedDateTime"] = $requestedDateTime;
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
$maestro["status"] = $status;
array_push($maestroExtensionList, $maestro);
}
return $maestroExtensionList;
}
?>
@@ -1,76 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestroName = $_POST["maestro_name"];
$maestroList = null;
if(strlen($maestroName) === 0)
$maestroList = get_maestro_list();
else
$maestroList = get_maestro_list_by_name($maestroName);
set_data("maestroList", $maestroList);
send_result_success();
exit;
function get_maestro_list() {
global $db_conn;
$query = "
SELECT MaestroID, Name, AccountType, AcceptClausesDateTime
FROM maestro
WHERE ActivateStatus=0
ORDER BY MaestroID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
// $stmt->bind_param("ii", $maestroName, $startNo);
$stmt->execute();
$stmt->bind_result($maestroID, $name, $accountType, $acceptClausesDateTime);
$maestroList = array();
while($stmt->fetch()) {
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $name;
$maestro["accountType"] = $accountType;
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
array_push($maestroList, $maestro);
}
return $maestroList;
}
function get_maestro_list_by_name($maestroName) {
global $db_conn;
$query = "
SELECT MaestroID, Name, AccountType, AcceptClausesDateTime
FROM maestro
WHERE Name LIKE CONCAT('%', ?, '%') AND ActivateStatus=0
ORDER BY MaestroID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
$stmt->bind_param("s", $maestroName);
$stmt->execute();
$stmt->bind_result($maestroID, $name, $accountType, $acceptClausesDateTime);
$maestroList = array();
while($stmt->fetch()) {
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $name;
$maestro["accountType"] = $accountType;
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
array_push($maestroList, $maestro);
}
return $maestroList;
}
?>
@@ -1,85 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
$maestroName = $_POST["maestro_name"];
$maestroUpgradeList = null;
if(strlen($maestroName) === 0)
$maestroUpgradeList = get_maestro_upgrade_list();
else
$maestroUpgradeList = get_maestro_update_list_by_name($maestroName);
set_data("maestroUpgradeList", $maestroUpgradeList);
send_result_success();
exit;
function get_maestro_upgrade_list() {
global $db_conn;
$query = "
SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredActivateStatus, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, M.AvailableActivateDateTime, U.Status
FROM maestro_upgrade U, maestro M
WHERE U.Status < 2 AND U.MaestroID = M.MaestroID
ORDER BY U.MaestroUpgradeID DESC
";
$stmt = $db_conn->prepare($query);
// $stmt->bind_param("iii", $maestroID, $startNo, $endNo);
// $stmt->bind_param("ii", $maestroName, $startNo);
$stmt->execute();
$stmt->bind_result($maestroUpgradeID, $maestroID, $maestroName, $registeredActivateStatus, $registeredAccountType, $requestedAccountType, $requestedDateTime, $availableActivateDateTime, $status);
$maestroUpgradeList = array();
while($stmt->fetch()) {
$maestro["maestroUpgradeID"] = $maestroUpgradeID;
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $maestroName;
$maestro["registeredActivateStatus"] = $registeredActivateStatus;
$maestro["registeredAccountType"] = $registeredAccountType;
$maestro["requestedAccountType"] = $requestedAccountType;
$maestro["requestedDateTime"] = $requestedDateTime;
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
$maestro["status"] = $status;
array_push($maestroUpgradeList, $maestro);
}
return $maestroUpgradeList;
}
function get_maestro_update_list_by_name($searchMaestroName) {
global $db_conn;
$query = "
SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredActivateStatus, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, M.AvailableActivateDateTime, U.Status
FROM maestro_upgrade U, maestro M
WHERE M.Name LIKE CONCAT('%', ?, '%') AND U.MaestroID = M.MaestroID
ORDER BY U.MaestroUpgradeID DESC
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("s", $searchMaestroName);
$stmt->execute();
$stmt->bind_result($maestroUpgradeID, $maestroID, $maestroName, $registeredActivateStatus, $registeredAccountType, $requestedAccountType, $requestedDateTime, $availableActivateDateTime, $status);
$maestroUpgradeList = array();
while($stmt->fetch()) {
$maestro["maestroUpgradeID"] = $maestroUpgradeID;
$maestro["maestroID"] = $maestroID;
$maestro["maestroName"] = $maestroName;
$maestro["registeredActivateStatus"] = $registeredActivateStatus;
$maestro["registeredAccountType"] = $registeredAccountType;
$maestro["requestedAccountType"] = $requestedAccountType;
$maestro["requestedDateTime"] = $requestedDateTime;
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
$maestro["status"] = $status;
array_push($maestroUpgradeList, $maestro);
}
return $maestroUpgradeList;
}
?>
-247
View File
@@ -1,247 +0,0 @@
<?php
header("Content-Type: application/json");
error_reporting( E_ALL );
ini_set( "display_errors", 1 );
include "./../lib/send_reply_json.php";
include "./../setup/connect_db.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include './../mail/mail_setting.php';
include './../mail/mail_contents.php';
include './../lib/maestro_account_info.php';
include "./../mail/send_jinaju_mail.php";
$maestroID = $_POST["maestro_id"];
$result = register_maestro($maestroID);
if($result <= 0) {
set_error_message("마에스트로 계정 활성화 실패");
send_result_fail();
exit;
}
add_maestro_test_player($maestroID);
$playerID = get_maestro_test_player($maestroID);
if($playerID === null) {
set_error_message("마에스트로 테스트 플레이어 생성 실패");
send_result_fail();
exit;
}
$result = set_maestro_test_player($maestroID, $playerID);
if($result === null || $result === 0) {
set_error_message("마에스트로 테스트 플레이어 등록 실패");
send_result_fail();
exit;
}
add_default_activated_apps($maestroID);
add_maestro_sample_player_data($maestroID);
$count = count_registered_player($maestroID);
update_count_registered_player($maestroID, $count);
$maestro_data = get_maestro_data($maestroID);
sendMailRegisterDone($maestro_data["name"], $maestro_data["email"]);
insertMaestroLog("register_maestro", $maestroID, $maestro_data["name"]." / ".$maestro_data["email"]);
send_result_success();
exit;
function register_maestro($maestroID) {
global $db_conn;
// $query = "
// UPDATE maestro
// SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
// WHERE MaestroID = ?
// ";
// closed beta
$query = "
UPDATE maestro
SET ActivateStatus = 1, AvailableActivateDateTime = '2022-07-31 23:59:59'
WHERE MaestroID = ?
";
// (07/17) before 2 weeks from closing beta service
// $query = "
// UPDATE maestro
// SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 14 DAY)
// WHERE MaestroID = ?
// ";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestroID);
$stmt->execute();
return $stmt->affected_rows;
}
function add_maestro_test_player($maestroID) {
global $db_conn;
$query = "
INSERT INTO player (MaestroID, Name, EnterCode, AccountType)
VALUES (?, '마에스트로', '', 1)
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestroID);
$stmt->execute();
}
function get_maestro_test_player($maestroID) {
global $db_conn;
$query = "
SELECT PlayerID
FROM player
WHERE MaestroID = ? AND AccountType = 1
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestroID);
$stmt->execute();
$stmt->bind_result($playerID);
$stmt->fetch();
$stmt->close();
return $playerID;
}
function set_maestro_test_player($maestroID, $playerID) {
global $db_conn;
$query = "
UPDATE maestro
SET MaestroTestID = ?
WHERE MaestroID = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("ii", $playerID, $maestroID);
$stmt->execute();
return $stmt->affected_rows;
}
function add_default_activated_apps($maestroID) {
global $db_conn;
$query = "
SELECT AppID
FROM app
WHERE Status = 1;
";
$stmt = $db_conn->prepare($query);
$stmt->execute();
$stmt->bind_result($appID);
$activeAppList = array();
while($stmt->fetch()) {
array_push($activeAppList, $appID);
}
$stmt->close();
$count = count($activeAppList);
for($i = 0; $i < $count; $i++) {
$activeAppID = $activeAppList[$i];
$query = "
INSERT INTO active_app (MaestroID, AppID)
VALUES (?, ?);
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("ii", $maestroID, $activeAppID);
$stmt->execute();
$stmt->close();
}
}
function add_maestro_sample_player_data($maestro_id) {
$samplePlayerList = make_sample_player_list($maestro_id);
for($i = 0; $i < count($samplePlayerList); $i++) {
insert_maestro_sample_player_data($maestro_id, $samplePlayerList[$i]);
}
}
function insert_maestro_sample_player_data($maestro_id, $player) {
global $db_conn;
$query = "
INSERT INTO player (MaestroID, Name, EnterCode, AccountType)
VALUES (?, ?, ?, ?)
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("issi",
$maestro_id,
$player["Name"],
$player["EnterCode"],
$player["AccountType"]
);
$stmt->execute();
$stmt->close();
}
function make_sample_player_list() {
$samplePlayerList = array();
$player["Name"] = "050215";
$player["EnterCode"] = "050215";
$player["AccountType"] = 0;
array_push($samplePlayerList, $player);
$player["Name"] = "6-3_이철수";
$player["EnterCode"] = "1111";
$player["AccountType"] = 0;
array_push($samplePlayerList, $player);
$player["Name"] = "3-1김영희";
$player["EnterCode"] = "0301";
$player["AccountType"] = 0;
array_push($samplePlayerList, $player);
$player["Name"] = "홍길동";
$player["EnterCode"] = "181231";
$player["AccountType"] = 0;
array_push($samplePlayerList, $player);
return $samplePlayerList;
}
function count_registered_player($maestroID) {
global $db_conn;
$query = "
SELECT COUNT(PlayerID)
FROM player
WHERE MaestroID = ? AND AccountType = 0
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestroID);
$stmt->execute();
$stmt->bind_result($countPlayer);
// while($stmt->fetch())
$stmt->fetch();
$stmt->close();
return $countPlayer;
}
function update_count_registered_player($maestroID, $countPlayer) {
global $db_conn;
$query = "
UPDATE maestro
SET PlayerCount = ?
WHERE MaestroID = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("ii", $countPlayer, $maestroID);
$stmt->execute();
}
?>
-81
View File
@@ -1,81 +0,0 @@
<?php
header("Content-Type: application/json");
include "./../setup/connect_db.php";
include "./../lib/send_reply_json.php";
include "./../lib/db_maestro.php";
include "./../lib/maestro_log.php";
include "./../mail/mail_setting.php";
include './../mail/mail_setting.php';
include './../mail/mail_contents.php';
include './../lib/maestro_account_info.php';
include "./../mail/send_jinaju_mail.php";
$maestro_upgrade_id = $_POST["maestro_upgrade_id"];
$maestro_id = $_POST["maestro_id"];
$registered_activate_status = $_POST["registered_activate_status"];
$registered_account_type = $_POST["registered_account_type"];
$upgrade_account_type = $_POST["upgrade_account_type"];
upgrade_maestro($maestro_id, $upgrade_account_type);
change_upgrade_request_status_to_close($maestro_id);
change_upgrade_request_status_to_applied($maestro_upgrade_id);
$maestro_data = get_maestro_data($maestro_id);
if($registered_activate_status == 1) { // 체험
sendMailTrialMaestroUpgradeDone($maestro_data["name"], $maestro_data["email"], $registered_account_type, $upgrade_account_type);
} else { // 0: 미승인, 2: 활성화, 3: 환불
sendMailUpgradeDone($maestro_data["name"], $maestro_data["email"], $registered_account_type, $upgrade_account_type);
}
insertMaestroLog("upgrade_maestro", $maestro_id, $registered_account_type." -> ".$upgrade_account_type);
// set_data("maestro_upgrade_id", $maestro_upgrade_id);
// set_data("maestro_id", $maestro_id);
// set_data("upgrade_account_type", $upgrade_account_type);
send_result_success();
exit;
function upgrade_maestro($maestro_id, $upgrade_account_type) {
global $db_conn;
$query = "
UPDATE maestro
SET AccountType = ?, ActivateStatus = 2, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
WHERE MaestroID = ?;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("ii", $upgrade_account_type, $maestro_id);
$stmt->execute();
}
function change_upgrade_request_status_to_close($maestro_id) {
global $db_conn;
$query = "
UPDATE maestro_upgrade
SET Status = 2
WHERE MaestroID = ? AND Status = 1;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestro_id);
$stmt->execute();
}
function change_upgrade_request_status_to_applied($maestro_upgrade_id) {
global $db_conn;
$query = "
UPDATE maestro_upgrade
SET Status = 3
WHERE MaestroUpgradeID = ?
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param("i", $maestro_upgrade_id);
$stmt->execute();
}
?>