Browse Source

新增TABLE 詳細資訊

manto07m 3 năm trước cách đây
mục cha
commit
ced75045ee

+ 1 - 0
assets/notPDF.pdf

@@ -0,0 +1 @@
+

+ 6 - 3
assets/vendor/jstree/themes/default/style.css

@@ -25,10 +25,13 @@
 .jstree-anchor,
 .jstree-anchor:link,
 .jstree-anchor:visited,
-.jstree-anchor:hover,
-.jstree-anchor:active {
+.jstree-anchor:active{
   text-decoration: none;
-  color: inherit;
+  color: black;
+}
+.jstree-anchor:hover {
+  text-decoration: none;
+  color: #0088cc;
 }
 .jstree-icon {
   display: inline-block;

+ 52 - 24
other-list.php

@@ -10,9 +10,9 @@ if (!isset($_SESSION['loggedin'])) {
 
 <head>
 	<!-- jstree CSS -->
-	<!-- <link rel="stylesheet" href="assets/vendor/jstree/themes/default/style.css" /> -->
+	<link rel="stylesheet" href="assets/vendor/jstree/themes/default/style.css" />
 	<!-- jstree CSS -->
-	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css">
+	<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css"> -->
 	<?php include("bim-support-header.html"); ?>
 	<script src="./script/js/global.js"></script>
 	<script src="./script/js/pdfobject.min.js"></script>
@@ -52,6 +52,17 @@ if (!isset($_SESSION['loggedin'])) {
 			overflow: hidden;
 			white-space: nowrap;
 		}
+
+		th {
+			text-align: center;
+			width: 30%;
+			font-size: 18px;
+		}
+
+		td {
+			text-align: center;
+			font-size: 18px;
+		}
 	</style>
 </head>
 
@@ -87,13 +98,34 @@ if (!isset($_SESSION['loggedin'])) {
 									<section class="panel">
 										<div class="panel-body">
 											<h5 class="text-semibold text-dark text-uppercase">檔案下載</h5>
-											<div id="treeAjaxHTML" style="height:400px"></div>
+											<div id="treeAjaxHTML" style="height:400px;overflow: auto;"></div>
 										</div>
 									</section>
 									<section class="panel">
 										<div class="panel-body">
-											<h5 class="text-semibold text-dark text-uppercase">檔案下載</h5>
-											<div id="treeAjaxHTML" style="height:200px"></div>
+											<h5 class="text-semibold text-dark text-uppercase">檔案資訊</h5>
+											<div id="fileTable" style="height:200px">
+												<table class="table table-bordered mb-none" style="height: 100%;">
+													<tbody>
+														<tr>
+															<th>檔案名稱</th>
+															<td id="fileName"></td>
+														</tr>
+														<tr>
+															<th>詳細資訊</th>
+															<td id="fileDetail">尚未填寫</td>
+														</tr>
+														<tr>
+															<th>檔案日期</th>
+															<td id="fileDate"></td>
+														</tr>
+														<tr>
+															<th>下載連結</th>
+															<td id="fileLink"><a id="fileHerf" href="#" target="_blank"><i class="fa fa-download">檔案下載</i></a></td>
+														</tr>
+													</tbody>
+												</table>
+											</div>
 										</div>
 									</section>
 								</div>
@@ -181,23 +213,6 @@ if (!isset($_SESSION['loggedin'])) {
 	<?php include("bim-support-body.html"); ?>
 
 	<script>
-		//	$(document).ready(function() {
-		$grid = $("#content").isotope({
-			itemSelector: ".isotope-item",
-			layoutMode: 'fitRows',
-			getSortData: {
-				name: '.name',
-			}
-		})
-
-		setTimeout(() => {
-			$grid.isotope({
-				sortBy: 'name'
-			})
-		}, 100);
-
-		//	});
-
 		$(document).ready(function() {
 			PDFObject.embed("./assets/null.pdf", "#pdfFile");
 			console.log(type);
@@ -244,7 +259,7 @@ if (!isset($_SESSION['loggedin'])) {
 
 					data.instance.toggle_node(data.node);
 
-					if (data.node.text.includes(".") & !data.node.text.includes(".pdf")) {
+					/*if (data.node.text.includes(".") & !data.node.text.includes(".pdf")) {
 						console.log(data.node);
 						var link = document.createElement("a");
 						link.download = data.node.text;
@@ -253,11 +268,24 @@ if (!isset($_SESSION['loggedin'])) {
 						link.click();
 						document.body.removeChild(link);
 
-					} else if (data.node.text.includes(".pdf")) {
+					} else */
+					if (data.node.text.includes(".pdf")) {
 						PDFObject.embed(data.node.a_attr.href, "#pdfFile");
+					} else {
+						if (data.node.text.includes(".")) {
+							PDFObject.embed("./assets/notPDF.pdf", "#pdfFile");
+						}
+					}
+
+					if (data.node.text.includes(".")) {
+						$("#fileName").empty();
+						$("#fileName").append(data.node.text);
+						$("#fileHerf").attr("href", data.node.a_attr.href);
 					}
 
 
+
+
 				}).bind('loaded.jstree', function(e, data) {
 				// invoked after jstree has loaded
 				/*$('.jstree-anchor').each(function(index) {

+ 1 - 1
script/php/getBIMData.php

@@ -9,7 +9,7 @@ $ajax = array();
 FindPath($root, $folder, $ajax);
 
 //echo json_encode($ajax, JSON_UNESCAPED_UNICODE);
-
+//todo: filemtime($filename); "Last modified: ".date("F d Y H:i:s.", filemtime("gfg.txt"));
 function FindPath($root, $folder, $ajax)
 {