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.

278 lines
9.6 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-admin :: head}"></head>
  4. <body>
  5. <!-- Page Container -->
  6. <div id="page-container"
  7. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  8. <!-- Sidebar Nav-->
  9. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  10. <!-- END Side Overlay (right)-->
  11. <!-- Sidebar Nav-->
  12. <nav th:replace="~{fragments/nav-gccstaff :: nav}"></nav>
  13. <!-- END Sidebar -->
  14. <!-- Header -->
  15. <header th:replace="~{fragments/header-department :: header}"></header>
  16. <!-- END Header -->
  17. <!-- Main Container -->
  18. <main id="main-container">
  19. <!-- Page Content -->
  20. <div class="content">
  21. <div class="block block-rounded">
  22. <div class="block-header block-header-default">
  23. <h3 class="block-title"> List of Approved Users</h3>
  24. </div>
  25. <div class="block-content p-0">
  26. <div class="p-sm-4 p-0">
  27. <div class="table-responsive">
  28. <table id="userApprovedList"
  29. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  30. <thead class="thead-light">
  31. <tr class="table-bordered">
  32. <th class="text-center no-sort">S.No</th>
  33. <th class="text-center" width="20%">Usertype</th>
  34. <th class="text-center">Name</th>
  35. <th class="text-center">Mobile Number</th>
  36. <th class="text-center">Email</th>
  37. <th class="text-center">User Status</th>
  38. <th class="text-center">Action</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. <!-- Use Thymeleaf to loop through the bookingList -->
  43. <tr th:each="users, rowStat : ${gccstaffApprovedList}">
  44. <!--<td class="text-center" th:text="${i.index + 1}"></td>-->
  45. <td class="text-center" th:text="${rowStat.index + 1}"></td>
  46. <td class="text-center" th:text="${users.usertype}"></td>
  47. <td class="text-center" th:text="${users.name}"></td>
  48. <td class="text-center" th:text="${users.mobileNo}"></td>
  49. <td class="text-center" th:text="${users.email}"></td>
  50. <td class="text-center" th:text="${users.userstatus}"></td>
  51. <td>
  52. <p>
  53. <span class="badge bg-success" style="cursor: pointer;"
  54. th:onclick="approved([[${users.userId}]])">Approved</span>
  55. </p>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. <!-- END Page Content -->
  66. </main>
  67. <!-- END Main Container -->
  68. <!-- END Main Container -->
  69. <!--modal for pening-->
  70. <div class="modal fade backdrop" id="approvalForm" data-backdrop="static" tabindex="-1" role="dialog"
  71. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  72. <div class="modal-dialog modal-lg" role="document">
  73. <div class="modal-content">
  74. <form id="ownform">
  75. <div class="block block-rounded block-themed block-transparent mb-0">
  76. <div class="block-header bg-primary-dark">
  77. <h3 class="block-title" id="2mtitle">User Approval Information</h3>
  78. <div class="block-options">
  79. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  80. aria-label="Close">
  81. <i class="fa fa-fw fa-times"></i>
  82. </button>
  83. </div>
  84. </div>
  85. <div class="block-content row">
  86. <!-- <div class="col-sm-4"> -->
  87. <!-- <label class="form-label">Pet ID:<span class="text-danger">*</span></label> -->
  88. <input type="hidden" class="form-control text-center" name="userid" id="userid"
  89. disabled />
  90. <!--<input type="hidden" class="form-control text-center" name="Mobii" id="Mobii"
  91. disabled />-->
  92. <!-- </div> -->
  93. <div class="col-sm-4">
  94. <label class="form-label">Name:<span class="text-danger"></span></label>
  95. <input type="text" class="form-control text-center" name="name" id="name"
  96. disabled />
  97. </div>
  98. <div class="col-sm-4">
  99. <label class="form-label">Mobile No:<span class="text-danger"></span></label>
  100. <input type="text" class="form-control text-center" name="mobile" id="mobile"
  101. disabled />
  102. </div>
  103. <div class="col-sm-4">
  104. <label class="form-label">Email:<span class="text-danger"></span></label>
  105. <input type="text" class="form-control text-center" name="email" id="email"
  106. disabled />
  107. </div>
  108. <div class="col-sm-4">
  109. <label class="form-label">Street:<span class="text-danger"></span></label>
  110. <input type="text" class="form-control text-center" name="street" id="street"
  111. disabled />
  112. </div>
  113. <div class="col-sm-4">
  114. <label class="form-label">Area:<span class="text-danger"></span></label>
  115. <input type="text" class="form-control text-center" name="area" id="area"
  116. disabled />
  117. </div>
  118. <div class="col-sm-4">
  119. <label class="form-label">Location:<span class="text-danger"></span></label>
  120. <input type="text" class="form-control text-center" name="location" id="location"
  121. disabled />
  122. </div>
  123. <div class="col-sm-4">
  124. <label class="form-label">Pincode:<span class="text-danger"></span></label>
  125. <input type="text" class="form-control text-center" name="pincode" id="pincode"
  126. disabled />
  127. </div>
  128. <div class="col-sm-4">
  129. <label class="form-label">UserType:<span class="text-danger"></span></label>
  130. <input type="text" class="form-control text-center" name="usertype" id="usertype"
  131. disabled />
  132. </div>
  133. <div class="col-sm-4">
  134. <label class="form-label">User Status:<span class="text-danger"></span></label>
  135. <input type="text" class="form-control text-center" name="userstatus"
  136. id="userstatus" disabled />
  137. </div>
  138. <div class="col-sm-4" style="display:none" id="idField">
  139. <label class="form-label">Usertype Id:<span class="text-danger"></span></label>
  140. <input type="text" class="form-control text-center" name="governmentId" id="governmentId"
  141. readonly />
  142. </div>
  143. <div class="col-sm-4" style="display:none" id="departmentField">
  144. <label class="form-label">Department:<span class="text-danger"></span></label>
  145. <input type="text" class="form-control text-center" name="department" id="department"
  146. readonly />
  147. </div>
  148. </div>
  149. </div>
  150. <div class="block-content block-content-full text-end bg-body" id="mbutton2">
  151. <button type="button" class="btn btn-sm btn-alt-secondary"
  152. data-bs-dismiss="modal">Close</button>
  153. </div>
  154. </form>
  155. </div>
  156. </div>
  157. </div>
  158. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  159. <!-- Scripts -->
  160. <script th:replace="~{fragments/loginscript :: script}"></script>
  161. <script type="text/javascript">
  162. $(document).ready(
  163. function () {
  164. var buttons = [{
  165. extend: 'pageLength',
  166. className: 'btn btn-primary'
  167. }, {
  168. title: 'Data export',
  169. extend: 'copyHtml5',
  170. text: 'Copy',
  171. className: 'btn btn-primary',
  172. id: 'copyBtn'
  173. }, {
  174. extend: 'excelHtml5',
  175. text: 'Excel',
  176. className: 'btn btn-primary',
  177. id: 'excelBtn'
  178. }, {
  179. extend: 'csvHtml5',
  180. text: 'CSV',
  181. className: 'btn btn-primary',
  182. id: 'csvBtn'
  183. }, {
  184. extend: 'pdfHtml5',
  185. text: 'PDF',
  186. className: 'btn btn-primary',
  187. id: 'pdfBtn'
  188. },
  189. ];
  190. $('#userApprovedList').DataTable(
  191. {
  192. dom: 'Bftip',
  193. columnDefs: [{
  194. targets: 'no-sort',
  195. orderable: false
  196. }],
  197. lengthMenu: [
  198. [50, 100, 200, 500, -1],
  199. ['50 rows', '100 rows', '200 rows',
  200. '500 rows', 'Show all']],
  201. scrollY: '50vh',
  202. fixedColumns: {
  203. left: 1,
  204. right: 1
  205. },
  206. buttons: [buttons],
  207. responsive: true,
  208. searching: true, // Enable search
  209. select: false,
  210. processing: false,
  211. });
  212. // Link the search input to DataTable
  213. $('#searchInput').on('keyup', function () {
  214. dataTable.search(this.value).draw();
  215. });
  216. });
  217. function approved(userId) {
  218. $.ajax({
  219. type: "GET",
  220. url: '/communityhall/api/officer/getUserDetails',
  221. data: {
  222. 'usersid': userId
  223. },
  224. success: function (x) {
  225. // console.log(x);
  226. showUserInfo(x)
  227. }
  228. });
  229. }
  230. function showUserInfo(list) {
  231. $('#approvalForm').modal({
  232. backdrop: 'static',
  233. keyboard: false
  234. });
  235. $('#approvalForm').modal('show');
  236. document.getElementById("userid").value = list.userId;
  237. document.getElementById("name").value = list.name;
  238. document.getElementById("mobile").value = list.mobileNo;
  239. document.getElementById("email").value = list.email;
  240. document.getElementById("street").value = list.street;
  241. document.getElementById("area").value = list.area;
  242. document.getElementById("location").value = list.location;
  243. document.getElementById("pincode").value = list.pinCode;
  244. document.getElementById("usertype").value = list.usertype;
  245. document.getElementById("userstatus").value = list.userstatus;
  246. document.getElementById("department").value=list.department;
  247. document.getElementById("governmentId").value=list.governmentId;
  248. if (list.usertype === 'GCC_EMPLOYEE' || list.usertype === 'PENSIONER') {
  249. idField.style.display = 'block';
  250. departmentField.style.display = 'block';
  251. } else {
  252. idField.style.display = 'none';
  253. departmentField.style.display = 'none';
  254. }
  255. }
  256. </script>
  257. </body>
  258. </html>