Add: send mail for extension maestro
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
|
||||
+ " <input type='text' class='maestro_name col-sm' disabled value='" + jsonList[i].maestroName + "'>"
|
||||
+ " <input type='text' class='registered_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
|
||||
+ " <input type='text' class='availableDate col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
|
||||
// + " <input type='text' class='new_account_type col-sm text-right' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
|
||||
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>"
|
||||
// + " <input type='text' class='col-sm text-right' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
|
||||
@@ -107,7 +107,7 @@
|
||||
+ " <input type='text' class='maestro_id d-none' disabled value='" + jsonList[i].maestroID + "'>"
|
||||
+ " <input type='text' class='maestro_name col-sm text-success' disabled value='" + jsonList[i].maestroName + "'>"
|
||||
+ " <input type='text' class='registered_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].registeredAccountType) + "'>"
|
||||
+ " <input type='text' class='col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
|
||||
+ " <input type='text' class='availableDate col-sm text-right' disabled value='" + jsonList[i].availableActivateDateTime.substring(0, 10) + "'>"
|
||||
// + " <input type='text' class='new_account_type col-sm text-right text-success' disabled value='" + accountType(jsonList[i].requestedAccountType) + "'>"
|
||||
+ " <input type='text' class='col-sm text-success text-right' disabled value='" + jsonList[i].requestedDateTime.substring(0, 10) + "'>"
|
||||
// + " <input type='text' class='col-sm text-success' disabled value='" + NumberUtil.numberWithCommas(price(jsonList[i].requestedAccountType, jsonList[i].registeredAccountType)) + "'>"
|
||||
@@ -141,6 +141,7 @@
|
||||
var maestroExtensionID;
|
||||
var maestroID;
|
||||
var maestroName;
|
||||
var availableDate;
|
||||
var registeredAccountType;
|
||||
for (var i=0; i < children.length; i++) {
|
||||
// console.log(children);
|
||||
@@ -156,20 +157,41 @@
|
||||
} else if (children[i].className == "maestro_name col-sm text-success") {
|
||||
maestroName = children[i].value;
|
||||
continue;
|
||||
} else if (children[i].className == "availableDate col-sm text-right") {
|
||||
availableDate = children[i].value;
|
||||
continue;
|
||||
} else if (children[i].className == "registered_account_type col-sm text-right") {
|
||||
registeredAccountType = accountTypeValue(children[i].value);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
console.log(maestroExtensionID);
|
||||
console.log(maestroID);
|
||||
console.log(maestroName);
|
||||
console.log(registeredAccountType);
|
||||
return;
|
||||
var availableDateArray = availableDate.split("-");
|
||||
// console.log("year : " + availableDateArray[0]);
|
||||
// console.log("month : " + availableDateArray[1]);
|
||||
// console.log("day : " + availableDateArray[2]);
|
||||
var endDate = new Date(availableDateArray[0], availableDateArray[1] - 1, availableDateArray[2]);
|
||||
// console.log("endDate : " + endDate);
|
||||
var newDate = new Date(endDate.setFullYear(endDate.getFullYear() + 1));
|
||||
// console.log("newDate : " + newDate);
|
||||
var newAvailableDate = newDate.toISOString().substring(0, 10);
|
||||
// console.log("newAvailableDate : " + newAvailableDate);
|
||||
|
||||
// console.log(maestroExtensionID);
|
||||
// console.log(maestroID);
|
||||
// console.log(maestroName);
|
||||
// // console.log(availableDate);
|
||||
// console.log(newAvailableDate);
|
||||
// console.log(registeredAccountType);
|
||||
// return;
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/admin/extension_maestro.php",
|
||||
"maestro_extension_id=" + maestroExtensionID + "&maestro_id=" + maestroID + + "&maestro_name=" + maestroName + "®istered_account_type=" + registeredAccountType,
|
||||
// $maestro_name, $new_available_date, $maestro_email
|
||||
"maestro_extension_id=" + maestroExtensionID
|
||||
+ "&maestro_id=" + maestroID
|
||||
+ "&maestro_name=" + maestroName
|
||||
+ "&new_available_date=" + newAvailableDate
|
||||
+ "®istered_account_type=" + registeredAccountType,
|
||||
|
||||
function(jsonData) {
|
||||
loadMaestroExtensionList("");
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script>
|
||||
|
||||
var registeredAccountType = -1;
|
||||
var availableDate = "";
|
||||
var newAvailableDate = "";
|
||||
|
||||
$(document).ready(function() {
|
||||
loadMaestroInfo(maestroID);
|
||||
@@ -34,6 +36,9 @@ function showEndDate(date) {
|
||||
var today = new Date();
|
||||
var endDay = new Date(endDate);
|
||||
var diffDay = (endDay.getTime() - today.getTime()) / (1000 * 60 * 60 * 24);
|
||||
availableDate = endDate;
|
||||
var newDate = new Date(endDay.setFullYear(endDay.getFullYear() + 1));
|
||||
newAvailableDate = newDate.toISOString().substring(0, 10);
|
||||
|
||||
$("#maestro_count_down_date").html("유효 기간 : ~ " + endDate + " <span id='countdown_day'>(남은 기간 : " + Math.ceil(diffDay) + "일)</span>");
|
||||
if(diffDay < 30)
|
||||
@@ -62,14 +67,24 @@ function showMaestroName(maestroName) {
|
||||
function extendMaestroAccount() {
|
||||
// console.log("extend maestro account");
|
||||
|
||||
// console.log("maestroID : " + maestroID);
|
||||
// console.log("availableDate : " + availableDate);
|
||||
// console.log("newAvailableDate : " + newAvailableDate);
|
||||
// console.log("registeredAccountType : " + registeredAccountType);
|
||||
// return;
|
||||
|
||||
sendRequestServer( //url, sendParams, onSuccess, onFail, isDebugMode);
|
||||
"./../server/maestro/request_extension_maestro.php",
|
||||
"maestro_id=" + maestroID + "&account_type=" + registeredAccountType,
|
||||
// // $maestro_name, $available_date, $new_available_date, $maestro_email, $registered_account_type
|
||||
"maestro_id=" + maestroID
|
||||
+ "&available_date=" + availableDate
|
||||
+ "&new_available_date=" + newAvailableDate
|
||||
+ "&account_type=" + registeredAccountType,
|
||||
|
||||
(function(jsonData) {
|
||||
// console.log(jsonData);
|
||||
alert("연장 신청이 등록되었습니다.\n입금 확인과 처리에 시간이 조금 걸립니다. 양해 부탁드립니다.");
|
||||
location.href="main_menu.html";
|
||||
// location.href="main_menu.html";
|
||||
}),
|
||||
|
||||
(function(errorMessage, errorCode) {
|
||||
@@ -109,18 +124,28 @@ function extendMaestroAccount() {
|
||||
|
||||
<div class="card-header bg-light"><span class="h4">마에스트로 계정 연장 신청</span></div>
|
||||
<div class="card-body">
|
||||
<div class="mb-4">
|
||||
<p>유효 기간을 <span class="text-primary">+1년 연장</span>합니다.</p>
|
||||
<div class="px-2 mb-4">
|
||||
<h5 class="card-title">유효 기간을 <span class="text-primary">+1년 연장</span>합니다.</h5>
|
||||
<ul>
|
||||
<li>만료일(<span id="end_day"></span>) 기준으로 1년이 추가됩니다.</li>
|
||||
<li>연장 신청한 날짜, 입금한 날짜와는 무관합니다.</li>
|
||||
</ul>
|
||||
|
||||
<h5 class="card-title">연장 신청 방법</h5>
|
||||
<ol>
|
||||
<li>
|
||||
만료일(<span id="end_day"></span>) 기준으로 1년이 추가됩니다.<br/><span class="text-muted">(연장 신청한 날짜와는 무관합니다)</span>
|
||||
</li>
|
||||
<li>아래에 있는 연장 신청 버튼을 클릭하세요.</li>
|
||||
<li>아래 내용을 참고하여 송금을 부탁드립니다.</li>
|
||||
<li>송금 내역이 확인되는대로 연장 처리를 진행합니다.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="card border-secondary bg-warning px-4 py-3 mx-2 mt-3 mb-3">
|
||||
<div class="mx-2 mb-4">
|
||||
<button type="button" class="btn btn-primary btn-block btn-lg" onclick="extendMaestroAccount();">연장 신청</button>
|
||||
</div>
|
||||
|
||||
<div class="card bg-warning mx-2 mt-3 mb-2">
|
||||
<div class="card-header"><span class="font-weight-bold">송금 정보</span></div>
|
||||
<div class="card-body px-5">
|
||||
<div class="row">
|
||||
<label class="col-sm-3 col-form-label">* 카카오뱅크</label>
|
||||
<label class="col-sm-9 col-form-label">3333-07-4977969 (예금주 : 박지상)</label>
|
||||
@@ -138,13 +163,10 @@ function extendMaestroAccount() {
|
||||
<small class="form-text text-muted">빠른 입금 확인과 계정 연장 처리 작업을 위해, 송금자명을 마에스트로 아이디로 입력 부탁드립니다.</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mx-4 mb-4">
|
||||
<button type="button" class="btn btn-primary btn-block btn-lg" onclick="extendMaestroAccount();">연장 신청</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -153,12 +175,12 @@ function extendMaestroAccount() {
|
||||
<h4 class="mb-4">마에스트로 계정 연장 안내</h4>
|
||||
|
||||
<ol>
|
||||
<li>계정 연장을 위한 송금 내용을 이메일로 발송했습니다.</li>
|
||||
<li>위의 <kbd>연장 신청</kbd> 버튼을 누르면 계정 연장, 송금 안내 내용이 이메일로 자동 발송됩니다.</li>
|
||||
<li>
|
||||
입금 확인 및 적용을 수작업으로 하고 있습니다. 최대한 빨리 확인하고 적용할 수 있도록 노력하겠습니다.<br/>
|
||||
<span class="text-muted">(보통 늦어도 반나절 이내에 처리됩니다)</span>
|
||||
</li>
|
||||
<li>유효 기간은 +1년씩만 연장할 수 있습니다.</li>
|
||||
<li>유효 기간은 +1년씩만 연장 가능합니다.</li>
|
||||
<li class="text-primary">계정 업그레이드를 하셔도 +1년 연장 효과가 적용됩니다.</li>
|
||||
</ol>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ include "./../mail/send_mail.php";
|
||||
$maestro_extension_id = $_POST["maestro_extension_id"];
|
||||
$maestro_id = $_POST["maestro_id"];
|
||||
$maestro_name = $_POST["maestro_name"];
|
||||
$new_available_date = $_POST["new_available_date"];
|
||||
$registered_account_type = $_POST["registered_account_type"];
|
||||
|
||||
extension_maestro($maestro_id);
|
||||
@@ -20,7 +21,8 @@ change_extension_request_status_to_close($maestro_id);
|
||||
change_extension_request_status_to_applied($maestro_extension_id);
|
||||
|
||||
$maestro_data = get_maestro_data($maestro_id);
|
||||
// sendMailExtensionDone($maestro_data["name"], $maestro_data["email"], $registered_account_type);
|
||||
// $maestro_name, $new_available_date, $maestro_email
|
||||
sendMailExtensionDone($maestro_data["name"], $new_available_date, $maestro_data["email"]);
|
||||
insertMaestroLog("extension_maestro", $maestro_id, $maestro_name."(".$registered_account_type.")");
|
||||
|
||||
// set_data("maestro_extension_id", $maestro_extension_id);
|
||||
@@ -36,7 +38,7 @@ function extension_maestro($maestro_id) {
|
||||
|
||||
$query = "
|
||||
UPDATE maestro
|
||||
SET AccountType = ?, ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(NOW(), INTERVAL 1 YEAR)
|
||||
SET ActivateStatus = 1, AvailableActivateDateTime = DATE_ADD(AvailableActivateDateTime, INTERVAL 1 YEAR)
|
||||
WHERE MaestroID = ?;
|
||||
";
|
||||
$stmt = $db_conn->prepare($query);
|
||||
|
||||
@@ -9,6 +9,8 @@ include "./../mail/mail_setting.php";
|
||||
include "./../mail/send_mail.php";
|
||||
|
||||
$maestro_id = $_POST["maestro_id"];
|
||||
$available_date = $_POST["available_date"];
|
||||
$new_available_date = $_POST["new_available_date"];
|
||||
$account_type = $_POST["account_type"];
|
||||
|
||||
|
||||
@@ -32,7 +34,8 @@ if($countUpgrade === null || $countUpgrade < 1) {
|
||||
}
|
||||
|
||||
$maestro_data = get_maestro_data($maestro_id);
|
||||
// sendMailExtensionBankInfo($maestro_data["name"], $maestro_data["email"], $account_type);
|
||||
// $maestro_name, $available_date, $new_available_date, $maestro_email, $registered_account_type
|
||||
sendMailExtensionBankInfo($maestro_data["name"], $available_date, $new_available_date, $maestro_data["email"], $account_type);
|
||||
|
||||
send_result_success();
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user