modify("+1 month");
$last_month = new DateTime();
$last_month->modify("-1 month");
$sql = "SELECT o.*, CONCAT(l.code, ' ', l.name_tc) AS loc FROM `order` o INNER JOIN location l ON o.location_id = l.id WHERE o.status = ? and o.enddate >= ? ORDER BY o.enddate ASC"; // AND o.enddate <= ? AND o.enddate >= ?
$parameters = array("NEW", $last_month->format("Y-m-d")); // , $date->format("Y-m-d"), date("Y-m-d")
$rows = bind_pdo($sql, $parameters, "selectall");
foreach ($rows as $key => $order) {
$order_id = $order["id"];
$rows[$key]["order_code"] = $order["code"];
$customer_name = get_customer_name(rsa_crypt($order["customer_firstname"], 2), rsa_crypt($order["customer_lastname"], 2));
$rows[$key]["customer_code"] = $order["customer_code"];
$rows[$key]["customer_name"] = $customer_name;
$rows[$key]["customer_tel"] = rsa_crypt($rows[$key]["customer_tel"], 2);
}
if(!empty($_GET["send_alert"]) && !empty($_GET["id"])){
if($_GET["send_alert"] == 1){
//$order_info = get_order((int)$_GET["id"]);
contract_alert_email((int)$_GET["id"]);
}
}
?>
|
|
快將完結合約
|
|
|
合約編號 |
門卡號碼 |
客戶姓名 |
聯絡電話 |
分店 |
租用單位 |
面積(平方呎) |
生效日期 |
結束日期 |
租用期(月) |
狀態 |
發出電郵通知 |
備註 |
";
}
?>
|
|