188 lines
6.5 KiB
HTML
188 lines
6.5 KiB
HTML
<script>
|
|
|
|
let registeredAccountType = -1;
|
|
|
|
|
|
$(document).ready(function() {
|
|
loadMaestroInfo(maestroID);
|
|
});
|
|
|
|
function loadMaestroInfo(maestroID) {
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/maestro/maestro_info.php",
|
|
"maestro_id=" + maestroID,
|
|
|
|
(jsonData) => {
|
|
// console.log(jsonData);
|
|
registeredAccountType = jsonData.accountType;
|
|
updateCards(registeredAccountType);
|
|
},
|
|
|
|
(errorMessage, errorCode) => {
|
|
showErrorMessage(errorMessage, "error");
|
|
}
|
|
|
|
);
|
|
}
|
|
|
|
function updateCards(accountType) {
|
|
console.log(accountType);
|
|
switch(accountType) {
|
|
case 1:
|
|
$("#account_type_1").addClass("border-warning");
|
|
$("#account_type_1_btn").addClass("btn-secondary disabled");
|
|
$("#account_type_1_footer").addClass("text-warning");
|
|
$("#account_type_1_footer").text("현재 적용된 요금제입니다.");
|
|
|
|
$("#account_type_2").addClass("border-primary");
|
|
$("#account_type_2_btn").addClass("btn-primary");
|
|
$("#account_type_2_footer").addClass("text-primary");
|
|
$("#account_type_2_footer").text("이 요금제로 업그레이드가 가능합니다.");
|
|
|
|
$("#account_type_3").addClass("border-primary");
|
|
$("#account_type_3_btn").addClass("btn-primary");
|
|
$("#account_type_3_footer").addClass("text-primary");
|
|
$("#account_type_3_footer").text("이 요금제로 업그레이드가 가능합니다.");
|
|
break;
|
|
|
|
case 2:
|
|
// $("#account_type_1").addClass("border-warning");
|
|
$("#account_type_1_btn").addClass("btn-secondary disabled");
|
|
$("#account_type_1_footer").addClass("text-muted");
|
|
$("#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-warning");
|
|
$("#account_type_2_footer").text("현재 적용된 요금제입니다.");
|
|
|
|
$("#account_type_3").addClass("border-primary");
|
|
$("#account_type_3_btn").addClass("btn-primary");
|
|
$("#account_type_3_footer").addClass("text-primary");
|
|
$("#account_type_3_footer").text("이 요금제로 업그레이드가 가능합니다.");
|
|
break;
|
|
|
|
case 3:
|
|
// $("#account_type_1").addClass("border-warning");
|
|
$("#account_type_1_btn").addClass("btn-secondary disabled");
|
|
$("#account_type_1_footer").addClass("text-muted");
|
|
$("#account_type_1_footer").text("낮은 요금제로 내릴 수는 없습니다.");
|
|
|
|
// $("#account_type_2").addClass("border-primary");
|
|
$("#account_type_2_btn").addClass("btn-secondary disabled");
|
|
$("#account_type_2_footer").addClass("text-muted");
|
|
$("#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-warning");
|
|
$("#account_type_3_footer").text("현재 적용된 요금제입니다.");
|
|
break;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
function upgradeMaestroInfo(accountType) {
|
|
console.log("upgrade to " + accountType);
|
|
let newAccountType = accountType;
|
|
|
|
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
|
"./../server/maestro/request_upgrade_maestro.php",
|
|
"maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType + "&new_account_type=" + newAccountType,
|
|
|
|
(jsonData) => {
|
|
// console.log(jsonData);
|
|
alert("업그레이드 요청이 등록되었습니다.");
|
|
location.href="main_menu.html";
|
|
},
|
|
|
|
(errorMessage, errorCode) => {
|
|
showErrorMessage(errorMessage, "error");
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="container my-3">
|
|
|
|
<div id="message_box">
|
|
</div>
|
|
|
|
<div class="card border-primary">
|
|
|
|
<div class="card-header bg-light"><span class="h4">요금제 업그레이드</span></div>
|
|
<div class="card-body">
|
|
|
|
<!-- <div class="card-group"> -->
|
|
<div class="card-deck">
|
|
<div id="account_type_1" class="card">
|
|
<div class="card-header"><span class="h3">1만원</span> <span class="text-muted">/ 1년 요금제</span></div>
|
|
<div class="card-body">
|
|
<ul>
|
|
<li><span class="text-danger font-weight-bold">20명</span>까지 학생 등록이 가능합니다.</li>
|
|
<li>모든 요금제의 기능은 동일합니다.</li>
|
|
<li>1년동안 유효합니다.</li>
|
|
</ul>
|
|
<a id="account_type_1_btn" class="btn" href="javascript:void(0);">업그레이드</a>
|
|
</div>
|
|
<div class="card-footer">
|
|
<small id="account_type_1_footer" class="">낮은 요금제로 내릴 수는 없습니다.</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="account_type_2" class="card">
|
|
<div class="card-header"><span class="h3">2만원</span> <span class="text-muted">/ 1년 요금제</span></div>
|
|
<div class="card-body">
|
|
<ul>
|
|
<li><span class="text-danger font-weight-bold">50명</span>까지 학생 등록이 가능합니다.</li>
|
|
<li>모든 요금제의 기능은 동일합니다.</li>
|
|
<li>1년동안 유효합니다.</li>
|
|
</ul>
|
|
<a id="account_type_2_btn" class="btn" href="javascript:void(0);" onclick="upgradeMaestroInfo(2);">업그레이드</a>
|
|
</div>
|
|
<div class="card-footer">
|
|
<small id="account_type_2_footer" class="">현재 적용된 요금제입니다.</small>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="account_type_3" class="card">
|
|
<div class="card-header"><span class="h3">3만원</span> <span class="text-muted">/ 1년 요금제</span></div>
|
|
<div class="card-body">
|
|
<ul>
|
|
<li><span class="text-danger font-weight-bold">100명</span>까지 학생 등록이 가능합니다.</li>
|
|
<li>모든 요금제의 기능은 동일합니다.</li>
|
|
<li>1년동안 유효합니다.</li>
|
|
</ul>
|
|
<a id="account_type_3_btn" class="btn" href="javascript:void(0);" onclick="upgradeMaestroInfo(3);">업그레이드</a>
|
|
</div>
|
|
<div class="card-footer">
|
|
<small id="account_type_3_footer" class="">이 요금제로 업그레이드가 가능합니다.</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="rounded px-5 py-4 my-3" style="background-color: #66ccff">
|
|
|
|
<h4 class="mb-4">마에스트로 업그레이드 안내</h4>
|
|
|
|
<ol>
|
|
<li>위에서 업그레이드 하실 상품을 선택하세요.</li>
|
|
<li>업그레이드를 신청하신 후, 추가 금액을 계좌이체해 주세요.</li>
|
|
<li>입금 내역이 확인되는대로 마에스트로 계정의 요금제를 변경해 드리겠습니다.</li>
|
|
<li>기존 요금제 기간이 얼마나 남았던가에 상관없이, 업그레이드가 적용된 날짜로부터 유효 기간이 1년으로 다시 리셋됩니다.<br/>
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
</div> <!-- container --> |