|
|
@@ -1,5 +1,5 @@
|
|
|
<?php
|
|
|
-include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_right.php");
|
|
|
+include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
|
|
|
?>
|
|
|
<!doctype html>
|
|
|
<html class="fixed">
|
|
|
@@ -13,12 +13,12 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<meta name="author" content="JSOFT.net">
|
|
|
|
|
|
<script src="/DataBase/assets/vendor/jquery/jquery.js"></script>
|
|
|
+ <script src="/Common/script/js/user-image.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">
|
|
|
+ <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 -->
|
|
|
@@ -380,8 +380,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<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">
|
|
|
+ <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>
|
|
|
@@ -390,12 +389,10 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<span class="separator"></span>
|
|
|
<ul class="notifications">
|
|
|
<li>
|
|
|
- <a href="/DataBase/index.php" class="notification-icon" data-toggle="tooltip" title="設計資料庫查詢"
|
|
|
- data-placement="bottom">
|
|
|
+ <a href="/DataBase/index.php" class="notification-icon" data-toggle="tooltip" title="設計資料庫查詢" data-placement="bottom">
|
|
|
<i class="fa fa-database"></i>
|
|
|
</a>
|
|
|
- <a href="/Front-Page/home.php" class="notification-icon" data-toggle="tooltip" title="綜合登入入口"
|
|
|
- data-placement="bottom">
|
|
|
+ <a href="/Front-Page/home.php" class="notification-icon" data-toggle="tooltip" title="綜合登入入口" data-placement="bottom">
|
|
|
<i class="fa fa-home"></i>
|
|
|
</a>
|
|
|
</li>
|
|
|
@@ -403,18 +400,14 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<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"><?php echo($groupName);?></span>
|
|
|
+ <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"><?php echo ($groupName); ?></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>
|
|
|
+ <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>
|
|
|
@@ -439,40 +432,32 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<div class="tabs tabs-primary">
|
|
|
<ul class="nav nav-tabs nav-justified">
|
|
|
<li class="active">
|
|
|
- <a href="#upload" data-toggle="tab" class="text-center"><i
|
|
|
- class="fa fa-upload"></i>上傳工具</a>
|
|
|
+ <a href="#upload" data-toggle="tab" class="text-center"><i class="fa fa-upload"></i>上傳工具</a>
|
|
|
</li>
|
|
|
<li>
|
|
|
- <a href="#edit" data-toggle="tab" class="text-center"><i
|
|
|
- class="fa fa-edit"></i>編輯工具</a>
|
|
|
+ <a href="#edit" data-toggle="tab" class="text-center"><i class="fa fa-edit"></i>編輯工具</a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<div class="tab-content">
|
|
|
<div id="upload" class="tab-pane active">
|
|
|
- <form method="post" enctype="multipart/form-data"
|
|
|
- action="./script/php/importTool/uploadExcel.php">
|
|
|
+ <form method="post" enctype="multipart/form-data" action="./script/php/importTool/uploadExcel.php">
|
|
|
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="projectId">計畫編號 </label>
|
|
|
<div class="col-md-6">
|
|
|
- <input type="text" name="projectId" class="form-control" id="projectId"
|
|
|
- class="form-controll"
|
|
|
- required="required" />
|
|
|
+ <input type="text" name="projectId" class="form-control" id="projectId" class="form-controll" required="required" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="projectName">計畫名稱 </label>
|
|
|
<div class="col-md-6">
|
|
|
- <input type="text" name="projectName" class="form-control"
|
|
|
- id="projectName" class="form-controll"
|
|
|
- required="required" />
|
|
|
+ <input type="text" name="projectName" class="form-control" id="projectName" class="form-controll" required="required" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="category">工程類別</label>
|
|
|
<div class="col-md-6">
|
|
|
- <select class="form-control mb-md" name="category" id="category"
|
|
|
- required="required">
|
|
|
+ <select class="form-control mb-md" name="category" id="category" required="required">
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -489,14 +474,10 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
<span class="btn btn-default btn-file">
|
|
|
<span class="fileupload-exists">更換檔案</span>
|
|
|
<span class="fileupload-new">選擇檔案</span>
|
|
|
- <input type="file" name="excel" id="excel"
|
|
|
- required="required"
|
|
|
- accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
|
|
|
+ <input type="file" name="excel" id="excel" required="required" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
|
|
|
</span>
|
|
|
- <a href="#" class="btn btn-default fileupload-exists"
|
|
|
- data-dismiss="fileupload">移除檔案</a>
|
|
|
- <span
|
|
|
- class="help-block"><strong>注意事項:</strong>Excel檔名請用 計畫編號-計畫名稱
|
|
|
+ <a href="#" class="btn btn-default fileupload-exists" data-dismiss="fileupload">移除檔案</a>
|
|
|
+ <span class="help-block"><strong>注意事項:</strong>Excel檔名請用 計畫編號-計畫名稱
|
|
|
<br>(例:180024-新北市3D智慧管線查詢及管理系統.xlsx)</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -512,34 +493,30 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
</form>
|
|
|
</div>
|
|
|
<div id="edit" class="tab-pane">
|
|
|
- <form id="formEdit" method="post" enctype="multipart/form-data"
|
|
|
- action="./script/php/importTool/updateProject.php">
|
|
|
+ <form id="formEdit" method="post" enctype="multipart/form-data" action="./script/php/importTool/updateProject.php">
|
|
|
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="projectId">計畫編號</label>
|
|
|
<div class="col-md-6">
|
|
|
- <input type="text" class="form-control" name="projectId"
|
|
|
- id="projectIdEdit" required="required">
|
|
|
+ <input type="text" class="form-control" name="projectId" id="projectIdEdit" required="required">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="projectName">計畫名稱</label>
|
|
|
<div class="col-md-6">
|
|
|
- <input type="text" class="form-control" name="projectName"
|
|
|
- id="projectNameEdit" required="required">
|
|
|
+ <input type="text" class="form-control" name="projectName" id="projectNameEdit" required="required">
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
|
|
<label class="col-md-3 control-label" for="category">工程類別</label>
|
|
|
<div class="col-md-6">
|
|
|
- <select class="form-control mb-md" name="category" id="categoryEdit"
|
|
|
- required="required">
|
|
|
+ <select class="form-control mb-md" name="category" id="categoryEdit" required="required">
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
-
|
|
|
+
|
|
|
<div class="form-group" style="border-bottom: 0px;">
|
|
|
<label class=" col-md-3 control-label">使用說明</label>
|
|
|
<div class="col-lg-6">
|
|
|
@@ -571,9 +548,12 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
+ var userName = "<?php echo $_SESSION['name'] ?>";
|
|
|
+ var role = "<?php echo ($groupName); ?>";
|
|
|
+ var right = <?php echo $right; ?>;
|
|
|
var projectTable;
|
|
|
- var projectName;
|
|
|
- $(document).ready(function () {
|
|
|
+ var projectName;
|
|
|
+ $(document).ready(function() {
|
|
|
var url_href = window.location.href;
|
|
|
var url = new URL(url_href);
|
|
|
var status = url.searchParams.get("status");
|
|
|
@@ -581,8 +561,9 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
alert("匯入成功!");
|
|
|
window.location.href = "./Upload.php"
|
|
|
}
|
|
|
+ addUserImage(userName.charAt(0),role);
|
|
|
getCategory();
|
|
|
- $("#projectId").change(function () {
|
|
|
+ $("#projectId").change(function() {
|
|
|
const find = projectTable.find(element => element[0] == this.value);
|
|
|
if (find != null) {
|
|
|
projectName = find[1];
|
|
|
@@ -603,7 +584,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
}
|
|
|
|
|
|
});
|
|
|
- $("#projectIdEdit").change(function () {
|
|
|
+ $("#projectIdEdit").change(function() {
|
|
|
const find = projectTable.find(element => element[0] == this.value);
|
|
|
if (find != null) {
|
|
|
projectName = find[1];
|
|
|
@@ -631,11 +612,11 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
$("#filename").text(fileList[0].name);
|
|
|
}
|
|
|
|
|
|
- jQuery(function ($) {
|
|
|
- $('form').bind('submit', function () {
|
|
|
+ jQuery(function($) {
|
|
|
+ $('form').bind('submit', function() {
|
|
|
$(this).find(':input').prop('disabled', false);
|
|
|
});
|
|
|
- $('formEdit').bind('submit', function () {
|
|
|
+ $('formEdit').bind('submit', function() {
|
|
|
$(this).find(':input').prop('disabled', false);
|
|
|
});
|
|
|
});
|
|
|
@@ -649,7 +630,7 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
dataType: "json",
|
|
|
type: "GET",
|
|
|
})
|
|
|
- .success(function (response) {
|
|
|
+ .success(function(response) {
|
|
|
projectTable = response["project"];
|
|
|
for (i = 0; i < response["category"].length; i++) {
|
|
|
$('#category').append(
|
|
|
@@ -658,10 +639,10 @@ include($_SERVER['DOCUMENT_ROOT']."/Authorization/script/php/permission/check_ri
|
|
|
`<option value='${response["category"][i][0]}'>${response["category"][i][1]}</option>`);
|
|
|
}
|
|
|
})
|
|
|
- .error(function (error) {
|
|
|
+ .error(function(error) {
|
|
|
console.log(error);
|
|
|
})
|
|
|
- .complete(function () {
|
|
|
+ .complete(function() {
|
|
|
$('#page0').addClass('in active')
|
|
|
});
|
|
|
}
|