diff --git a/src/web/admin/admin_send_email.html b/src/web/admin/admin_send_email.html index 47c4e37..5797f51 100644 --- a/src/web/admin/admin_send_email.html +++ b/src/web/admin/admin_send_email.html @@ -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"); + } + + ); + } + @@ -98,9 +146,17 @@
- + - + +
+
+ + + + +
+
diff --git a/src/web/admin/admin_upgrade_list.html b/src/web/admin/admin_upgrade_list.html index faede54..5eec3d3 100644 --- a/src/web/admin/admin_upgrade_list.html +++ b/src/web/admin/admin_upgrade_list.html @@ -68,7 +68,7 @@ + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -82,7 +82,7 @@ + " " + " " + " " - + " " + + " " + " " + " " + " " @@ -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(""); diff --git a/src/web/module/maestro_upgrade.html b/src/web/module/maestro_upgrade.html index 6953dc7..2d7bb42 100644 --- a/src/web/module/maestro_upgrade.html +++ b/src/web/module/maestro_upgrade.html @@ -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); diff --git a/src/web/server/admin/upgrade_maestro.php b/src/web/server/admin/upgrade_maestro.php index 613559d..1f4ac88 100644 --- a/src/web/server/admin/upgrade_maestro.php +++ b/src/web/server/admin/upgrade_maestro.php @@ -1,28 +1,35 @@ 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(); } diff --git a/src/web/server/lib/maestro_account_info.php b/src/web/server/lib/maestro_account_info.php index abebf0a..7bf28c5 100644 --- a/src/web/server/lib/maestro_account_info.php +++ b/src/web/server/lib/maestro_account_info.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/src/web/server/maestro/request_upgrade_maestro.php b/src/web/server/maestro/request_upgrade_maestro.php index f4ddf53..54ce3a6 100644 --- a/src/web/server/maestro/request_upgrade_maestro.php +++ b/src/web/server/maestro/request_upgrade_maestro.php @@ -1,36 +1,46 @@ 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(); } diff --git a/src/web/server/mail/send_mail.php b/src/web/server/mail/send_mail.php index ea27afb..f7854dc 100644 --- a/src/web/server/mail/send_mail.php +++ b/src/web/server/mail/send_mail.php @@ -1,48 +1,60 @@ \ No newline at end of file diff --git a/src/web/server/mail/send_mail_test.php b/src/web/server/mail/send_mail_test.php index 9b545c6..2e722ee 100644 --- a/src/web/server/mail/send_mail_test.php +++ b/src/web/server/mail/send_mail_test.php @@ -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();