From 430f35d19dc2eb222572b73b2d62c0698cbb057b Mon Sep 17 00:00:00 2001 From: "altob.rd" Date: Mon, 15 Jan 2018 11:01:02 +0800 Subject: [PATCH] upd --- controllers/Carpark.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/controllers/Carpark.php b/controllers/Carpark.php index a8cec5f..60c22ca 100644 --- a/controllers/Carpark.php +++ b/controllers/Carpark.php @@ -68,6 +68,28 @@ class Carpark extends CC_Controller } } + // 進出記錄表 (分時統計) + public function export_cario_summery() + { + // 次月算上月 + $last_day_of_previous_month = date("Y-n-j", strtotime("last day of previous month")); + $d = date_parse_from_format("Y-m-d", $last_day_of_previous_month); + + $station_name = empty($this->input->post('station_name', true)) ? '場站名稱' : $this->input->post('station_name', true); + $year = empty($this->input->post('year', true)) ? $d['year'] : $this->input->post('year', true); + $month = empty($this->input->post('month', true)) ? $d['month'] : $this->input->post('month', true); + $addr = empty($this->input->post('addr', true)) ? '地址' : $this->input->post('addr', true); + $phone_no = empty($this->input->post('phone_no', true)) ? '電話' : $this->input->post('phone_no', true); + + $result = $this->app_model('excel')->export_cario_summery($station_name, $year, $month, $addr, $phone_no); + + if(empty($result)) + { + echo '無記錄'; + exit; + } + } + // ------------------------------------------------ // // 博辰 (START)