|
@@ -1,31 +1,252 @@
|
|
|
<?php
|
|
<?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']) {
|
|
if (0 < $_FILES['excel']['error']) {
|
|
|
echo 'Error: ' . $_FILES['excel']['error'] . '<br>';
|
|
echo 'Error: ' . $_FILES['excel']['error'] . '<br>';
|
|
|
} else {
|
|
} else {
|
|
|
$filepath = 'uploads/' . $_FILES['excel']['name'];
|
|
$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_id = $_POST['projectId'];
|
|
|
$project_name = $_POST['projectName'];
|
|
$project_name = $_POST['projectName'];
|
|
|
$category_id = $_POST['category'];
|
|
$category_id = $_POST['category'];
|
|
|
$file = $_FILES['excel']['name'];
|
|
$file = $_FILES['excel']['name'];
|
|
|
-} ?>
|
|
|
|
|
-
|
|
|
|
|
-<!DOCTYPE html>
|
|
|
|
|
-<html>
|
|
|
|
|
|
|
+}
|
|
|
|
|
+?>
|
|
|
|
|
+<!doctype html>
|
|
|
|
|
+<html class="fixed">
|
|
|
|
|
|
|
|
<head>
|
|
<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/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/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>
|
|
<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 {
|
|
.excel {
|
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
font-family: Arial, Helvetica, sans-serif;
|
|
|
border-collapse: collapse;
|
|
border-collapse: collapse;
|
|
@@ -55,7 +276,7 @@ if (0 < $_FILES['excel']['error']) {
|
|
|
.excel th {
|
|
.excel th {
|
|
|
padding-top: 12px;
|
|
padding-top: 12px;
|
|
|
padding-bottom: 12px;
|
|
padding-bottom: 12px;
|
|
|
- text-align: left;
|
|
|
|
|
|
|
+ text-align: center;
|
|
|
background-color: #004B7C;
|
|
background-color: #004B7C;
|
|
|
color: white;
|
|
color: white;
|
|
|
}
|
|
}
|
|
@@ -89,18 +310,149 @@ if (0 < $_FILES['excel']['error']) {
|
|
|
.center {
|
|
.center {
|
|
|
text-align: 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>
|
|
</style>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</head>
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
<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>
|
|
</div>
|
|
|
- // TODO: 1.頁籤依據選擇變色 2.偵測null欄位資料
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </section>
|
|
|
<script type="text/javascript">
|
|
<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() {
|
|
$(document).ready(function() {
|
|
|
const queryString = window.location.search;
|
|
const queryString = window.location.search;
|
|
|
const urlParams = new URLSearchParams(queryString);
|
|
const urlParams = new URLSearchParams(queryString);
|
|
@@ -108,11 +460,11 @@ if (0 < $_FILES['excel']['error']) {
|
|
|
var categoryId = '<?= $category_id ?>';
|
|
var categoryId = '<?= $category_id ?>';
|
|
|
var projectId = '<?= $project_id ?>';
|
|
var projectId = '<?= $project_id ?>';
|
|
|
var projectName = '<?= $project_name ?>';
|
|
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({
|
|
$.ajax({
|
|
|
url: "./getExcel.php",
|
|
url: "./getExcel.php",
|
|
@@ -129,14 +481,17 @@ if (0 < $_FILES['excel']['error']) {
|
|
|
.success(function(response) {
|
|
.success(function(response) {
|
|
|
var table = response.table;
|
|
var table = response.table;
|
|
|
var info = response.info;
|
|
var info = response.info;
|
|
|
|
|
+ var statuses = response.statuses;
|
|
|
|
|
+ console.log(response.test);
|
|
|
let i = 0;
|
|
let i = 0;
|
|
|
for (var tab in table) {
|
|
for (var tab in table) {
|
|
|
|
|
+ let status = statuses[i];
|
|
|
|
|
+ let active = '';
|
|
|
if (i == 0) {
|
|
if (i == 0) {
|
|
|
active = 'class="active"';
|
|
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>`);
|
|
$("#tab-content").append(`<div id="page${i}" class="tab-pane fade"></div>`);
|
|
|
|
|
|
|
|
appendTable(table[tab], `#page${i}`);
|
|
appendTable(table[tab], `#page${i}`);
|
|
@@ -178,6 +533,7 @@ if (0 < $_FILES['excel']['error']) {
|
|
|
$(id).append(table);
|
|
$(id).append(table);
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
</body>
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|
|
</html>
|