VM暫存
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

506 строки
18KB

  1. <!DOCTYPE html>
  2. <html lang="zh-TW">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <title>歐特儀自動化服務機</title>
  10. <!-- Bootstrap Core CSS -->
  11. <link href="<?=BOOTSTRAPS?>bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
  12. <!-- MetisMenu CSS -->
  13. <link href="<?=BOOTSTRAPS?>bower_components/metisMenu/dist/metisMenu.min.css" rel="stylesheet">
  14. <!-- Timeline CSS -->
  15. <link href="<?=BOOTSTRAPS?>dist/css/timeline.css" rel="stylesheet">
  16. <!-- Custom CSS -->
  17. <link href="<?=BOOTSTRAPS?>dist/css/sb-admin-3.css" rel="stylesheet">
  18. <!-- Morris Charts CSS -->
  19. <link href="<?=BOOTSTRAPS?>bower_components/morrisjs/morris.css" rel="stylesheet">
  20. <!-- Custom Fonts -->
  21. <link href="<?=BOOTSTRAPS?>bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  22. </head>
  23. <body style="font-family:Microsoft JhengHei;">
  24. <div id="wrapper">
  25. <div id="page-wrapper"><?php /* 主要資料顯示區 */ ?>
  26. <div class="row">
  27. <div class="col-lg-12">
  28. <!--h1 class="page-header">歐特儀自動化服務機</h1--><?php /* 右側小表頭 */ ?>
  29. &nbsp;
  30. </div>
  31. <!-- /.col-lg-12 -->
  32. </div>
  33. <!-- /.row -->
  34. <?php /* ----- 查車作業 ----- */ ?>
  35. <div data-items="input_lpr" class="row">
  36. <div class="col-lg-12">
  37. <div class="panel panel-default">
  38. <div class="panel-heading" style="font-size:28px;"><?php /* 資料顯示區灰色小表頭 */ ?>
  39. 車位查詢
  40. </div>
  41. <div class="panel-body">
  42. <div data-rows class="row" style="font-size:28px;">
  43. <div class="col-lg-8">
  44. <form id="fuzzy_search_lpr" role="form" method="post">
  45. <div class="form-group">
  46. <input type="text" id="fuzzy_input" name="fuzzy_input" class="form-control" style="text-transform:uppercase;height:64px;font-size:32px;"
  47. placeholder="請輸入車牌關鍵字 ( 3 到 7 碼 ex. 111)"
  48. autofocus required pattern="[A-Za-z0-9]*"
  49. data-validation="length"
  50. data-validation-length="3-7"
  51. data-validation-error-msg="請輸入車牌關鍵字 ( 3 到 7 碼 ex. 111)">
  52. </div>
  53. &nbsp;&nbsp;
  54. <button type="reset" class="btn btn-default" style="font-size:28px;" onclick="$('#fuzzy_search_lpr_msg').text('');">清除</button>
  55. &nbsp;&nbsp;
  56. <span id='fuzzy_search_lpr_msg' style="font-size:28px;color:red;"></span>
  57. &nbsp;&nbsp;
  58. <!--button type="submit" class="btn btn-large btn-success pull-right" style="font-size:28px;">搜尋車牌</button-->
  59. </form>
  60. </div>
  61. </div>
  62. <br/>
  63. <!--div id="carin_query_list" class="col-lg-12 dataTable_wrapper" style="display:none; font-size:20px; max-height:300px">
  64. <table id="lpr_query_list" class="table table-striped table-bordered table-hover">
  65. <thead>
  66. <tr>
  67. <th style="text-align:center;">車號</th>
  68. <th style="text-align:center;">進場時間</th>
  69. <th style="text-align:center;">在席照片</th>
  70. <th style="text-align:center;">功能</th>
  71. </tr>
  72. </thead>
  73. <tbody id="carin_query_tbody" style="font-size:28px;"></tbody>
  74. </table>
  75. </div-->
  76. <div id="carin_query_list" class="col-lg-12 dataTable_wrapper" style="display:none; max-height: 300px; overflow-y: auto">
  77. <table id="lpr_query_list" class="table table-striped table-hover">
  78. <thead>
  79. <tr>
  80. <th style="text-align:center;">車號</th>
  81. <th style="text-align:center;">進場時間</th>
  82. <th style="text-align:center;">在席照片</th>
  83. <th style="text-align:center;">功能</th>
  84. </tr>
  85. </thead>
  86. <tbody id="carin_query_tbody" style="font-size:28px;"></tbody>
  87. </table>
  88. </div><!-- end of modal-body -->
  89. </div>
  90. <!-- /.panel-body -->
  91. </div>
  92. <!-- /.panel -->
  93. </div>
  94. <!-- /.col-lg-12 -->
  95. </div>
  96. <?php /* ----- 查詢作業(結束) ----- */ ?>
  97. <?php /* ----- 查詢結果 ----- */ ?>
  98. <!-- div data-items="rent_sync" class="row" style="display:none;"-->
  99. <div data-items="output_pks" class="row" style="display:none;">
  100. <div class="col-lg-6 col-sm-6">
  101. <div class="panel panel-default">
  102. <div class="panel-heading" style="font-size:28px;"><?php /* 資料顯示區灰色小表頭 */ ?>
  103. 查車結果
  104. </div>
  105. <div class="panel-body" style="margin: 0px auto;">
  106. <div data-rows class="row">
  107. <div class="col-lg-12" style="margin: 0px auto;">
  108. <table class="table table-striped table-bordered table-hover"">
  109. <tbody style="font-size:28px;">
  110. <tr>
  111. <td style="text-align:right;vertical-align: middle;">車號</td>
  112. <td id="show_lpr" style="text-align:left;vertical-align: middle;"></td>
  113. </tr>
  114. <tr>
  115. <td style="text-align:right;vertical-align: middle;">所在樓層</td>
  116. <td id="show_floors" style="text-align:left;vertical-align: middle; font-size:28px; color:blue;"></td>
  117. </tr>
  118. <tr>
  119. <td style="text-align:right;vertical-align: middle;">停入時間</td>
  120. <td id="show_update_time" style="text-align:left;vertical-align: middle;"></td>
  121. </tr>
  122. <tr>
  123. <td colspan="2" style="text-align:center;vertical-align: middle;">
  124. <button type="button" class="btn btn-large btn-success pull-right" style="font-size:28px;" onclick="show_item('input_lpr');">結束查詢</button>
  125. </td>
  126. </tr>
  127. </tbody>
  128. </table>
  129. </div>
  130. <!-- /.col-lg-6 (nested) -->
  131. </div>
  132. <!-- /.row (nested) -->
  133. </div>
  134. <!-- /.panel-body -->
  135. </div>
  136. <!-- /.panel -->
  137. </div>
  138. <div class="col-lg-6 col-sm-6">
  139. <div class="panel panel-default">
  140. <div class="panel-heading" style="font-size:28px;">
  141. 在席照片
  142. </div>
  143. </div>
  144. <div class="panel-body" style="margin: 0px auto;">
  145. <div class="col-lg-12" style="margin: 0px auto;">
  146. <table class="table table-striped table-bordered table-hover"">
  147. <tbody>
  148. <tr>
  149. <td colspan="2" style="text-align:center;vertical-align: middle;">
  150. <img id="show_img" style="max-width:300px" />
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. </div>
  156. </div>
  157. </div>
  158. <!-- /.col-lg-12 -->
  159. </div>
  160. <!-- /#page-wrapper -->
  161. </div>
  162. <!-- /#wrapper -->
  163. <!-- jQuery -->
  164. <script src="<?=BOOTSTRAPS?>bower_components/jquery/dist/jquery.min.js"></script>
  165. <!-- Bootstrap Core JavaScript -->
  166. <script src="<?=BOOTSTRAPS?>bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  167. <!-- Metis Menu Plugin JavaScript -->
  168. <script src="<?=BOOTSTRAPS?>bower_components/metisMenu/dist/metisMenu.min.js"></script>
  169. <!-- Morris Charts JavaScript -->
  170. <script src="<?=BOOTSTRAPS?>bower_components/raphael/raphael-min.js"></script>
  171. <!--script src="<?=BOOTSTRAPS?>bower_components/morrisjs/morris.min.js"></script-->
  172. <!--script src="<?=BOOTSTRAPS?>js/morris-data.js"></script-->
  173. <!-- virtual keyboard -->
  174. <link href="<?=WEB_LIB?>virtual-keyboard/css/jquery-ui.min.css" rel="stylesheet">
  175. <link href="<?=WEB_LIB?>virtual-keyboard/css/keyboard.css" rel="stylesheet">
  176. <script src="<?=WEB_LIB?>virtual-keyboard/js/jquery-ui.min.js"></script>
  177. <script src="<?=WEB_LIB?>virtual-keyboard/js/jquery.keyboard.js"></script>
  178. <script src="<?=WEB_LIB?>virtual-keyboard/js/jquery.keyboard.extension-caret.js"></script>
  179. <!-- alertify -->
  180. <link href="<?=WEB_LIB?>css/alertify.core.css" rel="stylesheet">
  181. <link href="<?=WEB_LIB?>css/alertify.bootstrap.css" rel="stylesheet">
  182. <script src="<?=WEB_LIB?>js/alertify.min.js"></script>
  183. <!-- moment -->
  184. <script src="<?=WEB_LIB?>js/moment.min.js"></script>
  185. <!-- jQuery validate -->
  186. <script src="<?=WEB_LIB?>form-validator/jquery.form-validator.min.js"></script>
  187. <!-- Custom Theme JavaScript -->
  188. <script src="<?=BOOTSTRAPS?>dist/js/sb-admin-2.js"></script>
  189. <div id="works" style="display:none;"></div><?php /* 作為浮動顯示區之用 */ ?>
  190. </body>
  191. </html>
  192. <script>
  193. <?php /* alertify function */ ?>
  194. function alertify_count_down($msg, $delay)
  195. {
  196. alertify.set({delay : $delay});
  197. alertify.log($msg);
  198. }
  199. function alertify_log($msg)
  200. {
  201. alertify.set({delay : 2000});
  202. alertify.log($msg);
  203. }
  204. function alertify_error($msg)
  205. {
  206. alertify.set({delay : 2000});
  207. alertify.error($msg);
  208. }
  209. function alertify_success($msg)
  210. {
  211. alertify.set({delay : 2000});
  212. alertify.success($msg);
  213. }
  214. function alertify_msg($msg)
  215. {
  216. alertify.set({ labels: {
  217. ok : "確定"
  218. } });
  219. alertify.alert($msg, function (e){
  220. // do nothing
  221. });
  222. }
  223. function reset_query()
  224. {
  225. $("#fuzzy_input").val("");
  226. $("#carin_query_list").hide();
  227. return false;
  228. }
  229. var refreshIntervalId = 0; // timer id
  230. <?php /* 顯示指定項目 */ ?>
  231. function show_item(tags)
  232. {
  233. // 查車
  234. reset_query();
  235. // 付款
  236. $("#payment_lpr").val("");<?php /* 清除車號欄位 */ ?>
  237. $("#show_member_name").val("");
  238. $("#show_payment_lpr").val("");
  239. $("#show_end_date").val("");
  240. $("#show_next_start").val("");
  241. $("#show_next_end").val("");
  242. $("#show_amt").val("");
  243. $("#invoice_receiver").val("");
  244. $("#company_no").val("");
  245. $("#email").val("");
  246. $("#mobile").val("");
  247. $("#show_order_no").val("");
  248. $("#show_amt_detail").val("");
  249. $("#show_balance_time_limit_countdown").val("");
  250. if(tags.indexOf('payment_data') < 0 && tags.indexOf('price_data') < 0){
  251. clearInterval(refreshIntervalId); // 消除倒數計時timer
  252. }
  253. $("[data-items]").hide();
  254. $("[data-items="+tags+"]").show();
  255. return false;
  256. }
  257. <?php /* 顯示指定項目, 不修改資料 */ ?>
  258. function show_item_without_change(tags)
  259. {
  260. $("[data-items]").hide();
  261. $("[data-items="+tags+"]").show();
  262. return false;
  263. }
  264. // 查車牌
  265. function check_lpr(idx)
  266. {
  267. $.ajax
  268. ({
  269. url: "<?=APP_URL?>q_pks",
  270. dataType:"json",
  271. type:"post",
  272. data:{ "lpr" : $("#lpr_"+idx).text() },
  273. success:function(jdata)
  274. {
  275. if(!jdata)
  276. {
  277. //alertify_msg("您的愛車可能在頂樓! 謝謝");
  278. alertify_msg("找不到。。謝謝");
  279. return false;
  280. }
  281. else if (jdata["pksno"] == "0")
  282. {
  283. alertify_msg("查無資料,請鍵入正確資料");
  284. return false;
  285. }
  286. $("#show_lpr").text($("#lpr_"+idx).text());
  287. //$("#show_floors").html(jdata["group_name"]+"<br/> ( 車格: " + jdata["pksno"].charAt(0) + "-" + jdata["pksno"].substr(2) +" )");
  288. //$("#show_floors").html(jdata["group_name"]+"<br/> ( 車格: " + jdata["pksno"] +" )");
  289. $("#show_floors").html(jdata["group_name"]+"<br/> ( 車格: " + jdata["pksno"].substr(-3, 3) +" )");
  290. $("#show_update_time").text(jdata["in_time"]);
  291. $("#show_img").attr("src", "<?=SERVER_URL?>pkspic/"+jdata["pic_name"]);
  292. show_item("output_pks");
  293. // 顯示位置圖
  294. if (jdata["group_id"]){
  295. //var groupSplit = jdata["group_id"].split('-'); // ex. B3-3
  296. //var floor = groupSplit[0];
  297. var floor = jdata["floors"];
  298. var x = jdata["posx"];
  299. var y = jdata["posy"];
  300. // 畫出指定位置
  301. AltobObject.AtsMap.drawPosition(floor, x, y);
  302. // show map
  303. $("[data-items="+floor+"]").show();
  304. }
  305. }
  306. });
  307. return false;
  308. }
  309. $(document).ready(function()
  310. {
  311. <?php /* 鎖右鍵 */ ?>
  312. $(document).bind('contextmenu', function (e) {
  313. e.preventDefault();
  314. });
  315. <?php /* 車牌模糊搜尋 */ ?>
  316. $("#fuzzy_search_lpr").submit(function(event)
  317. {
  318. event.preventDefault();
  319. // 清除搜尋提示訊息
  320. $("#fuzzy_search_lpr_msg").text('');
  321. if(! $("#fuzzy_search_lpr").isValid()) return false;
  322. $.ajax
  323. ({
  324. url: "<?=APP_URL?>q_fuzzy_pks",
  325. type: "post",
  326. dataType:"json",
  327. data: $(this).serialize(),
  328. success: function(jdata)
  329. {
  330. if (!jdata)
  331. {
  332. //alert("查無此車 !");
  333. $("#fuzzy_search_lpr_msg").text('查無此車');
  334. return false;
  335. }
  336. // 清除搜尋提示訊息
  337. $("#fuzzy_search_lpr_msg").text('');
  338. var tmp_str_array = [];
  339. for(idx in jdata.result)
  340. {
  341. tmp_str_array = tmp_str_array.concat(
  342. [
  343. "<tr><td id='lpr_", idx, "' style='text-align:center;vertical-align:middle;'>", jdata.result[idx]['lpr'] ,
  344. "</td><td id='in_time_", idx, "'style='text-align:center;vertical-align:middle;'>", jdata.result[idx]['in_time'],
  345. "</td><td id='pks_pic_path_", idx, "'style='text-align:center;vertical-align:middle;'><img height='57' width='150' src='", jdata.result[idx]['pks_pic_path'], "' />",
  346. "</td><td style='text-align:center;vertical-align:middle;'><button class='btn btn-large btn-success' style='font-size:28px;' onclick='check_lpr(", idx, ");'>查詢</button>" ,
  347. "</td></tr>"
  348. ]);
  349. }
  350. $("#carin_query_tbody").html(tmp_str_array.join(''));
  351. $("#carin_query_list").show();
  352. // 若只找到一台, 直接跳到結果頁
  353. if(idx == 0)
  354. {
  355. check_lpr(0);
  356. }
  357. }
  358. });
  359. });
  360. // Custom: altob-keyaction
  361. // ********************
  362. $.extend($.keyboard.keyaction, {
  363. accept : function(base) {
  364. base.close(true); // same as base.accept();
  365. // 直接 submit
  366. $( "#fuzzy_search_lpr" ).submit();
  367. return false; // return false prevents further processing
  368. }
  369. });
  370. // Custom: altob-input
  371. // ********************
  372. $('#fuzzy_input').keyboard({
  373. usePreview: false,
  374. css : {
  375. // input & preview styles
  376. input : 'ui-widget-content ui-corner-all',
  377. // keyboard container - this wraps the preview area (if `usePreview` is true) and all keys
  378. container : 'ui-widget-content ui-widget ui-corner-all ui-helper-clearfix',
  379. // default keyboard button state, these are applied to all keys, the remaining css options are toggled as needed
  380. buttonDefault : 'ui-state-default ui-corner-all',
  381. // hovered button
  382. buttonHover : 'ui-state-hover',
  383. // Action keys (e.g. Accept, Cancel, Tab, etc); this replaces the "actionClass" option
  384. buttonAction : 'ui-state-active',
  385. // used when disabling the decimal button {dec} when a decimal exists in the input area
  386. buttonDisabled : 'ui-state-disabled'
  387. },
  388. position : {
  389. // null (attach to input/textarea) or a jQuery object (attach elsewhere)
  390. of : null,
  391. my : 'center top',
  392. at : 'center top',
  393. // at2 is used when "usePreview" is false (centers keyboard at the bottom
  394. // of the input/textarea)
  395. at2: 'center bottom',
  396. collision: 'flipfit flipfit'
  397. },
  398. display: {
  399. 'bksp' : '\u2190',
  400. 'default' : 'ABC',
  401. 'accept' : '確 認'
  402. },
  403. layout: 'custom',
  404. customLayout: {
  405. 'default': [
  406. '1 2 3 4 5 6 7 8 9 0 {bksp}',
  407. 'Q W E R T Y U I O P',
  408. 'A S D F G H J K L',
  409. 'Z X C V B N M {accept}'
  410. ]
  411. }
  412. });
  413. // 定時自動更新頁面
  414. (function autoReloadPage(){
  415. var pageReloadTimeMillis = 60000; // 頁面, 自動重新載入週期 ( 1 min )
  416. var pageCheckReloadTimeMillis = 10000; // 頁面, 判斷重新載入週期 ( 10 sec )
  417. var pageShowReloadTimeMillis = 50000; // 頁面, 開始顯示倒數週期 ( 50 sec )
  418. var aliveTime = moment();
  419. var countdownTimeMillis = pageReloadTimeMillis;
  420. $(document.body).bind("mousemove keypress", function(e) {
  421. aliveTime = moment();
  422. countdownTimeMillis = pageReloadTimeMillis;
  423. });
  424. function refresh() {
  425. if(moment() - aliveTime >= pageReloadTimeMillis) // 如果頁面沒動作, 才更新
  426. window.location.reload(true);
  427. else{
  428. countdownTimeMillis -= pageCheckReloadTimeMillis;
  429. if(countdownTimeMillis < pageCheckReloadTimeMillis)
  430. {
  431. alertify_count_down("重新載入中..請稍候..", pageCheckReloadTimeMillis);
  432. }
  433. else if(countdownTimeMillis < pageShowReloadTimeMillis){
  434. alertify_count_down("倒數: " + (countdownTimeMillis / 1000) + " 秒, 重新載入畫面..", pageCheckReloadTimeMillis);
  435. }
  436. setTimeout(refresh, pageCheckReloadTimeMillis);
  437. }
  438. }
  439. setTimeout(refresh, pageCheckReloadTimeMillis);
  440. })();
  441. // 自動鎖定輸入欄位
  442. $( "#fuzzy_input" ).focus();
  443. });
  444. </script>