Add: send_mail_to_7days_left_maestro.php
This commit is contained in:
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
# /Applications/MAMP/bin/php/php7.3.1/bin/php send_mail_to_7days_left_maestro.php
|
||||||
|
|
||||||
|
include "./../../web/server/setup/connect_db.php";
|
||||||
|
|
||||||
|
include "./../../web/php/mail/mail_sender.php";
|
||||||
|
include "./../../web/php/mail/mail_setting.php";
|
||||||
|
include "./../../web/php/mail/chocomae_info.php";
|
||||||
|
|
||||||
|
$maestroList = null;
|
||||||
|
$maestroList = get_maestro_list();
|
||||||
|
print_r($maestroList);
|
||||||
|
exit;
|
||||||
|
|
||||||
|
|
||||||
|
function get_maestro_list(): array
|
||||||
|
{
|
||||||
|
global $db_conn;
|
||||||
|
|
||||||
|
/*
|
||||||
|
$query = "
|
||||||
|
select MaestroID, Name, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||||
|
from maestro
|
||||||
|
where DATE(AvailableActivateDateTime) - INTERVAL 7 DAY = DATE(NOW()) AND ActivateStatus = 1
|
||||||
|
";
|
||||||
|
*/
|
||||||
|
$query = "
|
||||||
|
select MaestroID, Name, AccountType, ActivateStatus, AvailableActivateDateTime, AcceptClausesDateTime, PlayerCount
|
||||||
|
from maestro
|
||||||
|
where DATE(AvailableActivateDateTime) - INTERVAL 70 DAY < DATE(NOW()) AND ActivateStatus = 1
|
||||||
|
";
|
||||||
|
$stmt = $db_conn->prepare($query);
|
||||||
|
$stmt->execute();
|
||||||
|
$stmt->bind_result($maestroID, $name, $accountType, $activateStatus, $availableActivateDateTime , $acceptClausesDateTime, $playerCount);
|
||||||
|
|
||||||
|
$maestroList = array();
|
||||||
|
while($stmt->fetch()) {
|
||||||
|
$maestro["maestroID"] = $maestroID;
|
||||||
|
$maestro["maestroName"] = $name;
|
||||||
|
$maestro["accountType"] = $accountType;
|
||||||
|
$maestro["activateStatus"] = $activateStatus;
|
||||||
|
$maestro["availableActivateDateTime"] = $availableActivateDateTime;
|
||||||
|
$maestro["acceptClausesDateTime"] = $acceptClausesDateTime;
|
||||||
|
$maestro["playerCount"] = $playerCount;
|
||||||
|
array_push($maestroList, $maestro);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $maestroList;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user