Przeglądaj źródła

匯入工具新增 圖示 顏色

manto07m 3 lat temu
rodzic
commit
52f977d445

+ 133 - 0
Upload-old.html

@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>設計群匯入工具</title>
+    <meta charset="utf-8">
+    <link rel="shortcut icon" href="./assets/images/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="./script/css/form.css" />
+    <link href='https://fonts.googleapis.com/css?family=Lato:100,200,300,400,500,600,700' rel='stylesheet'
+        type='text/css'>
+    <link rel="stylesheet" href="./assets/vendor/font-awesome/css/font-awesome.css" />
+    <script src="./assets/vendor/jquery/jquery.js"></script>
+</head>
+<a href="./edit.html" class="go-to-editor" target="_self">進入至編輯工具</a>
+<form method="post" enctype="multipart/form-data" action="./script/php/importTool/uploadExcel.php">
+
+    <h1><strong>MAA</strong> 設計群匯入工具</h1>
+
+    <div class="form-group">
+        <label for="projectId">計畫編號 </label>
+        <input type="text" name="projectId" id="projectId" class="form-controll" required="required" />
+    </div>
+    <div class="form-group">
+        <label for="projectName">計畫名稱 </label>
+        <input type="text" name="projectName" id="projectName" class="form-controll" required="required" />
+    </div>
+    <div class="form-group">
+        <label for="category">工程類別</label>
+        <select name="category" id="category" class="form-controll" required="required">
+        </select>
+    </div>
+
+    <div class="form-group file-area">
+        <label for="excel">Excel文件</label>
+        <input type="file" name="excel" id="excel" required="required"
+            accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
+        <div class="file-dummy">
+            <div class="success">你已經選擇<span id="filename"></span>。 請繼續下一步。</div>
+            <div class="default">選擇Excel文件</div>
+        </div>
+    </div>
+
+    <div class="form-group center">
+        <p><strong>注意事項:</strong>Excel檔名請包含計畫編號。 (例:15032.xlsx)</p>
+        <button type="submit">上傳檔案</button>
+        <button id="reset" type="button">清除表單</button>
+    </div>
+
+</form>
+<a href="./index.php" class="back-to-article" target="_self">返回至查詢工具</a>
+
+<script type="text/javascript">
+    var projectTable;
+    var projectName;
+    $(document).ready(function () {
+        var url_href = window.location.href;
+        var url = new URL(url_href);
+        var status = url.searchParams.get("status");
+        if(status == 'success'){
+            alert("匯入成功!");
+            window.location.href = "./upload.html"
+        }
+        getCategory();
+        $("#projectId").change(function () {
+            const find = projectTable.find(element => element[0] == this.value);
+            if (find != null) {
+                projectName = find[1];
+                category = find[2];
+                $("#projectName").val(projectName);
+                $("#projectName").css("cursor", "not-allowed");
+                $('#projectName').attr('readonly', true);
+                $('#category').val(category);
+                $("#category").css("cursor", "not-allowed");
+                $('#category').prop('disabled', true);
+            } else {
+                $("#projectName").val("");
+                $("#projectName").css("cursor", "text");
+                $('#projectName').attr('readonly', false);
+                $('#category').val(1);
+                $("#category").css("cursor", "default");
+                $('#category').prop('disabled', false);
+            }
+
+        });
+    });
+    var inputElement = document.getElementById("excel");
+    inputElement.addEventListener("change", handleFiles, false);
+
+    function handleFiles() {
+        var fileList = this.files;
+        $("#filename").text(fileList[0].name);
+    }
+
+    jQuery(function ($) {
+        $('form').bind('submit', function () {
+            $(this).find(':input').prop('disabled', false);
+        });
+    });
+
+    function getCategory() {
+
+        $.ajax({
+                url: "./script/php/importTool/getConstructionCategory.php",
+                async: false,
+                contentType: "application/json",
+                dataType: "json",
+                type: "GET",
+            })
+            .success(function (response) {
+                projectTable = response["project"];
+                for (i = 0; i < response["category"].length; i++) {
+                    $('#category').append(
+                        `<option value='${response["category"][i][0]}'>${response["category"][i][1]}</option>`);
+                }
+            })
+            .error(function (error) {
+                console.log(error);
+            })
+            .complete(function () {
+                $('#page0').addClass('in active')
+            });
+    }
+
+    $("#reset").click(function(){
+        $("#projectId").val('')
+        $("#projectName").val('')
+        $('#category').val(1);
+        $("#excel").val('')
+    })
+</script>
+
+</html>

+ 3 - 0
file.php

@@ -0,0 +1,3 @@
+<?php
+var_dump(is_file('/assets/建置資料/資訊工程/180024-新北市3D智慧管線查詢及管理系統/3_系統分析/18024_軟體測試計畫書.pdf')) . "\n";
+var_dump(is_file('/usr/bin/')) . "\n";

+ 25 - 4
script/php/importTool/getExcel.php

@@ -17,7 +17,7 @@ $file = '00000.xlsx';
 if (isset($_GET['file'])) {
     $file = "uploads/{$_GET['file']}";
 }
-
+$test = '';
 $isImport = '是';
 $isImportArray = array();
 $project_id = $_GET['projectId'];
@@ -34,6 +34,7 @@ $category = sqlsrv_fetch_array($fetchResult)[0];
 
 array_push($fileinfo, array($project_id, $category, $isImport));
 $importinfo = array(array("類別", "選擇檔案類型", "是否為新的類型"));
+$statuses = ["info"];
 $extension = pathinfo($file,PATHINFO_EXTENSION);
 $ajax["匯入資訊"] = $fileinfo;
 if ('csv' == $extension) {
@@ -71,43 +72,63 @@ for ($s = 0; $s < $sheetCount; $s++) {
 }
 
 for ($s = 0; $s < $sheetCount; $s++) {
+    $status = 'success';
     $normalCheck = "";
     $blueprintCheck = "";
     $cancelCheck = "";
     $sheet = $spreadsheet->getSheet($s);
     $sheetName = $spreadsheet->getSheetNames()[$s];
+    $fileCol = '0';
     if (str_contains($sheetName, '成果圖') || str_contains($sheetName, '設計圖')) {
+        $fileCol = 'F';
         $blueprintCheck = "checked='checked'";
     } else {
+        $fileCol = 'C';
         $normalCheck = "checked='checked'";
     }
     if (str_contains($sheetName, '目錄') || str_contains($sheetName, '注意')) {
         $cancelCheck = "checked='checked'";
+        $fileCol = '0';
     }
 
     $cellCollection = $sheet->getCellCollection();
     $column = $cellCollection->getHighestRowAndColumn();
     $data = array();
 
-    for ($i = 1; $i <= $column['row']; $i++) { //行
+    for ($i = 1; $i <= $column['row']; $i++) { //行        
         $row = array();
         for ($j = 'A'; $j <= $column['column']; $j++) { //列
             $key = $j . $i;
             $value = $sheet->getCell($key)->getValue();
+            if($value == null){
+                $status = 'warning';
+            }//.$value
+            if($fileCol != '0') {    
+                if($j == $fileCol & $i > 1){
+                    if(!is_file('../../../assets/建置資料/資訊工程/180024-新北市3D智慧管線查詢及管理系統'.$value)){
+                        $status = 'error';                        
+                    }
+                }            
+                
+            }
+           
             array_push($row, $value);
         }
         array_push($data, $row);
+        
     }
     $ajax[$sheetName] = $data;
+    array_push($statuses, $status);
     array_push($importinfo, array($sheetName, "<input type='radio' id='normal{$s}' name='type{$s}' value='[File_Table]' {$normalCheck}>
     <label for='normal{$s}'>一般檔案</label><br>
     <input type='radio' id='blueprint{$s}' name='type{$s}' value='[Blueprint]' {$blueprintCheck}>
     <label for='blueprint{$s}'>設計圖或成果圖</label><br>
     <input type='radio' id='cancel{$s}' name='type{$s}' value='cancel' {$cancelCheck}>
-    <label for='cancel{$s}'>不進行匯入</label>  ", $isImportArray[$s]));
+    <label for='cancel{$s}'>不進行匯入</label>  ", $isImportArray[$s]));    
 }
 $data["table"] = $ajax;
 $data["info"] = $importinfo;
-
+$data["statuses"] = $statuses;
+$data["test"] = $test;
 echo json_encode($data, JSON_UNESCAPED_UNICODE);
 sqlsrv_close($conn);  

+ 184 - 0
script/php/importTool/uploadExcel-old.php

@@ -0,0 +1,184 @@
+<?php
+if(!isset($_FILES['excel']['error'])){
+    header("Location: /DataBase/upload.html");
+}
+if (0 < $_FILES['excel']['error']) {
+    echo 'Error: ' . $_FILES['excel']['error'] . '<br>';
+} else {
+    $filepath = 'uploads/' . $_FILES['excel']['name'];
+    move_uploaded_file($_FILES['excel']['tmp_name'], $filepath);    
+    $project_id = $_POST['projectId'];
+    $project_name = $_POST['projectName'];
+    $category_id = $_POST['category'];
+    $file = $_FILES['excel']['name'];
+} ?>
+
+<!DOCTYPE html>
+<html>
+
+<head>
+    <title>設計群匯入工具</title>
+    <meta charset="utf-8">
+    <link rel="shortcut icon" href="/Database/assets/images/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
+    <script src="/DataBase/assets/vendor/jquery/jquery.js"></script>
+    <script src="/DataBase/script/js/bootstrap.js"></script>
+    <link rel="stylesheet" href="/DataBase/assets/vendor/font-awesome/css/font-awesome.css" />
+    <style>
+        .excel {
+            font-family: Arial, Helvetica, sans-serif;
+            border-collapse: collapse;
+            width: 100%;
+        }
+
+        .nav-tabs>li.active>a,
+        .nav-tabs>li.active>a:focus,
+        .nav-tabs>li.active>a:hover {
+            border: 1px solid #000;
+        }
+
+        .excel td,
+        .excel th {
+            border: 1px solid #aaa;
+            padding: 8px;
+        }
+
+        .excel tr:nth-child(even) {
+            background-color: #f2f2f2;
+        }
+
+        .excel tr:hover {
+            background-color: #ddd;
+        }
+
+        .excel th {
+            padding-top: 12px;
+            padding-bottom: 12px;
+            text-align: left;
+            background-color: #004B7C;
+            color: white;
+        }
+
+        .submit {
+            display: inline-block;
+            margin-left: auto;
+            margin-right: auto;
+            width: 20%;
+            background-color: #004B7C;
+            border: none;
+            color: white;
+            padding: 15px 32px;
+            text-align: center;
+            text-decoration: none;
+            font-size: 16px;
+            margin: 10px;
+        }
+
+        .delete {
+            background-color: red;
+            border: none;
+            color: white;
+            padding: 5px 32px;
+            text-align: center;
+            text-decoration: none;
+            display: inline-block;
+            font-size: 16px;
+        }
+
+        .center {
+            text-align: center;
+        }
+    </style>
+</head>
+
+<body>
+    <ul id="tabs" class="nav nav-tabs">
+    </ul>
+    <div id="tab-content" class="tab-content">
+
+    </div>
+    
+
+    <script type="text/javascript">
+        // TODO: 1.頁籤依據選擇變色 2.偵測null欄位資料
+        $(document).ready(function() {
+            const queryString = window.location.search;
+            const urlParams = new URLSearchParams(queryString);
+            var file = '<?= $file ?>';
+            var categoryId = '<?= $category_id ?>';
+            var projectId = '<?= $project_id ?>';
+            var projectName = '<?= $project_name ?>';
+            getExcel(file, projectId,projectName,categoryId);
+
+        });
+
+        function getExcel(file, projectId,projectName,categoryId) {
+
+            $.ajax({
+                    url: "./getExcel.php",
+                    data: {
+                        file: file,
+                        projectId: projectId,
+                        categoryId: categoryId,
+                    },
+                    async: false,
+                    contentType: "application/json",
+                    dataType: "json",
+                    type: "GET",
+                })
+                .success(function(response) {
+                    var table = response.table;
+                    var info = response.info;
+                    let i = 0;
+                    for (var tab in table) {
+                        if (i == 0) {
+                            active = 'class="active"';
+                        } else {
+                            active = '';
+                        }
+                        $('#tabs').append(`<li ${active}><a data-toggle="tab" href="#page${i}">${tab}</a></li>`);
+                        $("#tab-content").append(`<div id="page${i}" class="tab-pane fade"></div>`);
+
+                        appendTable(table[tab], `#page${i}`);
+                        i++;
+                    }
+                    $(`#page${0}`).append("<form id='form' method='post' action='./insertExcel.php'></form>");
+                    appendTable(info, "#form");
+                    // TODO: add confirm message
+                    $("#form").append(`<div class='center'><input class='submit' type='submit' value='開始匯入'><button type='button' class='submit' onClick=\"location.href='/DataBase/upload.html'\" >重新選擇檔案</button></div>`);
+                    $("#form").append(`<input id='projectId' name='projectId' type='hidden' value='${projectId}'><input id='projectName' name='projectName' type='hidden' value='${projectName}'><input id='file' name='file' type='hidden' value='${file}'><input id='categoryId' name='categoryId' style='display:none;' value='${categoryId}'>`);
+                })
+                .error(function(error) {
+                    console.log(error);
+                })
+                .complete(function() {
+                    $('#page0').addClass('in active')
+                });
+        }
+
+        function appendTable(data, id) {
+            let i = 0;
+            table = "<table class='excel'>";
+            for (var tab in data) {
+                table += "<tr>";
+
+                for (j = 0; j < data[tab].length; j++) {
+                    if (i == 0)
+                        table += `<th style="width:33%;">${data[tab][j]}</th>`
+                    else
+                        table += `<td>${data[tab][j]}</td>`
+                }
+                i++;
+                table += "</tr>";
+            }
+
+
+            table += "</table>";
+
+            $(id).append(table);
+        }
+    </script>
+</body>
+
+</html>

+ 380 - 24
script/php/importTool/uploadExcel.php

@@ -1,31 +1,252 @@
 <?php
-if(!isset($_FILES['excel']['error'])){
-    header("Location: /DataBase/upload.html");
+session_start();
+//Can't come in without logged in
+if (!isset($_SESSION['loggedin'])) {
+    header('Location: pages-signin.html');
+    exit;
+}
+
+if (!isset($_FILES['excel']['error'])) {
+    //header("Location: /DataBase/upload.html");
 }
 if (0 < $_FILES['excel']['error']) {
     echo 'Error: ' . $_FILES['excel']['error'] . '<br>';
 } else {
     $filepath = 'uploads/' . $_FILES['excel']['name'];
-    move_uploaded_file($_FILES['excel']['tmp_name'], $filepath);    
+    move_uploaded_file($_FILES['excel']['tmp_name'], $filepath);
     $project_id = $_POST['projectId'];
     $project_name = $_POST['projectName'];
     $category_id = $_POST['category'];
     $file = $_FILES['excel']['name'];
-} ?>
-
-<!DOCTYPE html>
-<html>
+}
+?>
+<!doctype html>
+<html class="fixed">
 
 <head>
-    <title>設計群匯入工具</title>
-    <meta charset="utf-8">
-    <link rel="shortcut icon" href="/Database/assets/images/favicon.ico" />
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
+    <!-- Basic -->
+    <meta charset="UTF-8">
+    <title>設計資料庫匯入工具</title>
+    <meta name="keywords" content="HTML5 Admin Template" />
+    <meta name="description" content="JSOFT Admin - Responsive HTML5 Template">
+    <meta name="author" content="JSOFT.net">
+
     <script src="/DataBase/assets/vendor/jquery/jquery.js"></script>
-    <script src="/DataBase/script/js/bootstrap.js"></script>
+    <!-- Mobile Metas -->
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+
+    <!-- Web Fonts  -->
+    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
+    <!-- jstree CSS -->
+    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css">
+    <!-- Vendor CSS -->
+    <link rel="stylesheet" href="/DataBase/assets/vendor/bootstrap/css/bootstrap.css" />
     <link rel="stylesheet" href="/DataBase/assets/vendor/font-awesome/css/font-awesome.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/magnific-popup/magnific-popup.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/pnotify/pnotify.custom.css" />
+    <!-- Specific Page Vendor CSS -->
+    <link rel="stylesheet" href="/DataBase/assets/vendor/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/morris/morris.css" />
+    <link rel="stylesheet" href="/DataBase/assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.css" />
+    <!-- Theme CSS -->
+    <link rel="stylesheet" href="/DataBase/assets/stylesheets/theme.css" />
+    <!-- Skin CSS -->
+    <link rel="stylesheet" href="/DataBase/assets/stylesheets/skins/default.css" />
+    <!-- Theme Custom CSS -->
+    <link rel="stylesheet" href="/DataBase/assets/stylesheets/theme-custom.css">
+    <!-- Head Libs -->
+    <script src="/DataBase/assets/vendor/modernizr/modernizr.js"></script>
+    <!-- chart.js -->
+    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
+    <!-- DataTable -->
+
+    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css">
+    <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js"></script>
+    <!-- Icon -->
+    <link rel="shortcut icon" href="/DataBase/assets/images/favicon.ico" />
+    <link href="https://js.arcgis.com/4.21/esri/themes/light/main.css" rel="stylesheet">
+    <link href="/DataBase/CustomCSS/main.css" rel="stylesheet">
+    <script src="/DataBase/script/js/bootstrap.js"></script>
+    <script src="/DataBase/script/js/pdfobject.min.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/jstree.min.js"></script>
+
+    <script src="https://js.arcgis.com/4.21/"></script>
     <style>
+        body {
+            color: #000;
+        }
+
+        .row {
+            margin-top: -15px;
+        }
+
+        .page-header>ul {
+            list-style: none;
+            padding: 0;
+            margin: 0;
+        }
+
+        .page-header>ul>li {
+            display: inline-block;
+            font-size: 25px;
+            color: #FFFFFF;
+        }
+
+        .page-header>ul>li.right {
+            float: right;
+            padding-right: 10px;
+        }
+
+        .input-search {
+            margin-top: 8px;
+        }
+
+        .page-header li>label {
+            margin-top: 13px;
+            border-bottom: 4px solid #0088cc;
+            height: 41px;
+        }
+
+        .sidebar-left {
+            box-shadow: 0 0 0;
+        }
+
+        .jstree-default .jstree-icon {
+            color: #ffe693;
+        }
+
+        .jqsfield {
+            color: white;
+            font: 10px arial, san serif;
+            text-align: left;
+        }
+
+        .jstree-anchor {
+            width: 250px;
+            text-overflow: ellipsis;
+            overflow: hidden;
+            white-space: nowrap;
+        }
+
+        .jstree-anchor,
+        .jstree-anchor:link,
+        .jstree-anchor:visited,
+        .jstree-anchor:hover,
+        .jstree-anchor:active {
+            color: #abb4be;
+        }
+
+        td,
+        th {
+            text-align: center;
+
+        }
+
+        th {
+            width: 30%;
+        }
+
+        .nav-main {
+            padding: 15px;
+        }
+
+        .node-hidden {
+            display: none;
+        }
+
+        html.fixed .page-header {
+            left: 0px;
+        }
+
+        html.fixed .content-body {
+            margin-left: 0px;
+        }
+
+        .sidebar-left {
+            width: 0px;
+        }
+
+        #datatable-ajax tr:hover {
+            background-color: #e8e8e8;
+        }
+
+        #viewDiv {
+            height: 100%;
+            width: 100%;
+        }
+
+        #zoom {
+            margin-bottom: 5px;
+        }
+
+        #actions {
+            padding: 5px;
+        }
+
+        .container {
+            height: 50%;
+            width: 100%;
+        }
+
+        #createSlideDiv {
+            background-color: white;
+            opacity: 0.9;
+            color: black;
+            padding: 6px;
+        }
+
+        #slidesDiv {
+            background-color: white;
+            opacity: 0.9;
+            color: black;
+            padding: 10px;
+            visibility: hidden;
+            bottom: 20px;
+            overflow-y: auto;
+            text-align: center;
+            height: 260px;
+        }
+
+        #slidesDiv .slide {
+            /* Show cursor as pointer when on a slide */
+            cursor: pointer;
+            margin-bottom: 6px;
+        }
+
+        #slidesDiv .slide .title {
+            /* Center the title text */
+            text-align: center;
+        }
+
+        /* Draw active slide with a nice border around the thumbnail */
+
+        #slidesDiv .slide.active img {
+            box-shadow: 0px 0px 12px black;
+            border-style: solid;
+            border-width: thin;
+            border-color: black;
+        }
+
+        .pdfobject-container {
+            height: 730px;
+        }
+
+        #topbar {
+            background: #fff;
+            padding: 10px;
+        }
+
+        /* uploadExcel */
+
+        td>label {
+            width: 8em;
+            text-align: left;
+            padding-right: 0.5em;
+            /* display: inline-block; */
+        }
+
         .excel {
             font-family: Arial, Helvetica, sans-serif;
             border-collapse: collapse;
@@ -55,7 +276,7 @@ if (0 < $_FILES['excel']['error']) {
         .excel th {
             padding-top: 12px;
             padding-bottom: 12px;
-            text-align: left;
+            text-align: center;
             background-color: #004B7C;
             color: white;
         }
@@ -89,18 +310,149 @@ if (0 < $_FILES['excel']['error']) {
         .center {
             text-align: center;
         }
+
+        .nav-tabs.nav-justified li.active a.error.text-center,
+        a.error.text-center:hover {
+            border-bottom-color: transparent;
+            border-top: 3px solid #d2322d;
+            box-shadow: none;
+            color: #d2322d;
+        }
+
+        a.error.text-center,i.error {
+            color: #d2322d;
+        }
+
+        .nav-tabs.nav-justified li.active a.warning.text-center,
+        a.warning.text-center:hover {
+            border-bottom-color: transparent;
+            border-top: 3px solid #ed9c28;
+            box-shadow: none;
+            color: #ed9c28;
+        }
+
+        a.warning.text-center,i.warning {
+            color: #ed9c28;
+        }
+
+        .nav-tabs.nav-justified li.active a.info.text-center,
+        a.info.text-center:hover {
+            border-bottom-color: transparent;
+            border-top: 3px solid #0088cc;
+            box-shadow: none;
+            color: #0088cc;
+        }
+
+        a.info.text-center,i.info {
+            color: #0088cc;
+        }
+
+        .nav-tabs.nav-justified li.active a.success.text-center,
+        a.success.text-center:hover {
+            border-bottom-color: transparent;
+            border-top: 3px solid #4a934a;
+            box-shadow: none;
+            color: #4a934a;
+        }
+
+        a.success.text-center,i.success {
+            color: #4a934a;
+        }
     </style>
+
+
 </head>
 
 <body>
-    <ul id="tabs" class="nav nav-tabs">
-    </ul>
-    <div id="tab-content" class="tab-content">
+    <section class="body">
+        <!-- start: header -->
+        <header class="header">
+            <div class="logo-container">
+                <div class="banner-txt">設計資料庫匯入工具</div>
+                <div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
+                    <i class="fa fa-bars" aria-label="Toggle sidebar"></i>
+                </div>
+            </div>
+            <!-- start: search & user box -->
+            <div class="header-right">
+                <span class="separator"></span>
+                <ul class="notifications">
+                    <li>
+                        <a href="/DataBase/upload.html" class="notification-icon" data-toggle="tooltip" title="匯入工具" data-placement="bottom">
+                            <i class="fa fa-upload"></i>
+                        </a>
+                        <a href="/Front-Page/home.php" class="notification-icon" data-toggle="tooltip" title="綜合登入入口" data-placement="bottom">
+                            <i class="fa fa-home"></i>
+                        </a>
+                    </li>
+                </ul>
+                <span class="separator"></span>
+                <div id="userbox" class="userbox">
+                    <a href="#" data-toggle="dropdown">
+                        <figure class="profile-picture"> <img src="/DataBase/assets/images/!logged-user.jpg" alt="Joseph Doe" class="img-circle" data-lock-picture="/DataBase/assets/images/!logged-user.jpg" /> </figure>
+                        <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>
+                    </a>
+                    <div class="dropdown-menu">
+                        <ul class="list-unstyled">
+                            <li class="divider"></li>
+                            <li> <a role="menuitem" tabindex="-1" href="/DataBase/script/php/Logout.php"><i class="fa fa-power-off"></i> Logout</a> </li>
+                        </ul>
+                    </div>
+                </div>
+            </div>
+            <!-- end: search & user box -->
+        </header>
+        <!-- end: header -->
+        <div class="inner-wrapper">
+            <!-- start: sidebar -->
+
+            <section role="main" class="content-body">
+                <header class="page-header">
+                    <ul>
+                        <li>
+                            <label id="header"></label>
+                        </li>
+                    </ul>
+                </header>
+                <div class="row">
+                    <div class="col-md-4 col-md-offset-8">
+                        圖示顏色含意: <i class="fa fa-info-circle info">匯入確認頁面</i> <i class="fa fa-check-circle success">此頁面資料正確</i> <i class="fa fa-exclamation-circle warning">此頁面資料有空</i> <i class="fa fa-times-circle error">此頁面檔案路徑有誤</i>
+                    </div>
+                    <div class="col-md-12">
+                        <div class="tabs">
+                            <ul class="nav nav-tabs nav-justified" id="tabs">
+
+                            </ul>
+                            <div class="tab-content" id="tab-content">
+
+                            </div>
+                        </div>
+                    </div>
+                </div>
+
+
+
+
 
+        </div>
+    </section>
     </div>
-    // TODO: 1.頁籤依據選擇變色 2.偵測null欄位資料
 
+
+
+
+
+
+    </section>
     <script type="text/javascript">
+
+        const icons = {
+            'info':'fa fa-info-circle',
+            'success':'fa fa-check-circle',
+            'error':'fa fa-times-circle',
+            'warning':'fa fa-exclamation-circle',
+        }; 
+        // TODO: 1.頁籤依據選擇變色 2.偵測null欄位資料
         $(document).ready(function() {
             const queryString = window.location.search;
             const urlParams = new URLSearchParams(queryString);
@@ -108,11 +460,11 @@ if (0 < $_FILES['excel']['error']) {
             var categoryId = '<?= $category_id ?>';
             var projectId = '<?= $project_id ?>';
             var projectName = '<?= $project_name ?>';
-            getExcel(file, projectId,projectName,categoryId);
+            getExcel(file, projectId, projectName, categoryId);
 
         });
 
-        function getExcel(file, projectId,projectName,categoryId) {
+        function getExcel(file, projectId, projectName, categoryId) {
 
             $.ajax({
                     url: "./getExcel.php",
@@ -129,14 +481,17 @@ if (0 < $_FILES['excel']['error']) {
                 .success(function(response) {
                     var table = response.table;
                     var info = response.info;
+                    var statuses = response.statuses;
+                    console.log(response.test);
                     let i = 0;
                     for (var tab in table) {
+                        let status = statuses[i];
+                        let active = '';
                         if (i == 0) {
                             active = 'class="active"';
-                        } else {
-                            active = '';
-                        }
-                        $('#tabs').append(`<li ${active}><a data-toggle="tab" href="#page${i}">${tab}</a></li>`);
+                        } 
+                        let icon = icons[status];
+                        $('#tabs').append(`<li ${active}><a href="#page${i}" data-toggle="tab" class="text-center ${status}"><i class="${icon}"></i> ${tab}</a></li>`);
                         $("#tab-content").append(`<div id="page${i}" class="tab-pane fade"></div>`);
 
                         appendTable(table[tab], `#page${i}`);
@@ -178,6 +533,7 @@ if (0 < $_FILES['excel']['error']) {
             $(id).append(table);
         }
     </script>
+
 </body>
 
 </html>

BIN
script/php/importTool/uploads/180024_新北市3D智慧管線查詢及管理系統.xlsx