Add: send mail - maestro upgrade
This commit is contained in:
@@ -15,28 +15,7 @@
|
||||
$("#header").load("admin_header.html");
|
||||
});
|
||||
|
||||
function getMaestroData() {
|
||||
var maestroID = 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,
|
||||
|
||||
function(jsonData) {
|
||||
console.log(jsonData);
|
||||
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
|
||||
// loadMaestroList("");
|
||||
},
|
||||
|
||||
function(errorMessage, errorCode) {
|
||||
showErrorMessage(errorMessage, "error");
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
function sendMailBankInfo() {
|
||||
function sendMailRegisterBankInfo() {
|
||||
var maestroName = "삼화초";
|
||||
var email = "jisangs@daum.net";
|
||||
var accountType = 1;
|
||||
@@ -44,7 +23,7 @@
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
// "./../server/mail/send_mail_bank_info.php",
|
||||
"./../server/mail/send_mail_test.php",
|
||||
"type=sendMailBankInfo" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType,
|
||||
"type=sendMailRegisterBankInfo" + "&maestro_name=" + maestroName + "&email=" + email + "&account_type=" + accountType,
|
||||
|
||||
function(jsonData) {
|
||||
console.log(jsonData);
|
||||
@@ -59,7 +38,7 @@
|
||||
);
|
||||
}
|
||||
|
||||
function sendMailRegistered() {
|
||||
function sendMailRegisterDone() {
|
||||
var maestroName = "삼화초";
|
||||
var email = "jisangs@daum.net";
|
||||
var accountType = 1;
|
||||
@@ -82,6 +61,75 @@
|
||||
);
|
||||
}
|
||||
|
||||
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 getMaestroData() {
|
||||
var maestroID = 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,
|
||||
|
||||
function(jsonData) {
|
||||
console.log(jsonData);
|
||||
// showErrorMessage("마에스트로 계정이 정상적으로 등록되었습니다.", "success");
|
||||
// loadMaestroList("");
|
||||
},
|
||||
|
||||
function(errorMessage, errorCode) {
|
||||
showErrorMessage(errorMessage, "error");
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -98,9 +146,17 @@
|
||||
|
||||
<div id="message_box"></div>
|
||||
|
||||
<button type="button" class="btn btn-primary" onClick="sendMailBankInfo()">[ 마에 ] 입금 계좌 안내 메일 발송</button>
|
||||
<button type="button" class="btn btn-primary" onClick="sendMailRegisterBankInfo()">[ 마에 ] 입금 계좌 안내 메일 발송</button>
|
||||
|
||||
<button type="button" class="btn btn-primary" onClick="sendMailRegistered()">[ 마에 ] 등록 완료 메일 발송</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-secondary" onClick="getMaestroData()">마에스트로 데이터 테스트</button>
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
+ " <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='col-sm' disabled value='" + accoutType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='registered_account_type col-sm' disabled value='" + accoutType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='new_account_type col-sm' disabled value='" + accoutType(jsonList[i].requestedAccountType) + "'>"
|
||||
+ " <input type='text' class='col-sm' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
|
||||
+ " <input type='text' class='col-sm' disabled value='" + jsonList[i].requestedDateTime + "'>"
|
||||
@@ -82,7 +82,7 @@
|
||||
+ " <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='col-sm text-success' disabled value='" + accoutType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='registered_account_type col-sm text-success' disabled value='" + accoutType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='new_account_type col-sm text-success' disabled value='" + accoutType(jsonList[i].requestedAccountType) + "'>"
|
||||
+ " <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='" + jsonList[i].requestedDateTime + "'>"
|
||||
@@ -111,35 +111,40 @@
|
||||
// var maestroID = $(inputButton).siblings(".maestro_id");
|
||||
// var id = maestroID.text();
|
||||
// var accountType = $(inputButton).siblings(".requested_account_type");
|
||||
// var newAccountType = accoutTypeValue(accountType.val());
|
||||
// var upgradeAccountType = accoutTypeValue(accountType.val());
|
||||
|
||||
var children = inputButton.parentElement.childNodes;
|
||||
var maestroUpgradeID;
|
||||
var maestroID;
|
||||
var newAccountType;
|
||||
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;
|
||||
}
|
||||
if (children[i].className == "maestro_id d-none") {
|
||||
} else if (children[i].className == "maestro_id d-none") {
|
||||
maestroID = children[i].value;
|
||||
continue;
|
||||
}
|
||||
if (children[i].className == "new_account_type col-sm") {
|
||||
// newAccountType = children[i].value;
|
||||
newAccountType = accoutTypeValue(children[i].value);
|
||||
} else if (children[i].className == "registered_account_type col-sm") {
|
||||
// upgradeAccountType = children[i].value;
|
||||
registeredAccountType = accoutTypeValue(children[i].value);
|
||||
continue;
|
||||
} else if (children[i].className == "new_account_type col-sm") {
|
||||
// upgradeAccountType = children[i].value;
|
||||
upgradeAccountType = accoutTypeValue(children[i].value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// console.log(maestroUpgradeID);
|
||||
// console.log(maestroID);
|
||||
// console.log(newAccountType);
|
||||
// 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 + "&new_account_type=" + newAccountType,
|
||||
"maestro_upgrade_id=" + maestroUpgradeID + "&maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType+ "&upgrade_account_type=" + upgradeAccountType,
|
||||
|
||||
function(jsonData) {
|
||||
loadMaestroUpgradeList("");
|
||||
|
||||
@@ -118,11 +118,11 @@ function updateCards(accountType) {
|
||||
|
||||
function upgradeMaestroInfo(accountType) {
|
||||
console.log("upgrade to " + accountType);
|
||||
let newAccountType = accountType;
|
||||
let upgradeAccountType = accountType;
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/maestro/request_upgrade_maestro.php",
|
||||
"maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType + "&new_account_type=" + newAccountType,
|
||||
"maestro_id=" + maestroID + "®istered_account_type=" + registeredAccountType + "&upgrade_account_type=" + upgradeAccountType,
|
||||
|
||||
(function(jsonData) {
|
||||
// console.log(jsonData);
|
||||
|
||||
@@ -1,28 +1,35 @@
|
||||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
include "./../lib/send_reply_json.php";
|
||||
include "./../setup/connect_db.php";
|
||||
include "./../lib/send_reply_json.php";
|
||||
include "./../lib/db_maestro.php";
|
||||
include "./../lib/maestro_account_info.php";
|
||||
include "./../mail/mail_setting.php";
|
||||
include "./../mail/send_mail.php";
|
||||
|
||||
$maestroUpgradeID = $_POST["maestro_upgrade_id"];
|
||||
$maestroID = $_POST["maestro_id"];
|
||||
$newAccountType = $_POST["new_account_type"];
|
||||
$maestro_upgrade_id = $_POST["maestro_upgrade_id"];
|
||||
$maestro_id = $_POST["maestro_id"];
|
||||
$registered_account_type = $_POST["registered_account_type"];
|
||||
$upgrade_account_type = $_POST["upgrade_account_type"];
|
||||
|
||||
upgrade_maestro($maestro_id, $upgrade_account_type);
|
||||
|
||||
upgrade_maestro($maestroID, $newAccountType);
|
||||
change_upgrade_request_status_to_close($maestro_id);
|
||||
change_upgrade_request_status_to_applied($maestro_upgrade_id);
|
||||
|
||||
change_upgrade_request_status_to_close($maestroID);
|
||||
change_upgrade_request_status_to_applied($maestroUpgradeID);
|
||||
$maestro_data = get_maestro_data($maestro_id);
|
||||
sendMailUpgradeDone($maestro_data["name"], $$maestro_data["email"], $registered_account_type, $upgrade_account_type);
|
||||
|
||||
// set_data("maestroUpgradeID", $maestroUpgradeID);
|
||||
// set_data("maestroID", $maestroID);
|
||||
// set_data("newAccountType", $newAccountType);
|
||||
// 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($maestroID, $newAccountType) {
|
||||
function upgrade_maestro($maestro_id, $upgrade_account_type) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -31,11 +38,11 @@ function upgrade_maestro($maestroID, $newAccountType) {
|
||||
WHERE MaestroID = ?;
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("ii", $newAccountType, $maestroID);
|
||||
$stmt->bind_param("ii", $upgrade_account_type, $maestro_id);
|
||||
$stmt->execute();
|
||||
}
|
||||
|
||||
function change_upgrade_request_status_to_close($maestroID) {
|
||||
function change_upgrade_request_status_to_close($maestro_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -44,11 +51,11 @@ function change_upgrade_request_status_to_close($maestroID) {
|
||||
WHERE MaestroID = ? AND Status = 1;
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("i", $maestroID);
|
||||
$stmt->bind_param("i", $maestro_id);
|
||||
$stmt->execute();
|
||||
}
|
||||
|
||||
function change_upgrade_request_status_to_applied($maestroUpgradeID) {
|
||||
function change_upgrade_request_status_to_applied($maestro_upgrade_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -57,7 +64,7 @@ function change_upgrade_request_status_to_applied($maestroUpgradeID) {
|
||||
WHERE MaestroUpgradeID = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("i", $maestroUpgradeID);
|
||||
$stmt->bind_param("i", $maestro_upgrade_id);
|
||||
$stmt->execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
function get_max_player_count($accountType) {
|
||||
switch($accountType) {
|
||||
function get_max_player_count($account_type) {
|
||||
switch($account_type) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 100:
|
||||
@@ -20,25 +20,46 @@ function get_max_player_count($accountType) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function get_price($accountType) {
|
||||
switch($accountType) {
|
||||
function get_price($account_type) {
|
||||
switch($account_type) {
|
||||
case 1:
|
||||
return "10,000";
|
||||
return 10000;
|
||||
|
||||
case 2:
|
||||
return "20,000";
|
||||
return 20000;
|
||||
|
||||
case 3:
|
||||
return "30,000";
|
||||
return 30000;
|
||||
|
||||
case 4:
|
||||
return "40,000";
|
||||
return 40000;
|
||||
|
||||
case 5:
|
||||
return "50,000";
|
||||
return 50000;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function get_accout_type($account_type) {
|
||||
switch($account_type) {
|
||||
case 1:
|
||||
return "20명 (1만원)";
|
||||
|
||||
case 2:
|
||||
return "50명 (2만원)";
|
||||
|
||||
case 3:
|
||||
return "100명 (3만원)";
|
||||
|
||||
case 4:
|
||||
return "500명 (4만원)";
|
||||
|
||||
case 5:
|
||||
return "1,000명 (5만원)";
|
||||
}
|
||||
|
||||
return $account_type."? (N/A)";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,36 +1,46 @@
|
||||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
include "./../lib/send_reply_json.php";
|
||||
include "./../setup/connect_db.php";
|
||||
include "./../lib/send_reply_json.php";
|
||||
include "./../lib/db_maestro.php";
|
||||
include "./../lib/maestro_account_info.php";
|
||||
include "./../mail/mail_setting.php";
|
||||
include "./../mail/send_mail.php";
|
||||
|
||||
$maestroID = $_POST["maestro_id"];
|
||||
$registeredAcountType = $_POST["registered_account_type"];
|
||||
$newAccountType = $_POST["new_account_type"];
|
||||
$maestro_id = $_POST["maestro_id"];
|
||||
$registered_acount_type = $_POST["registered_account_type"];
|
||||
$upgrade_account_type = $_POST["upgrade_account_type"];
|
||||
|
||||
|
||||
// $maestroID = has_maestro_name($maestro_name);
|
||||
// if($maestroID !== null) {
|
||||
// $maestro_id = has_maestro_name($maestro_name);
|
||||
// if($maestro_id !== null) {
|
||||
// set_error_message($maestro_name." : 이미 등록된 마에스트로 계정입니다.");
|
||||
// send_result_fail();
|
||||
// exit;
|
||||
// }
|
||||
|
||||
add_maestro_update($maestroID, $registeredAcountType, $newAccountType);
|
||||
add_maestro_update($maestro_id, $registered_acount_type, $upgrade_account_type);
|
||||
|
||||
$countUpgrade = count_maestro_upgrade($maestroID);
|
||||
// simplely check if maestro upgrade db added or not
|
||||
$countUpgrade = count_maestro_upgrade($maestro_id);
|
||||
if($countUpgrade === null || $countUpgrade < 1) {
|
||||
set_error_message($maestro_name." : 알 수 없는 이유로 마에스트로 계정 업그레이드 요청이 취소되었습니다.");
|
||||
// $maestro_data = get_maestro_data($maestro_id);
|
||||
// set_error_message($maestro_data["name"]." : 알 수 없는 이유로 마에스트로 계정 업그레이드 요청이 취소되었습니다.");
|
||||
set_error_message("알 수 없는 이유로 마에스트로 계정 업그레이드 요청이 취소되었습니다.");
|
||||
send_result_fail();
|
||||
exit;
|
||||
}
|
||||
|
||||
$maestro_data = get_maestro_data($maestro_id);
|
||||
sendMailUpgradeBankInfo($maestro_data["name"], $$maestro_data["email"], $registered_acount_type, $upgrade_account_type);
|
||||
|
||||
send_result_success();
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
function count_maestro_upgrade($maestroID) {
|
||||
function count_maestro_upgrade($maestro_id) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -39,7 +49,7 @@ function count_maestro_upgrade($maestroID) {
|
||||
WHERE MaestroID = ?
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("i", $maestroID);
|
||||
$stmt->bind_param("i", $maestro_id);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($countUpgrade);
|
||||
// while($stmt->fetch())
|
||||
@@ -49,7 +59,7 @@ function count_maestro_upgrade($maestroID) {
|
||||
return $countUpgrade;
|
||||
}
|
||||
|
||||
function add_maestro_update($maestroID, $registeredAcountType, $newAccountType) {
|
||||
function add_maestro_update($maestro_id, $registered_acount_type, $upgrade_account_type) {
|
||||
global $db_conn;
|
||||
|
||||
$query = "
|
||||
@@ -57,7 +67,7 @@ function add_maestro_update($maestroID, $registeredAcountType, $newAccountType)
|
||||
VALUES (?, ?, NOW(), 1, ?);
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
$stmt->bind_param("iii", $registeredAcountType, $newAccountType, $maestroID);
|
||||
$stmt->bind_param("iii", $registered_acount_type, $upgrade_account_type, $maestro_id);
|
||||
$stmt->execute();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +1,60 @@
|
||||
<?php
|
||||
|
||||
function makeMailHeader($from, $bcc) {
|
||||
global $new_line;
|
||||
|
||||
return "From:".$from.$new_line."BCC:".$bcc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// 마에스트로 계정 신청 - 입금 안내
|
||||
function sendMailBankInfo($maestro_name, $mail_to, $account_type) {
|
||||
function sendMailRegisterBankInfo($maestro_name, $mail_to, $account_type) {
|
||||
global $from, $bcc;
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
// $subject = subjectInfoBankAccountForRegisteringMaestro($maestro_name);
|
||||
// $message = messageInfoBankAccountForRegisteringMaestro($maestro_name, $account_type);
|
||||
// $header = "From:".$from.$new_line."BCC:".$bcc;
|
||||
// mb_send_mail($mail_to, $subject, $message, $header);
|
||||
mb_send_mail(
|
||||
$mail_to,
|
||||
subjectBankInfo($maestro_name),
|
||||
messageBankInfo($maestro_name, $account_type),
|
||||
subjectRegisterBankInfo($maestro_name),
|
||||
messageRegisterBankInfo($maestro_name, $account_type),
|
||||
makeMailHeader($from, $bcc)
|
||||
);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
}
|
||||
|
||||
function subjectBankInfo($maestro_name) {
|
||||
return "[초코마에] 마에스트로 계정 (".$maestro_name.") 등록을 위한 입금 안내";
|
||||
function subjectRegisterBankInfo($maestro_name) {
|
||||
return "[초코마에] ".$maestro_name." - 마에스트로 계정 등록을 위한 입금 안내";
|
||||
};
|
||||
|
||||
function messageBankInfo($maestro_name, $account_type) {
|
||||
function messageRegisterBankInfo($maestro_name, $account_type) {
|
||||
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
|
||||
|
||||
return "안녕하세요.".$new_line."[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
|
||||
$price = number_format(get_price($account_type));
|
||||
|
||||
return "안녕하세요.".$new_line.
|
||||
"[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
|
||||
.$new_line
|
||||
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
|
||||
."(이후에 [계정 등록 알림], [계정 유효기간 종료 예고] 등의 메일이 발송됩니다)".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
."[".$maestro_name."] 마에스트로 계정을 활성화 하기 위한 은행 계좌 정보는 아래와 같습니다.".$new_line
|
||||
."------------------------------------------------------------".$new_line
|
||||
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name." )".$new_line
|
||||
." * 예금주명 : ".$bank_owner_name.$new_line
|
||||
." * 금액 : ".get_price($account_type)." 원".$new_line
|
||||
."신청하신 마에스트로 계정 내용은 아래와 같습니다.".$new_line
|
||||
."1) 아이디 : ".$maestro_name.$new_line
|
||||
."2) 요금제 : ".get_accout_type($account_type).$new_line
|
||||
.$new_line
|
||||
."계정 등록을 위한 은행 계좌 입금 정보는 아래와 같습니다.".$new_line
|
||||
."------------------------------------------------------------".$new_line
|
||||
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name.", 예금주 : ".$bank_owner_name." )".$new_line
|
||||
." * 금액 : ".$price." 원".$new_line
|
||||
." * 송금자명 : ".$maestro_name." (신청하신 마에스트로 아이디)".$new_line
|
||||
." ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜".$new_line
|
||||
."------------------------------------------------------------".$new_line
|
||||
.$new_line
|
||||
."* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.".$new_line
|
||||
.$new_line
|
||||
."* 계정이 활성화되면 1년동안 사용하실 수 있습니다.".$new_line
|
||||
."* 연장 결제를 해주시면, 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
."* 상위 요금제로 업그레이드 하셔도, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
@@ -58,44 +70,43 @@ function messageBankInfo($maestro_name, $account_type) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// 마에스트로 계정 활성화 안내
|
||||
function sendMailRegistered($maestro_name, $mail_to) {
|
||||
function sendMailRegisterDone($maestro_name, $mail_to) {
|
||||
global $from, $bcc;
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
// $subject = subjectInfoBankAccountForRegisteringMaestro($maestro_name);
|
||||
// $message = messageInfoBankAccountForRegisteringMaestro($maestro_name, $account_type);
|
||||
// $header = "From:".$from.$new_line."BCC:".$bcc;
|
||||
// mb_send_mail($mail_to, $subject, $message, $header);
|
||||
mb_send_mail(
|
||||
$mail_to,
|
||||
subjectRegistered($maestro_name),
|
||||
messageRegistered($maestro_name),
|
||||
subjectRegisterDone($maestro_name),
|
||||
messageRegisterDone($maestro_name),
|
||||
makeMailHeader($from, $bcc)
|
||||
);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
}
|
||||
|
||||
function subjectRegistered($maestro_name) {
|
||||
return "[초코마에] 마에스트로 계정 (".$maestro_name.") 등록 및 활성화 완료";
|
||||
function subjectRegisterDone($maestro_name) {
|
||||
return "[초코마에] ".$maestro_name." - 마에스트로 계정 등록 및 활성화 완료";
|
||||
};
|
||||
|
||||
function messageRegistered($maestro_name) {
|
||||
function messageRegisterDone($maestro_name) {
|
||||
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
|
||||
|
||||
return "안녕하세요.".$new_line."[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
|
||||
return "안녕하세요.".$new_line.
|
||||
"[초코마에] 마에스트로 계정을 신청해 주셔서 감사합니다.".$new_line
|
||||
.$new_line
|
||||
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
|
||||
."(이후에 [계정 유효기간 종료 예고], [계정 업그레이드] 등의 메일이 발송됩니다)".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
."[".$maestro_name."] 마에스트로 계정이 활성화 되었습니다.".$new_line
|
||||
.$maestro_name." - 마에스트로 계정이 활성화 되었습니다.".$new_line
|
||||
.$new_line
|
||||
."* 계정이 활성화되면 1년동안 사용하실 수 있습니다.".$new_line
|
||||
."* 연장 결제를 해주시면, 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
."* 상위 요금제로 업그레이드 하셔도, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
."* 상위 요금제로 업그레이드 하시면, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
."* 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
@@ -108,10 +119,108 @@ function messageRegistered($maestro_name) {
|
||||
|
||||
|
||||
|
||||
function makeMailHeader($from, $bcc) {
|
||||
global $new_line;
|
||||
|
||||
return "From:".$from.$new_line."BCC:".$bcc;
|
||||
////////////////////////////////////////
|
||||
// 마에스트로 업그레이드 신청 - 입금 안내
|
||||
function sendMailUpgradeBankInfo($maestro_name, $mail_to, $account_type, $upgrade_account_type) {
|
||||
global $from, $bcc;
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
mb_send_mail(
|
||||
$mail_to,
|
||||
subjectUpgradeBankInfo($maestro_name),
|
||||
messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type),
|
||||
makeMailHeader($from, $bcc)
|
||||
);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
}
|
||||
|
||||
function subjectUpgradeBankInfo($maestro_name) {
|
||||
return "[초코마에] ".$maestro_name." - 마에스트로 계정 업그레이드를 위한 입금 안내";
|
||||
};
|
||||
|
||||
function messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type) {
|
||||
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
|
||||
|
||||
$price = number_format(get_price($upgrade_account_type) - get_price($account_type));
|
||||
|
||||
return "안녕하세요.".$new_line.
|
||||
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.".$new_line
|
||||
.$new_line
|
||||
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
|
||||
."(이후에 [계정 등록 알림], [계정 유효기간 종료 예고] 등의 메일이 발송됩니다)".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
.$maestro_name." - 마에스트로 계정의 현재 요금제와 업그레이드 요금제는 아래와 같습니다.".$new_line
|
||||
."1) 현재 사용중인 요금제 : ".get_accout_type($account_type).$new_line
|
||||
."2) 신청하신 업그레이드 요금제 : ".get_accout_type($upgrade_account_type).$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
."계정 요금제 업그레이드를 위한 은행 계좌 입금 정보는 아래와 같습니다.".$new_line
|
||||
."------------------------------------------------------------".$new_line
|
||||
." * 은행 계좌 : ".$bank_account_no." ( ".$bank_name.", 예금주 : ".$bank_owner_name." )".$new_line
|
||||
." * 금액 : ".$price." 원".$new_line
|
||||
." * 송금자명 : ".$maestro_name." (신청하신 마에스트로 아이디)".$new_line
|
||||
." ☞ 빠른 입금 확인을 위해, 송금자명을 본인 이름 대신 위와 같이 아이디로 부탁드립니다 ☜".$new_line
|
||||
."------------------------------------------------------------".$new_line
|
||||
.$new_line
|
||||
."* 혹시 신청하신 아이디가 아니라 본인 이름등으로 송금되었다면, 송금자명을 본 메일로 답신 부탁드립니다.".$new_line
|
||||
.$new_line
|
||||
."* 상위 요금제로 업그레이드 하시면, 현재 계정의 남은 기간에 1년이 추가됩니다.".$new_line
|
||||
."* 비활성화된 계정과 그 안에 있는 모든 정보는, 6개월 후에 자동 삭제됩니다.".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
."계정 신청 내역과 입금 내역이 확인되는대로 마에스트로 아이디를 업그레이드 해드리겠습니다.".$new_line
|
||||
."현재 수작업으로 확인하고 활성화하고 있어서 시간이 조금 걸리는 점 양해 부탁드립니다.".$new_line
|
||||
."마에스트로 계정이 업그레이드 되는대로, 즉시 알림 메일을 드리겠습니다.".$new_line
|
||||
.$new_line
|
||||
."감사합니다.".$new_line;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
// 마에스트로 업그레이드 완료 안내
|
||||
function sendMailUpgradeDone($maestro_name, $mail_to, $account_type, $upgrade_account_type) {
|
||||
global $from, $bcc;
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
mb_send_mail(
|
||||
$mail_to,
|
||||
subjectUpgradeDone($maestro_name),
|
||||
messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type),
|
||||
makeMailHeader($from, $bcc)
|
||||
);
|
||||
|
||||
header("Content-Type: application/json");
|
||||
}
|
||||
|
||||
function subjectUpgradeDone($maestro_name) {
|
||||
return "[초코마에] ".$maestro_name." - 마에스트로 계정의 요금제 업그레이드 완료 알림";
|
||||
};
|
||||
|
||||
function messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type) {
|
||||
global $new_line, $bank_name, $bank_account_no, $bank_owner_name;
|
||||
|
||||
return "안녕하세요.".$new_line.
|
||||
"[초코마에] 마에스트로 계정 요금제 업그레이드를 신청해주셔서 감사합니다.".$new_line
|
||||
.$new_line
|
||||
."※ 지금 보고 계신 메일이 [스팸 메일함]에 들어있다면, [스팸 해제]를 부탁드립니다 ※".$new_line
|
||||
."(이후에 [계정 유효기간 종료 예고], [계정 업그레이드] 등의 메일이 발송됩니다)".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
.$maestro_name." - 마에스트로 계정의 요금제가 [ ".get_accout_type($account_type)." ] 에서 [ ".get_accout_type($upgrade_account_type)." ] 로 업그레이드 되었습니다.".$new_line
|
||||
.$new_line
|
||||
."* 마에스트로 계정 유효기간이 업그레이드 되기 전 남은 기간 + 추가 1년으로 설정되었습니다.".$new_line
|
||||
.$new_line
|
||||
.$new_line
|
||||
."등록하신 마에스트로 계정 정보는 마에스트로 로그인 후, [계정 정보 수정] 화면에서 변경이 가능합니다.".$new_line
|
||||
."(변경 가능 정보 : 마에스트로 아이디, 이메일, 암호)".$new_line
|
||||
.$new_line
|
||||
."감사합니다.".$new_line;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -16,11 +16,25 @@ $email = $_POST["email"];
|
||||
$account_type = $_POST["account_type"];
|
||||
$upgrade_account_type = $_POST["upgrade_account_type"];
|
||||
|
||||
// set_data("maestro_name", $maestro_name);
|
||||
// set_data("email", $email);
|
||||
// set_data("account_type", $account_type);
|
||||
// set_data("upgrade_account_type", $upgrade_account_type);
|
||||
|
||||
if($type == "sendMailBankInfo") {
|
||||
sendMailBankInfo($maestro_name, $email, $account_type);
|
||||
if($type == "sendMailRegisterBankInfo") {
|
||||
sendMailRegisterBankInfo($maestro_name, $email, $account_type);
|
||||
|
||||
/*
|
||||
// subject registered
|
||||
$subject = subjectRegisterBankInfo($maestro_name);
|
||||
set_data("subject", $subject);
|
||||
|
||||
// messgae registered
|
||||
$messgae = messageRegisterBankInfo($maestro_name, $account_type, $upgrade_account_type);
|
||||
set_data("messgae", $messgae);
|
||||
*/
|
||||
} else if($type == "sendMailRegistered") {
|
||||
sendMailRegistered($maestro_name, $email, $account_type);
|
||||
sendMailRegisterDone($maestro_name, $email, $account_type);
|
||||
|
||||
/*
|
||||
// maestro data
|
||||
@@ -28,26 +42,42 @@ if($type == "sendMailBankInfo") {
|
||||
set_data("maestroData", $maestro_data);
|
||||
|
||||
// subject registered
|
||||
$subject = subjectRegistered($maestro_data["name"]);
|
||||
$subject = subjectRegisterDone($maestro_data["name"]);
|
||||
set_data("subject", $subject);
|
||||
|
||||
|
||||
// messgae registered
|
||||
$messgae = messageRegistered($maestro_data["name"]);
|
||||
$messgae = messageRegisterDone($maestro_data["name"]);
|
||||
set_data("messgae", $messgae);
|
||||
*/
|
||||
} else if($type == "sendMailUpgradeBankInfo") {
|
||||
sendMailUpgradeBankInfo($maestro_name, $email, $account_type, $upgrade_account_type);
|
||||
|
||||
/*
|
||||
// subject registered
|
||||
$subject = subjectUpgradeBankInfo($maestro_name);
|
||||
set_data("subject", $subject);
|
||||
|
||||
// messgae registered
|
||||
$messgae = messageUpgradeBankInfo($maestro_name, $account_type, $upgrade_account_type);
|
||||
set_data("messgae", $messgae);
|
||||
*/
|
||||
} else if($type == "sendMailUpgradeDone") {
|
||||
sendMailUpgradeDone($maestro_name, $email, $account_type, $upgrade_account_type);
|
||||
|
||||
/*
|
||||
// subject upgrade bank info
|
||||
$subject = subjectUpgradeDone($maestro_name);
|
||||
set_data("subject", $subject);
|
||||
|
||||
// messgae upgrade bank info
|
||||
$messgae = messageUpgradeDone($maestro_name, $account_type, $upgrade_account_type);
|
||||
set_data("messgae", $messgae);
|
||||
*/
|
||||
} else if($type == "get_maestro_data") {
|
||||
// maestro data
|
||||
$maestro_data = get_maestro_data($maestro_id);
|
||||
set_data("maestroData", $maestro_data);
|
||||
|
||||
// subject registered
|
||||
$subject = subjectRegistered($maestro_data["name"]);
|
||||
set_data("subject", $subject);
|
||||
|
||||
// messgae registered
|
||||
$messgae = messageRegistered($maestro_data["name"]);
|
||||
set_data("messgae", $messgae);
|
||||
}
|
||||
|
||||
send_result_success();
|
||||
|
||||
Reference in New Issue
Block a user