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.

347 lines
12 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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-admin :: nav}"></nav>
  13. <!-- END Sidebar -->
  14. <!-- Header -->
  15. <header th:replace="~{fragments/header-admin :: header}"></header>
  16. <!-- END Header -->
  17. <!-- Main Container -->
  18. <main id="main-container">
  19. <!-- END Hero -->
  20. <!-- Page Content -->
  21. <div class="content">
  22. <div class="block block-rounded">
  23. <div class="block-header block-header-default">
  24. <h3 class="block-title"> List of Rejected Users</h3>
  25. <!--<div class="block-options">
  26. <button type="button" class="btn-block-option" onclick="callAdd();"><i class="far fa-plus-square"></i> Register New Hall</button>
  27. </div>-->
  28. </div>
  29. <div class="block-content p-0">
  30. <div class="p-sm-4 p-0">
  31. <div class="table-responsive">
  32. <table id="userRejectedList"
  33. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  34. <thead class="thead-light">
  35. <tr class="table-bordered">
  36. <th class="text-center no-sort">S.No</th>
  37. <th class="text-center" width="20%">Usertype</th>
  38. <th class="text-center">Name</th>
  39. <th class="text-center">Mobile Number</th>
  40. <th class="text-center">E-Mail ID</th>
  41. <th class="text-center">User Status</th>
  42. <th class="text-center">Action</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <!-- Use Thymeleaf to loop through the bookingList -->
  47. <tr th:each="users, rowStat : ${rejectedlist}">
  48. <!--<td class="text-center" th:text="${i.index + 1}"></td>-->
  49. <td class="text-center" th:text="${rowStat.index + 1}"></td>
  50. <td class="text-center" th:text="${users.usertype}"></td>
  51. <td class="text-center" th:text="${users.name}"></td>
  52. <td class="text-center" th:text="${users.mobileNo}"></td>
  53. <td class="text-center" th:text="${users.email}"></td>
  54. <td class="text-center" th:text="${users.userstatus}"></td>
  55. <td>
  56. <p>
  57. <span class="badge bg-danger" style="cursor: pointer;"
  58. th:onclick="reject([[${users.userId}]])">Rejected</span>
  59. </p>
  60. </td>
  61. </tr>
  62. </tbody>
  63. </table>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <!-- END Page Content -->
  70. </main>
  71. <!-- END Main Container -->
  72. <!-- END Main Container -->
  73. <!--modal for pening-->
  74. <div class="modal fade backdrop" id="rejectForm" data-backdrop="static" tabindex="-1" role="dialog"
  75. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  76. <div class="modal-dialog modal-lg" role="document">
  77. <div class="modal-content">
  78. <form id="ownform">
  79. <div class="block block-rounded block-themed block-transparent mb-0">
  80. <div class="block-header bg-primary-dark">
  81. <h3 class="block-title" id="2mtitle">User Reject Information</h3>
  82. <div class="block-options">
  83. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  84. aria-label="Close">
  85. <i class="fa fa-fw fa-times"></i>
  86. </button>
  87. </div>
  88. </div>
  89. <div class="block-content row">
  90. <!-- <div class="col-sm-4"> -->
  91. <!-- <label class="form-label">Pet ID:<span class="text-danger">*</span></label> -->
  92. <input type="hidden" class="form-control text-center" name="userid" id="userid"
  93. disabled />
  94. <!--<input type="hidden" class="form-control text-center" name="Mobii" id="Mobii"
  95. disabled />-->
  96. <!-- </div> -->
  97. <div class="col-sm-4">
  98. <label class="form-label">Name:<span class="text-danger"></span></label>
  99. <input type="text" class="form-control text-center" name="name" id="name"
  100. disabled />
  101. </div>
  102. <div class="col-sm-4">
  103. <label class="form-label">Mobile No:<span class="text-danger"></span></label>
  104. <input type="text" class="form-control text-center" name="mobile" id="mobile"
  105. disabled />
  106. </div>
  107. <div class="col-sm-4">
  108. <label class="form-label">E-Mail ID:<span class="text-danger"></span></label>
  109. <input type="text" class="form-control text-center" name="email" id="email"
  110. disabled />
  111. </div>
  112. <div class="col-sm-4">
  113. <label class="form-label">Street:<span class="text-danger"></span></label>
  114. <input type="text" class="form-control text-center" name="street" id="street"
  115. disabled />
  116. </div>
  117. <div class="col-sm-4">
  118. <label class="form-label">Area:<span class="text-danger"></span></label>
  119. <input type="text" class="form-control text-center" name="area" id="area"
  120. disabled />
  121. </div>
  122. <div class="col-sm-4">
  123. <label class="form-label">Location:<span class="text-danger"></span></label>
  124. <input type="text" class="form-control text-center" name="location" id="location"
  125. disabled />
  126. </div>
  127. <div class="col-sm-4">
  128. <label class="form-label">Pincode:<span class="text-danger"></span></label>
  129. <input type="text" class="form-control text-center" name="pincode" id="pincode"
  130. disabled />
  131. </div>
  132. <div class="col-sm-4">
  133. <label class="form-label">UserType:<span class="text-danger"></span></label>
  134. <input type="text" class="form-control text-center" name="usertype" id="usertype"
  135. disabled />
  136. </div>
  137. <div class="col-sm-4">
  138. <label class="form-label">User Status:<span class="text-danger"></span></label>
  139. <input type="text" class="form-control text-center" name="userstatus"
  140. id="userstatus" disabled />
  141. </div>
  142. <div class="col-sm-4" style="display:none" id="idField">
  143. <label class="form-label">Usertype Id:<span class="text-danger"></span></label>
  144. <input type="text" class="form-control text-center" name="governmentId" id="governmentId"
  145. readonly />
  146. </div>
  147. <div class="col-sm-4" style="display:none" id="departmentField">
  148. <label class="form-label">Department:<span class="text-danger"></span></label>
  149. <input type="text" class="form-control text-center" name="department" id="department"
  150. readonly />
  151. </div>
  152. <div class="col-sm-4">
  153. <label class="form-label">Reject Reason:<span class="text-danger"></span></label>
  154. <input type="text" class="form-control text-center" name="userreject"
  155. id="userreject" disabled />
  156. </div>
  157. </div>
  158. </div>
  159. <div class="block-content block-content-full text-end bg-body" id="mbutton2">
  160. <button type="button" class="btn btn-sm btn-alt-success"
  161. th:onclick="accept()">Accept</button>
  162. <button type="button" class="btn btn-sm btn-alt-secondary"
  163. data-bs-dismiss="modal">Close</button>
  164. <!--<button type="submit" class="btn btn-sm btn-primary">Reject</button>-->
  165. </div>
  166. </form>
  167. </div>
  168. </div>
  169. </div>
  170. <div th:replace="~{fragments/resetpassword :: div}"></div>
  171. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  172. <!-- Scripts -->
  173. <script th:replace="~{fragments/loginscript :: script}"></script>
  174. <script type="text/javascript">
  175. $(document).ready(
  176. function () {
  177. var buttons = [{
  178. extend: 'pageLength',
  179. className: 'btn btn-primary'
  180. }, {
  181. title: 'Data export',
  182. extend: 'copyHtml5',
  183. text: 'Copy',
  184. className: 'btn btn-primary',
  185. id: 'copyBtn'
  186. }, {
  187. extend: 'excelHtml5',
  188. text: 'Excel',
  189. className: 'btn btn-primary',
  190. id: 'excelBtn'
  191. }, {
  192. extend: 'csvHtml5',
  193. text: 'CSV',
  194. className: 'btn btn-primary',
  195. id: 'csvBtn'
  196. }, {
  197. extend: 'pdfHtml5',
  198. text: 'PDF',
  199. className: 'btn btn-primary',
  200. id: 'pdfBtn'
  201. },
  202. ];
  203. $('#userRejectedList').DataTable(
  204. {
  205. dom: 'Bftip',
  206. columnDefs: [{
  207. targets: 'no-sort',
  208. orderable: false
  209. }],
  210. lengthMenu: [
  211. [50, 100, 200, 500, -1],
  212. ['50 rows', '100 rows', '200 rows',
  213. '500 rows', 'Show all']],
  214. scrollY: '50vh',
  215. fixedColumns: {
  216. left: 1,
  217. right: 1
  218. },
  219. buttons: [buttons],
  220. responsive: true,
  221. searching: true, // Enable search
  222. select: false,
  223. processing: false,
  224. });
  225. // Link the search input to DataTable
  226. $('#searchInput').on('keyup', function () {
  227. dataTable.search(this.value).draw();
  228. });
  229. });
  230. function reject(userId) {
  231. $.ajax({
  232. type: "GET",
  233. url: '/victoriahallbooking/api/officer/getUserDetails',
  234. data: {
  235. 'usersid': userId
  236. },
  237. success: function (x) {
  238. showUserInfo(x)
  239. }
  240. });
  241. }
  242. function showUserInfo(list) {
  243. $('#rejectForm').modal({
  244. backdrop: 'static',
  245. keyboard: false
  246. });
  247. $('#rejectForm').modal('show');
  248. document.getElementById("userid").value = list.userId;
  249. document.getElementById("name").value = list.name;
  250. document.getElementById("mobile").value = list.mobileNo;
  251. document.getElementById("email").value = list.email;
  252. document.getElementById("street").value = list.street;
  253. document.getElementById("area").value = list.area;
  254. document.getElementById("location").value = list.location;
  255. document.getElementById("pincode").value = list.pinCode;
  256. document.getElementById("usertype").value = list.usertype;
  257. document.getElementById("userstatus").value = list.userstatus;
  258. document.getElementById("governmentId").value=list.governmentId
  259. document.getElementById("department").value=list.department
  260. if (list.userHistories && list.userHistories.length > 0) {
  261. // Get the latest comment from the last element in userHistories
  262. var latestComment = list.userHistories[list.userHistories.length - 1].comments;
  263. document.getElementById("userreject").value = latestComment;
  264. } else {
  265. document.getElementById("userreject").value = "No comments available";
  266. }
  267. //document.getElementById("userreject").value =list.userHistories[userHistories.length-1].comments;
  268. if (list.usertype === 'GCC_EMPLOYEE' || list.usertype === 'PENSIONER') {
  269. idField.style.display = 'block';
  270. departmentField.style.display = 'block';
  271. } else {
  272. idField.style.display = 'none';
  273. departmentField.style.display = 'none';
  274. }
  275. }
  276. function accept() {
  277. let id = document.getElementById("userid").value;
  278. Swal.fire({
  279. title: 'Do you want to Accept this User ?',
  280. showDenyButton: true,
  281. showCancelButton: true,
  282. confirmButtonText: 'YES',
  283. denyButtonText: `NO`,
  284. }).then((result) => {
  285. /* Read more about isConfirmed, isDenied below */
  286. if (result.isConfirmed) {
  287. $.ajax({
  288. type: "POST",
  289. url: '/victoriahallbooking/api/officer/updateApprovedStatus/' + id,
  290. data: {
  291. 'status': 'APPROVED',
  292. 'comments': 'Accepted',
  293. 'userId': id
  294. },
  295. success: function (data, textStatus, xhr) {
  296. if (xhr.status === 200) { // Check if the response status is OK
  297. Swal.fire(
  298. 'Done',
  299. 'Successfully Accepted to the ID:' + id,
  300. 'success'
  301. ).then(() => {
  302. location.reload();
  303. });
  304. } else {
  305. Swal.fire(
  306. 'Error',
  307. 'Failed to accept the user',
  308. 'error'
  309. );
  310. }
  311. },
  312. error: function (xhr, textStatus, errorThrown) {
  313. Swal.fire(
  314. 'Error',
  315. 'Failed to accept the user',
  316. 'error'
  317. );
  318. }
  319. });
  320. } else if (result.isDenied) {
  321. Swal.fire('Changes are not saved', '', 'info')
  322. }
  323. });
  324. }
  325. </script>
  326. </body>
  327. </html>