238 lines
8.6 KiB
HTML
238 lines
8.6 KiB
HTML
<script type="text/javascript">
|
|
|
|
var maestroInfo = new MaestroInfo();
|
|
var isMaestroInfoLoaded = false;
|
|
|
|
var addPlayerListManager = null;
|
|
var searchPlayerListManager = null;
|
|
|
|
|
|
$(document).ready(function() {
|
|
$("#section_help").load("./../module/maestro_section_help.html");
|
|
$("#section_add_player").load("./../module/maestro_section_add_player.html");
|
|
$("#section_search_player").load("./../module/maestro_section_search.html");
|
|
$("#section_app_activation").load("./../module/maestro_section_app_activation.html");
|
|
// $("#mouse_app_list").load("./../module/maestro_section_mouse_app.html");
|
|
// $("#typing_app_list").load("./../module/maestro_section_typing_app.html");
|
|
$("#section_app_setting").load("./../module/maestro_section_app_setting.html");
|
|
$("#section_record").load("./../module/maestro_section_record.html");
|
|
|
|
maestroInfo.loadMaestroInfo(onLoadSuccessMaestroInfo, onLoadFailMaestroInfo);
|
|
});
|
|
|
|
function isExperienceMaestroAccount() {
|
|
var maestroAccountType = maestroInfo.accountType;
|
|
console.log("maestroAccountType : " + maestroAccountType);
|
|
if(maestroAccountType == 101)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
function showEndDate(date) {
|
|
var endDateArray = date.split(" ");
|
|
var endDate = endDateArray[0]; // "YY-MM_DD"
|
|
|
|
var today = new Date();
|
|
var endDay = new Date(endDate);
|
|
var diffDay = (endDay.getTime() - today.getTime()) / (1000 * 60 * 60 * 24);
|
|
|
|
$("#maestro_count_down_date").html("유효 기간 : ~ " + endDate + " <span id='countdown_day'>(남은 기간 : " + Math.ceil(diffDay) + "일)</span>");
|
|
if(diffDay < 30)
|
|
$("#countdown_day").addClass("text-danger");
|
|
else if(diffDay < 10)
|
|
$("#countdown_day").addClass("bg-danger text-light");
|
|
else if(diffDay < 0)
|
|
$("#countdown_day").addClass("bg-secondary text-light");
|
|
else
|
|
$("#countdown_day").addClass("text-muted");
|
|
}
|
|
|
|
|
|
function onLoadSuccessMaestroInfo() {
|
|
showEndDate(maestroInfo.availableActivateDateTime);
|
|
$("#maestro_info_player_count").val("학생수 : " + maestroInfo.getRegisteredPlayerCount() + " / " + maestroInfo.getMaxPlayerCount());
|
|
|
|
if(maestroInfo.getRegisteredPlayerCount() === maestroInfo.getMaxPlayerCount()) {
|
|
$("#maestro_info_player_count").addClass("text-danger borer-danger");
|
|
} else if(maestroInfo.getRegisteredPlayerCount() + 5 > maestroInfo.getMaxPlayerCount()) {
|
|
$("#maestro_info_player_count").addClass("text-danger");
|
|
}
|
|
|
|
if(isExperienceMaestroAccount() && !isMaestroInfoLoaded) {
|
|
isMaestroInfoLoaded = true;
|
|
$("#experienceMaestroModal").modal();
|
|
}
|
|
}
|
|
|
|
function onLoadFailMaestroInfo(errorMessage, errorCode) {
|
|
console.log("errorMessage : " + errorMessage);
|
|
console.log("errorCode : " + errorCode);
|
|
}
|
|
|
|
function refreshAddPlayerList() {
|
|
addPlayerListManager.refreshAddPlayerListPage();
|
|
}
|
|
|
|
function refreshSearchPlayerList() {
|
|
searchPlayerListManager.refreshSearchPlayerListPage();
|
|
}
|
|
|
|
function onChangePlayerCount() {
|
|
maestroInfo.loadMaestroInfo(onLoadSuccessMaestroInfo, onLoadFailMaestroInfo);
|
|
}
|
|
|
|
function onClickMaestroUpgrade() {
|
|
// console.log("onClickMaestroUpgrade");
|
|
location.href='./../maestro/upgrade.html';
|
|
}
|
|
|
|
function activateApp(appID) {
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/app/activate_app.php",
|
|
"maestro_id=" + maestroID + "&app_id=" + appID,
|
|
|
|
(function(jsonData) {
|
|
// console.log(jsonData);
|
|
showErrorMessage("[ " + jsonData["koreanName"] + "] 앱 버튼이 활성화 되었습니다. 이제 모든 학생들이 [ " + jsonData["koreanName"] + "] 앱을 실행할 수 있습니다.<br/>(상단 메뉴중 [앱 실행] 버튼을 눌러, 마에스트로 계정 화면에서 앱이 활성화 된 것을 확인해보세요)", "success");
|
|
}),
|
|
|
|
(function(errorMessage, errorCode) {
|
|
showErrorMessage(errorMessage, "error");
|
|
})
|
|
|
|
);
|
|
}
|
|
|
|
function deactivateApp(appID) {
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/app/deactivate_app.php",
|
|
"maestro_id=" + maestroID + "&app_id=" + appID,
|
|
|
|
(function(jsonData) {
|
|
// console.log(jsonData);
|
|
showErrorMessage("[ " + jsonData["koreanName"] + "] 앱 버튼이 비활성화 되었습니다. <br/>(상단 메뉴중 [앱 실행] 버튼을 눌러, 마에스트로 계정 화면에서 앱이 비활성화 된 것을 확인해보세요)", "danger");
|
|
}),
|
|
|
|
(function(errorMessage, errorCode) {
|
|
showErrorMessage(errorMessage, "error");
|
|
})
|
|
|
|
);
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
<div class="modal fade" id="experienceMaestroModal" tabindex="-1" role="dialog" aria-labelledby="experienceMaestroModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header alert-danger">
|
|
<h5 class="modal-title" id="exerienceMaestroModalLabel">체험 마에스트로 로그인</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
▶ [체험 마에스트로 계정] 데이터 초기화
|
|
<br/>
|
|
- 학생 목록이 샘플 데이터로 초기화되었습니다.<br/>
|
|
- 다른 사람이 "체험 마에스트로" 계정으로 로그인 할 때에도, 모든 데이터가 초기화됩니다.<br/>
|
|
<br/>
|
|
▶ 체험판 [마에스트로 앱] 기능 제한 안내<br/>
|
|
- 타자, 마우스 앱 연습 결과가 서버에 저장되지 않습니다.<br/>
|
|
- 모든 컨텐츠는 20초만 플레이하실 수 있습니다.<br/>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">닫기</button>
|
|
<!-- <button type="button" class="btn btn-primary">Save changes</button> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container py-3">
|
|
<div class="row border rounded border-dark py-2 mx-0 mb-3">
|
|
<div id="maestro_count_down_date" class="col-sm-6 my-auto text-left"></div>
|
|
|
|
<div class="col-sm-6 d-md-flex align-items-right">
|
|
<div class="input-group my-auto">
|
|
<input type="text" id="maestro_info_player_count" class="form-control px-2 mx-0" value="학생수 :">
|
|
<div class="input-group-append">
|
|
<a class="btn btn-primary px-2 mr-2" role="button" href="./../maestro/upgrade.html">업그레이드</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="btn btn-primary my-auto" href="./../maestro/setup.html">계정 정보 수정</a>
|
|
</div>
|
|
|
|
</div> <!-- row border -->
|
|
|
|
<div class="row mx-0">
|
|
<div class="col px-0">
|
|
<div id="message_box"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<ul class="nav nav-tabs card-header-tabs" id="myTab" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="help-tab" data-toggle="tab" href="#help" role="tab" aria-controls="help" aria-selected="false">도움말</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="add-tab" data-toggle="tab" href="#add" role="tab" aria-controls="add" aria-selected="true">학생 목록</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="search-tab" data-toggle="tab" href="#search" role="tab" aria-controls="search" aria-selected="false">학생 검색</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="app-activation-tab" data-toggle="tab" href="#app-activation" role="tab" aria-controls="activation" aria-selected="false">앱 활성화</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="app-setting-tab" data-toggle="tab" href="#app-setting" role="tab" aria-controls="app-setting" aria-selected="false">앱 설정</a>
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
<a class="nav-link active" id="record-tab" data-toggle="tab" href="#record" role="tab" aria-controls="record" aria-selected="false">학생 기록</a>
|
|
</li>
|
|
</ul> <!-- 탭 -->
|
|
</div> <!-- card header -->
|
|
|
|
<div class="card-body" id="myTabContent">
|
|
<div class="tab-content" id="myTabContent">
|
|
|
|
<div class="tab-pane fade mt-3" id="help" role="tabpanel" aria-labelledby="help">
|
|
<div id="section_help"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade mt-3" id="add" role="tabpanel" aria-labelledby="add-tab">
|
|
<div id="section_add_player"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade mt-3" id="search" role="tabpanel" aria-labelledby="search-tab">
|
|
<div id="section_search_player"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade mt-3" id="app-activation" role="tabpanel" aria-labelledby="app-activation-tab">
|
|
<div id="section_app_activation"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade mt-3" id="app-setting" role="tabpanel" aria-labelledby="app-setting-tab">
|
|
<div id="section_app_setting"></div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade show active mt-3" id="record" role="tabpanel" aria-labelledby="record-tab">
|
|
<div id="section_record"></div>
|
|
</div>
|
|
</div> <!-- tab-content -->
|
|
</div> <!-- card-body -->
|
|
|
|
</div> <!-- card --> |