diff --git a/resources/image/maestro/maestro_extension.png b/resources/image/maestro/maestro_extension.png new file mode 100644 index 0000000..7fb46ef Binary files /dev/null and b/resources/image/maestro/maestro_extension.png differ diff --git a/resources/image/maestro/maestro_upgrade.png b/resources/image/maestro/maestro_upgrade.png new file mode 100644 index 0000000..0d5f50a Binary files /dev/null and b/resources/image/maestro/maestro_upgrade.png differ diff --git a/src/web/admin/admin_upgrade_list.html b/src/web/admin/admin_upgrade_list.html index 619df7f..5f29b6c 100644 --- a/src/web/admin/admin_upgrade_list.html +++ b/src/web/admin/admin_upgrade_list.html @@ -67,27 +67,45 @@ } for(var i = 0; i < jsonList.length; i++) { - if(jsonList[i].status == 1) { - $("#maestro_list_result_contents").append( - "
" - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + " " - + "
" - ); - } else { + if(jsonList[i].status == 1) { // 요청 + var tableRowString = + "
" + + " " + + " " + + " " + + " "; + if(jsonList[i].registeredActivateStatus == 1) { // 체험 + tableRowString += + " "; + } else { // 0: 미승인, 2: 활성화, 100: 환불 + tableRowString += + " " + } + tableRowString += + " " + + " " + + " "; + if(jsonList[i].registeredActivateStatus == 1) { // 체험 + tableRowString += + " "; + } else { // 0: 미승인, 2: 활성화, 100: 환불 + tableRowString += + " "; + } + tableRowString += + " " + + " " + + "
"; + $("#maestro_list_result_contents").append(tableRowString); + } + /* + else { // status == 2: 취소, 3: 업그레이드 적용 $("#maestro_list_result_contents").append( "
" + " " + " " + " " + + " " + " " + " " + " " @@ -98,6 +116,7 @@ + "
" ); } + */ } } @@ -123,6 +142,7 @@ var children = inputButton.parentElement.childNodes; var maestroUpgradeID; var maestroID; + var registeredActiveStatus; var registeredAccountType; var upgradeAccountType; for (var i=0; i < children.length; i++) { @@ -133,6 +153,10 @@ } 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); @@ -151,11 +175,15 @@ sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); "./../server/admin/upgrade_maestro.php", - "maestro_upgrade_id=" + maestroUpgradeID + "&maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType+ "&upgrade_account_type=" + upgradeAccountType, + "maestro_upgrade_id=" + maestroUpgradeID + + "&maestro_id=" + maestroID + + "®istered_activate_status=" + registeredActiveStatus + + "®istered_account_type=" + registeredAccountType + + "&upgrade_account_type=" + upgradeAccountType, function(jsonData) { loadMaestroUpgradeList(""); - $("#error_message").text("마에스트로 계정이 정상적으로 등록되었습니다."); + $("#error_message").text("마에스트로 계정이 정상적으로 업그레이드되었습니다."); }, function(errorMessage, errorCode) { @@ -206,6 +234,7 @@
+ diff --git a/src/web/js/lib/account_info.js b/src/web/js/lib/account_info.js index e50938c..4a47eb9 100644 --- a/src/web/js/lib/account_info.js +++ b/src/web/js/lib/account_info.js @@ -19,6 +19,44 @@ return 0; } +function activateStatus(activateStatus) { + switch(activateStatus) { + case 0: + return "미승인"; + + case 1: + return "체험"; + + case 2: + return "활성화"; + + case 100: + return "등록 취소"; + + default: + return activateStatus + "? (N/A)"; + } +} + +function activateStatusValue(activateStatus) { + switch(activateStatus) { + case "미승인": + return 0; + + case "체험": + return 1; + + case "활성화": + return 2; + + case "등록 취소": + return 100; + + default: + return -1; + } +} + function accountType(accountType) { switch(accountType) { case 1: @@ -44,12 +82,40 @@ function accountType(accountType) { return accountType + "? (N/A)"; } +function trialAccountType(accountType) { + switch(accountType) { + case 1: + return "20명 (0원)"; + + case 2: + return "50명 (0원)"; + + case 3: + return "100명 (0원)"; + + case 4: + return "500명 (0원)"; + + case 5: + return "1,000명 (0원)"; + + case 100: + case 101: + return "해당없음"; + } + + return accountType + "? (N/A)"; +} + function accountStatus(accountType, activateStatus) { if(activateStatus == 0) return "입금대기"; + else if(activateStatus == 1) + return "체험"; else if(activateStatus == 100) return "환불"; + // activateStatus == 2 : "활성화" switch(accountType) { case 1: return "20명"; @@ -121,18 +187,23 @@ function accountTypePrice(accountType) { function accountTypeValue(accountType) { switch(accountType) { case "20명 (1만원)": + case "20명 (0원)": return 1; case "50명 (2만원)": + case "50명 (0원)": return 2; case "100명 (3만원)": + case "100명 (0원)": return 3; case "500명 (4만원)": + case "500명 (0원)": return 4; case "1,000명 (5만원)": + case "1,000명 (0원)": return 5; } diff --git a/src/web/js/lib/maestro_info.js b/src/web/js/lib/maestro_info.js index 0fe9905..03ebe1c 100644 --- a/src/web/js/lib/maestro_info.js +++ b/src/web/js/lib/maestro_info.js @@ -1,6 +1,7 @@ function MaestroInfo() { this.maestroID = sessionStorage.getItem("maestroID"); this.maestroName = ""; + this.activateStatus = 0; this.accountType = 0; this.availableActivateDateTime = ""; this.playerCount = 0; @@ -15,6 +16,7 @@ MaestroInfo.prototype.loadMaestroInfo = function(onSuccess, onFail) { function(jsonData) { self.maestroName = jsonData["name"]; + self.activatedStatus = jsonData["activatedStatus"]; self.accountType = jsonData["accountType"]; self.availableActivateDateTime = jsonData["availableActivateDateTime"]; self.playerCount = jsonData["playerCount"]; diff --git a/src/web/module/home_section.html b/src/web/module/home_section.html index 3c7ed78..cd4bce1 100644 --- a/src/web/module/home_section.html +++ b/src/web/module/home_section.html @@ -4,12 +4,13 @@ $(document).ready(function() { // showServiceCloseMessage(); showErrorMessage( '(07월 02일) 알림
\ - * 초코마에 유료 정식 서비스 시작
\ - * 계정 유효기간 연장 or 업그레이드 메뉴가 활성화되었습니다.
\ + * 초코마에 8월 유료 정식 서비스 예고
\ + * 7월 31일까지 계속해서 무료 사용 가능
\ + * 7월 31일 전에도 유료 결제 가능 - 유효기간 연장 / 업그레이드 기능 활성화
\
\ \ \ - 정식 유료 서비스 - 자세한 내용 보기' + 8월 유료 서비스 안내 - 자세한 내용 보기' , 'info' ); }); @@ -183,7 +184,7 @@ function experienceMaestro() {
- 마에스트로 가입 + 마에스트로 체험 계정 가입 (2022년 07월 31일까지 무료)
diff --git a/src/web/module/home_section_reopen_service.html b/src/web/module/home_section_reopen_service.html index 06c246b..74cef1f 100644 --- a/src/web/module/home_section_reopen_service.html +++ b/src/web/module/home_section_reopen_service.html @@ -11,14 +11,92 @@

+

+ +
마에스트로 체험 계정
+

+

+

+ +
마에스트로 체험 계정 생성 즉시 활성화
+

+

+

+ + + +
+ +
+
베타 서비스와 마에스트로 체험 계정의 무료 사용에 대한 안내
+
+
7월 2일 이전에 생성한 기존 무료 계정
+

+

+

+
7월 2일 ~ 7월 17일까지 생성한 체험 계정
+

+

+

+
7월 17일 ~ 7월 31일까지 생성한 계정
+

+

베타 서비스가 2주보다 적게 남은 시점입니다.
+ +

+
8월 1일 이후에 생성한 계정
+

+

-

@@ -34,38 +112,25 @@
  • 만료일 30일 전(7월 2일)부터 마에스트로 관리 화면 홈에 [유효기간 연장] 버튼이 보여집니다.
    - -
  • -
  • [유효기간 연장] 버튼을 눌러서 계정 유효기간을 신청합니다.
  • -
  • - 연장 신청 화면에서 보여드릴 초코마에 카카오뱅크 계좌로 송금해주세요. (보내는 사람 이름은 반드시 마에스트로 이름으로 기입 부탁드립니다) -
    - + 유효기간 연장 화면
  • +
  • [유효기간 연장] 버튼을 누르면 입금 안내 메일을 보내드립니다.
  • +
  • 입금 내역이 확인되는대로 승인을 처리해 드립니다.
  • -
    (방법 2) 계정 업그레이드
    +
    (방법 2) 요금제 업그레이드

    @@ -88,8 +153,11 @@

    diff --git a/src/web/module/maestro_extension.html b/src/web/module/maestro_extension.html index 05d5b4d..6ef6063 100644 --- a/src/web/module/maestro_extension.html +++ b/src/web/module/maestro_extension.html @@ -35,7 +35,6 @@ function showPrice() { $("#price_account").html( NumberUtil.numberWithCommas(accountTypePrice(registeredAccountType)) + "원" ); - // accountTypePrice(accountType) + "원"); } function showMaestroName(maestroName) { @@ -167,13 +166,13 @@ function extendMaestroAccount() {

    마에스트로 계정 연장 안내

      -
    1. 위의 연장 신청 버튼을 누르면 계정 연장, 송금 안내 내용이 이메일로 자동 발송됩니다.
    2. +
    3. 위의 유효기간 연장 버튼을 누르면 계정 연장, 송금 안내 내용이 이메일로 자동 발송됩니다.
    4. 입금 확인 및 적용을 수작업으로 하고 있습니다. 최대한 빨리 확인하고 적용할 수 있도록 노력하겠습니다.
      (보통 늦어도 반나절 이내에 처리됩니다)
    5. 유효 기간은 +1년씩만 연장 가능합니다.
    6. -
    7. 계정 업그레이드를 하셔도 +1년 연장 효과가 적용됩니다.
    8. +
    9. 계정 업그레이드를 하시면 학생수를 늘리고 1년을 사용하실 수 있습니다.
    diff --git a/src/web/module/maestro_section_main.html b/src/web/module/maestro_section_main.html index e5fdba1..e9a9b63 100644 --- a/src/web/module/maestro_section_main.html +++ b/src/web/module/maestro_section_main.html @@ -24,12 +24,13 @@ $(document).ready(function() { // showServiceCloseMessage(); showErrorMessage( '(07월 02일) 알림
    \ - * 초코마에 유료 정식 서비스 시작
    \ - * 계정 유효기간 연장 or 업그레이드 메뉴가 활성화되었습니다.
    \ + * 초코마에 8월 유료 정식 서비스 예고
    \ + * 7월 31일까지 계속해서 무료 사용 가능
    \ + * 7월 31일 전에도 유료 결제 가능 - 유효기간 연장 / 업그레이드 기능 활성화
    \
    \ \ \ - 정식 유료 서비스 - 자세한 내용 보기' + 8월 유료 서비스 안내 - 자세한 내용 보기' , 'info' ); }); diff --git a/src/web/module/maestro_section_register.html b/src/web/module/maestro_section_register.html index f74d96e..fd23ad9 100644 --- a/src/web/module/maestro_section_register.html +++ b/src/web/module/maestro_section_register.html @@ -564,7 +564,8 @@ $('#myTab a').on('click', function (e) { 1,000명 (5만원) - 계정 활성화 날짜로부터 1년동안 유효합니다. + 2022년 07월 31일까지 무료로 위의 마에스트로 계정을 체험하실 수 있습니다. + * 유료 결제하면, 위 내용으로 1년동안 사용하실 수 있습니다. @@ -630,6 +631,8 @@ $('#myTab a').on('click', function (e) { +
    +
    입력하신 내용이 모두 맞는지 확인해주세요.
    @@ -650,6 +653,16 @@ $('#myTab a').on('click', function (e) {

    마에스트로 아이디 ???? 가 신청되었습니다.

    + +
    + +
    + + + diff --git a/src/web/module/maestro_upgrade.html b/src/web/module/maestro_upgrade.html index 85b72fa..d054e6f 100644 --- a/src/web/module/maestro_upgrade.html +++ b/src/web/module/maestro_upgrade.html @@ -2,6 +2,7 @@ var maestroAvailableDate = new MaestroAvailableDate(); +var registeredActivateStatus = 0; var registeredAccountType = -1; @@ -9,6 +10,10 @@ $(document).ready(function() { loadMaestroInfo(maestroID); }); +function showMaestroName(maestroName) { + $("#maestro_name_account").html(maestroName); +} + function loadMaestroInfo(maestroID) { sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); "./../server/maestro/maestro_info.php", @@ -16,6 +21,7 @@ function loadMaestroInfo(maestroID) { (function(jsonData) { // console.log(jsonData); + registeredActivateStatus = jsonData.activateStatus; registeredAccountType = jsonData.accountType; // showEndDate(jsonData.availableActivateDateTime); @@ -25,6 +31,8 @@ function loadMaestroInfo(maestroID) { showPlayerCount(jsonData.accountType, jsonData.playerCount); updateCards(registeredAccountType); + + showMaestroName(jsonData.name); }), (function(errorMessage, errorCode) { @@ -136,17 +144,18 @@ function setCardConent(cardNo, cardType) { } } -function upgradeMaestroInfo(accountType) { - console.log("upgrade to " + accountType); - var upgradeAccountType = accountType; +function upgradeMaestroInfo(upgradeAccountType) { + console.log("upgrade to " + upgradeAccountType); sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode); "./../server/maestro/request_upgrade_maestro.php", - "maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType + "&upgrade_account_type=" + upgradeAccountType, - + "maestro_id=" + maestroID + + "®istered_activate_status=" + registeredActivateStatus + + "®istered_account_type=" + registeredAccountType + + "&upgrade_account_type=" + upgradeAccountType, (function(jsonData) { // console.log(jsonData); - alert("업그레이드 요청이 등록되었습니다."); + alert("업그레이드 안내 메일을 보내드렸습니다.\n메일 내용에 따라 송금해주시면 내역이 확인되는대로 업그레이드를 적용해드리겠습니다."); location.href="main_menu.html"; }), @@ -262,6 +271,29 @@ function upgradeMaestroInfo(accountType) { +
    +
    송금 정보
    +
    +
    + + +
    + +
    + + +
    + +
    + +
    + + 빠른 입금 확인과 계정 연장 처리 작업을 위해, 송금자명을 마에스트로 아이디로 입력 부탁드립니다. +
    +
    +
    +
    + @@ -272,10 +304,11 @@ function upgradeMaestroInfo(accountType) {

    마에스트로 업그레이드 안내

      -
    1. 위에서 업그레이드 하실 상품을 선택하세요.
    2. -
    3. 업그레이드를 신청하신 후, 추가 금액을 계좌이체해 주세요.
    4. -
    5. 신청 내역이 확인되는대로 마에스트로 계정의 요금제를 변경해 드리겠습니다.
    6. -
    7. 기존 요금제 기간이 얼마나 남았던가에 상관없이, 유효 기간은 업그레이드가 적용된 날짜로부터 1년으로 다시 채워집니다.
      +
    8. 업그레이드 하실 상품을 선택하세요.
    9. +
    10. 업그레이드 버튼을 누르면 입금 안내 메일이 발송됩니다.
    11. +
    12. 업그레이드 안내 메일 내용에 따라 청구된 금액을 송금해 주세요.
    13. +
    14. 송금 내역이 확인되는대로 마에스트로 계정의 업그레이드를 적용해 드리겠습립니다. (많이 늦어진다 싶으면 아래 문의 메일로 연락주세요)
    15. +
    16. 기존 요금제 기간이 얼마나 남았던가에 상관없이, 유효 기간은 업그레이드가 적용된 날짜로부터 1년으로 설정됩니다.
    diff --git a/src/web/server/admin/extension_maestro.php b/src/web/server/admin/extension_maestro.php index 3f604d1..a37abd0 100644 --- a/src/web/server/admin/extension_maestro.php +++ b/src/web/server/admin/extension_maestro.php @@ -47,7 +47,7 @@ function extension_maestro($maestro_id, $new_available_date) { // "; $query = " UPDATE maestro - SET ActivateStatus = 1, AvailableActivateDateTime = DATE_FORMAT(?, '%Y-%m-%d') + SET ActivateStatus = 2, AvailableActivateDateTime = DATE_FORMAT(?, '%Y-%m-%d') WHERE MaestroID = ?; "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/admin/maestro_upgrade_list.php b/src/web/server/admin/maestro_upgrade_list.php index 60c8467..d8bb84f 100644 --- a/src/web/server/admin/maestro_upgrade_list.php +++ b/src/web/server/admin/maestro_upgrade_list.php @@ -29,7 +29,7 @@ function get_maestro_upgrade_list() { global $db_conn; $query = " - SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, M.AvailableActivateDateTime, U.Status + 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 @@ -38,13 +38,14 @@ function get_maestro_upgrade_list() { // $stmt->bind_param("iii", $maestroID, $startNo, $endNo); // $stmt->bind_param("ii", $maestroName, $startNo); $stmt->execute(); - $stmt->bind_result($maestroUpgradeID, $maestroID, $maestroName, $registeredAccountType, $requestedAccountType, $requestedDateTime, $availableActivateDateTime, $status); + $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; @@ -60,7 +61,7 @@ function get_maestro_update_list_by_name($searchMaestroName) { global $db_conn; $query = " - SELECT U.MaestroUpgradeID, U.MaestroID, M.Name, U.RegisteredAccountType, U.RequestedAccountType, U.RequestedDateTime, M.AvailableActivateDateTime, U.Status + 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 @@ -68,13 +69,14 @@ function get_maestro_update_list_by_name($searchMaestroName) { $stmt = $db_conn->prepare($query); $stmt->bind_param("s", $searchMaestroName); $stmt->execute(); - $stmt->bind_result($maestroUpgradeID, $maestroID, $maestroName, $registeredAccountType, $requestedAccountType, $requestedDateTime, $availableActivateDateTime, $status); + $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; diff --git a/src/web/server/admin/register_maestro.php b/src/web/server/admin/register_maestro.php index 5967e76..091eb48 100644 --- a/src/web/server/admin/register_maestro.php +++ b/src/web/server/admin/register_maestro.php @@ -61,12 +61,20 @@ function register_maestro($maestroID) { // 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(); diff --git a/src/web/server/admin/upgrade_maestro.php b/src/web/server/admin/upgrade_maestro.php index 6a81dee..52a08b0 100644 --- a/src/web/server/admin/upgrade_maestro.php +++ b/src/web/server/admin/upgrade_maestro.php @@ -14,6 +14,7 @@ include "./../mail/send_naver_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"]; @@ -23,7 +24,11 @@ change_upgrade_request_status_to_close($maestro_id); change_upgrade_request_status_to_applied($maestro_upgrade_id); $maestro_data = get_maestro_data($maestro_id); -sendMailUpgradeDone($maestro_data["name"], $maestro_data["email"], $registered_account_type, $upgrade_account_type); +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); @@ -39,7 +44,7 @@ function upgrade_maestro($maestro_id, $upgrade_account_type) { $query = " UPDATE maestro - SET AccountType = ?, ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR) + SET AccountType = ?, ActivateStatus = 2, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR) WHERE MaestroID = ?; "; $stmt = $db_conn->prepare($query); diff --git a/src/web/server/maestro/add_maestro.php b/src/web/server/maestro/add_maestro.php index 5e95f70..45d3485 100644 --- a/src/web/server/maestro/add_maestro.php +++ b/src/web/server/maestro/add_maestro.php @@ -37,7 +37,29 @@ if($maestroID === null) { exit; } -sendMailRegisterBankInfo($maestro_name, $email, $account_type); +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); + +sendMailTrialRegisterDone($maestro_name, $email, $account_type); insertMaestroLog("add_maestro", $maestroID, $maestro_name." / ".$email." / ".$account_type); send_result_success(); @@ -69,10 +91,172 @@ function add_maestro($maestro_name, $password, $email, $account_type) { $query = " INSERT INTO maestro (Name, Password, Email, AccountType, ActivateStatus, AvailableActivateDateTime, PlayerCount, AcceptClausesDateTime, AllowEditEnterCode, MaestroTestID) - VALUES (?, PASSWORD(?), ?, ?, 0, NOW(), 0, NOW(), 0, 0)"; + VALUES (?, PASSWORD(?), ?, ?, 1, '2022-07-31 23:59:59', 0, NOW(), 0, 0)"; $stmt = $db_conn->prepare($query); $stmt->bind_param("sssi", $maestro_name, $password, $email, $account_type); $stmt->execute(); } +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(); +} + ?> \ No newline at end of file diff --git a/src/web/server/maestro/login.php b/src/web/server/maestro/login.php index 66dbb0c..9a1e524 100644 --- a/src/web/server/maestro/login.php +++ b/src/web/server/maestro/login.php @@ -26,14 +26,20 @@ if($loginData === null) { send_result_fail(); exit; } else if($loginData[activateStatus] === 0) { - set_error_code("over_date"); - set_error_message("마에스트로 계정이 아직 활성화되지 않았습니다."); + set_error_code("not_paid_maestro"); + set_error_message("아직 유료 가입하지 않은 마에스트로 계정입니다."); send_result_fail(); exit; - /* -} else if($loginData[activateStatus] === 1 && $date < $now) { +} else if($loginData[activateStatus] === 100) { + set_error_code("canceled_maestro"); + set_error_message("등록이 취소된 마에스트로 계정입니다."); + send_result_fail(); + exit; +/* +// 체험, 활성화 계정은 유효기간이 지나도 접속할 수 있음 +// 그래야 연장, 업그레이드를 통해 유료 결제하고 계정을 다시 살릴 수 있음 +} else if($loginData[activateStatus] !== 0 && $date < $now) { set_error_code("over_date"); - $date = new DateTime($loginData[availableActivateDateTime]); set_error_message("마에스트로 계정의 유효기간이 지났습니다. : ".$date->format("Y-m-d H:i:s")); send_result_fail(); exit; @@ -60,7 +66,7 @@ function get_maestro_id($maestroName) { $query = " SELECT MaestroID FROM maestro - WHERE Name = ? AND ActivateStatus = 1 + WHERE Name = ? AND ActivateStatus != 0 "; $stmt = $db_conn->prepare($query); $stmt->bind_param("s", $maestroName); diff --git a/src/web/server/maestro/maestro_info.php b/src/web/server/maestro/maestro_info.php index e8ba1f7..4f3ba12 100644 --- a/src/web/server/maestro/maestro_info.php +++ b/src/web/server/maestro/maestro_info.php @@ -18,6 +18,7 @@ $playerCount = getPlayerCount($maestroID); set_data("name", $info["name"]); set_data("email", $info["email"]); set_data("accountType", $info["accountType"]); +set_data("activateStatus", $info["activateStatus"]); set_data("availableActivateDateTime", $info["availableActivateDateTime"]); set_data("playerCount", $playerCount); send_result_success(); @@ -28,14 +29,14 @@ function get_maestro_info($maestroID) { global $db_conn; $query = " - SELECT Name, Email, AccountType, AvailableActivateDateTime, PlayerCount + SELECT Name, Email, AccountType, ActivateStatus, AvailableActivateDateTime, PlayerCount FROM maestro WHERE MaestroID = ? "; $stmt = $db_conn->prepare($query); $stmt->bind_param("s", $maestroID); $stmt->execute(); - $stmt->bind_result($name, $email, $accountType, $availableActivateDateTime, $playerCount); + $stmt->bind_result($name, $email, $accountType, $activateStatus, $availableActivateDateTime, $playerCount); // while($stmt->fetch()) $stmt->fetch(); $stmt->close(); @@ -43,6 +44,7 @@ function get_maestro_info($maestroID) { $info["name"] = $name; $info["email"] = $email; $info["accountType"] = $accountType; + $info["activateStatus"] = $activateStatus; $info["availableActivateDateTime"] = $availableActivateDateTime; $info["playerCount"] = $playerCount; diff --git a/src/web/server/maestro/request_upgrade_maestro.php b/src/web/server/maestro/request_upgrade_maestro.php index ae46bca..97435e2 100644 --- a/src/web/server/maestro/request_upgrade_maestro.php +++ b/src/web/server/maestro/request_upgrade_maestro.php @@ -11,7 +11,8 @@ include './../lib/maestro_account_info.php'; include "./../mail/send_naver_mail.php"; $maestro_id = $_POST["maestro_id"]; -$registered_acount_type = $_POST["registered_account_type"]; +$registered_activate_status = $_POST["registered_activate_status"]; +$registered_account_type = $_POST["registered_account_type"]; $upgrade_account_type = $_POST["upgrade_account_type"]; @@ -22,7 +23,7 @@ $upgrade_account_type = $_POST["upgrade_account_type"]; // exit; // } -add_maestro_update($maestro_id, $registered_acount_type, $upgrade_account_type); +add_maestro_update($maestro_id, $registered_activate_status, $registered_account_type, $upgrade_account_type); // simplely check if maestro upgrade db added or not $countUpgrade = count_maestro_upgrade($maestro_id); @@ -35,7 +36,12 @@ if($countUpgrade === null || $countUpgrade < 1) { } $maestro_data = get_maestro_data($maestro_id); -sendMailUpgradeBankInfo($maestro_data["name"], $maestro_data["email"], $registered_acount_type, $upgrade_account_type); +if($maestro_data["activateStatus"] == 1) { // 체험 + sendMailTrialMaestroUpgradeBankInfo($maestro_data["name"], $maestro_data["email"], $registered_account_type, $upgrade_account_type); +} else { // activateStatus == 2 : 활성화 + sendMailUpgradeBankInfo($maestro_data["name"], $maestro_data["email"], $registered_account_type, $upgrade_account_type); +} + send_result_success(); exit; @@ -61,15 +67,15 @@ function count_maestro_upgrade($maestro_id) { return $countUpgrade; } -function add_maestro_update($maestro_id, $registered_acount_type, $upgrade_account_type) { +function add_maestro_update($maestro_id, $registered_activate_status, $registered_account_type, $upgrade_account_type) { global $db_conn; $query = " - INSERT INTO maestro_upgrade (RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID) - VALUES (?, ?, NOW(), 1, ?); + INSERT INTO maestro_upgrade (RegisteredActivateStatus, RegisteredAccountType, RequestedAccountType, RequestedDateTime, Status, MaestroID) + VALUES (?, ?, ?, NOW(), 1, ?); "; $stmt = $db_conn->prepare($query); - $stmt->bind_param("iii", $registered_acount_type, $upgrade_account_type, $maestro_id); + $stmt->bind_param("iiii", $registered_activate_status, $registered_account_type, $upgrade_account_type, $maestro_id); $stmt->execute(); } diff --git a/src/web/server/mail/mail_contents.php b/src/web/server/mail/mail_contents.php index 0ef30d5..05ee654 100644 --- a/src/web/server/mail/mail_contents.php +++ b/src/web/server/mail/mail_contents.php @@ -86,11 +86,19 @@ $subjectMap['closedBetaRegistrationDone'] = "[초코마에] {{maestro_name}} - $bodyMap['closedBetaRegistrationDone'] = "안녕하세요.
    ". "[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.
    ". "
    ". +"신청하신 마에스트로 계정 내용은 아래와 같습니다.
    ". +"1) 아이디 : {{maestro_name}}
    ". +"2) 요금제 : {{student_count}}명 ({{price}}원)
    ". +"
    ". +"--------------------". +"
    ". +"
    ". "{{maestro_name}} - 마에스트로 계정이 활성화 되었습니다.
    ". "
    ". -"* 베타 기간인 7월 말까지 무료로 사용하실 수 있습니다. 마음에 들면 유료 정식 서비스때 결제 부탁드릴게요.
    ". -"* 베타 기간동안 서버 부하와 안정성을 확인합니다. 문제가 없으면 이후 유료로 정식 서비스를 재개할 예정입니다.
    ". -"* 계정 업그레이드는 베타 기간 이후에 가능합니다.
    ". +"
    ". +"* 베타 기간인 7월 말까지 무료로 사용하실 수 있습니다. 마음에 들면 유료 결제(유효기간 연장 / 업그레이드)를 부탁드릴게요.
    ". +"* 어뷰징 및 서버 성능 향상을 위해 사용하지 않는 계정은 삭제됩니다.
    ". +"* 위와 같은 이유로, 2주간의 체험 기간이 끝나고 결제가 이루어지지 않은 계정은 이후 자동으로 삭제됩니다.
    ". "
    ". "등록하신 마에스트로 계정 정보는 마에스트로 로그인 후, [계정 정보 수정] 화면에서 변경이 가능합니다.
    ". "(변경 가능 정보 : 마에스트로 아이디, 이메일, 암호)
    ". @@ -98,7 +106,6 @@ $bodyMap['closedBetaRegistrationDone'] = "안녕하세요.
    ". "감사합니다."; - // extension $subjectMap['extensionBankInfo'] = "[초코마에] {{maestro_name}} - 마에스트로 계정 유효기간 연장을 위한 입금 안내"; $bodyMap['extensionBankInfo'] = "안녕하세요.
    ". @@ -143,6 +150,52 @@ $bodyMap['extensionDone'] = "안녕하세요.
    ". +// upgrade - trial maestro +$subjectMap['trialMaestroUpgradeBankInfo'] = "[초코마에] {{maestro_name}} - 마에스트로 계정 업그레이드를 위한 입금 안내"; +$bodyMap['trialMaestroUpgradeBankInfo'] = "안녕하세요.
    ". +"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.
    ". +"
    ". +"{{maestro_name}} - 마에스트로 계정의 현재 요금제와 업그레이드 요금제는 아래와 같습니다.
    ". +"1) 현재 사용중인 요금제 : {{prev_student_count}}명 (0원 : 무료 체험 기간)
    ". +"2) 신청하신 업그레이드 요금제 : {{upgrade_student_count}}명 ({{upgrade_price}}원)
    ". +"
    ". +"
    ". +"계정 요금제 업그레이드를 위한 은행 계좌 입금 정보는 아래와 같습니다.
    ". +"------------------------------------------------------------
    ". +"* 은행 계좌 : {{bank_account_no}} ( 카카오뱅크, 예금주 : 박지상 )
    ". +"* 금액 : {{upgrade_price}}원
    ". +"* 송금자명 : {{maestro_name}} (신청하신 마에스트로 아이디)
    ". +" ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜
    ". +"------------------------------------------------------------
    ". +"
    ". +"* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.
    ". +"
    ". +"* 상위 요금제로 업그레이드 하시면, 유효기간은 업그레이드가 적용된 날짜로부터 1년으로 설정됩니다.
    ". +"* 유효기간이 끝나서 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.
    ". +"
    ". +"
    ". +"계정 신청 내역과 입금 내역이 확인되는대로 마에스트로 아이디를 업그레이드 해드리겠습니다.
    ". +"현재 수작업으로 확인하고 활성화하고 있어서 시간이 조금 걸리는 점 양해 부탁드립니다.
    ". +"마에스트로 계정이 업그레이드 되는대로, 즉시 알림 메일을 드리겠습니다.
    ". +"
    ". +"감사합니다."; + +$subjectMap['trialMaestroUpgradeDone'] = "[초코마에] {{maestro_name}} - 마에스트로 계정의 요금제 업그레이드 완료 알림"; +$bodyMap['trialMaestroUpgradeDone'] = "안녕하세요.
    ". +"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.
    ". +"
    ". +"{{maestro_name}} - 마에스트로 계정의 요금제가 [ {{prev_student_count}}명 (0원 : 무료 체험 기간) ] 에서 [ {{upgrade_student_count}}명 ({{upgrade_price}}원) ] 으로 업그레이드 되었습니다.
    ". +"
    ". +"* 마에스트로 계정 유효기간이 오늘부터 1년으로 설정되었습니다.
    ". +"
    ". +"
    ". +"등록하신 마에스트로 계정 정보는 마에스트로 로그인 후, [계정 정보 수정] 화면에서 변경이 가능합니다.
    ". +"(변경 가능 정보 : 마에스트로 아이디, 이메일, 암호)
    ". +"
    ". +"감사합니다."; + + + // upgrade $subjectMap['upgradeBankInfo'] = "[초코마에] {{maestro_name}} - 마에스트로 계정 업그레이드를 위한 입금 안내"; $bodyMap['upgradeBankInfo'] = "안녕하세요.
    ". @@ -163,7 +216,7 @@ $bodyMap['upgradeBankInfo'] = "안녕하세요.
    ". "
    ". "* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.
    ". "
    ". -"* 상위 요금제로 업그레이드 하시면, 유효기간은 업그레이드가 적용된 날짜로부터 1년으로 다시 채워집니다.
    ". +"* 상위 요금제로 업그레이드 하시면, 유효기간은 업그레이드가 적용된 날짜로부터 1년으로 설정됩니다.
    ". "* 유효기간이 끝나서 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.
    ". "
    ". "
    ". @@ -179,7 +232,7 @@ $bodyMap['upgradeDone'] = "안녕하세요.
    ". "
    ". "{{maestro_name}} - 마에스트로 계정의 요금제가 [ {{prev_student_count}}명 ({{prev_price}}원) ] 에서 [ {{upgrade_student_count}}명 ({{upgrade_price}}원) ] 으로 업그레이드 되었습니다.
    ". "
    ". -"* 마에스트로 계정 유효기간이 오늘부터 1년으로 다시 채워졌습니다.
    ". +"* 마에스트로 계정 유효기간이 오늘부터 1년으로 설정되었습니다.
    ". "
    ". "
    ". "등록하신 마에스트로 계정 정보는 마에스트로 로그인 후, [계정 정보 수정] 화면에서 변경이 가능합니다.
    ". diff --git a/src/web/server/mail/send_naver_mail.php b/src/web/server/mail/send_naver_mail.php index 0168e79..e6ce80d 100644 --- a/src/web/server/mail/send_naver_mail.php +++ b/src/web/server/mail/send_naver_mail.php @@ -40,6 +40,21 @@ function sendMailRegisterDone($maestro_name, $maestro_email) { } +// Register - closed beta, trial maestro +function sendMailTrialRegisterDone($maestro_name, $maestro_email, $account_type) { + global $subjectMap, $bodyMap; + + $subject = str_replace("{{maestro_name}}", $maestro_name, $subjectMap['closedBetaRegistrationDone']); + + $body = str_replace("{{maestro_name}}", $maestro_name, $bodyMap['closedBetaRegistrationDone']); + $body = str_replace("{{student_count}}", get_max_player_count($account_type), $body); + $price = number_format(get_price($account_type)); + $body = str_replace("{{price}}", $price, $body); + + return send_naver_mail($maestro_email, $maestro_name, $subject, $body); +} + + // Extend function sendMailExtensionBankInfo($maestro_name, $prev_date, $new_available_date, $maestro_email, $account_type) { global $subjectMap, $bodyMap, $bank_account_no; @@ -69,6 +84,39 @@ function sendMailExtensionDone($maestro_name, $new_available_date, $maestro_emai } +// Upgrade - trial maestro +function sendMailTrialMaestroUpgradeBankInfo($maestro_name, $maestro_email, $prev_account_type, $upgrade_account_type) { + global $subjectMap, $bodyMap, $bank_account_no; + + $subject = str_replace("{{maestro_name}}", $maestro_name, $subjectMap['trialMaestroUpgradeBankInfo']); + + $body = str_replace("{{maestro_name}}", $maestro_name, $bodyMap['trialMaestroUpgradeBankInfo']); + $body = str_replace("{{prev_student_count}}", get_max_player_count($prev_account_type), $body); + $prev_price = number_format(get_price($prev_account_type)); + $body = str_replace("{{upgrade_student_count}}", get_max_player_count($upgrade_account_type), $body); + $upgrade_price = number_format(get_price($upgrade_account_type)); + $body = str_replace("{{upgrade_price}}", $upgrade_price, $body); + $body = str_replace("{{bank_account_no}}", $bank_account_no, $body); + $body = str_replace("{{price}}", $upgrade_price, $body); + + return send_naver_mail($maestro_email, $maestro_name, $subject, $body); +} + +function sendMailTrialMaestroUpgradeDone($maestro_name, $maestro_email, $prev_account_type, $upgrade_account_type) { + global $subjectMap, $bodyMap; + + $subject = str_replace("{{maestro_name}}", $maestro_name, $subjectMap['trialMaestroUpgradeDone']); + + $body = str_replace("{{maestro_name}}", $maestro_name, $bodyMap['trialMaestroUpgradeDone']); + $body = str_replace("{{prev_student_count}}", get_max_player_count($prev_account_type), $body); + $body = str_replace("{{upgrade_student_count}}", get_max_player_count($upgrade_account_type), $body); + $upgrade_price = number_format(get_price($upgrade_account_type)); + $body = str_replace("{{upgrade_price}}", $upgrade_price, $body); + + return send_naver_mail($maestro_email, $maestro_name, $subject, $body); +} + + // Upgrade function sendMailUpgradeBankInfo($maestro_name, $maestro_email, $prev_account_type, $upgrade_account_type) { global $subjectMap, $bodyMap, $bank_account_no; @@ -83,8 +131,9 @@ function sendMailUpgradeBankInfo($maestro_name, $maestro_email, $prev_account_ty $upgrade_price = number_format(get_price($upgrade_account_type)); $body = str_replace("{{upgrade_price}}", $upgrade_price, $body); $body = str_replace("{{bank_account_no}}", $bank_account_no, $body); - $charge_price = (int)$upgrade_price - (int)$prev_price; - $body = str_replace("{{price}}", $charge_price, $body); + $charge_price = get_price($upgrade_account_type) - get_price($prev_account_type); +// $charge_price = (int)$upgrade_price - (int)$prev_price; + $body = str_replace("{{price}}", number_format($charge_price), $body); return send_naver_mail($maestro_email, $maestro_name, $subject, $body); } diff --git a/src/web/server/player/login.php b/src/web/server/player/login.php index 1500f9e..bac50f6 100644 --- a/src/web/server/player/login.php +++ b/src/web/server/player/login.php @@ -35,7 +35,7 @@ if($activateStatus == 0) { send_result_fail(); exit; } else if($activateStatus == 100) { - set_error_message("죄송합니다. 등록이 취소된 마에스트로 계정입니다."); + set_error_message("등록이 취소된 마에스트로 계정입니다."); send_result_fail(); exit; }