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