log.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <?php
  2. include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
  3. ?>
  4. <!doctype html>
  5. <html class="fixed">
  6. <head>
  7. <!-- Basic -->
  8. <meta charset="UTF-8">
  9. <title>設計資料庫工具</title>
  10. <meta name="keywords" content="HTML5 Admin Template" />
  11. <meta name="description" content="JSOFT Admin - Responsive HTML5 Template">
  12. <meta name="author" content="JSOFT.net">
  13. <script src="/DataBase/assets/vendor/jquery/jquery.js"></script>
  14. <script src="/Common/script/js/user-image.js"></script>
  15. <!-- Mobile Metas -->
  16. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  17. <!-- Web Fonts -->
  18. <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
  19. <!-- Vendor CSS -->
  20. <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" />
  21. <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" />
  22. <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" />
  23. <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
  24. <!-- Specific Page Vendor CSS -->
  25. <link rel="stylesheet" href="assets/vendor/select2/select2.css" />
  26. <link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
  27. <!-- Theme CSS -->
  28. <link rel="stylesheet" href="assets/stylesheets/theme.css" />
  29. <!-- Skin CSS -->
  30. <link rel="stylesheet" href="assets/stylesheets/skins/default.css" />
  31. <!-- Theme Custom CSS -->
  32. <link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
  33. <!-- Head Libs -->
  34. <script src="assets/vendor/modernizr/modernizr.js"></script>
  35. <script src="assets/vendor/jquery/jquery.js"></script>
  36. <!-- Icon -->
  37. <link rel="shortcut icon" href="assets/images/favicon.ico" />
  38. <style>
  39. body {
  40. color: #000;
  41. }
  42. .page-header>ul {
  43. list-style: none;
  44. padding: 0;
  45. margin: 0;
  46. }
  47. .page-header>ul>li {
  48. display: inline-block;
  49. font-size: 25px;
  50. color: #FFFFFF;
  51. }
  52. .page-header>ul>li.right {
  53. float: right;
  54. padding-right: 10px;
  55. }
  56. .input-search {
  57. margin-top: 8px;
  58. }
  59. .page-header li>label {
  60. margin-top: 13px;
  61. border-bottom: 4px solid #0088cc;
  62. height: 41px;
  63. padding-left: 40px;
  64. }
  65. .sidebar-left {
  66. box-shadow: 0 0 0;
  67. }
  68. .jstree-default .jstree-icon {
  69. color: #ffe693;
  70. }
  71. .jqsfield {
  72. color: white;
  73. font: 10px arial, san serif;
  74. text-align: left;
  75. }
  76. .jstree-anchor {
  77. width: 250px;
  78. text-overflow: ellipsis;
  79. overflow: hidden;
  80. white-space: nowrap;
  81. }
  82. .jstree-anchor,
  83. .jstree-anchor:link,
  84. .jstree-anchor:visited,
  85. .jstree-anchor:hover,
  86. .jstree-anchor:active {
  87. color: #abb4be;
  88. }
  89. td,
  90. th {
  91. text-align: center;
  92. }
  93. .nav-main {
  94. padding: 15px;
  95. }
  96. .node-hidden {
  97. display: none;
  98. }
  99. html.fixed .page-header {
  100. left: 0px;
  101. }
  102. html.fixed .content-body {
  103. margin-left: 0px;
  104. }
  105. .sidebar-left {
  106. width: 0px;
  107. }
  108. #viewDiv {
  109. height: 100%;
  110. width: 100%;
  111. }
  112. #zoom {
  113. margin-bottom: 5px;
  114. }
  115. #actions {
  116. padding: 5px;
  117. }
  118. .container {
  119. height: 50%;
  120. width: 100%;
  121. }
  122. #createSlideDiv {
  123. background-color: white;
  124. opacity: 0.9;
  125. color: black;
  126. padding: 6px;
  127. }
  128. #slidesDiv {
  129. background-color: white;
  130. opacity: 0.9;
  131. color: black;
  132. padding: 10px;
  133. visibility: hidden;
  134. bottom: 20px;
  135. overflow-y: auto;
  136. text-align: center;
  137. height: 260px;
  138. }
  139. #slidesDiv .slide {
  140. /* Show cursor as pointer when on a slide */
  141. cursor: pointer;
  142. margin-bottom: 6px;
  143. }
  144. #slidesDiv .slide .title {
  145. /* Center the title text */
  146. text-align: center;
  147. }
  148. /* Draw active slide with a nice border around the thumbnail */
  149. #slidesDiv .slide.active img {
  150. box-shadow: 0px 0px 12px black;
  151. border-style: solid;
  152. border-width: thin;
  153. border-color: black;
  154. }
  155. #topbar {
  156. background: #fff;
  157. padding: 10px;
  158. }
  159. </style>
  160. </head>
  161. <body>
  162. <section class="body">
  163. <!-- start: header -->
  164. <header class="header">
  165. <div class="logo-container">
  166. <div class="banner-txt">設計資料庫匯入工具</div>
  167. <div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
  168. <i class="fa fa-bars" aria-label="Toggle sidebar"></i>
  169. </div>
  170. </div>
  171. <!-- start: search & user box -->
  172. <div class="header-right">
  173. <span class="separator"></span>
  174. <ul class="notifications">
  175. <li>
  176. <a href="/DataBase/index.php" class="notification-icon" data-toggle="tooltip" title="設計資料庫查詢" data-placement="bottom">
  177. <i class="fa fa-database"></i>
  178. </a>
  179. <a href="/Front-Page/home.php" class="notification-icon" data-toggle="tooltip" title="綜合登入入口" data-placement="bottom">
  180. <i class="fa fa-home"></i>
  181. </a>
  182. </li>
  183. </ul>
  184. <span class="separator"></span>
  185. <div id="userbox" class="userbox">
  186. <a href="#" data-toggle="dropdown">
  187. <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>
  188. <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>
  189. </div> <i class="fa custom-caret"></i>
  190. </a>
  191. <div class="dropdown-menu">
  192. <ul class="list-unstyled">
  193. <li class="divider"></li>
  194. <li> <a role="menuitem" tabindex="-1" href="/DataBase/script/php/Logout.php"><i class="fa fa-power-off"></i> Logout</a> </li>
  195. </ul>
  196. </div>
  197. </div>
  198. </div>
  199. <!-- end: search & user box -->
  200. </header>
  201. <!-- end: header -->
  202. <div class="inner-wrapper">
  203. <!-- start: sidebar -->
  204. <section role="main" class="content-body">
  205. <header class="page-header">
  206. <ul>
  207. <li>
  208. <label id="header">LOG日誌</label>
  209. </li>
  210. </ul>
  211. </header>
  212. <section class="panel">
  213. <header class="panel-heading">
  214. <div class="panel-actions">
  215. <a href="#" class="fa fa-caret-down"></a>
  216. <a href="#" class="fa fa-times"></a>
  217. </div>
  218. <h2 class="panel-title">匯入日誌</h2>
  219. </header>
  220. <div class="panel-body">
  221. <table class="table table-bordered table-striped mb-none" id="datatable">
  222. <thead>
  223. <tr>
  224. <th>上傳人員</th>
  225. <th>所屬部門</th>
  226. <th>計畫編號</th>
  227. <th>計畫名稱</th>
  228. <th>上傳時間</th>
  229. </tr>
  230. </thead>
  231. <tbody id="table-data">
  232. </tbody>
  233. </table>
  234. </div>
  235. </section>
  236. </div>
  237. </section>
  238. </div>
  239. </section>
  240. </body>
  241. <!-- Vendor -->
  242. <script src="assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
  243. <script src="assets/vendor/bootstrap/js/bootstrap.js"></script>
  244. <script src="assets/vendor/nanoscroller/nanoscroller.js"></script>
  245. <script src="assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
  246. <script src="assets/vendor/magnific-popup/magnific-popup.js"></script>
  247. <script src="assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
  248. <!-- Specific Page Vendor -->
  249. <script src="assets/vendor/select2/select2.js"></script>
  250. <script src="assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
  251. <script src="assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
  252. <script src="assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
  253. <!-- Theme Base, Components and Settings -->
  254. <script src="assets/javascripts/theme.js"></script>
  255. <!-- Theme Custom -->
  256. <script src="assets/javascripts/theme.custom.js"></script>
  257. <!-- Theme Initialization Files -->
  258. <script src="assets/javascripts/theme.init.js"></script>
  259. <script type="text/javascript">
  260. var userName = "<?php //echo $_SESSION['name']
  261. ?>";
  262. var role = "<?php //echo ($groupName);
  263. ?>";
  264. //var right = <?php //echo $right;
  265. ?>;
  266. getLog();
  267. function getLog() {
  268. $.ajax({
  269. url: "./script/php/get_log.php",
  270. type: "POST",
  271. dataType: "json"
  272. }).done(function(result) {
  273. result.forEach(function(data) {
  274. $('#table-data').append(`<tr>
  275. <td>${data.UserID}</td>
  276. <td>${data.DepartmentName}</td>
  277. <td>${data.project_id}</td>
  278. <td>${data.project_name}</td>
  279. <td>${data.upload_time}</td>
  280. </tr>`);
  281. });
  282. }).error(function(error) {
  283. console.log(error);
  284. }).complete(function(e) {
  285. $('#datatable').DataTable({
  286. bProcessing: true,
  287. responsive: true,
  288. "searching": true,
  289. "pageLength": 10,
  290. "language": {
  291. "processing": "處理中...",
  292. "loadingRecords": "載入中...",
  293. "lengthMenu": "顯示 _MENU_ 項結果",
  294. "zeroRecords": "沒有符合的結果或是沒有資料",
  295. "info": "顯示第 _START_ 至 _END_ 項結果,共 _TOTAL_ 項",
  296. "infoEmpty": "顯示第 0 至 0 項結果,共 0 項",
  297. "infoFiltered": "(從 _MAX_ 項結果中過濾)",
  298. "infoPostFix": "",
  299. "search": "",
  300. "paginate": {
  301. "first": '<i class="fa fa-step-backward"></i>',
  302. "previous": '<i class="fa fa-backward"></i>',
  303. "next": '<i class="fa fa-forward"></i>',
  304. "last": '<i class="fa fa-step-forward"></i>'
  305. },
  306. "aria": {
  307. "sortAscending": ": 升冪排列",
  308. "sortDescending": ": 降冪排列"
  309. }
  310. },
  311. });
  312. $('body .dropdown-toggle').dropdown();
  313. $("body").on('click', '.groupDropdown', function(e) {
  314. let groupName = $(this).text();
  315. let groupID = $(this).attr('groupID');
  316. let userAccount = $(this).closest("td").attr('id');
  317. $(this).closest("td").append(addPermission(groupID, groupName, userAccount));
  318. })
  319. });
  320. }
  321. </script>
  322. </html>