VM暫存
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

615 linhas
20KB

  1. <?php
  2. /*
  3. file: Allpa_service.php (歐Pa卡)
  4. */
  5. if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  6. class Allpa_service extends CI_Controller
  7. {
  8. var $vars = array(); // 共用變數
  9. function __construct()
  10. {
  11. parent::__construct();
  12. $method_name = $this->router->fetch_method();
  13. if ($method_name == 'allpa_consume_handler')
  14. {
  15. ob_end_clean();
  16. ignore_user_abort();
  17. ob_start();
  18. header('Connection: close');
  19. header('Content-Length: ' . ob_get_length());
  20. ob_end_flush();
  21. flush();
  22. }
  23. // ----- 程式開發階段log設定 -----
  24. if (@ENVIRONMENT == 'development')
  25. {
  26. ini_set('display_errors', '1');
  27. //error_reporting(E_ALL ^ E_NOTICE);
  28. error_reporting(E_ALL);
  29. }
  30. set_error_handler(array($this, 'error_handler'), E_ALL); // 資料庫異動需做log
  31. /*
  32. // 共用記憶體
  33. $this->vars['mcache'] = new Memcache;
  34. $this->vars['mcache']->connect(MEMCACHE_HOST, MEMCACHE_PORT) or die ('Could not connect memcache');
  35. // mqtt subscribe
  36. $this->vars['mqtt'] = new phpMQTT(MQ_HOST, MQ_PORT, uniqid());
  37. if(!$this->vars['mqtt']->connect()){ die ('Could not connect mqtt'); }
  38. */
  39. // ----- 定義常數(路徑, cache秒數) -----
  40. define('APP_VERSION', '100'); // 版本號
  41. define('MAX_AGE', 604800); // cache秒數, 此定義1個月
  42. define('APP_NAME', 'allpa_service'); // 應用系統名稱
  43. define('PAGE_PATH', APP_BASE.'ci_application/views/'.APP_NAME.'/'); // path of views
  44. define('SERVER_URL', 'http://'.(isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost').'/'); // URL
  45. define('APP_URL', SERVER_URL.APP_NAME.'.html/'); // controller路徑
  46. define('WEB_URL', SERVER_URL.APP_NAME.'/'); // 網頁路徑
  47. define('WEB_LIB', SERVER_URL.'libs/'); // 網頁lib
  48. define('BOOTSTRAPS', WEB_LIB.'bootstrap_sb/'); // bootstrap lib
  49. define('LOG_PATH', FILE_BASE.APP_NAME.'/logs/'); // log path
  50. $this->load->model('allpa_service_model'); // 歐Pa卡
  51. $this->load->model('allpay_invoice_model'); // 歐付寶電子發票
  52. // ----- 中國信託金流 -----
  53. $this->load->model('ctbcbank_model'); // 中國信託金流
  54. define('CTBC_AuthResURL', APP_URL."return_ok/"); // 從收單行端取得授權碼後,要導回的網址,請勿填入特殊字元@、#、%、?、&等。
  55. // ----- 中國信託金流 (end) -----
  56. // ----- 頁面 -----
  57. define('MAIN_PAGE', "main_page");
  58. define('RESULT_PAGE', "result_page");
  59. define('ERROR_PAGE', "error_page");
  60. define('ADMIN_PAGE', "admin_page");
  61. define('ADMIN_LOGIN_PAGE', "admin_login_page");
  62. define('ADMIN_RESULT_PAGE', "admin_result_page");
  63. // ----- 頁面 -----
  64. // [START] 2016/06/08 登入
  65. $this->load->model('user_model');
  66. // load library
  67. $this->load->library(array('form_validation','session'));
  68. // load helpers
  69. $this->load->helper(array('form'));
  70. // ajax code
  71. define('RESULT_SUCCESS', 'ok');
  72. define('RESULT_FORM_VALIDATION_FAIL', '-1');
  73. define('RESULE_FAIL', 'gg');
  74. // [END] 2016/06/08 登入
  75. }
  76. // 發生錯誤時集中在此處理
  77. public function error_handler($errno, $errstr, $errfile, $errline, $errcontext)
  78. {
  79. $str = date('H:i:s')."|{$errstr}|{$errfile}|{$errline}|{$errno}\n";
  80. //error_log($str, 3, $log_file . '.' . date('Ymd').'.log.txt'); // 3代表參考後面的檔名
  81. //echo "whoami: ".`whoami`;
  82. //echo "<br/>".$str;
  83. error_log($str, 3, LOG_PATH.APP_NAME . '.' . date('Ymd').'.log.txt'); // 3代表參考後面的檔名
  84. }
  85. // 顯示靜態網頁(html檔)
  86. protected function show_page($page_name, &$data = null)
  87. {
  88. $page_file = PAGE_PATH.$page_name.'.php';
  89. $last_modified_time = filemtime($page_file);
  90. // 若檔案修改時間沒有異動, 或版本無異動, 通知瀏覽器使用cache, 不再下傳網頁
  91. // header('Cache-Control:max-age='.MAX_AGE); // cache 1個月
  92. header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_modified_time).' GMT');
  93. header('Etag: '. APP_VERSION);
  94. header('Cache-Control: public');
  95. if (!empty($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == APP_VERSION && @strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $last_modified_time)
  96. {
  97. header('HTTP/1.1 304 Not Modified');
  98. }
  99. else
  100. {
  101. $this->load->view(APP_NAME.'/'.$page_name, $data);
  102. }
  103. }
  104. // [START] 2016/06/08
  105. // ADMIN.1 管理者頁面
  106. public function admin()
  107. {
  108. if($this->session->userdata('logged_in'))
  109. {
  110. $session_data = $this->session->userdata('logged_in');
  111. $data['username'] = $session_data['username'];
  112. $data['type'] = $session_data['type'];
  113. if($data['type'] == 'admin')
  114. {
  115. $this->show_page('NOT_READY___', $data); // 進階管理者介面 (TODO)
  116. }
  117. else
  118. {
  119. $this->show_page(ADMIN_PAGE, $data); // 一般
  120. }
  121. }
  122. else
  123. {
  124. $this->show_page(ADMIN_LOGIN_PAGE);
  125. }
  126. }
  127. // ADMIN.2.a 管理者頁面登入
  128. public function user_login()
  129. {
  130. // form_validation
  131. $this->form_validation->set_rules('login_name', 'login_name', 'trim|required');
  132. $this->form_validation->set_rules('pswd', 'pswd', 'trim|required');
  133. if($this->form_validation->run() == FALSE)
  134. {
  135. return RESULT_FORM_VALIDATION_FAIL;
  136. }
  137. // go model
  138. $data = array
  139. (
  140. 'login_name' => $this->input->post('login_name', true),
  141. 'pswd' => $this->input->post('pswd', true)
  142. );
  143. $result = $this->user_model->user_login($data);
  144. if($result)
  145. {
  146. $sess_array = array();
  147. foreach($result as $row)
  148. {
  149. $sess_array = array
  150. (
  151. 'username' => $row->login_name ,
  152. 'type' => $row->user_type
  153. );
  154. $this->session->set_userdata('logged_in', $sess_array);
  155. }
  156. echo RESULT_SUCCESS;
  157. }
  158. else
  159. {
  160. return RESULE_FAIL;
  161. }
  162. }
  163. // ADMIN.2.b 管理者頁面登出
  164. public function user_logout()
  165. {
  166. if(!$this->session->userdata('logged_in')){echo json_encode(null, JSON_UNESCAPED_UNICODE);return;} // 沒登入就回傳null
  167. $this->session->unset_userdata('logged_in');
  168. session_destroy();
  169. return RESULT_SUCCESS;
  170. }
  171. // ADMIN.3.a 管理者產品列表
  172. // http://203.75.167.89/allpa_service.html/get_allpa_admin_products
  173. public function get_allpa_admin_products()
  174. {
  175. if(!$this->session->userdata('logged_in')){echo json_encode(null, JSON_UNESCAPED_UNICODE);return;} // 沒登入就回傳null
  176. $data = $this->allpa_service_model->get_allpa_admin_products();
  177. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  178. }
  179. // ADMIN.3.b 產品列表 - 購買管理者產品
  180. public function purchase_admin_products()
  181. {
  182. if(!$this->session->userdata('logged_in')){echo json_encode(null, JSON_UNESCAPED_UNICODE);return;} // 沒登入就回傳null
  183. $product_id = $this->input->post('product_id', true);
  184. $data = $this->allpa_service_model->create_admin_bill($product_id);
  185. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  186. }
  187. // ADMIN.3.c 管理者結帳
  188. public function transfer_money_admin()
  189. {
  190. if(!$this->session->userdata('logged_in')){echo json_encode(null, JSON_UNESCAPED_UNICODE);return;} // 沒登入就回傳null
  191. $lpr = strtoupper($this->uri->segment(3)); // 車牌號碼
  192. $order_no = strtoupper($this->uri->segment(4)); // 交易序號
  193. $invoice_receiver = urldecode($this->uri->segment(5)); // 載具編號 (可有可無)
  194. $company_no = urldecode($this->uri->segment(6)); // 載具編號 (可有可無)
  195. $email_base64 = $this->uri->segment(7); // 電子信箱
  196. $mobile = $this->uri->segment(8); // 手機號碼
  197. // decode email
  198. if(strlen($email_base64) > 0){
  199. $email = base64_decode($email_base64.'='); // base64字串尾端的'='還原
  200. }else{
  201. $email = email_base64;
  202. }
  203. $data = $this->allpa_service_model->pay_bill($lpr, $order_no, $invoice_receiver, $company_no, $email, $mobile); // 記錄訂單設定
  204. // 管理員結帳流程
  205. if (!empty($data)){
  206. $data = $this->allpa_service_model->get_product_bill($order_no);
  207. if (!empty($data)){
  208. $order_no = $data['order_no'];
  209. $lpr = $data['lpr'];
  210. $amt = $data['amt'];
  211. $status = $data['status'];
  212. switch($status){
  213. case 100: // 狀態: 0:剛建立, 1:結帳完成, 2:錢沒對上, 3:發票沒建立, 4:手動調整, 99:訂單逾期作廢, 100:交易進行中, 101: 交易失敗, 111:產品已領取
  214. // 先記錄
  215. $this->allpa_service_model->transfer_money_done($order_no);
  216. // 開立歐付寶電子發票
  217. $this->allpay_invoice_model->invoice_issue_for_product_bill($order_no, $amt);
  218. // 直接開卡
  219. $this->allpa_service_model->activate_bill_for_new_register($order_no);
  220. // 交易成功
  221. $this->show_page(ADMIN_RESULT_PAGE);
  222. break;
  223. default:
  224. // 對方多傳一次時??
  225. trigger_error(__FUNCTION__.', order_no=>' . $order_no.'<br>'.'status != 100');
  226. }
  227. }
  228. }
  229. }
  230. // [END] 2016/06/08
  231. // 首頁
  232. public function index()
  233. {
  234. $this->show_page(MAIN_PAGE);
  235. }
  236. // 管理
  237. /*
  238. public function admin()
  239. {
  240. $this->show_page(ADMIN_PAGE);
  241. }
  242. */
  243. // A.1 查詢, 用戶歐Pa卡資訊
  244. // http://203.75.167.89/allpa_service.html/get_allpa_info
  245. public function get_allpa_info()
  246. {
  247. $user_lpr = strtoupper($this->input->post('user_lpr', true));
  248. $data = $this->allpa_service_model->get_allpa_info($user_lpr);
  249. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  250. }
  251. // A.2 卡片查詢 (API)
  252. public function get_barcode_info()
  253. {
  254. $barcode = $this->input->post('barcode', true);
  255. $result = $this->allpa_service_model->get_barcode_info($barcode);
  256. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  257. }
  258. // A.3 卡片記名 (API)
  259. public function card_register()
  260. {
  261. $lpr = strtoupper($this->input->post('lpr', true));
  262. $barcode = $this->input->post('barcode', true);
  263. $result = $this->allpa_service_model->card_register($lpr, $barcode);
  264. echo json_encode($result, JSON_UNESCAPED_UNICODE);
  265. }
  266. // B.1 啟用, 產品
  267. public function activate_bill()
  268. {
  269. $order_no = $this->input->post('order_no', true);
  270. $data = $this->allpa_service_model->activate_bill($order_no);
  271. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  272. }
  273. // B.2 儲值
  274. public function allpa_reload()
  275. {
  276. $order_no = $this->input->post('order_no', true);
  277. $reload_pin = $this->input->post('reload_pin', true);
  278. $pin_check_id = $this->input->post('pin_check_id', true);
  279. $data = $this->allpa_service_model->allpa_reload($order_no, $reload_pin, $pin_check_id);
  280. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  281. }
  282. // B.3 扣款
  283. public function allpa_pay_bill()
  284. {
  285. $order_no = $this->input->post('order_no', true);
  286. $data = $this->allpa_service_model->allpa_pay_bill($order_no);
  287. if(! $data["result_code"]){
  288. $data = $this->allpa_service_model->get_allpa_info($data["lpr"]);
  289. }
  290. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  291. }
  292. // C.1 產品列表
  293. // http://203.75.167.89/allpa_service.html/get_allpa_products
  294. public function get_allpa_products()
  295. {
  296. $data = $this->allpa_service_model->get_allpa_products();
  297. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  298. }
  299. // C.2 產品列表 - 購買
  300. public function purchase()
  301. {
  302. $product_id = $this->input->post('product_id', true);
  303. $data = $this->allpa_service_model->create_bill($product_id);
  304. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  305. }
  306. // C.3 付款
  307. public function transfer_money()
  308. {
  309. $lpr = strtoupper($this->uri->segment(3)); // 車牌號碼
  310. $order_no = strtoupper($this->uri->segment(4)); // 交易序號
  311. $invoice_receiver = urldecode($this->uri->segment(5)); // 載具編號 (可有可無)
  312. $company_no = urldecode($this->uri->segment(6)); // 載具編號 (可有可無)
  313. $email_base64 = $this->uri->segment(7); // 電子信箱
  314. $mobile = $this->uri->segment(8); // 手機號碼
  315. // decode email
  316. if(strlen($email_base64) > 0){
  317. $email = base64_decode($email_base64.'='); // base64字串尾端的'='還原
  318. }else{
  319. $email = email_base64;
  320. }
  321. $data = $this->allpa_service_model->pay_bill($lpr, $order_no, $invoice_receiver, $company_no, $email, $mobile); // 記錄訂單設定
  322. if (!empty($data)){
  323. $this->ctbcbank_model->transfer_money_ctbc($data, CTBC_AuthResURL); // 中國信託
  324. }
  325. }
  326. // C.4 收單行端取得授權碼後,要導回的網址 (call by CTBC)
  327. public function return_ok()
  328. {
  329. /**
  330. =======ALL_REQUEST======
  331. URLResEnc: AF2100C51A9E844A1E820B953EA512BE49286403253FF9373474F6AE4A5877B084DD4D9B20F03AF0F34DB3D42A9C583938FE5DC1B60C53384864D9581EE997F92552A2F516B04F2FB2FE3E5C10D61CE84C5B63B87379F1048E16AC430AE94989724D8B0087734F73BF40CE904A05D555F526E5A93462C42931A0A7EC1E6AFF8BC39E641A8F5EE8882BD5B02F838BC217A87533AB9FE98CE1DD558B3CC345FC77D06C1783067F75DF94C58B55A826CD33B32355439BF3C9F17A4596138942B4457B66EB8FA09749C246D5B91799FB3942EC90138033272D89861B8698398FF4F3010628C0D11C7D88FB7A5F85CC59717D9F8D5CADBA5A1231E0396AE344B1DA139BA84F9D477E53A73A376BFCC92B52619E3B396BB28ABE7C4CEE3D3ED2CA1BEEF466F2D645C5CBF1C678C5747BA2A048F2F0FC2B86CAE379DE7A7F144D07C31A
  332. merID: 10063
  333. ----------------------------END
  334. */
  335. // 取得回傳資訊
  336. foreach ($_REQUEST as $key => $value) {
  337. switch ($key){
  338. case "URLResEnc": $resenc = $value; break;
  339. case "merID": $merid = $value; break;
  340. }
  341. }
  342. if(! empty($resenc)){
  343. $return_data = $this->ctbcbank_model->ctbcbank_return_handler($resenc, $merid);
  344. $ctbc_lidm = $return_data['lidm'];
  345. $ctbc_authamt = $return_data['authamt'];
  346. $ctbc_status = $return_data['status'];
  347. if($ctbc_status != 0){
  348. // 金流處理失敗
  349. $this->allpa_service_model->transfer_money_done_with_tx_error($order_no);
  350. }else if(! empty($ctbc_lidm)) {
  351. $data = $this->allpa_service_model->get_product_bill($ctbc_lidm);
  352. if (! empty($data)) {
  353. $order_no = $data['order_no'];
  354. $lpr = $data['lpr'];
  355. $amt = $data['amt'];
  356. $status = $data['status'];
  357. switch($status){
  358. case 100: // 狀態: 0:剛建立, 1:結帳完成, 2:錢沒對上, 3:發票沒建立, 4:手動調整, 99:訂單逾期作廢, 100:交易進行中, 101: 交易失敗, 111:產品已領取
  359. // 印發票流程
  360. if($ctbc_authamt == $amt){
  361. // 先記錄
  362. $this->allpa_service_model->transfer_money_done($order_no);
  363. // 開立歐付寶電子發票
  364. $this->allpay_invoice_model->invoice_issue_for_product_bill($order_no, $amt);
  365. // 直接開卡
  366. $this->allpa_service_model->activate_bill_for_new_register($order_no);
  367. // 交易成功
  368. $this->show_page(RESULT_PAGE);
  369. return;
  370. }else{
  371. // 錢沒對上
  372. $this->allpa_service_model->transfer_money_done_with_amt_error($order_no);
  373. }
  374. break;
  375. default:
  376. // 對方多傳一次時??
  377. trigger_error(__FUNCTION__.', order_no=>' . $order_no.'<br>'.'status != 100');
  378. }
  379. }else{
  380. // 我們自己找不到記錄時??
  381. trigger_error(__FUNCTION__.', order_no=>' . $order_no.'<br>'.' NOT FOUND !!');
  382. }
  383. }else{
  384. // 回傳沒有資料 lidm
  385. trigger_error(__FUNCTION__.', ERROR ..lidm=>' . $ctbc_lidm);
  386. }
  387. }else{
  388. // 回傳沒有資料 resenc
  389. trigger_error(__FUNCTION__.', ERROR ..resenc=>' . $resenc);
  390. }
  391. // 交易失敗
  392. $this->show_page(ERROR_PAGE);
  393. }
  394. // L.1 歐Pa卡 - 開門 (限制存取)
  395. // http://203.75.167.89/allpa_service.html/allpa_go/1458699630/QQQ/12112/5dfe0856f3cdf67772710c3e7e805b80
  396. // http://203.75.167.89/allpa_service.html/allpa_go/1458714030/EEE/12112/19dd4f6692057ad897dc4e0290183a58
  397. // http://203.75.167.89/allpa_service.html/allpa_go/1458714030/YYY/12112/efb076ad1c1d615e6db8c718c116d2d2
  398. // http://203.75.167.89/allpa_service.html/allpa_go/1458714030/MMM/12112/4da21617852b4b43b86f8ac36f9db3e5
  399. // http://203.75.167.89/allpa_service.html/allpa_go/1458714030/BBB/12112/335f61a2a90ba3277cfe0f4cd1a07e26 // KO
  400. // http://203.75.167.89/allpa_service.html/allpa_go/1458897030/KKK/12112/b72332e2939a1a3152aa9d31ef945952
  401. // http://203.75.167.89/allpa_service.html/allpa_go/1459078230/SAYLXXX/12112/5dd8036423fa8eeb7115cd4249327e08
  402. public function allpa_go()
  403. {
  404. $in_time = $this->uri->segment(3); // 進場時間
  405. $lpr = $this->uri->segment(4); // 車牌號碼
  406. $station_no = $this->uri->segment(5); // 場站編號
  407. $check_mac = $this->uri->segment(6); // 驗証欄位
  408. ob_end_clean();
  409. ignore_user_abort();
  410. ob_start();
  411. $data = $this->allpa_service_model->allpa_go($in_time, $lpr, $station_no, $check_mac); // 開門
  412. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  413. header('Connection: close');
  414. header('Content-Length: ' . ob_get_length());
  415. ob_end_flush();
  416. flush();
  417. // 呼叫: 非同步扣款流程
  418. if(!$data["result_code"]){
  419. file_get_contents(APP_URL."allpa_consume_handler/{$data["order_no"]}");
  420. }
  421. }
  422. // 遠端歐PA卡流程
  423. public function allpa_go_remote()
  424. {
  425. $in_time = $this->uri->segment(3); // 進場時間
  426. $lpr = $this->uri->segment(4); // 車牌號碼
  427. $station_no = $this->uri->segment(5); // 場站編號
  428. $check_mac = $this->uri->segment(6); // 驗証欄位
  429. // 驗証欄位
  430. if($check_mac != md5($in_time. $lpr . $station_no))
  431. {
  432. echo 'ck_error';
  433. exit;
  434. }
  435. // 先檢查本地端是否為歐PA會員
  436. $valid_user_ck = md5($lpr);
  437. $valid_user_result = $this->allpa_service_model->get_allpa_valid_user($lpr, $valid_user_ck); // check user
  438. if(!isset($valid_user_result['result_code']) || $valid_user_result['result_code'] != 0)
  439. {
  440. echo json_encode($valid_user_result, JSON_UNESCAPED_UNICODE);
  441. }
  442. else
  443. {
  444. $out_time = strtotime(date('Y-m-d H:i:s')); // 結帳時間
  445. require_once(ALTOB_SYNC_FILE);
  446. $sync_agent = new AltobSyncAgent();
  447. $sync_agent->init($station_no, $out_time);
  448. $sync_agent->in_time = $in_time; // 入場時間
  449. $allpa_go_result = $sync_agent->allpa_go($lpr);
  450. trigger_error(__FUNCTION__ . "..$lpr|$in_time|$out_time.." . print_r($allpa_go_result, true));
  451. echo $allpa_go_result;
  452. }
  453. }
  454. // L.2 歐Pa卡 - 非同步扣款 (限制存取)
  455. public function allpa_consume_handler()
  456. {
  457. $order_no = $this->uri->segment(3); // 訂單編號
  458. $this->allpa_service_model->allpa_pay_bill($order_no); // 扣款
  459. //sleep(5); // test delay
  460. exit();
  461. }
  462. // L.3 歐Pa卡 - 判斷有效用戶 (限制存取)
  463. public function get_allpa_valid_user()
  464. {
  465. $lpr = $this->uri->segment(3); // 車牌號碼
  466. $check_mac = $this->uri->segment(4); // 驗証欄位
  467. ob_end_clean();
  468. ignore_user_abort();
  469. ob_start();
  470. $data = $this->allpa_service_model->get_allpa_valid_user($lpr, $check_mac); // check user
  471. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  472. header('Connection: close');
  473. header('Content-Length: ' . ob_get_length());
  474. ob_end_flush();
  475. flush();
  476. }
  477. // only test
  478. public function gen_test_link()
  479. {
  480. $in_time = strtotime("2017-11-14 16:50:00");
  481. $lpr = "TEST123";
  482. $station_no = "12302";
  483. echo "TEST: ".APP_URL."allpa_go/{$in_time}/{$lpr}/{$station_no}/".md5($in_time.$lpr.$station_no);
  484. echo "\n";
  485. echo "TEST: ".APP_URL."get_allpa_valid_user/{$lpr}/".md5($lpr);
  486. echo "\n";
  487. echo "TEST: ".APP_URL."allpa_go_remote/{$in_time}/{$lpr}/{$station_no}/".md5($in_time.$lpr.$station_no);
  488. header('Connection: close');
  489. header('Content-Length: ' . ob_get_length());
  490. ob_end_flush();
  491. flush();
  492. }
  493. }