diff --git a/src/web/maestro/extension.html b/src/web/maestro/extension.html index c0581f2..a323aac 100644 --- a/src/web/maestro/extension.html +++ b/src/web/maestro/extension.html @@ -39,6 +39,7 @@ --> + diff --git a/src/web/module/maestro_extension.html b/src/web/module/maestro_extension.html index f8695da..a053466 100644 --- a/src/web/module/maestro_extension.html +++ b/src/web/module/maestro_extension.html @@ -2,7 +2,6 @@ var registeredAccountType = -1; - $(document).ready(function() { loadMaestroInfo(maestroID); }); @@ -15,9 +14,10 @@ function loadMaestroInfo(maestroID) { (function(jsonData) { // console.log(jsonData); registeredAccountType = jsonData.accountType; + showEndDate(jsonData.availableActivateDateTime); - showPlayerCount(jsonData.accountType, jsonData.playerCount); - updateCards(registeredAccountType); + showPrice(); + showMaestroName(jsonData.name); }), (function(errorMessage, errorCode) { @@ -44,120 +44,31 @@ function showEndDate(date) { $("#countdown_day").addClass("bg-secondary text-light"); else $("#countdown_day").addClass("text-muted"); + + $("#end_day").html(endDate); } -function showPlayerCount(accountType, playerCount) { - $("#maestro_info_player_count").val("학생수 : " + playerCount + " / " + accountTypePlayerCount(accountType)); +function showPrice() { + $("#price_account").html( + NumberUtil.numberWithCommas(accountTypePrice(registeredAccountType)) + "원" + ); + // accountTypePrice(accountType) + "원"); } -var CARD_TYPE_EXPERIENCE = "experience"; -var CARD_TYPE_LOWER_PRICE = "lower_price"; -var CARD_TYPE_PRESENT_PRICE = "present_price"; -var CARD_TYPE_UPPER_PRICE = "upper_price"; - -function updateCards(accountType) { - // console.log(accountType); - switch(accountType) { - case 100: - case 101: - setCardConent(1, CARD_TYPE_EXPERIENCE); - setCardConent(2, CARD_TYPE_EXPERIENCE); - setCardConent(3, CARD_TYPE_EXPERIENCE); - setCardConent(4, CARD_TYPE_EXPERIENCE); - setCardConent(5, CARD_TYPE_EXPERIENCE); - break; - - case 1: - setCardConent(1, CARD_TYPE_PRESENT_PRICE); - setCardConent(2, CARD_TYPE_UPPER_PRICE); - setCardConent(3, CARD_TYPE_UPPER_PRICE); - setCardConent(4, CARD_TYPE_UPPER_PRICE); - setCardConent(5, CARD_TYPE_UPPER_PRICE); - break; - - case 2: - setCardConent(1, CARD_TYPE_LOWER_PRICE); - setCardConent(2, CARD_TYPE_PRESENT_PRICE); - setCardConent(3, CARD_TYPE_UPPER_PRICE); - setCardConent(4, CARD_TYPE_UPPER_PRICE); - setCardConent(5, CARD_TYPE_UPPER_PRICE); - break; - - case 3: - setCardConent(1, CARD_TYPE_LOWER_PRICE); - setCardConent(2, CARD_TYPE_LOWER_PRICE); - setCardConent(3, CARD_TYPE_PRESENT_PRICE); - setCardConent(4, CARD_TYPE_UPPER_PRICE); - setCardConent(5, CARD_TYPE_UPPER_PRICE); - break; - - case 4: - setCardConent(1, CARD_TYPE_LOWER_PRICE); - setCardConent(2, CARD_TYPE_LOWER_PRICE); - setCardConent(3, CARD_TYPE_LOWER_PRICE); - setCardConent(4, CARD_TYPE_PRESENT_PRICE); - setCardConent(5, CARD_TYPE_UPPER_PRICE); - break; - - case 5: - default: - setCardConent(1, CARD_TYPE_LOWER_PRICE); - setCardConent(2, CARD_TYPE_LOWER_PRICE); - setCardConent(3, CARD_TYPE_LOWER_PRICE); - setCardConent(4, CARD_TYPE_LOWER_PRICE); - setCardConent(5, CARD_TYPE_PRESENT_PRICE); - break; - - } +function showMaestroName(maestroName) { + $("#maestro_name_account").html(maestroName); } -function setCardConent(cardNo, cardType) { - var htmlID = "#account_type_" + cardNo; - var buttonID = htmlID + "_btn"; - var footerID = htmlID + "_footer"; - - switch(cardType) { - case CARD_TYPE_EXPERIENCE: - $(htmlID).addClass("border-warning"); - $(buttonID).addClass("btn-secondary disabled"); - $(footerID).addClass("text-danger"); - $(footerID).text("체험 계정은 업그레이드가 불가능합니다."); - break; - - case CARD_TYPE_LOWER_PRICE: - $(htmlID).addClass("border-muted"); - $(buttonID).addClass("btn-secondary disabled"); - $(footerID).addClass("text-muted"); - $(footerID).text("낮은 요금제"); - break; - - case CARD_TYPE_PRESENT_PRICE: - $(htmlID).addClass("border-warning"); - $(buttonID).addClass("btn-secondary disabled"); - $(footerID).addClass("text-warning"); - $(footerID).text("현재 요금제"); - break; - - case CARD_TYPE_UPPER_PRICE: - $(htmlID).addClass("border-primary"); - $(buttonID).addClass("btn-primary"); - $(footerID).addClass("text-primary"); - $(footerID).text("업그레이드 가능"); - break; - } -} - -function upgradeMaestroInfo(accountType) { - console.log("upgrade to " + accountType); - var upgradeAccountType = accountType; +function extendMaestroAccount() { + // console.log("extend maestro account"); sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); - "./../server/maestro/request_upgrade_maestro.php", - "maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType + "&upgrade_account_type=" + upgradeAccountType, + "./../server/maestro/request_extend_maestro.php", + "maestro_id=" + maestroID + "&account_type=" + registeredAccountType, (function(jsonData) { // console.log(jsonData); - alert("업그레이드 요청이 등록되었습니다."); + alert("연장 신청이 등록되었습니다.\n입금 확인과 처리에 시간이 조금 걸립니다. 양해 부탁드립니다."); location.href="main_menu.html"; }), @@ -196,12 +107,43 @@ function upgradeMaestroInfo(accountType) {
유효 기간을 +1년 연장합니다.
+