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"]); } } ?>
 
  
   快將完結合約
合約編號
門卡號碼
客戶姓名
聯絡電話
租用單位
結束日期
狀態

'; print ""; print ""; print ""; /*$customer_type = get_master_type_code("CUSTOMER_TYPE", $order["customer_typeid"]); if($order["customer_typeid"] == "BUSINESS"){ print ""; }else if($order["customer_typeid"] == "PERSONAL"){ print ""; }*/ print ""; print ""; $order_room_info = get_order_room($order["id"]); $order_room_list = ""; foreach ($order_room_info as $detail) { $room_info = get_room($detail["room_id"]); $order_room_list .= check_combine_room($room_info["code"]) . ", "; } $order_room_list = substr_replace($order_room_list, "", -2); print ""; print ""; print ""; print ""; print ""; print ""; $order_status = get_master_type_code("ORDER_STATUS", $order["status"]); print ""; // Modify print ""; print ""; print ""; } ?>
合約編號 門卡號碼 客戶姓名 聯絡電話 分店 租用單位 面積(平方呎) 生效日期 結束日期 租用期(月) 狀態 發出電郵通知
  " . $order['order_code'] . "" . $order['room_key'] . "" . $customer_type["name_tc"] . "
".$order["customer_companyname"]."
" . $customer_type["name_tc"] . "" . $order['customer_name'] . "
(" . $order['customer_code'] . ")
" . $order['customer_tel'] . "" . $order['loc'] . "" . $order_room_list . "" . $order['roughly_size'] . "" . $order['startdate'] . "" . $order['enddate'] . "" . $order['rent_month'] . "" . $order_status["name_tc"] . "