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.

1039 lines
38 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. <style>
  5. .card-body table {
  6. width: 100%;
  7. padding: 100px;
  8. }
  9. .card-body th,
  10. td {
  11. padding: 8px;
  12. text-align: left;
  13. }
  14. .amount-cell {
  15. text-align: right;
  16. padding-right: 1rem;
  17. /* Adjust padding as needed */
  18. }
  19. .table {
  20. width: 100% !important;
  21. }
  22. </style>
  23. <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
  24. integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
  25. crossorigin="anonymous"></script>
  26. <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"
  27. integrity="sha384-vUDzXQ+PSziH/FUbe0YVEv7qEoRJRT5D02B1RWZC1yyP3+n6K8N7q0clmKf3nDOJ"
  28. crossorigin="anonymous"></script>
  29. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
  30. integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
  31. crossorigin="anonymous"></script>
  32. <body>
  33. <!-- Page Container -->
  34. <div id="page-container"
  35. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  36. <!-- Side Overlay aside (right)-->
  37. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  38. <!-- END Side Overlay (right)-->
  39. <!-- Sidebar Nav-->
  40. <nav th:replace="~{fragments/nav-admin :: nav}"></nav>
  41. <!-- END Sidebar -->
  42. <!-- Header -->
  43. <header th:replace="~{fragments/header-admin :: header}"></header>
  44. <!-- END Header -->
  45. <!-- Main Container -->
  46. <main id="main-container">
  47. <div class="content">
  48. <ul class="nav nav-tabs" id="myTab" role="tablist">
  49. <li class="nav-item">
  50. <a class="nav-link active" id="settlement-approved-tab" data-toggle="tab"
  51. href="#settlement-approved" role="tab" aria-controls="settlement-approved"
  52. aria-selected="true">Present Events</a>
  53. </li>
  54. <li class="nav-item">
  55. <a class="nav-link" id="cancelled-bookings-tab" data-toggle="tab" href="#cancelled-bookings"
  56. role="tab" aria-controls="cancelled-bookings" aria-selected="false">Past Bookings</a>
  57. </li>
  58. <li class="nav-item">
  59. <a class="nav-link" id="gcc-blocked-tab" data-toggle="tab" href="#gcc-blocked" role="tab"
  60. aria-controls="gcc-blocked" aria-selected="false">Future Events</a>
  61. </li>
  62. </ul>
  63. <div class="tab-content" id="myTabContent">
  64. <!-- Tab pane for Settlement Approved -->
  65. <div class="tab-pane fade show active" id="settlement-approved" role="tabpanel"
  66. aria-labelledby="settlement-approved-tab">
  67. <div class="block block-rounded">
  68. <div class="block-header block-header-default">
  69. <h3 class="block-title">Present Events</h3>
  70. </div>
  71. <div class="block-content p-0">
  72. <div class="p-sm-4 p-0">
  73. <div class="table-responsive">
  74. <table id="SettlementApprovedListTable"
  75. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  76. <thead class="thead-light">
  77. <tr>
  78. <!--<th class="text-center no-sort">S.No</th>
  79. <th class="text-center">Zone</th>
  80. <th class="text-center">Division</th>
  81. <th class="text-center" width="20%">Hall Name</th>
  82. <th class="text-center">User Name</th>
  83. <th class="text-center">User type</th>
  84. <th class="text-center" width="10%">Booking Date</th>
  85. <th class="text-center">Number of days</th>
  86. <th class="text-center">Reason for Booking</th>
  87. <th class="text-center">Caretaker Name/MobileNumber</th>
  88. <th class="text-center">Action</th>-->
  89. <th>Hall Name</th>
  90. <th>Booking Id</th>
  91. <th>Start Date</th>
  92. <th>End Date</th>
  93. <th>No of Days</th>
  94. <th>Starting Period</th>
  95. <th>Ending Period</th>
  96. <th>Actions</th>
  97. </tr>
  98. </thead>
  99. <tbody>
  100. <!-- Populate rows with Thymeleaf -->
  101. <tr th:each="booking, rowStat : ${presenteventslist}">
  102. <!--<td class="text-center" th:text="${rowStat.index + 1}"></td>
  103. <td class="text-center" th:text="${booking.hallDetails.zone}"></td>
  104. <td class="text-center" th:text="${booking.hallDetails.division}"></td>
  105. <td class="text-center" th:text="${booking.hallDetails.hallName}"></td>
  106. <td class="text-center" th:text="${booking.users.name}"></td>
  107. <td class="text-center" th:text="${booking.users.usertype}"></td>
  108. <td class="text-center" th:text="${booking.bookingDate}"></td>
  109. <td class="text-center" th:text="${booking.noOfDays}"></td>
  110. <td class="text-center" th:text="${booking.reason}"></td>
  111. <td class="text-center"
  112. th:text="${booking.hallDetails.hallInchargeName} + ' / ' + ${booking.hallDetails.hallInchargeMobno}">
  113. </td>-->
  114. <td th:text="${booking.hallDetails.hallName}"></td>
  115. <td th:text="${booking.bookingId}"></td>
  116. <td th:text="${booking.startDate}"></td>
  117. <td th:text="${booking.endDate}"></td>
  118. <td th:text="${booking.noOfDays}"></td>
  119. <td th:text="${booking.startingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  120. <td th:text="${booking.endingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  121. <td>
  122. <p>
  123. <span class="badge bg-warning" style="cursor: pointer;"
  124. th:onclick="pendingbooking([[${booking.bookingId}]])">View</span>
  125. </p>
  126. <p>
  127. <span type="button" class="btn btn-primary settlement"
  128. th:if="${booking.ebDetails != null and booking.settlement == null}"
  129. th:onclick="settleTheAmount([[${booking.bookingId}]])">Settlement</button>
  130. </p>
  131. <button type="button" class="btn btn-primary" th:if="${booking.ebDetails==null}"
  132. th:onclick="enterStartingReading([[${booking.bookingId}]], '[[${booking.hallDetails.ebNumber}]]')"
  133. id="ebDetails">EB</button>
  134. </td>
  135. </tr>
  136. </tbody>
  137. </table>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <!-- Tab pane for Cancelled Bookings Approved -->
  144. <div class="tab-pane fade" id="cancelled-bookings" role="tabpanel"
  145. aria-labelledby="cancelled-bookings-tab">
  146. <!-- Repeat similar structure for Cancelled Bookings Approved -->
  147. <div class="block block-rounded">
  148. <div class="block-header block-header-default">
  149. <h3 class="block-title">Past Events</h3>
  150. </div>
  151. <div class="block-content p-0">
  152. <div class="p-sm-4 p-0">
  153. <div class="table-responsive">
  154. <table id="cancelledApprovedListTable"
  155. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  156. <thead class="thead-light">
  157. <tr>
  158. <!--<th class="text-center no-sort">S.No</th>
  159. <th class="text-center">Booking Id</th>
  160. <th class="text-center" width="20%">Hall Name</th>
  161. <th class="text-center">User Name</th>
  162. <th class="text-center">User type</th>
  163. <th class="text-center" width="10%">Booking Date</th>
  164. <th class="text-center">Number of days</th>
  165. <th class="text-center">Reason for Booking</th>
  166. <th class="text-center">Caretaker Name/MobileNumber</th>
  167. <th class="text-center">Action</th>-->
  168. <th>Hall Name</th>
  169. <th>Booking Id</th>
  170. <th>Start Date</th>
  171. <th>End Date</th>
  172. <th>No of Days</th>
  173. <th>Starting Period</th>
  174. <th>Ending Period</th>
  175. <th>Actions</th>
  176. </tr>
  177. </thead>
  178. <tbody>
  179. <!-- Populate rows with Thymeleaf -->
  180. <tr th:each="booking, rowStat : ${pasteventslist}">
  181. <!--<td class="text-center" th:text="${rowStat.index + 1}"></td>
  182. <td class="text-center" th:text="${booking.bookingId}"></td>
  183. <td class="text-center" th:text="${booking.hallDetails.hallName}"></td>
  184. <td class="text-center" th:text="${booking.users.name}"></td>
  185. <td class="text-center" th:text="${booking.users.usertype}"></td>
  186. <td class="text-center" th:text="${booking.bookingDate}"></td>
  187. <td class="text-center" th:text="${booking.noOfDays}"></td>
  188. <td class="text-center" th:text="${booking.reason}"></td>
  189. <td class="text-center"
  190. th:text="${booking.hallDetails.hallInchargeName} + ' / ' + ${booking.hallDetails.hallInchargeMobno}">
  191. </td>-->
  192. <td th:text="${booking.hallDetails.hallName}"></td>
  193. <td th:text="${booking.bookingId}"></td>
  194. <td th:text="${booking.startDate}"></td>
  195. <td th:text="${booking.endDate}"></td>
  196. <td th:text="${booking.noOfDays}"></td>
  197. <td th:text="${booking.startingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  198. <td th:text="${booking.endingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  199. <td>
  200. <p>
  201. <span class="badge bg-warning" style="cursor: pointer;"
  202. th:onclick="pendingbooking([[${booking.bookingId}]])">View</span>
  203. </p>
  204. <p>
  205. <span type="button" class="btn btn-primary settlement"
  206. th:if="${booking.ebDetails != null and booking.settlement == null}"
  207. th:onclick="settleTheAmount([[${booking.bookingId}]])">Settlement</button>
  208. </p>
  209. <button type="button" class="btn btn-primary" th:if="${booking.ebDetails==null}"
  210. th:onclick="enterStartingReading([[${booking.bookingId}]], '[[${booking.hallDetails.ebNumber}]]')"
  211. id="ebDetails">EB</button>
  212. </td>
  213. </tr>
  214. </tbody>
  215. </table>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. <!-- Tab pane for GCC Blocked/Rejected Approved -->
  222. <div class="tab-pane fade" id="gcc-blocked" role="tabpanel" aria-labelledby="gcc-blocked-tab">
  223. <!-- Repeat similar structure for GCC Blocked/Rejected Approved -->
  224. <div class="block block-rounded">
  225. <div class="block-header block-header-default">
  226. <h3 class="block-title">Future Events</h3>
  227. </div>
  228. <div class="block-content p-0">
  229. <div class="p-sm-4 p-0">
  230. <div class="table-responsive">
  231. <table id="rejectedApprovedListTable"
  232. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  233. <thead class="thead-light">
  234. <tr>
  235. <!--<th class="text-center no-sort">S.No</th>
  236. <th class="text-center">Zone</th>
  237. <th class="text-center">Division</th>
  238. <th class="text-center" width="20%">Hall Name</th>
  239. <th class="text-center">User Name</th>
  240. <th class="text-center">User type</th>
  241. <th class="text-center" width="10%">Booking Date</th>
  242. <th class="text-center">Number of days</th>
  243. <th class="text-center">Reason for Booking</th>
  244. <th class="text-center">Caretaker Name/MobileNumber</th>
  245. <th class="text-center">Action</th>-->
  246. <th>Hall Name</th>
  247. <th>Booking Id</th>
  248. <th>Start Date</th>
  249. <th>End Date</th>
  250. <th>No of Days</th>
  251. <th>Starting Period</th>
  252. <th>Ending Period</th>
  253. <th>Actions</th>
  254. </tr>
  255. </thead>
  256. <tbody>
  257. <!-- Populate rows with Thymeleaf -->
  258. <tr th:each="booking, rowStat : ${futureeventslist}">
  259. <!--<td class="text-center" th:text="${rowStat.index + 1}"></td>
  260. <td class="text-center" th:text="${booking.hallDetails.zone}"></td>
  261. <td class="text-center" th:text="${booking.hallDetails.division}"></td>
  262. <td class="text-center" th:text="${booking.hallDetails.hallName}"></td>
  263. <td class="text-center" th:text="${booking.users.name}"></td>
  264. <td class="text-center" th:text="${booking.users.usertype}"></td>
  265. <td class="text-center" th:text="${booking.bookingDate}"></td>
  266. <td class="text-center" th:text="${booking.noOfDays}"></td>
  267. <td class="text-center" th:text="${booking.reason}"></td>
  268. <td class="text-center"
  269. th:text="${booking.hallDetails.hallInchargeName} + ' / ' + ${booking.hallDetails.hallInchargeMobno}">
  270. </td>-->
  271. <td th:text="${booking.hallDetails.hallName}"></td>
  272. <td th:text="${booking.bookingId}"></td>
  273. <td th:text="${booking.startDate}"></td>
  274. <td th:text="${booking.endDate}"></td>
  275. <td th:text="${booking.noOfDays}"></td>
  276. <td th:text="${booking.startingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  277. <td th:text="${booking.endingSlot == 1 ? 'Morning' : 'Evening'}"></td>
  278. <td>
  279. <p>
  280. <span class="badge bg-warning" style="cursor: pointer;"
  281. th:onclick="pendingbooking([[${booking.bookingId}]])">View</span>
  282. </p>
  283. </td>
  284. </tr>
  285. </tbody>
  286. </table>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </main>
  295. <!-- END Main Container -->
  296. <!-- Approved Bookingform-->
  297. <div class="modal fade backdrop" id="pendingBookingForm" data-backdrop="static" tabindex="-1" role="dialog"
  298. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  299. <div class="modal-dialog modal-lg" role="document">
  300. <div class="modal-content">
  301. <form id="ownform" onsubmit="return rejectsubmit();">
  302. <div class="block block-rounded block-themed block-transparent mb-0">
  303. <div class="block-header bg-primary-dark">
  304. <h3 class="block-title" id="2mtitle">Booking Information</h3>
  305. <div class="block-options">
  306. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  307. aria-label="Close">
  308. <i class="fa fa-fw fa-times"></i>
  309. </button>
  310. </div>
  311. </div>
  312. <div class="block-content row">
  313. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  314. <input type="hidden" class="form-control text-center" name="bookingid"
  315. id="bookingid" disabled />
  316. <div class="card-body">
  317. <table>
  318. <tr>
  319. <th colspan="10" style="background-color: #f2f2f2;">User Details</th>
  320. </tr>
  321. <tr>
  322. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Name:
  323. </th>
  324. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  325. id="td_userName"></td>
  326. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Mobile Number:
  327. </th>
  328. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  329. id="td_mobileNumber"></td>
  330. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Type:
  331. </th>
  332. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  333. id="td_usertype"></td>
  334. </tr>
  335. <tr>
  336. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Address:
  337. </th>
  338. <td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  339. id="td_useraddress"></td>
  340. </tr>
  341. </table>
  342. </div>
  343. </div>
  344. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  345. <input type="hidden" class="form-control text-center" name="bookingid"
  346. id="bookingid" disabled />
  347. <div class="card-body">
  348. <table>
  349. <tr>
  350. <th colspan="10" style="background-color: #f2f2f2;">Hall Details</th>
  351. </tr>
  352. <tr>
  353. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Hall Name:
  354. </th>
  355. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  356. id="td_hallName"></td>
  357. </tr>
  358. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Hall Address:</th>
  359. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  360. id="td_halladdress"></td>
  361. </tr>
  362. <tr>
  363. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Caretaker
  364. Name:</th>
  365. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  366. id="td_caretakername"></td>
  367. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Caretaker
  368. Mobile Number:</th>
  369. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  370. id="td_caretakermobileNumber"></td>
  371. </tr>
  372. </table>
  373. </div>
  374. </div>
  375. <div class="col-md-12 col-lg-12 col-sm-12">
  376. <input type="hidden" class="form-control text-center" name="settlementid"
  377. id="settlementid" disabled />
  378. <div class="card-body">
  379. <table>
  380. <tr>
  381. <th colspan="4" style="background-color: #f2f2f2;">Booking
  382. Details (Booking Id:-<span id="booking_id"
  383. style="color:blue"></span>)</th>
  384. </tr>
  385. <tr>
  386. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Booking Date:
  387. </th>
  388. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  389. id="td_bookingDate"></td>
  390. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Booking Status:
  391. </th>
  392. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  393. id="td_bookingStatus"></td>
  394. </tr>
  395. <tr>
  396. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Date:
  397. </th>
  398. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  399. id="td_startDate"></td>
  400. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Deposit
  401. Amount:</th>
  402. <td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
  403. id="td_depositeAmount"></td>
  404. </tr>
  405. <tr>
  406. <th style="padding: 0.45rem 0.45rem;font-weight: normal">END
  407. Date:</th>
  408. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  409. id="td_endDate"></td>
  410. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Hall Amount:
  411. </th>
  412. <td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
  413. id="td_hallAmount"></td>
  414. </tr>
  415. <tr>
  416. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Starting Slot:
  417. </th>
  418. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  419. id="td_startingSlot"></td>
  420. <th style="padding: 0.45rem 0.45rem;font-weight: normal">GST @18%:</th>
  421. <td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
  422. id="td_gst"></td>
  423. </tr>
  424. <tr>
  425. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
  426. </th>
  427. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  428. id="td_endingSlot"></td>
  429. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Total Amount:
  430. </th>
  431. <td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
  432. id="td_totalAmount"></td>
  433. </tr>
  434. </table>
  435. </div>
  436. </div>
  437. <div class="col-sm-12">
  438. <!--<label class="form-label">Documents:<span class="text-danger"></span></label>-->
  439. <div class="documents" id="documents"></div>
  440. </div>
  441. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  442. <input type="hidden" class="form-control text-center" name="bookingid"
  443. id="bookingid" disabled />
  444. <div class="card-body">
  445. <table>
  446. <tr>
  447. <th colspan="10" style="background-color: #f2f2f2;">Booking Payment
  448. Details</th>
  449. </tr>
  450. <tr>
  451. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Transaction
  452. ID:</th>
  453. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  454. id="td_transactionId"></td>
  455. </tr>
  456. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Amount Received:
  457. </th>
  458. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  459. id="td_payamountReceived"></td>
  460. </tr>
  461. <tr>
  462. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Transaction
  463. Status:</th>
  464. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  465. id="td_paymentStatus"></td>
  466. </tr>
  467. </table>
  468. </div>
  469. </div>
  470. </div>
  471. </div>
  472. <div class="block-content block-content-full text-end bg-body" id="mbutton2">
  473. <button type="button" class="btn btn-sm btn-alt-secondary"
  474. data-bs-dismiss="modal">Close</button>
  475. </div>
  476. </form>
  477. </div>
  478. </div>
  479. </div>
  480. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel"
  481. aria-hidden="true">
  482. <div class="modal-dialog modal-lg" role="document">
  483. <div class="modal-content">
  484. <div class="modal-header">
  485. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  486. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  487. <span aria-hidden="true">&times;</span>
  488. </button>
  489. </div>
  490. <div class="modal-body">
  491. <embed id="filePreview" src="" width="100%" height="600px">
  492. </div>
  493. <div class="modal-footer">
  494. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  495. </div>
  496. </div>
  497. </div>
  498. </div>
  499. <div class="modal fade backdrop" id="EBdestailsModal" tabindex="-1" role="dialog"
  500. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  501. <div class="modal-dialog modal-lg" role="document">
  502. <div class="modal-content">
  503. <div class="block block-rounded block-themed block-transparent mb-0">
  504. <div class="block-header bg-primary-dark">
  505. <h3 class="block-title">EB Details</h3>
  506. <div class="block-options">
  507. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  508. aria-label="Close">
  509. <i class="fa fa-fw fa-times"></i>
  510. </button>
  511. </div>
  512. </div>
  513. <div class="block-content row">
  514. <input type="hidden" class="form-control text-center" id="bookingId" name="bookingId"
  515. readonly>
  516. <div class="col-sm-6">
  517. <div class="form-group">
  518. <label for="ebNumber">Consumer Number<span class="required">*</span>:</label>
  519. <input type="text" class="form-control text-center" id="ebNumber" name="ebNumber"
  520. placeholder="EB Number" readonly>
  521. </div>
  522. </div>
  523. <div class="col-sm-6">
  524. <div class="form-group">
  525. <label for="startingReading">Starting Reading<span
  526. class="required">*</span>:</label>
  527. <input type="text" class="form-control text-center" id="startingReading"
  528. name="startingReading">
  529. </div>
  530. </div>
  531. <div class="col-sm-6">
  532. <div class="form-group">
  533. <label for="startingReadingimage">Starting Reading Image<span
  534. class="required"></span>:</label>
  535. <input type="file" class="form-control text-center startreading-image" id="startingReadingimage"
  536. name="startingReadingimage">
  537. </div>
  538. </div>
  539. </div>
  540. </div><br><br>
  541. <div class="modal-footer">
  542. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  543. <button type="button" class="btn btn-primary" id="submitEbDetails">Submit</button>
  544. </div>
  545. </div>
  546. </div>
  547. </div>
  548. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  549. <!-- END Footer -->
  550. </div>
  551. <div th:replace="~{fragments/resetpassword :: div}"></div>
  552. <script th:replace="~{fragments/loginscript :: script}"></script>
  553. <script>
  554. $(document).ready(function () {
  555. $('#myTab a').on('click', function (e) {
  556. e.preventDefault();
  557. $(this).tab('show');
  558. });
  559. })
  560. $(document).ready(function () {
  561. // DataTables buttons configuration
  562. var buttons = [
  563. {
  564. extend: 'pageLength',
  565. className: 'btn btn-primary'
  566. },
  567. {
  568. title: 'Data export',
  569. extend: 'copyHtml5',
  570. text: 'Copy',
  571. className: 'btn btn-primary',
  572. id: 'copyBtn'
  573. },
  574. {
  575. extend: 'excelHtml5',
  576. text: 'Excel',
  577. className: 'btn btn-primary',
  578. id: 'excelBtn'
  579. },
  580. {
  581. extend: 'csvHtml5',
  582. text: 'CSV',
  583. className: 'btn btn-primary',
  584. id: 'csvBtn'
  585. },
  586. {
  587. extend: 'pdfHtml5',
  588. text: 'PDF',
  589. className: 'btn btn-primary',
  590. id: 'pdfBtn'
  591. }
  592. ];
  593. // Initialize DataTable for each tab on tab shown event
  594. $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  595. var targetTable = $(e.target).attr('href'); // activated tab
  596. $(targetTable).find('.dataTable').DataTable().columns.adjust();
  597. });
  598. // Initialize DataTable for Settlement Approved tab
  599. $('#SettlementApprovedListTable').DataTable({
  600. dom: 'Bftip',
  601. columnDefs: [
  602. {targets: 'no-sort', orderable: false}
  603. ],
  604. lengthMenu: [
  605. [50, 100, 200, 500, -1],
  606. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  607. ],
  608. buttons: buttons,
  609. responsive: true,
  610. searching: true,
  611. select: false,
  612. processing: false,
  613. // Set width to 100%
  614. "autoWidth": true
  615. });
  616. // Initialize DataTable for Cancelled Bookings Approved tab
  617. $('#cancelledApprovedListTable').DataTable({
  618. dom: 'Bftip',
  619. columnDefs: [
  620. {targets: 'no-sort', orderable: false}
  621. ],
  622. lengthMenu: [
  623. [50, 100, 200, 500, -1],
  624. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  625. ],
  626. buttons: buttons,
  627. responsive: true,
  628. searching: true,
  629. select: false,
  630. processing: false,
  631. // Set width to 100%
  632. "autoWidth": true
  633. });
  634. // Initialize DataTable for GCC Blocked/Rejected Approved tab
  635. $('#rejectedApprovedListTable').DataTable({
  636. dom: 'Bftip',
  637. columnDefs: [
  638. {targets: 'no-sort', orderable: false}
  639. ],
  640. lengthMenu: [
  641. [50, 100, 200, 500, -1],
  642. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  643. ],
  644. buttons: buttons,
  645. responsive: true,
  646. searching: true,
  647. select: false,
  648. processing: false,
  649. // Set width to 100%
  650. "autoWidth": true
  651. });
  652. });
  653. function pendingbooking(bookingId) {
  654. $.ajax({
  655. type: "GET",
  656. url: '/communityhall/api/officer/getBookingDetails',
  657. data: {
  658. 'bookingsId': bookingId
  659. },
  660. success: function (x) {
  661. //console.log(x);
  662. showBookingInfo(x);
  663. }
  664. });
  665. }
  666. function showBookingInfo(list) {
  667. $('#pendingBookingForm').modal({
  668. backdrop: 'static',
  669. keyboard: false
  670. });
  671. $('#pendingBookingForm').modal('show');
  672. var todaydate = new Date().toISOString().split('T')[0];
  673. // Convert startDate to YYYY-MM-DD format if needed
  674. var startDate = new Date(list.startDate).toISOString().split('T')[0]; // Ensure this is in the correct format
  675. if (startDate > todaydate) {
  676. $('#reasondetails').show();
  677. $('#rejectbutton').show();
  678. } else {
  679. $('#reasondetails').hide();
  680. $('#rejectbutton').hide();
  681. }
  682. document.getElementById("td_userName").innerHTML = list.users.name;
  683. document.getElementById("td_mobileNumber").innerHTML = list.users.mobileNo;
  684. document.getElementById("td_usertype").innerHTML = list.users.usertype;
  685. document.getElementById("bookingid").value = list.bookingId;
  686. var userDetails = list.users;
  687. var userDetailsString =
  688. userDetails.doorNo + ", " +
  689. userDetails.street + ", " +
  690. userDetails.area + ", " +
  691. userDetails.location + "- " +
  692. userDetails.pinCode;
  693. document.getElementById("td_useraddress").innerHTML = userDetailsString;
  694. document.getElementById("td_hallName").innerHTML = list.hallDetails.hallName;
  695. var hallDetails = list.hallDetails;
  696. var hallDetailsString =
  697. hallDetails.doorNo + ", " +
  698. hallDetails.street + ", " +
  699. hallDetails.area + ", " +
  700. hallDetails.city + "- " +
  701. hallDetails.pinCode;
  702. document.getElementById("td_halladdress").innerHTML = hallDetailsString;
  703. document.getElementById("td_caretakername").innerHTML = list.hallDetails.hallInchargeName;
  704. document.getElementById("td_caretakermobileNumber").innerHTML = list.hallDetails.hallInchargeMobno;
  705. document.getElementById("td_bookingDate").innerHTML = list.bookingDate;
  706. document.getElementById("td_depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
  707. document.getElementById("td_hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2);
  708. document.getElementById("td_totalAmount").innerHTML = '₹ ' + parseFloat(list.amountReceived).toFixed(2);
  709. var gstcl = (list.hallAmount * (list.hallDetails.gst/100));
  710. var formattedGst = gstcl.toFixed(2);
  711. document.getElementById("td_gst").innerHTML = '₹ ' + formattedGst;
  712. document.getElementById("td_startDate").innerHTML = list.startDate;
  713. document.getElementById("td_endDate").innerHTML = list.endDate;
  714. document.getElementById("booking_id").innerHTML = list.bookingId;
  715. function getTimeSlot(slotValue) {
  716. //console.log("Slot Value in getTimeSlot function:", slotValue);
  717. var timeSlot;
  718. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  719. if (trimmedSlotValue === '1') {
  720. timeSlot = 'Morning';
  721. } else if (trimmedSlotValue === '2') {
  722. timeSlot = 'Evening';
  723. } else {
  724. timeSlot = 'Unknown';
  725. }
  726. //console.log("Time Slot:", timeSlot);
  727. return timeSlot;
  728. }
  729. document.getElementById("td_startingSlot").innerHTML = getTimeSlot(list.startingSlot);
  730. document.getElementById("td_endingSlot").innerHTML = getTimeSlot(list.endingSlot);
  731. document.getElementById("td_bookingStatus").innerHTML = list.bookingStatus;
  732. document.getElementById("td_transactionId").innerHTML = list.payments.transactionId;
  733. document.getElementById("td_payamountReceived").innerHTML = '₹ ' + list.payments.amountReceived;
  734. document.getElementById("td_paymentStatus").innerHTML = list.payments.paymentStatus;
  735. showReasonDocuments(list);
  736. }
  737. function showReasonDocuments(list) {
  738. $.ajax({
  739. type: "GET",
  740. url: '/communityhall/api/officer/getReasonByName',
  741. data: {
  742. 'reasonName': list.reason
  743. },
  744. success: function (x) {
  745. //console.log(x);
  746. showReasonWithDocument(x, list);
  747. }
  748. });
  749. }
  750. // Display booking documents
  751. function showReasonWithDocument(reasonData, list) {
  752. var reasonDocumentData = reasonData.reasonDocumentMasterList;
  753. var bookingDocumentsList = list.bookingDocumentsList;
  754. const reasonFieldsContainer = $('#documents');
  755. reasonFieldsContainer.empty();
  756. // Create a responsive table container
  757. var tableResponsiveDiv = $('<div>').addClass('table-responsive');
  758. // Create the table with Bootstrap classes and custom styles
  759. var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
  760. 'width': '100%',
  761. 'height': 'auto',
  762. 'border': '1px solid black'
  763. });
  764. // Create the table header (thead)
  765. var thead = $('<thead>').appendTo(table);
  766. var headerRow = $('<tr>').appendTo(thead);
  767. $('<th>').attr('colspan', '3').text('Document Details').css({
  768. 'color': 'black',
  769. 'font-weight': 'bold',
  770. 'background-color': '#f2f2f2',
  771. 'padding': '0.45rem 0.45rem'
  772. }).appendTo(headerRow);
  773. // Create header row for columns
  774. var columnHeadersRow = $('<tr>').appendTo(thead);
  775. $('<th>').text('S.No').appendTo(columnHeadersRow);
  776. $('<th>').text('Required Info').appendTo(columnHeadersRow);
  777. $('<th>').text('Required Documents').appendTo(columnHeadersRow);
  778. // Create the table body (tbody)
  779. var tbody = $('<tbody>').appendTo(table);
  780. // Iterate through the documents list and populate rows
  781. for (var i = 0; i < bookingDocumentsList.length; i++) {
  782. (function (index) {
  783. var row = $('<tr>').appendTo(tbody);
  784. $('<td>').text(index + 1).appendTo(row);
  785. $('<td>').text(reasonDocumentData[index].fieldName + ': ' + bookingDocumentsList[index].name).appendTo(row);
  786. // Create a link to view document image
  787. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text(reasonDocumentData[index].docFieldName).on('click', function () {
  788. showDocumentImage(bookingDocumentsList[index].bookingDocUrl);
  789. });
  790. $('<td>').append(viewLink).appendTo(row);
  791. })(i);
  792. }
  793. // Append table to the responsive container
  794. tableResponsiveDiv.append(table);
  795. // Append table to the container in the DOM
  796. reasonFieldsContainer.append(tableResponsiveDiv);
  797. }
  798. function showDocumentImage(fileURL) {
  799. //console.log(fileURL);
  800. openFileModal(fileURL);
  801. }
  802. // Event delegation for dynamically added elements
  803. $(document).on('click', '.view-document', function () {
  804. const fileURL = $(this).data('url');
  805. openFileModal(fileURL);
  806. });
  807. function openFileModal(fileURL) {
  808. $('#filePreview').attr('src', fileURL);
  809. $('#fileModal').modal('show');
  810. }
  811. function accept() {
  812. let id = document.getElementById("bookingid").value;
  813. Swal.fire({
  814. title: 'Do you want to Accept this User ?',
  815. showDenyButton: true,
  816. showCancelButton: true,
  817. confirmButtonText: 'YES',
  818. denyButtonText: 'NO',
  819. }).then((result) => {
  820. /* Read more about isConfirmed, isDenied below */
  821. if (result.isConfirmed) {
  822. $.ajax({
  823. type: "POST",
  824. url: '/communityhall/api/officer/updateBookingApproved/' + id,
  825. data: {
  826. 'status': 'APPROVED',
  827. 'comments': 'Accepted',
  828. 'bookingId': id
  829. },
  830. success: function (data, textStatus, xhr) {
  831. if (xhr.status === 200) { // Check if the response status is OK
  832. Swal.fire(
  833. 'Done',
  834. 'Successfully Accepted to the ID:' + id,
  835. 'success'
  836. ).then(() => {
  837. location.reload();
  838. });
  839. } else {
  840. Swal.fire(
  841. 'Error',
  842. 'Failed to accept the user',
  843. 'error'
  844. );
  845. }
  846. },
  847. error: function (xhr, textStatus, errorThrown) {
  848. Swal.fire(
  849. 'Error',
  850. 'Failed to accept the user',
  851. 'error'
  852. );
  853. }
  854. });
  855. } else if (result.isDenied) {
  856. Swal.fire('Changes are not saved', '', 'info')
  857. }
  858. });
  859. }
  860. function rejectsubmit() {
  861. let id = document.getElementById("bookingid").value;
  862. let reason = document.getElementById("reason").value.trim();
  863. let reasontype = document.getElementById("reasontype").value;
  864. // Check if reason is empty only when rejecting
  865. if (reason === "" || reason.length === 0) {
  866. document.getElementById("reasonValidationText").style.display = "block";
  867. return false; // Prevent form submission
  868. } else {
  869. document.getElementById("reasonValidationText").style.display = "none";
  870. }
  871. Swal.fire({
  872. title: 'Do you want to Reject this User ?',
  873. showDenyButton: true,
  874. showCancelButton: true,
  875. confirmButtonText: 'YES',
  876. denyButtonText: 'NO',
  877. }).then((result) => {
  878. /* Read more about isConfirmed, isDenied below */
  879. if (result.isConfirmed) {
  880. $.ajax({
  881. type: "POST",
  882. url: '/communityhall/api/officer/updateBookingReject/' + id,
  883. data: {
  884. 'status': 'REJECTED',
  885. 'comments': reason,
  886. 'bookingId': id,
  887. 'reasontype': reasontype
  888. },
  889. success: function (data, textStatus, xhr) {
  890. //console.log("Rejection successful");
  891. if (xhr.status === 200) { // Check if the response status is OK
  892. Swal.fire(
  893. 'Done',
  894. 'Successfully Rejected to the ID:' + id,
  895. 'success'
  896. ).then(() => {
  897. location.reload();
  898. });
  899. } else {
  900. Swal.fire(
  901. 'Error',
  902. 'Failed to reject the user',
  903. 'error'
  904. );
  905. }
  906. },
  907. error: function (xhr, textStatus, errorThrown) {
  908. console.error("Error:", errorThrown);
  909. Swal.fire(
  910. 'Error',
  911. 'Failed to reject the user',
  912. 'error'
  913. );
  914. }
  915. });
  916. } else if (result.isDenied) {
  917. Swal.fire('Changes are not saved', '', 'info')
  918. }
  919. });
  920. return false; // Prevent form submission
  921. }
  922. function enterStartingReading(bookingId, ebNumber) {
  923. $('#bookingId').val(bookingId);
  924. $('#ebNumber').val(ebNumber);
  925. $('#EBdestailsModal').modal('show');
  926. }
  927. $(document).ready(function () {
  928. $("#submitEbDetails").click(function () {
  929. var bookid = parseInt($("#bookingId").val());
  930. // console.log("bookid = "+ bookid)
  931. var startingReading = $("#startingReading").val();
  932. // console.log("startingReading = "+ startingReading)
  933. var startingReadingimage = $("#startingReadingimage")[0].files[0]; // Get the file
  934. var formData = new FormData();
  935. formData.append("bookingId", bookid);
  936. formData.append("startingReading", startingReading);
  937. formData.append("startingReadingimage", startingReadingimage);
  938. $.ajax({
  939. type: "POST",
  940. url: "/communityhall/careTaker/api/saveEbDetails",
  941. data: formData,
  942. contentType: false, // Prevent jQuery from setting content type
  943. processData: false, // Prevent jQuery from processing the data
  944. success: function (response) {
  945. $("#EBdestailsModal").modal('hide');
  946. // Show SweetAlert success message
  947. Swal.fire({
  948. title: 'Success!',
  949. text: 'EB details saved successfully.',
  950. icon: 'success',
  951. confirmButtonText: 'OK'
  952. }).then(function() {
  953. // Reload the page after the alert is dismissed
  954. location.reload();
  955. });
  956. },
  957. error: function (xhr, status, error) {
  958. console.error(xhr.responseText);
  959. alert("Error occurred while saving EbDetails.");
  960. }
  961. });
  962. });
  963. });
  964. document.getElementById('EBdetailsModal').addEventListener('hide.bs.modal', function () {
  965. // Clear the startingReading input field
  966. document.getElementById('startingReading').value = '';
  967. // Clear the startingReadingimage file input field
  968. document.getElementById('startingReadingimage').value = '';
  969. });
  970. function settleTheAmount(bookingId) {
  971. window.location.href = '/communityhall/admin/raisesettlement?bookingId=' + bookingId;
  972. }
  973. </script>
  974. </body>
  975. </html>