Add: send mail - maestro upgrade
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user