index.php 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  1. <?php
  2. session_start();
  3. //Can't come in without logged in
  4. if (!isset($_SESSION['loggedin'])) {
  5. header('Location: ../Front-Page/pages-signin.html');
  6. exit;
  7. }
  8. ?>
  9. <!doctype html>
  10. <html class="fixed">
  11. <head>
  12. <!-- Basic -->
  13. <meta charset="UTF-8">
  14. <title>設計資料庫查詢系統</title>
  15. <meta name="keywords" content="HTML5 Admin Template" />
  16. <meta name="description" content="JSOFT Admin - Responsive HTML5 Template">
  17. <meta name="author" content="JSOFT.net">
  18. <script src="assets/vendor/jquery/jquery.js"></script>
  19. <script src="./assets/vendor/jquery-hoverIntent/jquery.hoverIntent.js"></script>
  20. <!-- Mobile Metas -->
  21. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  22. <!-- Web Fonts -->
  23. <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
  24. <!-- jstree CSS -->
  25. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css">
  26. <!-- Vendor CSS -->
  27. <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" />
  28. <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" />
  29. <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" />
  30. <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
  31. <link rel="stylesheet" href="assets/vendor/pnotify/pnotify.custom.css" />
  32. <!-- Specific Page Vendor CSS -->
  33. <link rel="stylesheet" href="assets/vendor/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" />
  34. <link rel="stylesheet" href="assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" />
  35. <link rel="stylesheet" href="assets/vendor/morris/morris.css" />
  36. <link rel="stylesheet" href="assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.css" />
  37. <!-- Theme CSS -->
  38. <link rel="stylesheet" href="assets/stylesheets/theme.css" />
  39. <!-- Skin CSS -->
  40. <link rel="stylesheet" href="assets/stylesheets/skins/default.css" />
  41. <!-- Theme Custom CSS -->
  42. <link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
  43. <!-- Head Libs -->
  44. <script src="assets/vendor/modernizr/modernizr.js"></script>
  45. <!-- chart.js -->
  46. <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
  47. <!-- DataTable -->
  48. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css">
  49. <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script>
  50. <!-- Icon -->
  51. <link rel="shortcut icon" href="assets/images/favicon.ico" />
  52. <link href="https://js.arcgis.com/4.21/esri/themes/light/main.css" rel="stylesheet">
  53. <link href="./CustomCSS/main.css" rel="stylesheet">
  54. <script src="./script/js/bootstrap.js"></script>
  55. <script src="./script/js/pdfobject.min.js"></script>
  56. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/jstree.min.js"></script>
  57. <script src="./script/js/jstreeAJAX.js"></script>
  58. <script src="https://js.arcgis.com/4.21/"></script>
  59. <style>
  60. .page-header>ul {
  61. list-style: none;
  62. padding: 0;
  63. margin: 0;
  64. }
  65. .page-header>ul>li {
  66. display: inline-block;
  67. font-size: 25px;
  68. color: #FFFFFF;
  69. }
  70. .page-header>ul>li.right {
  71. float: right;
  72. padding-right: 10px;
  73. }
  74. .input-search {
  75. margin-top: 8px;
  76. }
  77. .page-header li>label {
  78. margin-top: 13px;
  79. border-bottom: 4px solid #0088cc;
  80. height: 41px;
  81. }
  82. .sidebar-left {
  83. box-shadow: 0 0 0;
  84. }
  85. .jstree-default .jstree-icon {
  86. color: #ffe693;
  87. }
  88. .jqsfield {
  89. color: white;
  90. font: 10px arial, san serif;
  91. text-align: left;
  92. }
  93. .jstree-anchor {
  94. width: 250px;
  95. text-overflow: ellipsis;
  96. overflow: hidden;
  97. white-space: nowrap;
  98. }
  99. .jstree-anchor,
  100. .jstree-anchor:link,
  101. .jstree-anchor:visited,
  102. .jstree-anchor:hover,
  103. .jstree-anchor:active {
  104. color: #abb4be;
  105. }
  106. td,
  107. th {
  108. text-align: center;
  109. }
  110. th {
  111. width: 30%;
  112. }
  113. .nav-main {
  114. padding: 15px;
  115. }
  116. .node-hidden {
  117. display: none;
  118. }
  119. html.fixed .page-header {
  120. left: 349px;
  121. }
  122. html.fixed .content-body {
  123. margin-left: 350px;
  124. }
  125. .sidebar-left {
  126. width: 350px;
  127. }
  128. #datatable-ajax tr:hover {
  129. background-color: #e8e8e8;
  130. }
  131. #viewDiv {
  132. height: 100%;
  133. width: 100%;
  134. }
  135. #zoom {
  136. margin-bottom: 5px;
  137. }
  138. #actions {
  139. padding: 5px;
  140. }
  141. .container {
  142. height: 50%;
  143. width: 100%;
  144. }
  145. #createSlideDiv {
  146. background-color: white;
  147. opacity: 0.9;
  148. color: black;
  149. padding: 6px;
  150. }
  151. #slidesDiv {
  152. background-color: white;
  153. opacity: 0.9;
  154. color: black;
  155. padding: 10px;
  156. visibility: hidden;
  157. bottom: 20px;
  158. overflow-y: auto;
  159. text-align: center;
  160. height: 260px;
  161. }
  162. #slidesDiv .slide {
  163. /* Show cursor as pointer when on a slide */
  164. cursor: pointer;
  165. margin-bottom: 6px;
  166. }
  167. #slidesDiv .slide .title {
  168. /* Center the title text */
  169. text-align: center;
  170. }
  171. /* Draw active slide with a nice border around the thumbnail */
  172. #slidesDiv .slide.active img {
  173. box-shadow: 0px 0px 12px black;
  174. border-style: solid;
  175. border-width: thin;
  176. border-color: black;
  177. }
  178. .pdfobject-container {
  179. height: 730px;
  180. }
  181. #topbar {
  182. background: #fff;
  183. padding: 10px;
  184. }
  185. #datatable-ajax_length {
  186. width: 100%;
  187. }
  188. .multiselect {
  189. width: 200px;
  190. }
  191. .selectBox {
  192. position: relative;
  193. width: 200px;
  194. }
  195. .selectBox select {
  196. width: 100%;
  197. font-weight: bold;
  198. }
  199. .overSelect {
  200. position: absolute;
  201. left: 0;
  202. right: 0;
  203. top: 0;
  204. bottom: 0;
  205. }
  206. .checkboxes {
  207. display: none;
  208. border: 1px #dadada solid;
  209. background-color: white;
  210. z-index: 2;
  211. position: absolute;
  212. width: 200px;
  213. display: none;
  214. }
  215. .checkboxes label {
  216. display: block;
  217. padding-left: 10px;
  218. padding-right: 10px;
  219. padding-top: 5px;
  220. padding-bottom: 5px;
  221. }
  222. .checkboxes label:hover {
  223. background-color: #1e90ff;
  224. color: #ffffff;
  225. }
  226. .multiselect {
  227. display: inline-block;
  228. }
  229. #filter-slide{
  230. width: 100%;
  231. }
  232. </style>
  233. <script>
  234. $(document).ready(function() {
  235. getToken();
  236. });
  237. var token;
  238. function getToken() {
  239. var t;
  240. $.ajax({
  241. url: "./scripts/PHP/access_token.php",
  242. type: "GET",
  243. async: false,
  244. }).done(function(data) {
  245. token = data;
  246. //data = JSON.parse(data);
  247. }).error(function() {
  248. });
  249. }
  250. require([
  251. "esri/config",
  252. "esri/Map",
  253. "esri/WebScene",
  254. "esri/views/SceneView",
  255. "esri/core/urlUtils",
  256. "esri/identity/OAuthInfo",
  257. "esri/identity/IdentityManager",
  258. "esri/widgets/Legend",
  259. "esri/widgets/Home",
  260. "esri/widgets/Fullscreen",
  261. "esri/widgets/Slider",
  262. "esri/widgets/BasemapGallery",
  263. "esri/widgets/LayerList",
  264. "esri/layers/GroupLayer",
  265. "esri/layers/FeatureLayer",
  266. "esri/widgets/FeatureTable",
  267. "esri/tasks/support/Query",
  268. "esri/layers/SceneLayer",
  269. "esri/widgets/Zoom",
  270. "esri/widgets/Compass",
  271. "esri/widgets/NavigationToggle",
  272. "esri/widgets/Slice",
  273. "esri/widgets/Search",
  274. "esri/geometry/Point",
  275. "esri/geometry/Polyline",
  276. "esri/webscene/Slide",
  277. "esri/symbols/WebStyleSymbol",
  278. "esri/widgets/DirectLineMeasurement3D",
  279. "esri/widgets/AreaMeasurement3D",
  280. "esri/Graphic",
  281. "esri/widgets/Search/LocatorSearchSource",
  282. "esri/renderers/UniqueValueRenderer",
  283. "esri/geometry/geometryEngine",
  284. "esri/widgets/Expand",
  285. "esri/layers/GeoJSONLayer",
  286. "esri/PopupTemplate",
  287. "esri/renderers/Renderer",
  288. "esri/geometry/projection"
  289. ], (esriConfig, Map, WebScene, SceneView, urlUtils, OAuthInfo, esriId,
  290. Legend,
  291. Home,
  292. Fullscreen,
  293. Slider,
  294. BasemapGallery,
  295. LayerList,
  296. GroupLayer,
  297. FeatureLayer,
  298. FeatureTable,
  299. Query,
  300. SceneLayer,
  301. Zoom,
  302. Compass,
  303. NavigationToggle,
  304. Slice,
  305. Search,
  306. Point,
  307. Polyline,
  308. Slide,
  309. WebStyleSymbol,
  310. DirectLineMeasurement3D,
  311. AreaMeasurement3D,
  312. Graphic,
  313. LocatorSearchSource,
  314. UniqueValueRenderer,
  315. geometryEngine,
  316. Expand, GeoJsonLayer, PopupTemplate, Renderer, projection) => {
  317. esriConfig.apiKey = token;
  318. let activeWidget = null;
  319. const webscene = new WebScene({
  320. portalItem: {
  321. id: "dea6580d8d4547df9915a822fe7f2b9d"
  322. },
  323. opacity: .75,
  324. showAttribution: false,
  325. });
  326. var featureLayer = new FeatureLayer({
  327. url: "https://services3.arcgis.com/W6g8dmWX0ILAHcNd/arcgis/rest/services/%E5%B7%A5%E7%A8%8B%E8%A8%AD%E8%A8%88%E8%B3%87%E6%96%99%E5%BA%AB/FeatureServer",
  328. outFields: ["*"],
  329. //renderer: poleRenderer,
  330. title: "工程設計資料庫",
  331. elevationInfo: "on-the-ground",
  332. visible: true
  333. });
  334. webscene.add(featureLayer);
  335. const view = new SceneView({
  336. container: "viewDiv",
  337. map: webscene,
  338. popup: {
  339. defaultPopupTemplateEnabled: true,
  340. dockEnabled: true,
  341. dockOptions: {
  342. breakpoint: false,
  343. buttonEnabled: false,
  344. position: "bottom-right",
  345. }
  346. }
  347. });
  348. window.view = view;
  349. view.ui.empty("top-left");
  350. //view.ui.empty("manual");
  351. view.ui.add(
  352. new Expand({
  353. view: view,
  354. content: new BasemapGallery({
  355. view: view
  356. }),
  357. autoCollapse: true,
  358. group: "top-left"
  359. }),
  360. "top-left"
  361. );
  362. view.ui.add(
  363. new Expand({
  364. view: view,
  365. content: new Legend({
  366. view: view
  367. }),
  368. autoCollapse: true,
  369. group: "top-left"
  370. }),
  371. "top-left"
  372. );
  373. view.ui.add(
  374. new Home({
  375. view: view,
  376. group: "top-left"
  377. }),
  378. "top-left"
  379. );
  380. //新增量測工具
  381. view.ui.add("topbar", "bottom-right");
  382. document
  383. .getElementById("distanceButton")
  384. .addEventListener("click", (event) => {
  385. setActiveWidget(null);
  386. if (!event.target.classList.contains("active")) {
  387. setActiveWidget("distance");
  388. } else {
  389. setActiveButton(null);
  390. }
  391. });
  392. document
  393. .getElementById("areaButton")
  394. .addEventListener("click", (event) => {
  395. setActiveWidget(null);
  396. if (!event.target.classList.contains("active")) {
  397. setActiveWidget("area");
  398. } else {
  399. setActiveButton(null);
  400. }
  401. });
  402. document
  403. .getElementById("clear")
  404. .addEventListener("click", (event) => {
  405. setActiveWidget(null);
  406. setActiveButton(null);
  407. });
  408. function setActiveWidget(type) {
  409. switch (type) {
  410. case "distance":
  411. activeWidget = new DirectLineMeasurement3D({
  412. view: view
  413. });
  414. // skip the initial 'new measurement' button
  415. activeWidget.viewModel.start().catch((error) => {
  416. if (promiseUtils.isAbortError(error)) {
  417. return; // don't display abort errors
  418. }
  419. throw error; // throw other errors since they are of interest
  420. });
  421. view.ui.add(activeWidget, "bottom-left");
  422. setActiveButton(document.getElementById("distanceButton"));
  423. break;
  424. case "area":
  425. activeWidget = new AreaMeasurement3D({
  426. view: view
  427. });
  428. // skip the initial 'new measurement' button
  429. activeWidget.viewModel.start().catch((error) => {
  430. if (promiseUtils.isAbortError(error)) {
  431. return; // don't display abort errors
  432. }
  433. throw error; // throw other errors since they are of interest
  434. });
  435. view.ui.add(activeWidget, "bottom-left");
  436. setActiveButton(document.getElementById("areaButton"));
  437. break;
  438. case null:
  439. if (activeWidget) {
  440. view.ui.remove(activeWidget);
  441. activeWidget.destroy();
  442. activeWidget = null;
  443. }
  444. break;
  445. }
  446. }
  447. function setActiveButton(selectedButton) {
  448. // focus the view to activate keyboard shortcuts for sketching
  449. view.focus();
  450. const elements = document.getElementById("topbar").getElementsByClassName("active");
  451. for (let i = 0; i < elements.length; i++) {
  452. elements[i].classList.remove("active");
  453. }
  454. if (selectedButton) {
  455. selectedButton.classList.add("active");
  456. }
  457. }
  458. view.ui.add(
  459. new Fullscreen({
  460. view: view,
  461. group: "top-left"
  462. }),
  463. "top-right"
  464. );
  465. view.ui.add(
  466. new Zoom({
  467. view: view
  468. }),
  469. "top-right"
  470. );
  471. view.ui.add(
  472. new NavigationToggle({
  473. view: view
  474. }),
  475. "top-right"
  476. );
  477. view.ui.add(
  478. new Compass({
  479. view: view
  480. }),
  481. "top-right"
  482. );
  483. $("#measureExpendDiv .esri-widget--button").click(function() {
  484. if (pMeasureExpand.expanded) {
  485. activeMeasureWidget.viewModel.newMeasurement();
  486. } else {
  487. activeMeasureWidget.viewModel.clearMeasurement();
  488. }
  489. });
  490. function zoomToLayer(layer) {
  491. return layer.queryExtent().then((response) => {
  492. view.goTo({
  493. target: response.extent,
  494. tilt: 0,
  495. heading: 0,
  496. }).catch((error) => {
  497. console.error(error);
  498. });
  499. });
  500. }
  501. $('#treeAjaxHTML').on("select_node.jstree", function(e, data) {
  502. if (data.node.text.includes("-")) {
  503. project_id = data.node.text.split("-")[0];
  504. featureLayer.definitionExpression = "計畫編號 = " + project_id;
  505. zoomToLayer(featureLayer);
  506. }
  507. /*else{
  508. type = data.node.text;
  509. console.log(type);
  510. featureLayer.definitionExpression = "工程類別 = '"+ type + "'";
  511. zoomToLayer(featureLayer);
  512. }*/
  513. });
  514. view.when(function() {
  515. });
  516. });
  517. var db_table = {};
  518. $.ajax({
  519. url: "./script/php/get_db_table.php",
  520. type: "GET",
  521. async: false,
  522. contentType: "application/json",
  523. dataType: "json"
  524. }).done(function(data) {
  525. db_table = data;
  526. }).error(function(error) {
  527. console.log(error);
  528. });
  529. db_table["notes"] = merge_object_by_key(db_table["notes"], "project_id", "notes");
  530. var notes_button_list = [...new Set([].concat(...Object.values(db_table["notes"])))];
  531. var search_data = {
  532. "category": get_value_list_by_key(db_table["category"], null, -1, "category_id").toString().split(","),
  533. "project": get_value_list_by_key(db_table["project"], null, -1, "project_id"),
  534. "type": get_value_list_by_key(db_table["type"], null, -1, "type_id").toString().split(","),
  535. "notes": notes_button_list
  536. };
  537. var filter_base_data = search_data;
  538. function get_value_list_by_key(obj_list, key_search, target_value, key_save) {
  539. output_list = [];
  540. obj_list.forEach(element => {
  541. if (target_value != -1) {
  542. target_value.forEach(e => {
  543. if(e.toString() == element[key_search].toString()) {
  544. output_list.push(element[key_save]);
  545. }
  546. });
  547. } else {
  548. output_list.push(element[key_save]);
  549. }
  550. });
  551. output_list = [...new Set(output_list)];
  552. return output_list;
  553. }
  554. function merge_object_by_key(obj, key, value) {
  555. output_object = {};
  556. while (obj.length > 0) {
  557. pop_out = obj.pop();
  558. if (output_object[pop_out[key]] == undefined) {
  559. output_object[pop_out[key]] = [pop_out[value]];
  560. } else {
  561. output_object[pop_out[key]].push(pop_out[value]);
  562. }
  563. }
  564. return output_object
  565. }
  566. </script>
  567. </head>
  568. <body>
  569. <script type="application/javascript">
  570. var test;
  571. var i = 0;
  572. var download;
  573. var fileName;
  574. var folder;
  575. var software;
  576. var userName = 'maabim';
  577. jQuery(window).load(function() {
  578. var url_href = window.location.href;
  579. var url = new URL(url_href);
  580. var type = url.searchParams.get("type");
  581. var projectId = url.searchParams.get("projectId");
  582. if (projectId != null) {
  583. var projectNode = $(".jstree-anchor").filter(function() {
  584. return $(this).text().includes(projectId);
  585. });
  586. let nodeId = projectNode[0].attributes.id.value;
  587. $('#treeAjaxHTML').jstree("select_node", nodeId);
  588. $("#treeAjaxHTML").jstree("close_all");
  589. }
  590. });
  591. //var typeId = node[0].attributes.id.value;
  592. </script>
  593. <section class="body">
  594. <!-- start: header -->
  595. <header class="header">
  596. <div class="logo-container">
  597. <div class="banner-txt">設計資料庫查詢系統</div>
  598. <div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
  599. <i class="fa fa-bars" aria-label="Toggle sidebar"></i>
  600. </div>
  601. </div>
  602. <!-- start: search & user box -->
  603. <div class="header-right">
  604. <span class="separator"></span>
  605. <ul class="notifications">
  606. <li>
  607. <a href="./upload.html" class="notification-icon" data-toggle="tooltip" title="匯入工具" data-placement="bottom">
  608. <i class="fa fa-upload"></i>
  609. </a>
  610. <a href="/Front-Page/home.php" class="notification-icon" data-toggle="tooltip" title="綜合登入入口" data-placement="bottom">
  611. <i class="fa fa-home"></i>
  612. </a>
  613. </li>
  614. </ul>
  615. <span class="separator"></span>
  616. <div id="userbox" class="userbox">
  617. <a href="#" data-toggle="dropdown">
  618. <figure class="profile-picture"> <img src="assets/images/!logged-user.jpg" alt="Joseph Doe" class="img-circle" data-lock-picture="assets/images/!logged-user.jpg" /> </figure>
  619. <div class="profile-info" data-lock-name="John Doe" data-lock-email="johndoe@JSOFT.com"> <span class="name"><?php echo $_SESSION['name'] ?></span> <span class="role">tester</span> </div> <i class="fa custom-caret"></i>
  620. </a>
  621. <div class="dropdown-menu">
  622. <ul class="list-unstyled">
  623. <li class="divider"></li>
  624. <li> <a role="menuitem" tabindex="-1" href="./script/php/Logout.php"><i class="fa fa-power-off"></i> Logout</a> </li>
  625. </ul>
  626. </div>
  627. </div>
  628. </div>
  629. <!-- end: search & user box -->
  630. </header>
  631. <!-- end: header -->
  632. <div class="inner-wrapper">
  633. <!-- start: sidebar -->
  634. <aside id="sidebar-left" class="sidebar-left">
  635. <div class="nano">
  636. <div class="nano-content">
  637. <nav id="menu" class="nav-main" role="navigation">
  638. <div class="widget-header clearfix">
  639. <h6 class="title pull-left mt-xs">資料庫文件</h6>
  640. </div>
  641. <div class="widget-content">
  642. <div class="jstree jstree-1 jstree-default" id="treeAjaxHTML"></div>
  643. </div>
  644. </nav>
  645. </div>
  646. </div>
  647. </aside>
  648. <!-- end: sidebar -->
  649. <section role="main" class="content-body">
  650. <header class="page-header">
  651. <ul>
  652. <li>
  653. <label id="header"></label>
  654. </li>
  655. <li class="right">
  656. <a class="mb-xs mt-xs mr-xs modal-with-move-anim btn btn-default" href="#advancedSearch"><i class="fa fa-search"></i> 進階搜尋</a>
  657. </li>
  658. </ul>
  659. </header>
  660. <div class="row">
  661. <div id="advancedSearch" class="zoom-anim-dialog modal-block modal-block-primary mfp-hide">
  662. <section class="panel">
  663. <header class="panel-heading">
  664. <h2 class="panel-title">進階搜尋</h2>
  665. </header>
  666. <div class="panel-body">
  667. <form class="form-horizontal form-bordered" method="get">
  668. <div class="form-group" id="category">
  669. <label class="col-md-3 control-label">工程類別:</label>
  670. <div class="multiselect col-md-6">
  671. <div class="selectBox">
  672. <select>
  673. <option>選擇工程</option>
  674. </select>
  675. <div class="overSelect"></div>
  676. </div>
  677. <div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
  678. <label for="category-any"><input type="checkbox" id="category-any" value="any" checked/> 全選</label>
  679. <!-- append option -->
  680. </div>
  681. </div>
  682. </div>
  683. <div class="form-group" id="project">
  684. <label class="col-md-3 control-label">專案類別:</label>
  685. <div class="multiselect col-md-6">
  686. <div class="selectBox">
  687. <select>
  688. <option>選擇專案</option>
  689. </select>
  690. <div class="overSelect"></div>
  691. </div>
  692. <div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
  693. <label for="project-any"><input type="checkbox" id="project-any" value="any" checked/> 全選</label>
  694. <!-- append option -->
  695. </div>
  696. </div>
  697. </div>
  698. <div class="form-group" id="type">
  699. <label class="col-md-3 control-label">文件類別:</label>
  700. <div class="multiselect col-md-6">
  701. <div class="selectBox">
  702. <select>
  703. <option>選擇文件</option>
  704. </select>
  705. <div class="overSelect"></div>
  706. </div>
  707. <div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
  708. <label for="type-any"><input type="checkbox" id="type-any" value="any" checked/> 全選</label>
  709. <!-- append option -->
  710. </div>
  711. </div>
  712. </div>
  713. <div class="form-group" id="notes" style="display: bllock;" hidden>
  714. <label class="col-md-3 control-label">設計圖類別:</label>
  715. <div class="multiselect col-md-6">
  716. <div class="selectBox">
  717. <select>
  718. <option>選擇設計圖</option>
  719. </select>
  720. <div class="overSelect"></div>
  721. </div>
  722. <div class="checkboxes form-inline" style="display: none; overflow-y:scroll; height:300px">
  723. <label for="notes-any"><input type="checkbox" id="notes-any" value="any" checked/> 全選</label>
  724. <!-- append option -->
  725. </div>
  726. </div>
  727. </div>
  728. <div class="form-group">
  729. <label class="col-md-3 control-label" for="search-word">文字搜尋:</label>
  730. <div class="col-md-6">
  731. <input type="text" class="form-control" placeholder="輸入關鍵字" id="search-word">
  732. </div>
  733. </div>
  734. </form>
  735. </div>
  736. <footer class="panel-footer">
  737. <div class="row">
  738. <div class="col-md-12 text-right">
  739. <div id="treeAjaxJSON" class="jstree jstree-4 jstree-default" role="tree" style="display: none;">
  740. <ul class="jstree-container-ul jstree-children">
  741. <li class="jstree-initial-node jstree-loading jstree-leaf jstree-last">
  742. <i class="jstree-icon jstree-ocl"></i>
  743. <a class="jstree-anchor" href="#"><i class="jstree-icon jstree-themeicon-hidden"></i>Loading ...</a>
  744. </li>
  745. </ul>
  746. </div>
  747. <div class="progress progress-striped light active m-md" style="display: none;">
  748. <div class="progress-bar progress-bar-primary" id="progress-bars" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
  749. </div>
  750. <div class="jstree jstree-4 jstree-default" id="loading" style="display: none;">
  751. <ul class="jstree-container-ul">
  752. <li class="jstree-loading">
  753. <i class="jstree-icon jstree-ocl"></i>讀取中 ...
  754. </li>
  755. </ul>
  756. </div>
  757. <div id="advanced-search-button-group" style="display: block;">
  758. <p id="warning-text" style="display: none; color: red;">警告! 篩選結果多於 1000 筆 </p>
  759. <button class="btn btn-warning" id="keep-search-button" style="display: none;">仍要搜尋</button>
  760. <button class="btn btn-primary" id="advanced-search-button" style="display: inline-block;">搜尋</button>
  761. <button class="btn btn-default modal-dismiss">取消</button>
  762. </div>
  763. </div>
  764. </div>
  765. </footer>
  766. </section>
  767. </div>
  768. <div class="col-md-6">
  769. <section class="panel" id="search-filter-panel" style="display: none;">
  770. <div class="panel-body">
  771. <form class="form-horizontal form-bordered" id="search-filter" method="get" hidden>
  772. <div class="form-group">
  773. <label class="col-md-3 control-label">工程類別:</label>
  774. <div class="col-md-7" id="f-category">
  775. <!-- append option -->
  776. </div>
  777. </div>
  778. <div class="form-group">
  779. <label class="col-md-3 control-label">專案類別:</label>
  780. <div class="col-md-7" id="f-project">
  781. <!-- append option -->
  782. </div>
  783. </div>
  784. <div class="form-group">
  785. <label class="col-md-3 control-label">文件類別:</label>
  786. <div class="col-md-7" id="f-type">
  787. <!-- append option -->
  788. </div>
  789. </div>
  790. <div class="form-group" id="filter_notes" style="display: none;">
  791. <label class="col-md-3 control-label">設計圖類別:</label>
  792. <div class="col-md-7" id="f-notes">
  793. <!-- append option -->
  794. </div>
  795. </div>
  796. </form>
  797. <i class="text-center fa fa-sort-desc" id="filter-slide"></i>
  798. </div>
  799. </section>
  800. <section class="panel">
  801. <div class="panel-body">
  802. <button id="reset" type="button" class="mb-xs mr-xs btn btn-default" style="float: right;"><i class="fa fa-reply"></i> 上一層</button>
  803. <table style="width:99%;" class="table table-bordered table-striped" id="datatable-ajax">
  804. <thead>
  805. <tr>
  806. <th id="SN">項次</th>
  807. <th id="name">類別</th>
  808. <th>關鍵字</th>
  809. <th>版次</th>
  810. <th>檔案數</th>
  811. </tr>
  812. </thead>
  813. <tbody>
  814. </tbody>
  815. </table>
  816. </div>
  817. </section>
  818. <section class="panel">
  819. <div id="panel" class="panel-body" style="height: 300px;">
  820. <div class="table-responsive" style="display:none;">
  821. <table class="table table-bordered mb-none" id="tableDetail">
  822. <tbody>
  823. <tr>
  824. <th>計畫編號</th>
  825. <td id="plan_code"></td>
  826. </tr>
  827. <tr>
  828. <th>計畫名稱</th>
  829. <td id="plan_name"></td>
  830. </tr>
  831. <tr>
  832. <th>圖名</th>
  833. <td id="fileName"></td>
  834. </tr>
  835. <tr>
  836. <th>版次</th>
  837. <td id="version"></td>
  838. </tr>
  839. <tr>
  840. <th>文件</th>
  841. <td id="download"></td>
  842. </tr>
  843. </tbody>
  844. </table>
  845. </div>
  846. </div>
  847. </section>
  848. </div>
  849. <div class="col-md-6">
  850. <div class="tabs">
  851. <ul class="nav nav-tabs nav-justified">
  852. <li class="active">
  853. <a href="#arcgisTab" data-toggle="tab" class="text-center"><i class="fa fa-map-marker"></i> ArcGIS</a>
  854. </li>
  855. <li>
  856. <a href="#pdfTab" data-toggle="tab" class="text-center"><i class="fa fa-file"></i> Pdf 預覽</a>
  857. </li>
  858. </ul>
  859. <div class="tab-content">
  860. <div id="arcgisTab" class="tab-pane active">
  861. <div id="arcgis" class="panel-body" style="height: 730px;">
  862. <div class="mapok" style="height:100%">
  863. <div id="topbar" class="esri-component esri-widget">
  864. <button id="distanceButton" class="action-button esri-icon-measure-line" type="button" title="Measure distance between two points"></button>
  865. <button id="areaButton" class="action-button esri-icon-measure-area" type="button" title="Measure area"></button>
  866. <button id="clear" class="action-button esri-icon-trash" title="Clear Measurements"></button>
  867. </div>
  868. <div id="viewDiv"></div>
  869. <div id="measureExpendDiv"></div>
  870. <div id="measureExpendDiv2"></div>
  871. <div id="slidesDiv" class="esri-widget"></div>
  872. <span style="display:none;" id="project-id"></span>
  873. </div>
  874. </div>
  875. </div>
  876. <div id="pdfTab" class="tab-pane">
  877. <div id="pdfFile"></div>
  878. </div>
  879. </div>
  880. </div>
  881. </div>
  882. </div>
  883. </section>
  884. </div>
  885. </section>
  886. </div>
  887. <script>
  888. db_table["category"].forEach(element => {
  889. option_id = "c" + element["category_id"] + "-l" + element["list_id"];
  890. $("#category .checkboxes").append("<label class='category-button' for="+option_id+"><input type='checkbox' class='category-option' value="+element["category_name"]+" id="+option_id+" />"+element["category_name"]+"</label>");
  891. filter_option_id = "f-c" + element["category_id"]
  892. list_id = element["list_id"];
  893. $("#f-category").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" list_id="+list_id+" style='display:none;'>"+element["category_name"]+"</button>");
  894. });
  895. db_table["project"].forEach(element => {
  896. option_id = "p" + element["project_id"];
  897. $("#project .checkboxes").append("<label class='project-button' for="+option_id+"><input type='checkbox' class='project-option' value="+element["project_id"]+" id="+option_id+" />["+element["project_id"]+"] "+element["project_name"]+"</label>");
  898. filter_option_id = "f-" + option_id;
  899. $("#f-project").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+element["project_name"]+"</button>");
  900. });
  901. db_table["type"].forEach(element => {
  902. option_id = "t" + element["type_id"];
  903. $("#type .checkboxes").append("<label class='type-button' for="+option_id+"><input type='checkbox' class='type-option' value="+element["type_name"]+" id="+option_id+" />"+element["type_name"]+"</label>");
  904. filter_option_id = "f-" + option_id;
  905. $("#f-type").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+element["type_name"]+"</button>");
  906. });
  907. for(i=0;i<notes_button_list.length;i++) {
  908. option_id = "n" + i;
  909. $("#notes .checkboxes").append("<label class='notes-button' for="+option_id+"><input type='checkbox' class='notes-option' value="+notes_button_list[i]+" id="+option_id+" />"+notes_button_list[i]+"</label>");
  910. filter_option_id = "f-" + option_id;
  911. $("#f-notes").append("<button type='button' class='mb-xs mt-xs mr-xs btn btn-primary' id="+filter_option_id+" style='display:none;'>"+notes_button_list[i]+"</button>");
  912. }
  913. </script>
  914. <!-- Vendor -->
  915. <script src="assets/vendor/magnific-popup/magnific-popup.js"></script>
  916. <!-- Examples -->
  917. <script src='./script/js/search.js'></script>
  918. <script src='./script/js/filter.js'></script>
  919. <script src="assets/javascripts/ui-elements/examples.modals.js"></script>
  920. </body>
  921. </html>