index.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. <!-- Mobile Metas -->
  14. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  15. <!-- Web Fonts -->
  16. <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
  17. <!-- Vendor CSS -->
  18. <link rel="stylesheet" href="assets/vendor/bootstrap/css/bootstrap.css" />
  19. <link rel="stylesheet" href="assets/vendor/font-awesome/css/font-awesome.css" />
  20. <link rel="stylesheet" href="assets/vendor/magnific-popup/magnific-popup.css" />
  21. <link rel="stylesheet" href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
  22. <!-- Specific Page Vendor CSS -->
  23. <link rel="stylesheet" href="assets/vendor/select2/select2.css" />
  24. <link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
  25. <!-- Theme CSS -->
  26. <link rel="stylesheet" href="assets/stylesheets/theme.css" />
  27. <!-- Skin CSS -->
  28. <link rel="stylesheet" href="assets/stylesheets/skins/default.css" />
  29. <!-- Theme Custom CSS -->
  30. <link rel="stylesheet" href="assets/stylesheets/theme-custom.css">
  31. <!-- Head Libs -->
  32. <script src="assets/vendor/modernizr/modernizr.js"></script>
  33. <script src="assets/vendor/jquery/jquery.js"></script>
  34. <!-- Icon -->
  35. <link rel="shortcut icon" href="assets/images/favicon.ico" />
  36. <!-- vue3 -->
  37. <script src="https://unpkg.com/vue@next"></script>
  38. <script src="./script/js/global.js"></script>
  39. <style>
  40. td{
  41. font-size:20px;
  42. color:black;
  43. }
  44. select{
  45. font-size:12px;
  46. color:black;
  47. }
  48. </style>
  49. <script type="application/javascript">
  50. var userName = '<?php echo $_SESSION['name']; ?>';
  51. var pageHeader = '帳號權限管理系統';
  52. var role = '<?php echo ($groupName); ?>';
  53. var roles;
  54. getDeptUser();
  55. function getDeptUser() {
  56. $.ajax({
  57. url: "./script/php/get_data/get_dept_user.php",
  58. type: "POST",
  59. dataType: "json"
  60. }).done(function(result) {
  61. console.log(result);
  62. result.forEach(function(data){
  63. $('#table-data').append(`<tr>
  64. <td>${data.UserID}</td>
  65. <td>${data.Account}</td>
  66. <td>${data.UserName}</td>
  67. <td>${data.DepartmentID}</td>
  68. <td>
  69. <select name="right" id="right">
  70. <option value="User">一般用戶</option>
  71. <option value="Editor">上傳人員</option>
  72. <option value="Dadmin">部門管理員</option>
  73. </select>
  74. </td>
  75. </tr>`);
  76. });
  77. }).error(function(error) {
  78. console.log(error);
  79. });
  80. }
  81. function getPageGroup() {
  82. $.ajax({
  83. url: "./script/php/get_data/get_page_group.php",
  84. type: "POST",
  85. dataType: "json"
  86. }).done(function(result) {
  87. for (const [key, value] of Object.entries(result)) {
  88. object = {};
  89. object['id'] = 't';
  90. object['idd'] = 'tt';
  91. object["title"] = key;
  92. roles.push(object);
  93. result[key].forEach(function(item) {
  94. })
  95. }
  96. }).error(function(error) {
  97. console.log(error);
  98. });
  99. }
  100. </script>
  101. </head>
  102. <body>
  103. <section class="body">
  104. <!-- start: header -->
  105. <header-menu></header-menu>
  106. <!-- end: header -->
  107. <div class="inner-wrapper">
  108. <!-- start: sidebar -->
  109. <side-bar></side-bar>
  110. <!-- end: sidebar -->
  111. <section role="main" class="content-body" id="contentBody">
  112. <header class="page-header">
  113. <h2>{{pageHeader}}</h2>
  114. </header>
  115. <role-block v-for="item in roles" v-bind:tbodyId='item.id' v-bind:title='item.title' v-bind:tableId='item.idd'></role-block>
  116. <section class="panel">
  117. <header class="panel-heading">
  118. <div class="panel-actions">
  119. <a href="#" class="fa fa-caret-down"></a>
  120. <a href="#" class="fa fa-times"></a>
  121. </div>
  122. <h2 class="panel-title">設計資料庫查詢系統</h2>
  123. </header>
  124. <div class="panel-body">
  125. <table class="table table-bordered table-striped mb-none" id="datatable">
  126. <thead>
  127. <tr>
  128. <th>員工編號</th>
  129. <th>使用者帳號</th>
  130. <th>使用者名稱</th>
  131. <th>所屬部門</th>
  132. <th>使用者權限</th>
  133. </tr>
  134. </thead>
  135. <tbody id="table-data">
  136. </tbody>
  137. </table>
  138. </div>
  139. </section>
  140. </div>
  141. </section>
  142. <script>
  143. vm.mount('.body');
  144. $(document).ready(function() {
  145. $('#datatable').dataTable();
  146. })
  147. </script>
  148. <!-- Vendor -->
  149. <script src="assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
  150. <script src="assets/vendor/bootstrap/js/bootstrap.js"></script>
  151. <script src="assets/vendor/nanoscroller/nanoscroller.js"></script>
  152. <script src="assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
  153. <script src="assets/vendor/magnific-popup/magnific-popup.js"></script>
  154. <script src="assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
  155. <!-- Specific Page Vendor -->
  156. <script src="assets/vendor/select2/select2.js"></script>
  157. <script src="assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
  158. <script src="assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
  159. <script src="assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
  160. <!-- Theme Base, Components and Settings -->
  161. <script src="assets/javascripts/theme.js"></script>
  162. <!-- Theme Custom -->
  163. <script src="assets/javascripts/theme.custom.js"></script>
  164. <!-- Theme Initialization Files -->
  165. <script src="assets/javascripts/theme.init.js"></script>
  166. <!-- Examples -->
  167. <script src="assets/javascripts/tables/examples.datatables.default.js"></script>
  168. <script src="assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
  169. <script src="assets/javascripts/tables/examples.datatables.tabletools.js"></script>
  170. </section>
  171. </body>
  172. </html>