Victoria Hall Booking for Events
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.

444 lines
13 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-headquarters :: head}"></head>
  4. <style>
  5. .toggle-button {
  6. position: relative;
  7. display: flex;
  8. align-items: center;
  9. width: 91px;
  10. height: 33px;
  11. padding: 5px;
  12. border-radius: 25px;
  13. cursor: pointer;
  14. font-size: 14px;
  15. color: white;
  16. background-color: #f44336;
  17. transition: background-color 0.4s;
  18. }
  19. .toggle-button.active {
  20. background-color: #4CAF50;
  21. }
  22. .toggle-thumb {
  23. position: absolute;
  24. width: 30px;
  25. height: 30px;
  26. border-radius: 50%;
  27. background-color: white;
  28. transition: transform 0.4s;
  29. }
  30. .toggle-text {
  31. flex-grow: 1;
  32. text-align: center;
  33. transition: transform 0.4s;
  34. }
  35. .toggle-button.active .toggle-thumb {
  36. transform: translateX(55px);
  37. }
  38. .toggle-button.active .toggle-text {
  39. transform: translateX(-16px);
  40. }
  41. .toggle-button.inactive .toggle-text {
  42. transform: translateX(14px);
  43. }
  44. </style>
  45. <body>
  46. <!-- Page Container -->
  47. <div id="page-container"
  48. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  49. <!-- Sidebar Nav-->
  50. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  51. <!-- END Side Overlay (right)-->
  52. <!-- Sidebar Nav-->
  53. <nav th:replace="~{fragments/nav-headquarters :: nav}"></nav>
  54. <!-- END Sidebar -->
  55. <!-- Header -->
  56. <header th:replace="~{fragments/header-headquarters :: header}"></header>
  57. <!-- END Header -->
  58. <!-- Main Container -->
  59. <main id="main-container">
  60. <!-- Hero -->
  61. <!-- END Hero -->
  62. <div class="content">
  63. <div class="block block-rounded">
  64. <div class="block-header block-header-default">
  65. <h3 class="block-title"> List of User Approval</h3>
  66. </div>
  67. <div class="block-content p-0">
  68. <div class="p-sm-4 p-0">
  69. <div class="table-responsive">
  70. <table id="userPendingTable"
  71. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  72. <thead class="thead-light">
  73. <tr>
  74. <th>S.no</th>
  75. <th>Usertype</th>
  76. <th>Name</th>
  77. <th>Mobile Number</th>
  78. <th>E-Mail ID</th>
  79. <th>Area</th>
  80. <th>Pincode</th>
  81. <th>Action</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <!--<tbody th:each="registration, i : ${registrations}">-->
  86. <!--<tr>-->
  87. <tr th:each="users, rowStat : ${pendinglist}">
  88. <!--<td class="text-center" th:text="${i.index + 1}"></td>-->
  89. <td class="text-center" th:text="${rowStat.index + 1}"></td>
  90. <td class="text-center" th:text="${users.usertype}"></td>
  91. <td class="text-center" th:text="${users.name}"></td>
  92. <td class="text-center" th:text="${users.mobileNo}"></td>
  93. <td class="text-center" th:text="${users.email}"></td>
  94. <td class="text-center" th:text="${users.area}"></td>
  95. <td class="text-center" th:text="${users.pinCode}"></td>
  96. <td>
  97. <p>
  98. <span class="badge bg-warning" style="cursor: pointer;"
  99. th:onclick="pending([[${users.userId}]])">pending</span>
  100. </p>
  101. </td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </main>
  111. <!-- END Main Container -->
  112. <!--modal for pening-->
  113. <div class="modal fade backdrop" id="pendingForm" data-backdrop="static" tabindex="-1" role="dialog"
  114. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  115. <div class="modal-dialog modal-lg" role="document">
  116. <div class="modal-content">
  117. <form id="ownform" onsubmit="return rejectsubmit();">
  118. <div class="block block-rounded block-themed block-transparent mb-0">
  119. <div class="block-header bg-primary-dark">
  120. <h3 class="block-title" id="2mtitle">User Information</h3>
  121. <div class="block-options">
  122. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  123. aria-label="Close">
  124. <i class="fa fa-fw fa-times"></i>
  125. </button>
  126. </div>
  127. </div>
  128. <div class="block-content row">
  129. <!-- <div class="col-sm-4"> -->
  130. <!-- <label class="form-label">Pet ID:<span class="text-danger">*</span></label> -->
  131. <input type="hidden" class="form-control text-center" name="userid" id="userid"
  132. disabled />
  133. <!--<input type="hidden" class="form-control text-center" name="Mobii" id="Mobii"
  134. disabled />-->
  135. <!-- </div> -->
  136. <div class="col-sm-4">
  137. <label class="form-label">Name:<span class="text-danger"></span></label>
  138. <input type="text" class="form-control text-center" name="name" id="name"
  139. readonly />
  140. </div>
  141. <div class="col-sm-4">
  142. <label class="form-label">Mobile No:<span class="text-danger"></span></label>
  143. <input type="text" class="form-control text-center" name="mobile" id="mobile"
  144. readonly />
  145. </div>
  146. <div class="col-sm-4">
  147. <label class="form-label">E-Mail ID:<span class="text-danger"></span></label>
  148. <input type="text" class="form-control text-center" name="email" id="email"
  149. readonly />
  150. </div>
  151. <div class="col-sm-4">
  152. <label class="form-label">Street:<span class="text-danger"></span></label>
  153. <input type="text" class="form-control text-center" name="street" id="street"
  154. readonly />
  155. </div>
  156. <div class="col-sm-4">
  157. <label class="form-label">Area:<span class="text-danger"></span></label>
  158. <input type="text" class="form-control text-center" name="area" id="area"
  159. readonly />
  160. </div>
  161. <div class="col-sm-4">
  162. <label class="form-label">Location:<span class="text-danger"></span></label>
  163. <input type="text" class="form-control text-center" name="location" id="location"
  164. readonly />
  165. </div>
  166. <div class="col-sm-4">
  167. <label class="form-label">Pincode:<span class="text-danger"></span></label>
  168. <input type="text" class="form-control text-center" name="pincode" id="pincode"
  169. readonly />
  170. </div>
  171. <div class="col-sm-4">
  172. <label class="form-label">User Type:<span class="text-danger"></span></label>
  173. <input type="text" class="form-control text-center" name="usertype" id="usertype"
  174. readonly />
  175. </div>
  176. <div class="col-sm-4" style="display:none" id="idField">
  177. <label class="form-label">User Type Id:<span class="text-danger"></span></label>
  178. <input type="text" class="form-control text-center" name="governmentId" id="governmentId"
  179. readonly />
  180. </div>
  181. <div class="col-sm-4" style="display:none" id="departmentField">
  182. <label class="form-label">Department:<span class="text-danger"></span></label>
  183. <input type="text" class="form-control text-center" name="department" id="department"
  184. readonly />
  185. </div>
  186. <div class="mb-4">
  187. <label class="form-label">Reason:<span class="text-danger"></span></label>
  188. <textarea class="form-control " name="reason" id="reason" required></textarea>
  189. </div>
  190. </div>
  191. </div>
  192. <div class="block-content block-content-full text-end bg-body" id="mbutton2">
  193. <button type="button" class="btn btn-sm btn-alt-success"
  194. th:onclick="accept()">Accept</button>
  195. <button type="button" class="btn btn-sm btn-alt-secondary"
  196. data-bs-dismiss="modal">Close</button>
  197. <button type="submit" class="btn btn-sm btn-primary">Reject</button>
  198. </div>
  199. </form>
  200. </div>
  201. </div>
  202. </div>
  203. <div th:replace="~{fragments/resetpassword :: div}"></div>
  204. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  205. <!-- END Footer -->
  206. </div>
  207. <script th:replace="~{fragments/loginscript :: script}"></script>
  208. <script>
  209. $(document).ready(
  210. function () {
  211. // DataTables buttons configuration
  212. var buttons = [{
  213. extend: 'pageLength',
  214. className: 'btn btn-primary'
  215. }, {
  216. title: 'Data export',
  217. extend: 'copyHtml5',
  218. text: 'Copy',
  219. className: 'btn btn-primary',
  220. id: 'copyBtn'
  221. }, {
  222. extend: 'excelHtml5',
  223. text: 'Excel',
  224. className: 'btn btn-primary',
  225. id: 'excelBtn'
  226. }, {
  227. extend: 'csvHtml5',
  228. text: 'CSV',
  229. className: 'btn btn-primary',
  230. id: 'csvBtn'
  231. }, {
  232. extend: 'pdfHtml5',
  233. text: 'PDF',
  234. className: 'btn btn-primary',
  235. id: 'pdfBtn'
  236. },
  237. ];
  238. $('#userPendingTable').DataTable(
  239. {
  240. dom: 'Bftip',
  241. columnDefs: [{
  242. targets: 'no-sort',
  243. orderable: false
  244. }],
  245. lengthMenu: [
  246. [50, 100, 200, 500, -1],
  247. ['50 rows', '100 rows', '200 rows',
  248. '500 rows', 'Show all']],
  249. scrollY: '50vh',
  250. fixedColumns: {
  251. left: 1,
  252. right: 1
  253. },
  254. buttons: [buttons],
  255. responsive: true,
  256. searching: true, // Enable search
  257. select: false,
  258. processing: false,
  259. });
  260. // Link the search input to DataTable
  261. $('#searchInput').on('keyup', function () {
  262. dataTable.search(this.value).draw();
  263. });
  264. });
  265. //script to open pending form
  266. function pending(userId) {
  267. $.ajax({
  268. type: "GET",
  269. url: '/victoriahallbooking/api/officer/getUserDetails',
  270. data: {
  271. 'usersid': userId
  272. },
  273. success: function (x) {
  274. //console.log(x);
  275. showUserInfo(x)
  276. }
  277. });
  278. }
  279. function showUserInfo(list) {
  280. $('#pendingForm').modal({
  281. backdrop: 'static',
  282. keyboard: false
  283. });
  284. $('#pendingForm').modal('show');
  285. document.getElementById("userid").value = list.userId;
  286. document.getElementById("name").value = list.name;
  287. document.getElementById("mobile").value = list.mobileNo;
  288. document.getElementById("email").value = list.email;
  289. document.getElementById("street").value = list.street;
  290. document.getElementById("area").value = list.area;
  291. document.getElementById("location").value = list.location;
  292. document.getElementById("pincode").value = list.pinCode;
  293. document.getElementById("usertype").value = list.usertype;
  294. document.getElementById("governmentId").value=list.governmentId
  295. document.getElementById("department").value=list.department
  296. if (list.usertype === 'GCC_EMPLOYEE' || list.usertype === 'PENSIONER') {
  297. idField.style.display = 'block';
  298. departmentField.style.display = 'block';
  299. } else {
  300. idField.style.display = 'none';
  301. departmentField.style.display = 'none';
  302. }
  303. }
  304. function accept() {
  305. let id = document.getElementById("userid").value;
  306. Swal.fire({
  307. title: 'Do you want to Accept this User ?',
  308. showDenyButton: true,
  309. showCancelButton: true,
  310. confirmButtonText: 'YES',
  311. denyButtonText: `NO`,
  312. }).then((result) => {
  313. /* Read more about isConfirmed, isDenied below */
  314. if (result.isConfirmed) {
  315. $.ajax({
  316. type: "POST",
  317. url: '/victoriahallbooking/api/officer/updateApprovedStatus/' + id,
  318. data: {
  319. 'status': 'APPROVED',
  320. 'comments': 'Accepted',
  321. 'userId': id
  322. },
  323. success: function (data, textStatus, xhr) {
  324. if (xhr.status === 200) { // Check if the response status is OK
  325. Swal.fire(
  326. 'Done',
  327. 'Successfully Accepted to the ID:' + id,
  328. 'success'
  329. ).then(() => {
  330. location.reload();
  331. });
  332. } else {
  333. Swal.fire(
  334. 'Error',
  335. 'Failed to accept the user',
  336. 'error'
  337. );
  338. }
  339. },
  340. error: function (xhr, textStatus, errorThrown) {
  341. Swal.fire(
  342. 'Error',
  343. 'Failed to accept the user',
  344. 'error'
  345. );
  346. }
  347. });
  348. } else if (result.isDenied) {
  349. Swal.fire('Changes are not saved', '', 'info')
  350. }
  351. });
  352. }
  353. function rejectsubmit() {
  354. let id = document.getElementById("userid").value;
  355. let reason = $("#reason").val();
  356. Swal.fire({
  357. title: 'Do you want to Reject this User ?',
  358. showDenyButton: true,
  359. showCancelButton: true,
  360. confirmButtonText: 'YES',
  361. denyButtonText: `NO`,
  362. }).then((result) => {
  363. /* Read more about isConfirmed, isDenied below */
  364. if (result.isConfirmed) {
  365. //console.log("Submitting rejection...");
  366. $.ajax({
  367. type: "POST",
  368. url: '/victoriahallbooking/api/officer/updateRejectStatus/' + id,
  369. data: {
  370. 'status': 'REJECTED',
  371. 'comments': reason,
  372. 'userId': id
  373. },
  374. success: function (data, textStatus, xhr) {
  375. //console.log("Rejection successful");
  376. if (xhr.status === 200) { // Check if the response status is OK
  377. Swal.fire(
  378. 'Done',
  379. 'Successfully Rejected to the ID:' + id,
  380. 'success'
  381. ).then(() => {
  382. location.reload();
  383. });
  384. } else {
  385. Swal.fire(
  386. 'Error',
  387. 'Failed to reject the user',
  388. 'error'
  389. );
  390. }
  391. },
  392. error: function (xhr, textStatus, errorThrown) {
  393. console.error("Error:", errorThrown);
  394. Swal.fire(
  395. 'Error',
  396. 'Failed to reject the user',
  397. 'error'
  398. );
  399. }
  400. });
  401. } else if (result.isDenied) {
  402. Swal.fire('Changes are not saved', '', 'info')
  403. }
  404. });
  405. return false; // Prevent form submission
  406. }
  407. </script>
  408. </body>
  409. </html>