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.

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