You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
9.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  4. <body>
  5. <!--[if lt IE 8]>
  6. <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  7. <![endif]-->
  8. <div class="wrapper">
  9. <!-- header top menu Start -->
  10. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  11. <!-- header top menu end -->
  12. <div class="page-wrap">
  13. <!--=============== Left Menu side Start ================-->
  14. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  15. <!--=============== Left side End ================-->
  16. <div class="main-content">
  17. <div class="container-fluid">
  18. <div class="page-header">
  19. <div class="row align-items-end">
  20. <div class="col-lg-6">
  21. <div class="page-header-title">
  22. <i class="fa fa-user bg-blue"></i>
  23. <div class="d-inline">
  24. <h5>User List</h5>
  25. <span>GCC Application Configuration</span>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="col-lg-6">
  30. <nav class="breadcrumb-container" aria-label="breadcrumb">
  31. <ol class="breadcrumb">
  32. <li class="breadcrumb-item">
  33. <a href="/index"><i class="ik ik-home"></i></a>
  34. </li>
  35. <li class="breadcrumb-item">Admin</li>
  36. <li class="breadcrumb-item active" aria-current="page">User List</li>
  37. </ol>
  38. </nav>
  39. </div>
  40. </div>
  41. </div>
  42. <hr>
  43. <div class="row">
  44. <div class="col-md-12">
  45. <div class="card">
  46. <div class="card-block">
  47. <div>
  48. <table id="assetDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%">
  49. <thead class="thead-dark">
  50. <tr class="table-bordered">
  51. <th class="text-center no-sort">S.No</th>
  52. <th class="text-center">Name</th>
  53. <th class="text-center">E-mail</th>
  54. <th class="text-center">Mobile</th>
  55. <th class="text-center">Username</th>
  56. <th class="text-center">Role</th>
  57. <th class="text-center">Access Group</th>
  58. <th class="text-center" width="10%">Status</th>
  59. <th class="text-center" width="10%">Action</th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. <tr th:each="userlistData, i : ${userlist}" class="${userlist}">
  64. <td th:utext="${i.count}">0</td>
  65. <td th:utext="${userlistData.userid.name}"></td>
  66. <td th:utext="${userlistData.userid.email}"></td>
  67. <td th:utext="${userlistData.userid.phone}"></td>
  68. <td th:text="${userlistData.username}"></td>
  69. <td th:utext="${userlistData.roles}" class="text-center"></td>
  70. <td th:text="${userlistData.usergroup_id.name}"></td>
  71. <td style="text-transform: capitalize;" th:utext="${userlistData.isActive} ? 'Active' : 'Inactive'" th:class="${userlistData.isActive} ? 'text-center text-green' : 'text-center text-red'"></td>
  72. <td class="text-center">
  73. <a th:href="@{#}" th:onclick="return callUserDetails([[${userlistData.id}]]);" data-toggle="tooltip" data-animation="true" data-placement="top" title="View User Details" data-original-title="View User Details"><i class="ik ik-file-text text-green" style="font-size: 18px;"></i></a>
  74. </td>
  75. </tr>
  76. </tbody>
  77. <tfoot class="thead-dark">
  78. <tr class="table-bordered">
  79. <th class="text-center no-sort">S.No</th>
  80. <th class="text-center">Name</th>
  81. <th class="text-center">E-mail</th>
  82. <th class="text-center">Mobile</th>
  83. <th class="text-center">Username</th>
  84. <th class="text-center">Role</th>
  85. <th class="text-center">Access Group</th>
  86. <th class="text-center" width="10%">Status</th>
  87. <th class="text-center" width="10%">Action</th>
  88. </tr>
  89. </tfoot>
  90. </table>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  99. </div>
  100. </div>
  101. <div th:replace="~{fragments/modules/admin/modal-box :: div}"></div>
  102. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  103. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  104. <script th:inline="javascript">
  105. //var qrAssetFeedbackApiUrl = "[[${qrAssetFeedbackApiUrl}]]";
  106. $(document).ready(function() {
  107. var exportTitle = "GCC Application User List";
  108. // DataTables buttons configuration
  109. var buttons = [
  110. {
  111. extend: 'pageLength',
  112. className: 'btn btn-warning'
  113. },
  114. {
  115. title: 'Data export',
  116. extend: 'copyHtml5',
  117. text: 'Copy',
  118. className: 'btn btn-secondary',
  119. id: 'copyBtn'
  120. },
  121. {
  122. extend: 'excelHtml5',
  123. text: 'Excel',
  124. className: 'btn btn-secondary',
  125. id: 'excelBtn',
  126. title: exportTitle
  127. },
  128. {
  129. extend: 'csvHtml5',
  130. text: 'CSV',
  131. className: 'btn btn-secondary',
  132. id: 'csvBtn',
  133. title: exportTitle
  134. },
  135. {
  136. extend: 'pdfHtml5',
  137. text: 'PDF',
  138. className: 'btn btn-secondary',
  139. id: 'pdfBtn',
  140. title: exportTitle
  141. }
  142. ];
  143. $('#assetDatatable').DataTable( {
  144. /* Disable initial sort */
  145. aaSorting: [],
  146. columnDefs: [
  147. { targets: 'no-sort', orderable: false }
  148. ],
  149. dom: 'Bftip',
  150. lengthMenu: [
  151. [ 50, 100, 200, 500, -1 ],
  152. [ '50 rows', '100 rows', '200 rows','500 rows', 'Show all' ]
  153. ],
  154. scrollY: '50vh',
  155. fixedColumns: {
  156. left: 1,
  157. right: 1
  158. },
  159. buttons: [buttons],
  160. responsive: true,
  161. searching: false,
  162. select: false,
  163. processing: false,
  164. } );
  165. } );
  166. // For view user details
  167. function callUserDetails(userid){
  168. $("#profilehtml").html(searchinfo("<b>Retrieving Information, Please Wait...<div id=\"loadingimg\"></div></b>"));
  169. call_loading("loadingimg","start");
  170. $('#viewUserDetails').modal({
  171. backdrop: 'static',
  172. keyboard: false
  173. })
  174. $('#viewUserDetails').modal('show');
  175. var userProfileHtml = "";
  176. getUserDetails(userid).then(response => {
  177. // Handle the success response
  178. $("#profilehtml").html(response);
  179. })
  180. .catch(error => {
  181. // Handle the error response
  182. $("#profilehtml").html(error);
  183. });
  184. }
  185. function getUserDetails(userid){
  186. const apiUrl = "/election/api/getUserProfile";
  187. return new Promise((resolve, reject) => {
  188. $.ajax({
  189. url: apiUrl,
  190. type: 'GET',
  191. dataType: 'text',
  192. data: { userId: userid},
  193. success: function(response) {
  194. // Handle the success response
  195. resolve(response);
  196. },
  197. error: function(error) {
  198. // Handle the error response
  199. console.error('API error:', error);
  200. reject(error);
  201. }
  202. });
  203. });
  204. }
  205. </script>
  206. </body>
  207. </html>