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.

2726 lines
140 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. <meta charset="ISO-8859-1">
  5. <!-- Include DataTables CSS -->
  6. </head>
  7. <style>
  8. .block-content {
  9. padding-bottom: 10px;
  10. }
  11. .small-input {
  12. width: 150px;
  13. /* Adjust the width as needed */
  14. }
  15. .small-table th,
  16. .small-table td {
  17. font-size: 14px;
  18. /* Adjust font size as needed */
  19. }
  20. /* Reduce padding for table cells */
  21. .small-table td,
  22. .small-table th {
  23. padding: 5px;
  24. /* Adjust padding as needed */
  25. }
  26. .card-body table {
  27. width: 100%;
  28. padding: 100px;
  29. }
  30. .card-body th,
  31. td {
  32. padding: 8px;
  33. text-align: left;
  34. }
  35. .amount-cell {
  36. text-align: right;
  37. padding-right: 1rem;
  38. /* Adjust padding as needed */
  39. }
  40. .table {
  41. width: 100% !important;
  42. }
  43. .hidden {
  44. display: none;
  45. }
  46. .modal-fullscreen-custom {
  47. max-width: 98% !important;
  48. width: 98%;
  49. margin: 0 auto;
  50. }
  51. /* Ensure second modal is on top of the first modal */
  52. .modal-backdrop.show:nth-of-type(2) {
  53. z-index: 1055 !important; /* slightly above the first modal */
  54. }
  55. #showBookingDetails.modal {
  56. z-index: 1060 !important; /* higher than .modal-backdrop */
  57. }
  58. </style>
  59. <body>
  60. <!-- Page Container -->
  61. <div id="page-container"
  62. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  63. <!-- Side Overlay aside (right)-->
  64. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  65. <!-- END Side Overlay (right)-->
  66. <!-- Sidebar Nav-->
  67. <nav th:replace="~{fragments/nav-admin :: nav}"></nav>
  68. <!-- END Sidebar -->
  69. <!-- Header -->
  70. <header th:replace="~{fragments/header-admin :: header}"></header>
  71. <!-- END Header -->
  72. <!-- Main Container -->
  73. <main id="main-container">
  74. <!-- Page Content -->
  75. <!-- Card Container -->
  76. <div class="content">
  77. <div class="block block-rounded">
  78. <form id="myForm" th:action="@{/communityhall/admin/getReport}" onsubmit="return validateme()"
  79. method="post">
  80. <div class="block-header bg-primary text-white">
  81. <h3 class="block-title">Community Hall Reports</h3>
  82. </div>
  83. <div class="block-content">
  84. <div class="row">
  85. <div class="col-sm-3 mb-2">
  86. <label class="form-label" for="fromdate">From:<span
  87. class="text-danger">*</span></label> <input type="date"
  88. th:value="${fromdate}"
  89. class="form-control" name="FromDate"
  90. id="fromdate"
  91. placeholder="From Date"
  92. required="required"
  93. data-date-format="yyyy-mm-dd"/>
  94. </div>
  95. <div class="col-sm-3 mb-2">
  96. <label class="form-label" for="todate">To:<span class="text-danger">*</span></label>
  97. <input type="date" th:value="${todate}" class="form-control" name="ToDate"
  98. id="todate" placeholder="To Date" required="required"
  99. data-date-format="yyyy-mm-dd"/>
  100. </div>
  101. <div class="col-sm-3 mb-2">
  102. <label class="form-label" for="request">Get Info:<span
  103. class="text-danger">*</span></label>
  104. <select type="text" class="form-control text-center" id="request" name="request"
  105. onchange="myRequest()" required>
  106. <option value="">Select</option>
  107. <option value="1" th:selected="${request=='1'}">Users</option>
  108. <option value="2" th:selected="${request=='2'}">Booking Details</option>
  109. <option value="3" th:selected="${request=='3'}">Payment Info</option>
  110. <option value="8" th:selected="${request=='8'}">Extra Payments Info</option>
  111. <option value="4" th:selected="${request=='4'}">Users Booking List</option>
  112. <option value="5" th:selected="${request=='5'}">Hall Booking List</option>
  113. <option value="6" th:selected="${request=='6'}">Refund Details</option>
  114. <option value="7" th:selected="${request=='7'}">Total Count</option>
  115. <option value="9" th:selected="${request=='9'}">Counter Details</option>
  116. <option value="10" th:selected="${request=='10'}">Review Report</option>
  117. </select>
  118. </div>
  119. <div class="col-sm-3 mb-2" id="bookingcountbasedonDropdown" style="display: none;">
  120. <label class="form-label" for="basedon">Based On: <span
  121. class="text-danger">*</span></label>
  122. <select class="form-control text-center" id="basedon" name="basedon"
  123. th:value="${basedon}">
  124. <option value="">Select</option>
  125. <option value="zone" th:selected="${basedon == 'zone'}">Zone
  126. </option>
  127. <option value="division" th:selected="${basedon == 'division'}">Division
  128. </option>
  129. </select>
  130. <span id="basedonError" class="text-danger"></span>
  131. </div>
  132. <!-- UsersDropdown2 -->
  133. <div class="col-sm-3 mb-2" id="userDropdown2" style="display: none;">
  134. <label class="form-label" for="usertype">User Type: </label>
  135. <select class="form-control text-center" id="usertype" name="usertype"
  136. th:value="${usertype}">
  137. <option value="">Select User Type</option>
  138. <option value="PENSIONER" th:selected="${usertype == 'PENSIONER'}">PENSIONER
  139. </option>
  140. <option value="GCC_EMPLOYEE" th:selected="${usertype == 'GCC_EMPLOYEE'}">GCC
  141. EMPLOYEE
  142. </option>
  143. <option value="COUNCILLOR" th:selected="${usertype == 'COUNCILLOR'}">COUNCILLOR
  144. </option>
  145. <option value="PUBLIC" th:selected="${usertype == 'PUBLIC'}">PUBLIC</option>
  146. <!-- Add more options as needed -->
  147. </select>
  148. </div>
  149. <!-- UsersDropdown1 -->
  150. <div class="col-sm-3 mb-2" id="userDropdown1" style="display: none;">
  151. <label class="form-label" for="userstatus">User Status: </label>
  152. <select class="form-control text-center" id="userstatus" name="userstatus"
  153. th:value="${userstatus}">
  154. <option value="">Select a User Status</option>
  155. <option value="PENDING" th:selected="${userstatus == 'PENDING'}">PENDING
  156. </option>
  157. <option value="APPROVED" th:selected="${userstatus == 'APPROVED'}">APPROVED
  158. </option>
  159. <option value="REJECTED" th:selected="${userstatus == 'REJECTED'}">REJECTED
  160. </option>
  161. <!-- Add more options as needed -->
  162. </select>
  163. </div>
  164. <!-- bookingDetailsDropdown1 -->
  165. <div class="col-sm-3 mb-2" id="bookingDetailsDropdown1" style="display: none;">
  166. <label class="form-label" for="bookingId">Booking Id: </label>
  167. <input type="number" class="form-control" id="bookingId" name="bookingId"
  168. th:value="${bookingId}" placeholder="BookingId">
  169. </div>
  170. <div class="col-sm-3 mb-2" id="zoneDropdown" style="display: none;">
  171. <label class="form-label" for="zone1">Select Zone: </label>
  172. <select class="form-select custom-select" name="zone1" id="zone1">
  173. <option value="ALL">--Select Zone--</option>
  174. <option th:each="zone : ${zones}" th:value="${zone}" th:text="${zone}"
  175. th:selected="${zone == selectedZone}"></option>
  176. </select>
  177. </div>
  178. <div class="col-sm-3 mb-2 hidden" id="divisionContainer" style="display: none;">
  179. <label class="form-label" for="division1">Select division: </label>
  180. <select class="form-select custom-select" name="division1" id="division1">
  181. <option value="ALL">--Select division--</option>
  182. <option th:each="division : ${divisions}" th:value="${division}"
  183. th:text="${division}" th:selected="${division == selectedDivision}">
  184. </option>
  185. </select>
  186. </div>
  187. <div class="col-sm-3 mb-2 hidden" id="hallContainer" style="display: none;">
  188. <label class="form-label" for="hall1">Select Hall: </label>
  189. <select class="form-select custom-select" name="hall1" id="hall1">
  190. <option value="1000">--Select Hall--</option>
  191. <option th:each="hall : ${halls}" th:value="${hall.id}" th:text="${hall.name}"
  192. th:selected="${hall.id == selectedHall}"></option>
  193. </select>
  194. </div>
  195. <!-- bookingDetailsDropdown 3-->
  196. <div class="col-sm-3 mb-2" id="bookingDetailsDropdown3" style="display: none;">
  197. <label class="form-label" for="filterby">Filter by:</label>
  198. <select class="form-control text-center" id="filterby" name="filterby"
  199. th:value="${filterby}">
  200. <option value="">Select Filterby</option>
  201. <option value="1" th:selected="${filterby == '1'}">Booking Date</option>
  202. <option value="2" th:selected="${filterby == '2'}">Event Date</option>
  203. <!-- Add more options as needed -->
  204. </select>
  205. </div>
  206. <!-- bookingDetailsDropdown2 -->
  207. <div class="col-sm-3 mb-2" id="bookingDetailsDropdown2" style="display: none;">
  208. <label class="form-label" for="bookingStatus">Booking Status: </label>
  209. <select class="form-control text-center" id="bookingStatus" name="bookingStatus"
  210. th:value="${bookingStatus}">
  211. <option value="">Select Booking Status</option>
  212. <option value="PENDING" th:selected="${bookingStatus == 'PENDING'}">PENDING
  213. </option>
  214. <option value="APPROVED" th:selected="${bookingStatus == 'APPROVED'}">APPROVED
  215. </option>
  216. <option value="REJECTED" th:selected="${bookingStatus == 'REJECTED'}">REJECTED
  217. </option>
  218. <option value="CANCELED" th:selected="${bookingStatus == 'CANCELED'}">CANCELLED
  219. </option>
  220. <option value="COMPLETED" th:selected="${bookingStatus == 'COMPLETED'}">COMPLETED
  221. </option>
  222. <option value="PAYMENT_FAILURE"
  223. th:selected="${bookingStatus == 'PAYMENT_FAILURE'}">PAYMENT_FAILURE
  224. </option>
  225. <option value="GCC_BLOCKED" th:selected="${bookingStatus == 'GCC_BLOCKED'}">
  226. GCC_BLOCKED
  227. </option>
  228. <option value="REFUNDED" th:selected="${bookingStatus == 'REFUNDED'}">REFUNDED
  229. </option>
  230. <option value="WAITING_FOR_NOC" th:selected="${bookingStatus == 'WAITING_FOR_NOC'}">
  231. WAITING FOR NOC
  232. </option>
  233. <option value="WAITING_FOR_NOC_APPROVAL"
  234. th:selected="${bookingStatus == 'WAITING_FOR_NOC_APPROVAL'}">WAITING FOR NOC
  235. APPROVAL
  236. </option>
  237. </select>
  238. </div>
  239. <!--Payment Dropdown -->
  240. <div class="col-sm-3" id="paymentInfoDropdown1" style="display: none;">
  241. <label class="form-label" for="paymentStatus">Payment Status:</label>
  242. <select class="form-control text-center" id="paymentStatus" name="paymentStatus"
  243. th:value="${paymentStatus}">
  244. <option value="">Select Payment Status</option>
  245. <option value="SUCCESS" th:selected="${paymentStatus == 'SUCCESS'}">SUCCESS</option>
  246. <option value="NOT COMPLETED" th:selected="${paymentStatus == 'NOT COMPLETED'}">NOT
  247. COMPLETED
  248. </option>
  249. </select>
  250. </div>
  251. <div class="col-sm-3 mb-2" id="refundDetailsDropdown" style="display: none;">
  252. <label class="form-label" for="refundStatus">Refund Status: </label>
  253. <select class="form-control text-center" id="refundStatus" name="refundStatus"
  254. th:value="${refundStatus}">
  255. <option value="">Select Refund Status</option>
  256. <option value="WAITING" th:selected="${refundStatus == 'WAITING'}">WAITING
  257. </option>
  258. <option value="APPROVED" th:selected="${refundStatus == 'APPROVED'}">APPROVED
  259. </option>
  260. <option value="INITIATED" th:selected="${refundStatus == 'INITIATED'}">INITIATED
  261. </option>
  262. <option value="REJECTED" th:selected="${refundStatus == 'REJECTED'}">REJECTED
  263. </option>
  264. <option value="COMPLETED" th:selected="${refundStatus == 'COMPLETED'}">COMPLETED
  265. </option>
  266. <option value="NA" th:selected="${refundStatus == 'NA'}">NA
  267. </option>
  268. <option value="CLOSED" th:selected="${refundStatus == 'CLOSED'}">CLOSED
  269. </option>
  270. <option value="FAILURE" th:selected="${refundStatus == 'FAILURE'}">FAILURE
  271. </option>
  272. <!-- Add more options as needed -->
  273. </select>
  274. </div>
  275. <div class="col-sm-3 mb-2" id="counterreportDropdown" style="display: none;">
  276. <label class="form-label" for="reporttype">Report Type: <span
  277. class="text-danger">*</span></label>
  278. <select class="form-control text-center" id="reporttype" name="reporttype"
  279. th:value="${reporttype}">
  280. <option value="">Select</option>
  281. <option value="abstract" th:selected="${reporttype == 'abstract'}">Abstract
  282. </option>
  283. <option value="detailed" th:selected="${reporttype == 'detailed'}">Detailed Report
  284. </option>
  285. </select>
  286. <span id="reportTypeError" class="text-danger"></span>
  287. </div>
  288. <div class="col-sm-3">
  289. <br>
  290. <button type="submit" class="btn btn-sm btn-primary mt-2" name="submit"
  291. id="submit">Submit
  292. </button>
  293. <button class="btn btn-danger mt-2" onclick="resetDate()" name="reset"
  294. type="reset">Reset
  295. </button>
  296. </div>
  297. </div>
  298. </div>
  299. </form>
  300. </div>
  301. <div class="table-responsive" id="usertable" th:if="${request}==1">
  302. <table id="requestTable1" class="table table-striped table-bordered table-hover dataTable"
  303. role="grid" width="99.5%">
  304. <thead class="thead-dark">
  305. <tr role="row">
  306. <th>S.No</th>
  307. <th width="130px">User Id</th>
  308. <th>Name</th>
  309. <th>Mobile</th>
  310. <th>Address</th>
  311. <th>UserType</th>
  312. <th>UserStatus</th>
  313. </tr>
  314. </thead>
  315. <tr th:each="user, iterStat : ${users}">
  316. <td th:text="${iterStat.count}">0</td>
  317. <td th:text="${user.userId}"></td>
  318. <td th:text="${user.name}"></td>
  319. <td th:text="${user.mobileNo}"></td>
  320. <td
  321. th:text="${user.DoorNo + ', ' + user.Street + ', ' + user.Area + ', ' + user.Location + ', ' + user.PinCode}">
  322. </td>
  323. <td th:text="${user.usertype}"></td>
  324. <td th:text="${user.userstatus}"></td>
  325. </tr>
  326. </table>
  327. </div>
  328. <div class="table-responsive" id="Bookingtable" th:if="${request}==2">
  329. <table id="requestTable2" class="table table-striped table-bordered table-hover dataTable"
  330. role="grid" width="99.5%">
  331. <thead class="thead-dark">
  332. <tr role="row">
  333. <th>S.No</th>
  334. <th>Booking Id</th>
  335. <th>Booking Date</th>
  336. <th>Hall Name</th>
  337. <th>User Name</th>
  338. <th>Mobile</th>
  339. <th>Address</th>
  340. <th>User type</th>
  341. <th>Reason</th>
  342. <th>Startdate_Enddate</th>
  343. <th>Deposit Amount</th>
  344. <th>Hall Amount</th>
  345. <th>GST</th>
  346. <th>Amount Paid</th>
  347. <th>Booking Status</th>
  348. <th>Action</th>
  349. </tr>
  350. </thead>
  351. <tbody>
  352. <tr th:each="booking, iterStat : ${bookings}">
  353. <td th:text="${iterStat.count}">0</td>
  354. <td th:text="${booking[0]}"></td>
  355. <td th:text="${booking[1]}"></td>
  356. <td th:text="${booking[2]}"></td>
  357. <td th:text="${booking[3]}"></td>
  358. <td th:text="${booking[4]}"></td>
  359. <td th:text="${booking[5]}"></td>
  360. <td th:text="${booking[6]}"></td>
  361. <td th:text="${booking[7]}"></td>
  362. <td th:text="${booking[8] + ' to ' + booking[9]}"></td>
  363. <td th:text="${booking[10]}"></td>
  364. <td th:text="${booking[11]}"></td>
  365. <td th:text="${booking[12]}"></td>
  366. <td th:text="${(T(java.lang.Math).round(booking[13] * 100.0) / 100.0)}"></td>
  367. <!--<td th:text="${booking[10]}"></td>-->
  368. <td th:text="${booking[14]}"></td>
  369. <td>
  370. <p>
  371. <span class="badge bg-warning" style="cursor: pointer;"
  372. th:onclick="viewDetails([[${booking[0]}]])">View</span>
  373. </p>
  374. </td>
  375. </tr>
  376. </tbody>
  377. </table>
  378. </div>
  379. <div class="table-responsive" id="Paymenttable" th:if="${request}==3">
  380. <table id="requestTable3" class="table table-striped table-bordered table-hover dataTable"
  381. role="grid" width="99.5%">
  382. <thead class="thead-dark">
  383. <tr role="row">
  384. <th>S.No</th>
  385. <th>Booking Id</th>
  386. <th>Booking Date</th>
  387. <th>Hall Name</th>
  388. <th>User Name</th>
  389. <th>User type</th>
  390. <th>Transaction ID</th>
  391. <th>Payment Type</th>
  392. <th>Deposit Amount</th>
  393. <th>Hall Amount</th>
  394. <th>GST</th>
  395. <th>Amount received</th>
  396. <th>Reason</th>
  397. <th width="1000px">Start date & end Date</th>
  398. <th>status</th>
  399. </tr>
  400. </thead>
  401. <tr th:each="payment, iterStat : ${paymentLists}">
  402. <td th:text="${iterStat.count}">0</td>
  403. <td th:text="${payment[0]}"></td>
  404. <td th:text="${payment[1]}"></td>
  405. <td th:text="${payment[2]}"></td>
  406. <td th:text="${payment[3]}"></td>
  407. <td th:text="${payment[4]}"></td>
  408. <td th:text="${payment[5]}"></td>
  409. <td th:text="${payment[6]}"></td>
  410. <td th:text="${payment[7]}"></td>
  411. <td th:text="${payment[8]}"></td>
  412. <td th:text="${payment[9]}"></td>
  413. <td th:text="${payment[10]}"></td>
  414. <td th:text="${payment[11]}"></td>
  415. <td th:text="${payment[12] + ' to ' + payment[13]}" width="1000px"></td>
  416. <td th:text="${payment[14]}"></td>
  417. </tr>
  418. </table>
  419. </div>
  420. <div class="table-responsive" id="extraPaymenttable" th:if="${request}==8">
  421. <table id="requestTable8" class="table table-striped table-bordered table-hover dataTable"
  422. role="grid" width="99.5%">
  423. <thead class="thead-dark">
  424. <tr role="row">
  425. <th>S.No</th>
  426. <th>Booking Id</th>
  427. <th>Booking Date</th>
  428. <th>Hall Name</th>
  429. <th>User Name</th>
  430. <th>User type</th>
  431. <th>Transaction ID</th>
  432. <th>Payment Type</th>
  433. <th>Deposit Amount</th>
  434. <th>Hall Amount</th>
  435. <th>GST</th>
  436. <th>Amount received</th>
  437. <th>Reason</th>
  438. <th width="1000px">Start date & end Date</th>
  439. <th>status</th>
  440. </tr>
  441. </thead>
  442. <tr th:each="payment, iterStat : ${extrapaymentLists}">
  443. <td th:text="${iterStat.count}">0</td>
  444. <td th:text="${payment[0]}"></td>
  445. <td th:text="${payment[1]}"></td>
  446. <td th:text="${payment[2]}"></td>
  447. <td th:text="${payment[3]}"></td>
  448. <td th:text="${payment[4]}"></td>
  449. <td th:text="${payment[5]}"></td>
  450. <td th:text="${payment[6]}"></td>
  451. <td th:text="${payment[7]}"></td>
  452. <td th:text="${payment[8]}"></td>
  453. <td th:text="${payment[9]}"></td>
  454. <td th:text="${payment[10]}"></td>
  455. <td th:text="${payment[11]}"></td>
  456. <td th:text="${payment[12] + ' to ' + payment[13]}" width="1000px"></td>
  457. <td th:text="${payment[14]}"></td>
  458. </tr>
  459. </table>
  460. </div>
  461. <div class="table-responsive" id="userBookingtable" th:if="${request}==4">
  462. <table id="requestTable4" class="table table-striped table-bordered table-hover dataTable"
  463. role="grid" width="99.5%">
  464. <thead class="thead-dark">
  465. <tr role="row">
  466. <th>S.No</th>
  467. <th width="110px">User Id</th>
  468. <th>Name</th>
  469. <th>Mobile</th>
  470. <th>Address</th>
  471. <th>Total Bookings</th>
  472. </tr>
  473. </thead>
  474. <tr th:each="userbookingList, iterStat : ${userbookingLists}">
  475. <td th:text="${iterStat.count}">0</td>
  476. <td th:text="${userbookingList[0]}"></td>
  477. <td th:text="${userbookingList[1]}"></td>
  478. <td th:text="${userbookingList[2]}"></td>
  479. <td th:text="${userbookingList[3]}"></td>
  480. <td th:text="${userbookingList[4]}"
  481. th:onclick="viewbookingDetails([[${userbookingList[0]}]])" style="cursor:pointer;"></td>
  482. </tr>
  483. </table>
  484. </div>
  485. <div class="table-responsive" id="hallBookingtable" th:if="${request}==5">
  486. <table id="requestTable5" class="table table-striped table-bordered table-hover dataTable"
  487. role="grid" width="99.5%">
  488. <thead class="thead-dark">
  489. <tr role="row">
  490. <th>S.No</th>
  491. <th>Hall Id</th>
  492. <th>Hall Name</th>
  493. <th>Zone/Division</th>
  494. <th>Caretaker Name</th>
  495. <th>Caretaker Mobile</th>
  496. <th>Total Bookings</th>
  497. <th>Deposit Amount</th>
  498. <th>Hall Amount</th>
  499. <th>GST</th>
  500. <th>Amount Received</th>
  501. <th>Amount Refund</th>
  502. <th>Net Revenue</th>
  503. </tr>
  504. </thead>
  505. <tbody>
  506. <tr th:each="hallbookingList, iterStat : ${hallbookingLists}">
  507. <td th:text="${iterStat.count}">0</td>
  508. <td th:text="${hallbookingList[11]}"></td>
  509. <td th:text="${hallbookingList[0]}"></td>
  510. <td th:text="${hallbookingList[3]}"></td> <!-- Combined Zone/Division -->
  511. <td th:text="${hallbookingList[1]}"></td>
  512. <td th:text="${hallbookingList[2]}"></td>
  513. <td th:text="${hallbookingList[4]}"></td>
  514. <td th:text="${(T(java.lang.Math).round(hallbookingList[5] * 100.0) / 100.0)}"></td>
  515. <td th:text="${(T(java.lang.Math).round(hallbookingList[6] * 100.0) / 100.0)}"></td>
  516. <td th:text="${(T(java.lang.Math).round(hallbookingList[7] * 100.0) / 100.0)}"></td>
  517. <td th:text="${(T(java.lang.Math).round(hallbookingList[8] * 100.0) / 100.0)}"></td>
  518. <td th:text="${(T(java.lang.Math).round(hallbookingList[9] * 100.0) / 100.0)}"></td>
  519. <td th:text="${(T(java.lang.Math).round(hallbookingList[10] * 100.0) / 100.0)}"></td>
  520. </tr>
  521. </tbody>
  522. </table>
  523. </div>
  524. <div class="table-responsive" id="BookingSettlementtable" th:if="${request}==6">
  525. <table id="requestTable6" class="table table-striped table-bordered table-hover dataTable"
  526. role="grid" width="99.5%">
  527. <thead class="thead-dark">
  528. <tr role="row">
  529. <th>S.No</th>
  530. <th>Name</th>
  531. <th>Mobile</th>
  532. <th>Booking Id</th>
  533. <th>Booked Hall</th>
  534. <th>Reason</th>
  535. <th>Booking Date</th>
  536. <th>Event Date</th>
  537. <th>No of Days</th>
  538. <th>User type</th>
  539. <th>Refund Status</th>
  540. <th>Booking Status</th>
  541. </tr>
  542. </thead>
  543. <tr th:each="settlementlist, iterStat : ${bookingSettlementList}">
  544. <td th:text="${iterStat.count}">0</td>
  545. <td th:text="${settlementlist.users.name}"></td>
  546. <td th:text="${settlementlist.users.mobileNo}"></td>
  547. <td th:text="${settlementlist.bookingId}"></td>
  548. <td th:text="${settlementlist.hallDetails.hallName}"></td>
  549. <td th:text="${settlementlist.reason}"></td>
  550. <td th:text="${settlementlist.bookingDate}"></td>
  551. <td th:text="${settlementlist.startDate +' to '+ settlementlist.endDate}"></td>
  552. <td th:text="${settlementlist.noOfDays}"></td>
  553. <td th:text="${settlementlist.users.usertype}"></td>
  554. <td th:text="${settlementlist.refundStatus}"></td>
  555. <td th:text="${settlementlist.bookingStatus}"></td>
  556. </tr>
  557. </table>
  558. </div>
  559. <div class="table-responsive" id="totalCounttable" th:if="${request == '7'}">
  560. <table id="requestTable7" class="table table-striped table-bordered table-hover dataTable"
  561. role="grid" width="99.5%">
  562. <thead class="thead-dark">
  563. <tr role="row">
  564. <th>S.No</th>
  565. <th th:text="${basedon == 'zone' ? 'Zone' : 'Division'}"></th>
  566. <th>Bookings Count</th>
  567. </tr>
  568. </thead>
  569. <tbody>
  570. <tr th:each="data, stat : ${totalcount}">
  571. <td th:text="${stat.index + 1}"></td> <!-- Serial number -->
  572. <td th:text="${data[0]}"></td> <!-- Zone or Division -->
  573. <td th:text="${data[1]}"></td> <!-- Bookings Count -->
  574. </tr>
  575. </tbody>
  576. <tfoot>
  577. <tr>
  578. <th></th>
  579. <td><strong>Total Bookings :</strong></td>
  580. <td th:text="${totalBookings}"></td> <!-- Total bookings -->
  581. </tr>
  582. </tfoot>
  583. </table>
  584. </div>
  585. <!--<div class="table-responsive" id="countertable" th:if="${request == '9'}">-->
  586. <div class="table-responsive" id="countertable" th:if="${request}==9">
  587. <div th:if="${reporttype == 'abstract'}">
  588. <table id="requestTable9" class="table table-striped table-bordered table-hover dataTable"
  589. role="grid" width="99.5%">
  590. <thead class="thead-dark">
  591. <tr role="row">
  592. <th>S.No</th>
  593. <th>Counter ID</th>
  594. <th>Total Bookings</th>
  595. </tr>
  596. </thead>
  597. <tbody>
  598. <tr th:each="counterdata, iterstat : ${counterBookingList}">
  599. <td th:text="${iterstat.index + 1}"></td>
  600. <td th:text="${counterdata[0]}"></td>
  601. <td>
  602. <button href="#"
  603. th:attr="data-counter-id=${counterdata[0]}"
  604. data-bs-toggle="modal"
  605. data-bs-target="#bookingModal"
  606. style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
  607. onclick="showCounterTable(this)">
  608. <span th:text="${counterdata[1]}"></span>
  609. </button>
  610. </td>
  611. </tr>
  612. </tbody>
  613. </table>
  614. </div>
  615. <div th:if="${reporttype == 'detailed'}">
  616. <table id="detailedrequestTable" class="table table-striped table-bordered table-hover dataTable"
  617. role="grid" width="99.5%">
  618. <thead class="thead-dark">
  619. <tr role="row">
  620. <th>S.No</th>
  621. <th>Booking ID</th>
  622. <th>Hall Name</th>
  623. <th>Booking Date</th>
  624. <th>Start Date</th>
  625. <th>End Date</th>
  626. <th>Starting Slot</th>
  627. <th>Ending Slot</th>
  628. <th>No.of.Days</th>
  629. <th>Reason for Booking</th>
  630. <th>Hall Amount</th>
  631. <th>Deposit Amount</th>
  632. <th>GSt</th>
  633. <th>Amount Received</th>
  634. <th>Booking Status</th>
  635. <th>Booking Type</th>
  636. <th>Counter Id</th>
  637. <th>View</th>
  638. </tr>
  639. </thead>
  640. <tbody>
  641. <tr th:each="counterdata, iterstat : ${counterBookingList}">
  642. <td th:text="${iterstat.index + 1}"></td>
  643. <td th:text="${counterdata[0]}"></td>
  644. <td th:text="${counterdata[1]}"></td>
  645. <td th:text="${counterdata[2]}"></td>
  646. <td th:text="${counterdata[3]}"></td>
  647. <td th:text="${counterdata[4]}"></td>
  648. <td th:text="${counterdata[5]}"></td>
  649. <td th:text="${counterdata[6]}"></td>
  650. <td th:text="${counterdata[7]}"></td>
  651. <td th:text="${counterdata[8]}"></td>
  652. <td th:text="${counterdata[9]}"></td>
  653. <td th:text="${counterdata[10]}"></td>
  654. <td th:text="${counterdata[11]}"></td>
  655. <td th:text="${counterdata[12]}"></td>
  656. <td th:text="${counterdata[13]}"></td>
  657. <td th:text="${counterdata[14]}"></td>
  658. <td th:text="${counterdata[15]}"></td>
  659. <td>
  660. <p>
  661. <span class="badge bg-warning" style="cursor: pointer;"
  662. th:onclick="viewDetails([[${counterdata[0]}]])">View</span>
  663. </p>
  664. </td>
  665. </tr>
  666. </tbody>
  667. </table>
  668. </div>
  669. </div>
  670. <div class="table-responsive" id="zoneWiseBookingTable" th:if="${request}==10">
  671. <table id="requestTable10" class="table table-striped table-bordered table-hover dataTable"
  672. role="grid" width="99.5%">
  673. <thead class="thead-dark">
  674. <tr role="row">
  675. <th>S.No</th>
  676. <th>Zone</th>
  677. <th>Hall Count</th>
  678. <th>Online Booking Count</th>
  679. <th>Counter Booking Count</th>
  680. <th>Total Count</th>
  681. </tr>
  682. </thead>
  683. <tr th:each="zoneList, iterStat : ${zoneWiseBookingList}">
  684. <td th:text="${iterStat.count}">0</td>
  685. <td>
  686. <button href="#"
  687. th:attr="data-zone-id=${zoneList[0]}"
  688. data-bs-toggle="modal"
  689. data-bs-target="#hallModal"
  690. style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
  691. onclick="showHallDetailsTable(this)">
  692. <span th:text="${zoneList[0]}"></span>
  693. </button>
  694. </td>
  695. <td th:text="${zoneList[1]}"></td>
  696. <td th:text="${zoneList[3]}"></td>
  697. <td th:text="${zoneList[4]}"></td>
  698. <td th:text="${zoneList[2]}"></td>
  699. </tr>
  700. </table>
  701. </div>
  702. </div>
  703. <div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static"
  704. tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel"
  705. aria-hidden="true">
  706. <div class="modal-dialog modal-lg" role="document">
  707. <div class="modal-content" id="printableContent">
  708. <form id="regform" onsubmit="return rejectsubmit();">
  709. <div
  710. class="block block-rounded block-themed block-transparent mb-0">
  711. <div class="block-header bg-primary-dark">
  712. <h3 class="block-title" id="2mtitle">Booking
  713. Information</h3>
  714. <div class="block-options">
  715. <button type="button" class="btn-block-option"
  716. data-bs-dismiss="modal" aria-label="Close">
  717. <i class="fa fa-fw fa-times"></i>
  718. </button>
  719. </div>
  720. </div>
  721. <div class="block-content row"
  722. style="margin-right:0px;margin:0;padding:0;">
  723. <div class="col-md-12 col-lg-12 col-sm-12">
  724. <div class="card-body">
  725. <table>
  726. <tr>
  727. <th colspan="10"
  728. style="background-color: lightgrey;">
  729. User Details
  730. </th>
  731. </tr>
  732. <tr>
  733. <th
  734. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  735. User Name:
  736. </th>
  737. <td class="fw-semibold"
  738. style="padding: 0.45rem 0.45rem;"
  739. id="td_userName"></td>
  740. <th
  741. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  742. Mobile Number:
  743. </th>
  744. <td class="fw-semibold"
  745. style="padding: 0.45rem 0.45rem;"
  746. id="td_mobileNumber"></td>
  747. <th
  748. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  749. User Type:
  750. </th>
  751. <td class="fw-semibold"
  752. style="padding: 0.45rem 0.45rem;"
  753. id="td_usertype"></td>
  754. </tr>
  755. <tr>
  756. <th
  757. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  758. User Address:
  759. </th>
  760. <td colspan="5" class="fw-semibold"
  761. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  762. id="td_useraddress"></td>
  763. </tr>
  764. <input type="hidden"
  765. class="form-control text-center"
  766. name="bookingid" id="bookingid" disabled/>
  767. <tr>
  768. <th colspan="10"
  769. style="background-color: lightgrey;">
  770. Hall Details
  771. </th>
  772. </tr>
  773. <tr>
  774. <th
  775. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  776. Hall Name:
  777. </th>
  778. <td colspan="10" class="fw-semibold"
  779. style="padding: 0.45rem 0.45rem;text-wrap:pretty;"
  780. id="td_hallName"></td>
  781. </tr>
  782. <th
  783. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  784. Hall Address:
  785. </th>
  786. <td colspan="10" class="fw-semibold"
  787. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  788. id="td_halladdress"></td>
  789. </tr>
  790. <tr>
  791. <th
  792. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  793. Caretaker Name:
  794. </th>
  795. <td colspan="2" class="fw-semibold"
  796. style="padding: 0.45rem 0.45rem;"
  797. id="td_caretakername"></td>
  798. <th
  799. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  800. Caretaker Mobile Number:
  801. </th>
  802. <td colspan="2" class="fw-semibold"
  803. style="padding: 0.45rem 0.45rem;"
  804. id="td_caretakermobileNumber"></td>
  805. </tr>
  806. <tr>
  807. <th colspan="10"
  808. style="background-color: lightgrey;">
  809. Booking
  810. Details (Booking Id:-<span
  811. id="booking_id"
  812. style="color:blue"></span>)
  813. </th>
  814. </tr>
  815. <tr>
  816. <th
  817. style="padding: 0.45rem 0.45rem;font-weight: normal">
  818. Booking Date:
  819. </th>
  820. <td colspan="2" class="fw-semibold"
  821. style="padding: 0.45rem 0.45rem;"
  822. id="td_bookingDate"></td>
  823. <th
  824. style="padding: 0.45rem 0.45rem;font-weight: normal">
  825. Deposit Amount (in Rs):
  826. </th>
  827. <td colspan="2"
  828. class="fw-semibold amount-cell"
  829. style="padding: 0.45rem 0.45rem;"
  830. id="td_depositeAmount"></td>
  831. </tr>
  832. <tr>
  833. <th
  834. style="padding: 0.45rem 0.45rem;font-weight: normal">
  835. Start Date:
  836. </th>
  837. <td colspan="2" class="fw-semibold"
  838. style="padding: 0.45rem 0.45rem;"
  839. id="td_startDate"></td>
  840. <th
  841. style="padding: 0.45rem 0.45rem;font-weight: normal">
  842. Hall Amount (in Rs):
  843. </th>
  844. <td colspan="2"
  845. class="fw-semibold amount-cell"
  846. style="padding: 0.45rem 0.45rem;"
  847. id="td_hallAmount"></td>
  848. </tr>
  849. <tr>
  850. <th
  851. style="padding: 0.45rem 0.45rem;font-weight: normal">
  852. END Date:
  853. </th>
  854. <td colspan="2" class="fw-semibold"
  855. style="padding: 0.45rem 0.45rem;"
  856. id="td_endDate"></td>
  857. <th
  858. style="padding: 0.45rem 0.45rem;font-weight: normal">
  859. GST @18% (in Rs):
  860. </th>
  861. <td colspan="2"
  862. class="fw-semibold amount-cell"
  863. style="padding: 0.45rem 0.45rem;"
  864. id="td_gst"></td>
  865. </tr>
  866. <tr>
  867. <th
  868. style="padding: 0.45rem 0.45rem;font-weight: normal">
  869. Starting Slot:
  870. </th>
  871. <td colspan="2" class="fw-semibold"
  872. style="padding: 0.45rem 0.45rem;"
  873. id="td_startingSlot"></td>
  874. <th
  875. style="padding: 0.45rem 0.45rem;font-weight: normal">
  876. Total Amount (in Rs):
  877. </th>
  878. <td colspan="2"
  879. class="fw-semibold amount-cell"
  880. style="padding: 0.45rem 0.45rem;"
  881. id="td_totalAmount"></td>
  882. </tr>
  883. <tr>
  884. <th
  885. style="padding: 0.45rem 0.45rem;font-weight: normal">
  886. Ending Slot:
  887. </th>
  888. <td colspan="2" class="fw-semibold"
  889. style="padding: 0.45rem 0.45rem;"
  890. id="td_endingSlot"></td>
  891. <!--<th style="display:none;padding: 0.45rem 0.45rem;border:none"
  892. id="rejectionreasondiv">Rejection
  893. Reason:</th>
  894. <td class="fw-semibold"
  895. style="padding: 0.45rem 0.45rem;"
  896. id="reasonforrejection"></td>-->
  897. <th
  898. style="padding: 0.45rem 0.45rem;border:none">
  899. Booking Status:
  900. </th>
  901. <td colspan="2" class="fw-semibold"
  902. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  903. id="bookingstatus_td"></td>
  904. </tr>
  905. <tr>
  906. <th style="display:none;padding: 0.45rem 0.45rem;border:none"
  907. id="rejectionreasondiv">Rejection
  908. Reason:
  909. </th>
  910. <td class="fw-semibold"
  911. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  912. id="reasonforrejection"></td>
  913. </tr>
  914. </table>
  915. </div>
  916. </div>
  917. <div class="row col-md-12 col-lg-12 col-sm-12">
  918. <div class="documents" id="documents"></div>
  919. </div>
  920. <div class="col-md-12 col-lg-12 col-sm-12 mb-2"
  921. id="paymentsdetails"
  922. style="display:none; margin-top: -16px;">
  923. <div class="card-body">
  924. <table>
  925. <tr>
  926. <th colspan="10"
  927. style="background-color: lightgrey;">
  928. Booking Payment Details
  929. </th>
  930. </tr>
  931. <tr>
  932. <th
  933. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  934. Transaction ID:
  935. </th>
  936. <td colspan="10" class="fw-semibold"
  937. style="padding: 0.45rem 0.45rem;"
  938. id="td_transactionId"></td>
  939. </tr>
  940. <th
  941. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  942. Amount Received (in Rs):
  943. </th>
  944. <td colspan="10" class="fw-semibold"
  945. style="padding: 0.45rem 0.45rem;"
  946. id="td_payamountReceived"></td>
  947. </tr>
  948. <tr>
  949. <th
  950. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  951. Transaction Status:
  952. </th>
  953. <td class="fw-semibold"
  954. style="padding: 0.45rem 0.45rem;"
  955. id="td_paymentStatus"></td>
  956. </tr>
  957. </table>
  958. </div>
  959. </div>
  960. <!--Newly added for Reschedule Details-->
  961. <!--<div class="row col-md-12 col-lg-12 col-sm-12"
  962. id="rescheduleDetails"
  963. style="display:none;margin-left: 0px;margin-top: -10px">
  964. <div class="card-body">
  965. <table>
  966. <tr>
  967. <th colspan="4"
  968. style="background-color: lightgrey;">Reschedule
  969. Details
  970. </th>
  971. </tr>
  972. <tr>
  973. <th
  974. style="padding: 0.45rem 0.45rem;font-weight: normal">
  975. Event Start Date:
  976. </th>
  977. <td class="fw-semibold"
  978. style="padding: 0.45rem 0.45rem;"
  979. id="td_res_start_date"></td>
  980. <th
  981. style="padding: 0.45rem 0.45rem;font-weight: normal">
  982. Event End Date:
  983. </th>
  984. <td class="fw-semibold"
  985. style="padding: 0.45rem 0.45rem;"
  986. id="td_res_end_date"></td>
  987. </tr>
  988. <tr>
  989. <th
  990. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  991. Rescheduled Date:
  992. </th>
  993. <td class="fw-semibold" colspan="5"
  994. style="padding: 0.45rem 0.45rem;"
  995. id="td_res_date"></td>
  996. </tr>
  997. </tbody>
  998. </table>
  999. </div>
  1000. </div>-->
  1001. <div class="row col-md-12 col-lg-12 col-sm-12"
  1002. id="ebdetails"
  1003. style="display:none;margin-left: 0px;margin-top: -10px">
  1004. <div class="card-body">
  1005. <table>
  1006. <tr>
  1007. <th colspan="4"
  1008. style="background-color: lightgrey;">EB
  1009. Details
  1010. </th>
  1011. </tr>
  1012. <tr>
  1013. <th
  1014. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1015. Consumer Number:
  1016. </th>
  1017. <td class="fw-semibold"
  1018. style="padding: 0.45rem 0.45rem;"
  1019. id="td_EBNumber"></td>
  1020. <th
  1021. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1022. EB Amount Per Unit (in Rs):
  1023. </th>
  1024. <td class="fw-semibold"
  1025. style="padding: 0.45rem 0.45rem;"
  1026. id="td_ebamountperunit"></td>
  1027. </tr>
  1028. <tr>
  1029. <th
  1030. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1031. Start Reading:
  1032. </th>
  1033. <td class="fw-semibold"
  1034. style="padding: 0.45rem 0.45rem;"
  1035. id="td_startingReading"></td>
  1036. <th
  1037. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1038. Unit Consumed:
  1039. </th>
  1040. <td class="fw-semibold"
  1041. style="padding: 0.45rem 0.45rem;"
  1042. id="td_usedunit"></td>
  1043. </tr>
  1044. <tr>
  1045. <th
  1046. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1047. END Reading:
  1048. </th>
  1049. <td class="fw-semibold"
  1050. style="padding: 0.45rem 0.45rem;"
  1051. id="td_endingReading"></td>
  1052. <th
  1053. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1054. EB Amount (in Rs):
  1055. </th>
  1056. <td class="fw-semibold"
  1057. style="padding: 0.45rem 0.45rem;"
  1058. id="td_electricityamount"></td>
  1059. </tr>
  1060. </tbody>
  1061. </table>
  1062. </div>
  1063. </div>
  1064. <div class="row col-md-12 col-lg-12 col-sm-12"
  1065. id="damagelist" style="disaply:none">
  1066. <div id="damageDetails"></div>
  1067. </div>
  1068. <div class="col-md-12 col-lg-12 col-sm-12"
  1069. id="refunddetails" style="margin-top:-1px">
  1070. <div class="card-body">
  1071. <table>
  1072. <tr>
  1073. <th colspan="2"
  1074. style="background-color: lightgrey;">
  1075. Amount to be Refunded (in Rs)
  1076. </th>
  1077. </tr>
  1078. <tr>
  1079. <th
  1080. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1081. Deposit Amount:
  1082. </th>
  1083. <td class="fw-semibold amount-cell"
  1084. style="padding: 0.45rem 0.45rem;"
  1085. id="td_depositeamountforrefund">0
  1086. </td>
  1087. </tr>
  1088. <tr>
  1089. <th
  1090. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1091. EB Amount:
  1092. </th>
  1093. <td class="fw-semibold amount-cell"
  1094. style="padding: 0.45rem 0.45rem;"
  1095. id="td_ebAmount"></td>
  1096. </tr>
  1097. <tr>
  1098. <th
  1099. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1100. Damage Amount:
  1101. </th>
  1102. <td class="fw-semibold amount-cell"
  1103. style="padding: 0.45rem 0.45rem;"
  1104. id="td_damage"></td>
  1105. </tr>
  1106. <tr id="pendingcolumn">
  1107. <th id="th_settel_label"
  1108. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1109. Collection Pending Amount:
  1110. </th>
  1111. <td class="fw-semibold amount-cell"
  1112. style="padding: 0.45rem 0.45rem; color: green;"
  1113. id="td_pending_amt">0
  1114. </td>
  1115. </tr>
  1116. <tr id="collectionstatuscolumn">
  1117. <th id="label"
  1118. style="padding: 0.45rem 0.45rem;font-weight: normal">Collection
  1119. Pending Status
  1120. :
  1121. </th>
  1122. <td class="fw-semibold amount-cell"
  1123. style="padding: 0.45rem 0.45rem; color: green;"
  1124. id="td_collection_status">
  1125. </td>
  1126. </tr>
  1127. <tr>
  1128. <th
  1129. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1130. Actual refundable Amount:
  1131. </th>
  1132. <td class="fw-semibold amount-cell"
  1133. style="padding: 0.45rem 0.45rem; color: green;"
  1134. id="td_settel_amt">0
  1135. </td>
  1136. </tr>
  1137. </table>
  1138. </div>
  1139. </div>
  1140. <div class="row col-md-12 col-lg-12 col-sm-12"
  1141. id="refundamountDetails"
  1142. style="display:none;margin-left: 0px;margin-top: -49px">
  1143. <div class="card-body">
  1144. <table>
  1145. <tr>
  1146. <th colspan="4"
  1147. style="background-color: lightgrey;">
  1148. Refund Details
  1149. </th>
  1150. </tr>
  1151. <tr>
  1152. <th
  1153. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1154. Booking Status:
  1155. </th>
  1156. <td class="fw-semibold"
  1157. style="padding: 0.45rem 0.45rem;"
  1158. id="td_bookingStatus"></td>
  1159. <th
  1160. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1161. Refund Status:
  1162. </th>
  1163. <td class="fw-semibold"
  1164. style="padding: 0.45rem 0.45rem;"
  1165. id="td_refundStatus"></td>
  1166. </tr>
  1167. <tr>
  1168. <th
  1169. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  1170. Refund amount:
  1171. </th>
  1172. <td class="fw-semibold" colspan="5"
  1173. style="padding: 0.45rem 0.45rem;"
  1174. id="td_refundamount"></td>
  1175. </tr>
  1176. </tbody>
  1177. </table>
  1178. </div>
  1179. </div>
  1180. <div id="refundMessage" style="display: none;">
  1181. <h1 id="refundText"
  1182. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1183. </h1>
  1184. </div>
  1185. <div id="rejectrefundMessage" style="display: none;">
  1186. <h1 id="rejectrefundText"
  1187. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1188. </h1>
  1189. </div>
  1190. <div id="blockedrefundMessage" style="display: none;">
  1191. <h1 id="blockedrefundText"
  1192. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1193. </h1>
  1194. </div>
  1195. </div>
  1196. </div>
  1197. <div class="block-content block-content-full text-end bg-body"
  1198. id="mbutton">
  1199. <button type="button"
  1200. style="background-color: rgb(21,69,93);color: white;"
  1201. class="btn btn-sm btn-alt-secondary"
  1202. data-bs-dismiss="modal">Close
  1203. </button>
  1204. </div>
  1205. </form>
  1206. </div>
  1207. </div>
  1208. </div>
  1209. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel"
  1210. aria-hidden="true">
  1211. <div class="modal-dialog modal-lg" role="document">
  1212. <div class="modal-content">
  1213. <div class="modal-header">
  1214. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  1215. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  1216. <span aria-hidden="true">&times;</span>
  1217. </button>
  1218. </div>
  1219. <div class="modal-body">
  1220. <embed id="filePreview" src="" width="100%" height="600px">
  1221. </div>
  1222. <div class="modal-footer">
  1223. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  1224. </div>
  1225. </div>
  1226. </div>
  1227. </div>
  1228. <div class="modal fade" id="viewbookingDetailsdetails">
  1229. <div class="modal-dialog modal-xl">
  1230. <div class="modal-content">
  1231. <!-- Modal Header -->
  1232. <div class="modal-header">
  1233. <h4 class="modal-title">List of Bookings</h4>
  1234. <button type="button" class="btn" data-bs-dismiss="modal">&times;</button>
  1235. </div>
  1236. <!-- Modal Body -->
  1237. <div class="modal-body">
  1238. <div class="content">
  1239. <div class="block block-rounded">
  1240. <div class="block-content p-0">
  1241. <div class="p-sm-4 p-0">
  1242. <div class="table-responsive">
  1243. <table id="bookinglistdataTable"
  1244. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  1245. <thead class="thead-light">
  1246. <tr class="table-bordered">
  1247. <th class="text-center no-sort">S.No</th>
  1248. <th class="text-center no-sort">Booking Id</th>
  1249. <th class="text-center no-sort">Booking Date</th>
  1250. <th class="text-center no-sort">Start Date</th>
  1251. <th class="text-center no-sort">End Date</th>
  1252. <th class="text-center no-sort">Starting Slot</th>
  1253. <th class="text-center no-sort">Ending Slot</th>
  1254. <th class="text-center no-sort">Reason For Booking</th>
  1255. <th class="text-center no-sort">No of days</th>
  1256. <th class="text-center no-sort">Booking Status</th>
  1257. <th class="text-center no-sort">Hall Amount</th>
  1258. <th class="text-center no-sort">Total Amount Paid</th>
  1259. </tr>
  1260. </thead>
  1261. <tbody id="bookingTableBody"></tbody>
  1262. </table>
  1263. </div>
  1264. </div>
  1265. </div>
  1266. </div>
  1267. </div>
  1268. </div>
  1269. <!-- Modal Footer -->
  1270. <div class="modal-footer">
  1271. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  1272. </div>
  1273. </div>
  1274. </div>
  1275. </div>
  1276. <div class="modal fade" id="viewbookingDetailsbyzone">
  1277. <div class="modal-dialog modal-xl">
  1278. <div class="modal-content">
  1279. <!-- Modal Header -->
  1280. <div class="modal-header">
  1281. <h4 class="modal-title">List of Bookings Based on Zone</h4>
  1282. <button type="button" class="btn" data-bs-dismiss="modal">&times;</button>
  1283. </div>
  1284. <!-- Modal Body -->
  1285. <div class="modal-body">
  1286. <div class="content">
  1287. <div class="block block-rounded">
  1288. <div class="block-content p-0">
  1289. <div class="p-sm-4 p-0">
  1290. <div class="table-responsive">
  1291. <table id="bookinglistdataTablebyzone"
  1292. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  1293. <thead class="thead-light">
  1294. <tr class="table-bordered">
  1295. <th class="text-center no-sort">S.No</th>
  1296. <th class="text-center no-sort">Booking Id</th>
  1297. <th class="text-center no-sort">Booking Date</th>
  1298. <th class="text-center no-sort">Start Date</th>
  1299. <th class="text-center no-sort">End Date</th>
  1300. <th class="text-center no-sort">Starting Slot</th>
  1301. <th class="text-center no-sort">Ending Slot</th>
  1302. <th class="text-center no-sort">Reason For Booking</th>
  1303. <th class="text-center no-sort">No of Days</th>
  1304. <th class="text-center no-sort">Booking Status</th>
  1305. <th class="text-center no-sort">Hall Amount</th>
  1306. <th class="text-center no-sort">Total Amount Paid</th>
  1307. </tr>
  1308. </thead>
  1309. <tbody id="bookingTableBodybyzone"></tbody>
  1310. </table>
  1311. </div>
  1312. </div>
  1313. </div>
  1314. </div>
  1315. </div>
  1316. </div>
  1317. <!-- Modal Footer -->
  1318. <div class="modal-footer">
  1319. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  1320. </div>
  1321. </div>
  1322. </div>
  1323. </div>
  1324. <!-- Modal -->
  1325. <div class="modal fade" id="bookingModal" tabindex="-1" aria-labelledby="bookingModalLabel" aria-hidden="true">
  1326. <div class="modal-dialog modal-xl modal-dialog-scrollable">
  1327. <div class="modal-content">
  1328. <div class="modal-header">
  1329. <h5 class="modal-title">Hall-wise Booking Details</h5>
  1330. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1331. </div>
  1332. <div class="modal-body">
  1333. <!--
  1334. <table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;">
  1335. -->
  1336. <table id="modalBookingTable" class="table table-striped table-bordered table-hover dataTable"
  1337. role="grid" width="99.5%">
  1338. <input type="hidden" id="hallBookingJsonInput" th:value="${hallBookingJson}">
  1339. <thead>
  1340. <tr>
  1341. <th>S.No</th>
  1342. <th>Zone</th>
  1343. <th>Division</th>
  1344. <th>Hall Name</th>
  1345. <th>Total Bookings</th>
  1346. </tr>
  1347. </thead>
  1348. <tbody id="modalBookingDetails"></tbody>
  1349. </table>
  1350. </div>
  1351. </div>
  1352. </div>
  1353. </div>
  1354. <div class="modal fade" id="hallDetailModal" tabindex="-1" aria-hidden="true">
  1355. <div class="modal-dialog modal-fullscreen-custom modal-dialog-scrollable">
  1356. <div class="modal-content">
  1357. <div class="modal-header">
  1358. <h5 class="modal-title">Booking Details for Hall</h5>
  1359. <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
  1360. </div>
  1361. <div class="modal-body">
  1362. <table id="hallDetailsTable" class="table table-bordered table-striped">
  1363. <input type="hidden" id="hallBookingDetailsJsonInput" th:value="${hallBookingDetailsJson}">
  1364. <thead>
  1365. <tr>
  1366. <th>S.No</th>
  1367. <th>Booking ID</th>
  1368. <th>Hall Name</th>
  1369. <th>Booking Date</th>
  1370. <th>Start Date</th>
  1371. <th>End Date</th>
  1372. <th>Starting Slot</th>
  1373. <th>Ending Slot</th>
  1374. <th>No.of.Days</th>
  1375. <th>Reason for Booking</th>
  1376. <th>Hall Amount</th>
  1377. <th>Deposit Amount</th>
  1378. <th>GSt</th>
  1379. <th>Amount Received</th>
  1380. <th>Booking Status</th>
  1381. <th>Booking Type</th>
  1382. <th>View</th>
  1383. </tr>
  1384. </thead>
  1385. <tbody id="hallDetailsTableBody"></tbody>
  1386. </table>
  1387. </div>
  1388. </div>
  1389. </div>
  1390. </div>
  1391. <!--Modal For Review Report-->
  1392. <div class="modal fade" id="hallModal" tabindex="-1" aria-labelledby="hallModalLabel" aria-hidden="true">
  1393. <div class="modal-dialog modal-xl modal-dialog-scrollable">
  1394. <div class="modal-content">
  1395. <div class="modal-header">
  1396. <h5 class="modal-title">Hall-wise Booking Details</h5>
  1397. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1398. </div>
  1399. <div class="modal-body">
  1400. <!--
  1401. <table id="modalBookingTable" class="table table-bordered table-striped dataTable" style="width: 100%;">
  1402. -->
  1403. <table id="hallwiseBookingTable"
  1404. class="table table-striped table-bordered table-hover dataTable"
  1405. role="grid" width="99.5%">
  1406. <input type="hidden" id="hallWiseBookingList" th:value="${hallWiseBookingList}" />
  1407. <thead>
  1408. <tr>
  1409. <th>S.No</th>
  1410. <th>Hall Name</th>
  1411. <th>Online Booking Count</th>
  1412. <th>Counter Booking Count</th>
  1413. <th>Total Count</th>
  1414. </tr>
  1415. </thead>
  1416. <tbody id="hallwiseBookingDetails"></tbody>
  1417. </table>
  1418. </div>
  1419. </div>
  1420. </div>
  1421. </div>
  1422. <div class="modal fade" id="counterDetailModal" tabindex="-1" aria-hidden="true">
  1423. <div class="modal-dialog modal-fullscreen-custom modal-dialog-scrollable">
  1424. <div class="modal-content">
  1425. <div class="modal-header">
  1426. <h5 class="modal-title">Booking Details for Hall</h5>
  1427. <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
  1428. </div>
  1429. <div class="modal-body">
  1430. <table id="counterDetailsTable" class="table table-bordered table-striped">
  1431. <input type="hidden" id="counterWiseBookingList" th:value="${counterWiseBookingList}" />
  1432. <thead>
  1433. <tr>
  1434. <th>S.No</th>
  1435. <th>Counter ID</th>
  1436. <th>No.of Booking</th>
  1437. </tr>
  1438. </thead>
  1439. <tbody id="counterDetailsTableBody"></tbody>
  1440. </table>
  1441. </div>
  1442. </div>
  1443. </div>
  1444. </div>
  1445. <div class="modal fade" id="bookingInfoModal" tabindex="-1" aria-labelledby="bookingInfoModalLabel"
  1446. aria-hidden="true">
  1447. <div class="modal-dialog modal-xl">
  1448. <div class="modal-content">
  1449. <div class="modal-header bg-dark text-white">
  1450. <h5 class="modal-title">Booking Information</h5>
  1451. <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
  1452. </div>
  1453. <div class="modal-body" id="bookingInfoContent">
  1454. <!-- Filled by JS -->
  1455. </div>
  1456. </div>
  1457. </div>
  1458. </div>
  1459. </main>
  1460. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  1461. </div>
  1462. <div th:replace="~{fragments/resetpassword :: div}"></div>
  1463. <script th:replace="~{fragments/loginscript :: script}"></script>
  1464. <script>
  1465. /*$(document).ready(function () {
  1466. // Common buttons configuration
  1467. var buttons = [{
  1468. extend: 'pageLength',
  1469. className: 'btn btn-primary'
  1470. }, {
  1471. title: 'Data export',
  1472. extend: 'copyHtml5',
  1473. text: 'Copy',
  1474. className: 'btn btn-primary',
  1475. id: 'copyBtn'
  1476. }, {
  1477. extend: 'excelHtml5',
  1478. text: 'Excel',
  1479. className: 'btn btn-primary',
  1480. id: 'excelBtn'
  1481. }, {
  1482. extend: 'csvHtml5',
  1483. text: 'CSV',
  1484. className: 'btn btn-primary',
  1485. id: 'csvBtn'
  1486. }, {
  1487. extend: 'pdfHtml5',
  1488. text: 'PDF',
  1489. className: 'btn btn-primary',
  1490. id: 'pdfBtn'
  1491. }];
  1492. // DataTables initialization
  1493. $('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7,#requestTable9,#modalBookingTable,#hallDetailsTable').DataTable({
  1494. dom: 'Bftip',
  1495. columnDefs: [{
  1496. targets: 'no-sort',
  1497. orderable: false
  1498. }],
  1499. lengthMenu: [
  1500. [50, 100, 200, 500, -1],
  1501. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  1502. ],
  1503. // scrollY: '50vh',
  1504. fixedColumns: {
  1505. left: 1,
  1506. right: 1
  1507. },
  1508. buttons: buttons,
  1509. responsive: true,
  1510. searching: true, // Enable search
  1511. select: false,
  1512. processing: false,
  1513. order: [] // Remove any default sorting
  1514. });
  1515. // Link the search input to DataTable
  1516. $('#searchInput').on('keyup', function () {
  1517. $('#bookinglistdataTable').DataTable().search(this.value).draw();
  1518. });
  1519. });*/
  1520. $(document).ready(function () {
  1521. // Common buttons (default for most tables)
  1522. var commonButtons = [{
  1523. extend: 'pageLength',
  1524. className: 'btn btn-primary'
  1525. }, {
  1526. title: 'Data export',
  1527. extend: 'copyHtml5',
  1528. text: 'Copy',
  1529. className: 'btn btn-primary',
  1530. id: 'copyBtn'
  1531. }, {
  1532. extend: 'excelHtml5',
  1533. text: 'Excel',
  1534. className: 'btn btn-primary',
  1535. id: 'excelBtn'
  1536. }, {
  1537. extend: 'csvHtml5',
  1538. text: 'CSV',
  1539. className: 'btn btn-primary',
  1540. id: 'csvBtn'
  1541. }, {
  1542. extend: 'pdfHtml5',
  1543. text: 'PDF',
  1544. className: 'btn btn-primary',
  1545. id: 'pdfBtn'
  1546. }];
  1547. // Custom PDF buttons for specific tables
  1548. function getCustomButtons(tableId) {
  1549. let orientation = 'portrait';
  1550. let pageSize = 'A4';
  1551. if (tableId === 'modalBookingTable') {
  1552. orientation = 'landscape';
  1553. pageSize = 'A4';
  1554. } else if (tableId === 'hallDetailsTable') {
  1555. orientation = 'landscape';
  1556. pageSize = 'A3';
  1557. } else if (tableId === 'detailedrequestTable') {
  1558. orientation = 'landscape';
  1559. pageSize = 'A3';
  1560. }
  1561. return [{
  1562. extend: 'pageLength',
  1563. className: 'btn btn-primary'
  1564. }, {
  1565. title: 'Data export',
  1566. extend: 'copyHtml5',
  1567. text: 'Copy',
  1568. className: 'btn btn-primary'
  1569. }, {
  1570. extend: 'excelHtml5',
  1571. text: 'Excel',
  1572. className: 'btn btn-primary'
  1573. }, {
  1574. extend: 'csvHtml5',
  1575. text: 'CSV',
  1576. className: 'btn btn-primary'
  1577. }, {
  1578. extend: 'pdfHtml5',
  1579. text: 'PDF',
  1580. className: 'btn btn-primary',
  1581. orientation: orientation,
  1582. pageSize: pageSize
  1583. }];
  1584. }
  1585. // Tables using default buttons
  1586. $('#requestTable1, #requestTable2, #requestTable3, #requestTable8, #requestTable4, #requestTable5, #requestTable6, #requestTable7, #requestTable10, #hallwiseBookingTable, #counterDetailsTable').DataTable({
  1587. dom: 'Bftip',
  1588. columnDefs: [{
  1589. targets: 'no-sort',
  1590. orderable: false
  1591. }],
  1592. lengthMenu: [
  1593. [50, 100, 200, 500, -1],
  1594. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  1595. ],
  1596. fixedColumns: {
  1597. left: 1,
  1598. right: 1
  1599. },
  1600. buttons: commonButtons,
  1601. responsive: true,
  1602. searching: true,
  1603. select: false,
  1604. processing: false,
  1605. order: []
  1606. });
  1607. // Tables with custom PDF buttons
  1608. ['requestTable9', 'modalBookingTable', 'hallDetailsTable', 'detailedrequestTable'].forEach(function (tableId) {
  1609. $('#' + tableId).DataTable({
  1610. dom: 'Bftip',
  1611. columnDefs: [{
  1612. targets: 'no-sort',
  1613. orderable: false
  1614. }],
  1615. lengthMenu: [
  1616. [50, 100, 200, 500, -1],
  1617. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  1618. ],
  1619. fixedColumns: {
  1620. left: 1,
  1621. right: 1
  1622. },
  1623. buttons: getCustomButtons(tableId),
  1624. responsive: true,
  1625. searching: true,
  1626. select: false,
  1627. processing: false,
  1628. order: []
  1629. });
  1630. });
  1631. // Link the search input to DataTable
  1632. $('#searchInput').on('keyup', function () {
  1633. $('#bookinglistdataTable').DataTable().search(this.value).draw();
  1634. });
  1635. });
  1636. function validateme() {
  1637. // checkTodateCon();
  1638. return true;
  1639. }
  1640. var fromdate = document.getElementById("fromdate"), todate = document
  1641. .getElementById("todate");
  1642. function validateDate() {
  1643. if ($("#fromdate").val() == "" || $("#todate").val() == "") {
  1644. todate.setCustomValidity("FromDate and ToDate Must");
  1645. } else {
  1646. todate.setCustomValidity('');
  1647. }
  1648. }
  1649. fromdate.onchange = validateDate;
  1650. todate.onchange = validateDate;
  1651. $(document).ready(function () {
  1652. var today = new Date();
  1653. $('.datepicker').datepicker({
  1654. dateFormat: 'yy-mm-dd',
  1655. maxDate: '1'
  1656. })
  1657. $('.datepicker').keyup(function () {
  1658. if (this.value.match(/[^0-9]/g)) {
  1659. this.value = this.value.replace(/[^0-9^-]/g, '');
  1660. }
  1661. });
  1662. });
  1663. document.addEventListener("DOMContentLoaded", function () {
  1664. myRequest(); // Initial call to set dropdowns based on initial value
  1665. });
  1666. document.addEventListener("DOMContentLoaded", function () {
  1667. checkTodateCon();
  1668. });
  1669. function checkTodateCon() {
  1670. var today = new Date();
  1671. var sixMonthsLater = new Date();
  1672. sixMonthsLater.setMonth(today.getMonth() + 6);
  1673. var minDate = today.toISOString().split('T')[0];
  1674. var maxDate = sixMonthsLater.toISOString().split('T')[0];
  1675. let fromDateInput = document.getElementById('fromdate');
  1676. let toDateInput = document.getElementById('todate');
  1677. let selectedFromDate = document.getElementById('fromdate').value;
  1678. fromDateInput.setAttribute('max', maxDate);
  1679. toDateInput.setAttribute('min', selectedFromDate);
  1680. toDateInput.setAttribute('max', maxDate);
  1681. fromDateInput.addEventListener('change', function () {
  1682. let selectedFromDate = this.value;
  1683. let toDateInput = document.getElementById('todate');
  1684. toDateInput.setAttribute('min', selectedFromDate);
  1685. toDateInput.value = ''; // Reset the value of toDate
  1686. });
  1687. }
  1688. document.addEventListener("DOMContentLoaded", function () {
  1689. const form = document.getElementById('myForm');
  1690. const basedonSelect = document.getElementById('basedon');
  1691. const errorSpan = document.getElementById('basedonError');
  1692. const request = document.getElementById('request');
  1693. const reportTypeSelect = document.getElementById('reporttype');
  1694. const reportTypeerror = document.getElementById('reportTypeError');
  1695. form.addEventListener("submit", function (event) {
  1696. const requestValue = request.value;
  1697. if (requestValue === "7") {
  1698. console.log("inside 7");
  1699. console.log("basedonSelect.value=====" + basedonSelect.value);
  1700. if (basedonSelect.value === "") {
  1701. event.preventDefault(); // Stop form submission
  1702. errorSpan.textContent = "Please select a value.";
  1703. basedonSelect.classList.add("is-invalid");
  1704. } else {
  1705. errorSpan.textContent = "";
  1706. basedonSelect.classList.remove("is-invalid");
  1707. }
  1708. } else if (requestValue === "9") {
  1709. console.log("inside 9");
  1710. console.log("reportTypeSelect.value=====" + reportTypeSelect.value);
  1711. if (reportTypeSelect.value === "") {
  1712. event.preventDefault(); // Stop form submission
  1713. reportTypeerror.textContent = "Please select a value.";
  1714. reportTypeSelect.classList.add("is-invalid");
  1715. } else {
  1716. reportTypeerror.textContent = "";
  1717. reportTypeSelect.classList.remove("is-invalid");
  1718. }
  1719. }
  1720. });
  1721. document.getElementById("basedon").addEventListener("change", function () {
  1722. this.classList.remove("is-invalid");
  1723. document.getElementById("basedonError").textContent = "";
  1724. });
  1725. document.getElementById("reporttype").addEventListener("change", function () {
  1726. this.classList.remove("is-invalid");
  1727. document.getElementById("reportTypeError").textContent = "";
  1728. });
  1729. });
  1730. // Function to manage the display of dropdowns based on the request type
  1731. function myRequest() {
  1732. var requestValue = document.getElementById("request").value;
  1733. // Hide all dropdowns initially
  1734. document.getElementById("userDropdown1").style.display = "none";
  1735. document.getElementById("userDropdown2").style.display = "none";
  1736. document.getElementById("bookingDetailsDropdown1").style.display = "none";
  1737. document.getElementById("bookingDetailsDropdown2").style.display = "none";
  1738. document.getElementById("bookingDetailsDropdown3").style.display = "none";
  1739. document.getElementById("refundDetailsDropdown").style.display = "none";
  1740. document.getElementById("zoneDropdown").style.display = "none";
  1741. document.getElementById("divisionContainer").style.display = "none";
  1742. document.getElementById("hallContainer").style.display = "none";
  1743. document.getElementById("bookingcountbasedonDropdown").style.display = "none";
  1744. document.getElementById("paymentInfoDropdown1").style.display = "none";
  1745. document.getElementById("counterreportDropdown").style.display = "none";
  1746. // Reset dropdown values
  1747. document.getElementById('zone1').value = 'ALL';
  1748. document.getElementById('division1').value = '';
  1749. document.getElementById('hall1').value = '';
  1750. // Show relevant dropdowns based on the selected request value
  1751. if (requestValue === "1") {
  1752. document.getElementById("userDropdown1").style.display = "block";
  1753. document.getElementById("userDropdown2").style.display = "block";
  1754. // Add event listener to handle "User Type" selection
  1755. document.getElementById("usertype").addEventListener("change", function () {
  1756. var userTypeValue = document.getElementById("usertype").value;
  1757. if (userTypeValue === "PUBLIC") {
  1758. document.getElementById("userDropdown1").style.display = "none"; // Hide "User Status" dropdown
  1759. } else {
  1760. document.getElementById("userDropdown1").style.display = "block"; // Show "User Status" dropdown
  1761. }
  1762. });
  1763. // Trigger the change event to apply the logic on initial load if "PUBLIC" is already selected
  1764. document.getElementById("usertype").dispatchEvent(new Event('change'));
  1765. } else if (requestValue === "2") {
  1766. document.getElementById("bookingDetailsDropdown1").style.display = "block";
  1767. document.getElementById("bookingDetailsDropdown2").style.display = "block";
  1768. document.getElementById("bookingDetailsDropdown3").style.display = "block";
  1769. document.getElementById("zoneDropdown").style.display = "block";
  1770. document.getElementById("divisionContainer").style.display = "block";
  1771. document.getElementById("hallContainer").style.display = "block";
  1772. } else if (requestValue === "6") {
  1773. document.getElementById("refundDetailsDropdown").style.display = "block";
  1774. document.getElementById("bookingDetailsDropdown3").style.display = "block";
  1775. } else if (requestValue === "3") {
  1776. document.getElementById("zoneDropdown").style.display = "block";
  1777. document.getElementById("divisionContainer").style.display = "block";
  1778. document.getElementById("hallContainer").style.display = "block";
  1779. document.getElementById("paymentInfoDropdown1").style.display = "block";
  1780. } else if (requestValue === "5") {
  1781. document.getElementById("bookingDetailsDropdown3").style.display = "block";
  1782. document.getElementById("zoneDropdown").style.display = "block";
  1783. document.getElementById("divisionContainer").style.display = "block";
  1784. document.getElementById("hallContainer").style.display = "block";
  1785. } else if (requestValue === "7") {
  1786. document.getElementById("bookingcountbasedonDropdown").style.display = "block";
  1787. } else if (requestValue === "8") {
  1788. document.getElementById("zoneDropdown").style.display = "block";
  1789. document.getElementById("divisionContainer").style.display = "block";
  1790. document.getElementById("hallContainer").style.display = "block";
  1791. document.getElementById("paymentInfoDropdown1").style.display = "block";
  1792. } else if (requestValue === "9") {
  1793. document.getElementById("counterreportDropdown").style.display = "block";
  1794. }
  1795. }
  1796. document.addEventListener("DOMContentLoaded", function () {
  1797. document.getElementById("basedon").addEventListener("change", function () {
  1798. const selectedValue = this.value;
  1799. document.getElementById("bookingcountbasedonDropdown").style.display = selectedValue ? "block" : "none";
  1800. });
  1801. });
  1802. document.addEventListener("DOMContentLoaded", function () {
  1803. document.getElementById("reporttype").addEventListener("change", function () {
  1804. const selectedValue = this.value;
  1805. document.getElementById("counterreportDropdown").style.display = selectedValue ? "block" : "none";
  1806. });
  1807. });
  1808. // Function to reset date fields
  1809. function resetDate() {
  1810. window.location.href = "/communityhall/admin/Reports";
  1811. document.getElementById('fromdate').value = '';
  1812. document.getElementById('todate').value = '';
  1813. }
  1814. function viewDetails(bookingId) {
  1815. $.ajax({
  1816. url: '/communityhall/user/api/viewAllBookingDetails',
  1817. method: 'GET',
  1818. data: {bookingId: bookingId},
  1819. success: function (response) {
  1820. document.getElementById("td_userName").innerHTML = response.users.name;
  1821. document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo;
  1822. document.getElementById("td_usertype").innerHTML = response.users.usertype;
  1823. var userDetails = response.users;
  1824. var userDetailsString =
  1825. userDetails.doorNo + ", " +
  1826. userDetails.street + ", " +
  1827. userDetails.area + ", " +
  1828. userDetails.location + " ,Chennai- " +
  1829. userDetails.pinCode;
  1830. document.getElementById("td_useraddress").innerHTML = userDetailsString;
  1831. document.getElementById("td_hallName").innerHTML = response.hallDetails.hallName;
  1832. var hallDetails = response.hallDetails;
  1833. var hallDetailsString =
  1834. hallDetails.doorNo + ", " +
  1835. hallDetails.street + ", " +
  1836. hallDetails.area + ", " +
  1837. hallDetails.city + "- " +
  1838. hallDetails.pinCode;
  1839. document.getElementById("td_halladdress").innerHTML = hallDetailsString;
  1840. document.getElementById("td_caretakername").innerHTML = response.hallDetails.hallInchargeName;
  1841. document.getElementById("td_caretakermobileNumber").innerHTML = response.hallDetails.hallInchargeMobno;
  1842. document.getElementById("td_bookingDate").innerHTML = response.bookingDate;
  1843. document.getElementById("td_depositeAmount").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1844. document.getElementById("td_hallAmount").innerHTML = parseFloat(response.hallAmount).toFixed(2);
  1845. // Calculate GST and total amount
  1846. var gstAmount = (parseFloat(response.hallAmount) * (response.hallDetails.gst / 100)).toFixed(2);
  1847. var totalAmount = parseFloat(response.amountReceived).toFixed(2);
  1848. document.getElementById("td_gst").innerHTML = gstAmount;
  1849. document.getElementById("td_totalAmount").innerHTML = totalAmount;
  1850. document.getElementById("td_startDate").innerHTML = response.startDate;
  1851. document.getElementById("td_endDate").innerHTML = response.endDate;
  1852. document.getElementById("booking_id").innerHTML = response.bookingId;
  1853. function getTimeSlot(slotValue) {
  1854. var timeSlot;
  1855. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  1856. if (trimmedSlotValue === '1') {
  1857. timeSlot = 'Morning';
  1858. } else if (trimmedSlotValue === '2') {
  1859. timeSlot = 'Evening';
  1860. } else {
  1861. timeSlot = 'Unknown';
  1862. }
  1863. return timeSlot;
  1864. }
  1865. document.getElementById("td_startingSlot").innerHTML = getTimeSlot(response.startingSlot);
  1866. document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot);
  1867. document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus;
  1868. console.log("before comments admin...");
  1869. console.log("Comments..." + response.comments);
  1870. if (response.bookingStatus === 'REJECTED' && response.comments) {
  1871. document.getElementById("rejectionreasondiv").style.display = "block";
  1872. const rejectionCell = document.getElementById("reasonforrejection");
  1873. rejectionCell.innerHTML = response.comments;
  1874. } else {
  1875. document.getElementById("rejectionreasondiv").style.display = "none";
  1876. document.getElementById("reasonforrejection").style.display = "none";
  1877. }
  1878. showReasonDocuments(response);
  1879. if (response.payments) {
  1880. document.getElementById("paymentsdetails").style.display = "block";
  1881. document.getElementById("td_transactionId").innerHTML = response.payments.transactionId;
  1882. document.getElementById("td_payamountReceived").innerHTML = response.payments.amountReceived;
  1883. document.getElementById("td_paymentStatus").innerHTML = response.payments.paymentStatus;
  1884. } else {
  1885. document.getElementById("paymentsdetails").style.display = "none";
  1886. }
  1887. if (response.ebDetails) {
  1888. document.getElementById("ebdetails").style.display = "block";
  1889. document.getElementById("td_EBNumber").innerHTML = response.hallDetails.ebNumber;
  1890. document.getElementById("td_startingReading").innerHTML = response.ebDetails.startingReading;
  1891. document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
  1892. document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
  1893. document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
  1894. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1895. } else {
  1896. document.getElementById("ebdetails").style.display = "none";
  1897. }
  1898. if (response.damageList && response.damageList.length > 0) {
  1899. document.getElementById("damagelist").style.display = "block";
  1900. } else {
  1901. document.getElementById("damagelist").style.display = "none";
  1902. }
  1903. if (response.settlement) {
  1904. document.getElementById("refunddetails").style.display = "block";
  1905. document.getElementById("td_depositeamountforrefund").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1906. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1907. document.getElementById("td_ebAmount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1908. document.getElementById("td_damage").innerHTML = parseFloat(response.settlement.damageAmount).toFixed(2);
  1909. var eb_amt = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1910. var deposit_amt = parseFloat(response.depositAmount).toFixed(2);
  1911. var tem_total = (deposit_amt - eb_amt).toFixed(2);
  1912. $("#td_settel_amt").html(tem_total);
  1913. } else {
  1914. document.getElementById("refunddetails").style.display = "none";
  1915. }
  1916. /*if (response.scheduleCount === 1) {
  1917. document.getElementById("rescheduleDetails").style.display = "block";
  1918. document.getElementById("td_res_start_date").innerHTML = response.startDate;
  1919. document.getElementById("td_res_end_date").innerHTML = response.endDate;
  1920. document.getElementById("td_res_date").innerHTML = response.updatedDate;
  1921. } else {
  1922. document.getElementById("rescheduleDetails").style.display = "none";
  1923. }*/
  1924. showDamageDetails(response);
  1925. if (response.bookingStatus === 'CANCELED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1926. document.getElementById("td_refundamount").innerHTML = `Your booking has been cancelled. Deposit amount of ₹ ${parseFloat(response.depositAmount).toFixed(2)} will be refund 3 to 15 Days`;
  1927. document.getElementById("refundamountDetails").style.display = "block";
  1928. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1929. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1930. } else if (response.bookingStatus === 'CANCELED' && response.refundStatus === 'COMPLETED') {
  1931. document.getElementById("td_refundamount").innerHTML = `Deposit amount of ₹ ${parseFloat(response.depositAmount).toFixed(2)} refunded successfully`;
  1932. document.getElementById("refundamountDetails").style.display = "block";
  1933. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1934. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1935. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus) && response.amountReceived == 0) {
  1936. document.getElementById("refundamountDetails").style.display = "none";
  1937. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1938. document.getElementById("td_refundamount").innerHTML = `Your booking has been Rejected by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1939. document.getElementById("refundamountDetails").style.display = "block";
  1940. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1941. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1942. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'COMPLETED') {
  1943. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1944. document.getElementById("refundamountDetails").style.display = "block";
  1945. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1946. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1947. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'NA') {
  1948. document.getElementById("td_refundamount").innerHTML = `Your Booking has been rejected by GCC`;
  1949. document.getElementById("refundamountDetails").style.display = "block";
  1950. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1951. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1952. } else if (response.bookingStatus === 'GCC_BLOCKED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1953. document.getElementById("td_refundamount").innerHTML = `Your booking has been Blocked by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1954. document.getElementById("refundamountDetails").style.display = "block";
  1955. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1956. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1957. } else if (response.bookingStatus === 'GCC_BLOCKED' && response.refundStatus === 'COMPLETED') {
  1958. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1959. document.getElementById("refundamountDetails").style.display = "block";
  1960. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1961. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1962. } else {
  1963. document.getElementById("refundamountDetails").style.display = "none";
  1964. }
  1965. // Show the modal
  1966. $('#showBookingDetails').modal('show');
  1967. },
  1968. error: function () {
  1969. console.error("An error occurred while fetching booking details.");
  1970. }
  1971. });
  1972. }
  1973. function showDamageDetails(data) {
  1974. var damageFieldContainer = $('#damageDetails');
  1975. damageFieldContainer.empty();
  1976. // Create a div for table responsiveness
  1977. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px'});
  1978. // Create table with similar classes and styles to the modal table
  1979. var table = $('<table>').addClass('table table-bordered table-striped').css({
  1980. 'width': '97%',
  1981. 'border-color': 'black',
  1982. 'border-top-color': 'white'
  1983. });
  1984. var thead = $('<thead>').addClass('thead-light');
  1985. var tbody = $('<tbody>');
  1986. // Create Damage Details header row
  1987. var headerRow = $('<tr>').appendTo(thead);
  1988. $('<th>').attr('colspan', '6').text('Damage Details (if any)').css({
  1989. 'padding': '0.45rem 0.45rem',
  1990. 'background-color': 'lightgrey',
  1991. 'font-weight': 'bold',
  1992. 'color': 'black',
  1993. }).appendTo(headerRow);
  1994. // Create table header row
  1995. var columnHeadersRow = $('<tr>').css('background-color', 'white').appendTo(thead);
  1996. $('<th>').text('S.No').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1997. $('<th>').text('Asset Name').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1998. $('<th>').text('Damage Img').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1999. $('<th>').text('Cost').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  2000. $('<th>').text('Qty').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  2001. $('<th>').text('Amount').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  2002. var totalAmount = 0;
  2003. $.each(data.damageList, function (index, detail) {
  2004. var row = $('<tr>').appendTo(tbody);
  2005. $('<td>').text(index + 1).css('padding', '0.45rem 0.45rem').appendTo(row);
  2006. $('<td>').text(detail.assetName).css('padding', '0.45rem 0.45rem').appendTo(row);
  2007. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
  2008. showDamageImage(detail.damageImageUrl);
  2009. });
  2010. var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
  2011. $('<td>').css('padding', '0.45rem 0.45rem').append(viewLink).appendTo(row);
  2012. $('<td>').text(assetamt).css('padding', '0.45rem 0.45rem').appendTo(row);
  2013. $('<td>').text(detail.quantity).css('padding', '0.45rem 0.45rem').appendTo(row);
  2014. var amount = detail.assetAmount;
  2015. totalAmount += amount;
  2016. $('<td>').text(amount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(row);
  2017. $("#td_dam_amt").html(totalAmount.toFixed(2));
  2018. });
  2019. // Add row for total amount
  2020. var totalRow = $('<tr>').appendTo(tbody);
  2021. $('<td>').attr('colspan', '5').text('Total Amount').css('padding', '0.45rem 0.45rem; font-weight: bold; background-color: #f2f2f2').appendTo(totalRow);
  2022. $('<td>').text(totalAmount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(totalRow);
  2023. // Append the table elements to the container div
  2024. table.append(thead, tbody);
  2025. tableResponsiveDiv.append(table);
  2026. damageFieldContainer.append(tableResponsiveDiv);
  2027. var temp_total = parseFloat($("#td_settel_amt").html());
  2028. var settleAmount = temp_total - totalAmount;
  2029. if (settleAmount < 0) {
  2030. var pendingstatus = data.settlement.collectionStatus
  2031. $("#td_settel_amt").html(0.00);
  2032. $("#pendingcolumn").show();
  2033. $("#collectionstatuscolumn").show();
  2034. $('#td_collection_status').html(pendingstatus);
  2035. $("#td_pending_amt").html(Math.abs(settleAmount).toFixed(2));
  2036. $("#td_pending_amt").css("color", "red");
  2037. } else {
  2038. $("#td_settel_amt").html(settleAmount.toFixed(2));
  2039. $("#pendingcolumn").hide();
  2040. $("#collectionstatuscolumn").hide();
  2041. $("#td_settel_amt").css("color", "green"); // Set color to green for positive amounts
  2042. }
  2043. }
  2044. function showReasonDocuments(list) {
  2045. $.ajax({
  2046. type: "GET",
  2047. url: '/communityhall/api/officer/getReasonByName',
  2048. data: {
  2049. 'reasonName': list.reason
  2050. },
  2051. success: function (x) {
  2052. // console.log(x);
  2053. showReasonWithDocument(x, list);
  2054. }
  2055. });
  2056. }
  2057. // Display booking documents
  2058. function showReasonWithDocument(reasonData, list) {
  2059. var reasonDocumentData = reasonData.reasonDocumentMasterList;
  2060. var bookingDocumentsList = list.bookingDocumentsList;
  2061. const reasonFieldsContainer = $('#documents');
  2062. reasonFieldsContainer.empty();
  2063. // Create a responsive table container
  2064. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({'width': '770px', 'border': 'black'});
  2065. // Create the table with Bootstrap classes and custom styles
  2066. var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
  2067. 'width': '100%',
  2068. 'height': 'auto',
  2069. 'border': '1px solid black'
  2070. });
  2071. // Create the table header (thead)
  2072. var thead = $('<thead>').appendTo(table);
  2073. var headerRow = $('<tr>').appendTo(thead);
  2074. $('<th>').attr('colspan', '3').text('Document Details').css({
  2075. 'color': 'black',
  2076. 'background-color': '#f2f2f2',
  2077. 'padding': '0.45rem 0.45rem'
  2078. }).appendTo(headerRow);
  2079. // Create header row for columns
  2080. var columnHeadersRow = $('<tr>').appendTo(thead);
  2081. $('<th>').text('S.No').appendTo(columnHeadersRow);
  2082. $('<th>').text('Required Info').appendTo(columnHeadersRow);
  2083. $('<th>').text('Required Documents').appendTo(columnHeadersRow);
  2084. // Create the table body (tbody)
  2085. var tbody = $('<tbody>').appendTo(table);
  2086. // Iterate through the documents list and populate rows
  2087. for (var i = 0; i < bookingDocumentsList.length; i++) {
  2088. (function (index) {
  2089. var row = $('<tr>').appendTo(tbody);
  2090. $('<td>').text(index + 1).appendTo(row);
  2091. $('<td>').text(reasonDocumentData[index].fieldName + ': ' + bookingDocumentsList[index].name).appendTo(row);
  2092. // Create a link to view document image
  2093. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text(reasonDocumentData[index].docFieldName).on('click', function () {
  2094. showDocumentImage(bookingDocumentsList[index].bookingDocUrl);
  2095. });
  2096. $('<td>').append(viewLink).appendTo(row);
  2097. })(i);
  2098. }
  2099. // Append table to the responsive container
  2100. tableResponsiveDiv.append(table);
  2101. // Append table to the container in the DOM
  2102. reasonFieldsContainer.append(tableResponsiveDiv);
  2103. }
  2104. function showDocumentImage(fileURL) {
  2105. //console.log(fileURL);
  2106. openFileModal(fileURL);
  2107. }
  2108. // Event delegation for dynamically added elements
  2109. $(document).on('click', '.view-document', function () {
  2110. const fileURL = $(this).data('url');
  2111. openFileModal(fileURL);
  2112. });
  2113. function openFileModal(fileURL) {
  2114. $('#filePreview').attr('src', fileURL);
  2115. $('#fileModal').modal('show');
  2116. }
  2117. $('#fileModal').on('shown.bs.modal', function () {
  2118. // boost the last backdrop above everything else
  2119. $('.modal-backdrop').last().css({
  2120. 'z-index': 1095,
  2121. 'pointer-events': 'none'
  2122. });
  2123. // boost this modal
  2124. $(this).css('z-index', 1100);
  2125. });
  2126. function viewbookingDetails(userId) {
  2127. $.ajax({
  2128. type: "GET",
  2129. url: '/communityhall/admin/api/bookingdetailsByuserId',
  2130. data: {'userId': userId},
  2131. success: function (response) {
  2132. // console.log(response);
  2133. $("#bookingTableBody").empty(); // Ensure bookingTableBody is the correct ID of the table body
  2134. $.each(response, function (index, booking) {
  2135. // Create table row with the data from response
  2136. var row = '<tr>' + // Added <tr> tag
  2137. '<td class="text-center">' + (index + 1) + '</td>' +
  2138. '<td class="text-center">' + booking.bookingId + '</td>' +
  2139. '<td class="text-center">' + booking.bookingDate + '</td>' +
  2140. '<td class="text-center">' + booking.startDate + '</td>' +
  2141. '<td class="text-center">' + booking.endDate + '</td>' +
  2142. '<td class="text-center">' + booking.startingSlot + '</td>' +
  2143. '<td class="text-center">' + booking.endingSlot + '</td>' +
  2144. '<td class="text-center">' + booking.reason + '</td>' +
  2145. '<td class="text-center">' + booking.noOfDays + '</td>' +
  2146. '<td class="text-center">' + booking.bookingStatus + '</td>' +
  2147. '<td class="text-center">' + booking.hallAmount + '</td>' +
  2148. '<td class="text-center">' + booking.amountReceived + '</td>' +
  2149. '</tr>'; // Close <tr> tag
  2150. // Append the row to the table body
  2151. $("#bookingTableBody").append(row);
  2152. });
  2153. $('#viewbookingDetailsdetails').modal('show');
  2154. },
  2155. error: function (xhr, status, error) {
  2156. console.error(xhr.responseText);
  2157. // Handle error here
  2158. }
  2159. });
  2160. }
  2161. function viewbookingDetailsbasedonzone(zone) {
  2162. $.ajax({
  2163. type: "GET",
  2164. url: '/communityhall/admin/api/bookingdetailsByzone',
  2165. data: {'zone': zone},
  2166. success: function (response) {
  2167. // console.log(response);
  2168. // Clear existing table data and destroy DataTable instance if it exists
  2169. var table = $('#bookinglistdataTablebyzone').DataTable();
  2170. if (table) {
  2171. table.clear().destroy();
  2172. }
  2173. // Populate table with new data
  2174. var tableBody = $("#bookingTableBodybyzone");
  2175. tableBody.empty(); // Clear the table body
  2176. $.each(response, function (index, booking) {
  2177. var row = '<tr>' +
  2178. '<td class="text-center">' + (index + 1) + '</td>' +
  2179. '<td class="text-center">' + booking.bookingId + '</td>' +
  2180. '<td class="text-center">' + booking.bookingDate + '</td>' +
  2181. '<td class="text-center">' + booking.startDate + '</td>' +
  2182. '<td class="text-center">' + booking.endDate + '</td>' +
  2183. '<td class="text-center">' + booking.startingSlot + '</td>' +
  2184. '<td class="text-center">' + booking.endingSlot + '</td>' +
  2185. '<td class="text-center">' + booking.reason + '</td>' +
  2186. '<td class="text-center">' + booking.noOfDays + '</td>' +
  2187. '<td class="text-center">' + booking.bookingStatus + '</td>' +
  2188. '<td class="text-center">' + booking.hallAmount + '</td>' +
  2189. '<td class="text-center">' + booking.amountReceived + '</td>' +
  2190. '</tr>';
  2191. tableBody.append(row);
  2192. });
  2193. // Initialize DataTable
  2194. $('#bookinglistdataTablebyzone').DataTable({
  2195. "paging": true,
  2196. "searching": true,
  2197. "ordering": true,
  2198. "info": true
  2199. });
  2200. // Show the modal
  2201. $('#viewbookingDetailsbyzone').modal('show');
  2202. },
  2203. error: function (xhr, status, error) {
  2204. console.error(xhr.responseText);
  2205. // Handle error here
  2206. }
  2207. });
  2208. }
  2209. document.addEventListener('DOMContentLoaded', function () {
  2210. fetchData();
  2211. restoreSelectedValues();
  2212. document.getElementById('request').addEventListener('change', function () {
  2213. myRequest(); // Handle request change
  2214. });
  2215. document.getElementById('zone1').addEventListener('change', function () {
  2216. updateDivisions();
  2217. });
  2218. document.getElementById('division1').addEventListener('change', function () {
  2219. updateHalls();
  2220. });
  2221. });
  2222. function fetchData() {
  2223. fetch('/communityhall/user/api/getZonehalls') // Replace with your actual API endpoint
  2224. .then(response => response.json())
  2225. .then(data => {
  2226. populateDropdowns(data);
  2227. restoreSelectedValues();
  2228. })
  2229. .catch(error => console.error('Error fetching data:', error));
  2230. }
  2231. function populateDropdowns(data) {
  2232. const zoneDropdown = document.getElementById('zone1');
  2233. const divisionDropdown = document.getElementById('division1');
  2234. const hallDropdown = document.getElementById('hall1');
  2235. const zones = new Set();
  2236. const divisionsByZone = {};
  2237. const hallsByDivision = {};
  2238. data.forEach(item => {
  2239. zones.add(item.zone);
  2240. if (!divisionsByZone[item.zone]) {
  2241. divisionsByZone[item.zone] = [];
  2242. }
  2243. if (!divisionsByZone[item.zone].includes(item.division)) {
  2244. divisionsByZone[item.zone].push(item.division);
  2245. }
  2246. if (!hallsByDivision[item.division]) {
  2247. hallsByDivision[item.division] = [];
  2248. }
  2249. hallsByDivision[item.division].push({hallName: item.hall_name, hallId: item.hall_id});
  2250. });
  2251. // Populate zones
  2252. zones.forEach(zone => {
  2253. const option = document.createElement('option');
  2254. option.value = zone;
  2255. option.textContent = zone;
  2256. zoneDropdown.appendChild(option);
  2257. });
  2258. zoneDropdown.dataset.divisionsByZone = JSON.stringify(divisionsByZone);
  2259. divisionDropdown.dataset.hallsByDivision = JSON.stringify(hallsByDivision);
  2260. // Initialize divisions and halls
  2261. updateDivisions();
  2262. }
  2263. function updateDivisions() {
  2264. const zoneDropdown = document.getElementById('zone1');
  2265. const selectedZone = zoneDropdown.value;
  2266. const divisionsByZone = JSON.parse(zoneDropdown.dataset.divisionsByZone || '{}');
  2267. const divisionDropdown = document.getElementById('division1');
  2268. divisionDropdown.innerHTML = '';
  2269. const allOption = document.createElement('option');
  2270. allOption.value = '';
  2271. allOption.textContent = '--Select Division--';
  2272. divisionDropdown.appendChild(allOption);
  2273. if (selectedZone === '') {
  2274. document.getElementById('divisionContainer').classList.add('hidden');
  2275. } else {
  2276. document.getElementById('divisionContainer').classList.remove('hidden');
  2277. (divisionsByZone[selectedZone] || []).forEach(division => {
  2278. const option = document.createElement('option');
  2279. option.value = division;
  2280. option.textContent = division;
  2281. divisionDropdown.appendChild(option);
  2282. });
  2283. updateHalls();
  2284. }
  2285. }
  2286. function updateHalls() {
  2287. const divisionDropdown = document.getElementById('division1');
  2288. const selectedDivision = divisionDropdown.value;
  2289. const hallsByDivision = JSON.parse(divisionDropdown.dataset.hallsByDivision || '{}');
  2290. const hallDropdown = document.getElementById('hall1');
  2291. hallDropdown.innerHTML = '';
  2292. const allOption = document.createElement('option');
  2293. allOption.value = '';
  2294. allOption.textContent = '--Select Hall--';
  2295. hallDropdown.appendChild(allOption);
  2296. if (selectedDivision === '') {
  2297. document.getElementById('hallContainer').classList.add('hidden');
  2298. } else {
  2299. document.getElementById('hallContainer').classList.remove('hidden');
  2300. (hallsByDivision[selectedDivision] || []).forEach(hall => {
  2301. const option = document.createElement('option');
  2302. option.value = hall.hallId;
  2303. option.textContent = hall.hallName;
  2304. hallDropdown.appendChild(option);
  2305. });
  2306. }
  2307. }
  2308. function restoreSelectedValues() {
  2309. const selectedZone = localStorage.getItem('selectedZone') || '';
  2310. const selectedDivision = localStorage.getItem('selectedDivision') || '';
  2311. const selectedHall = localStorage.getItem('selectedHall') || '';
  2312. const zoneDropdown = document.getElementById('zone1');
  2313. const divisionDropdown = document.getElementById('division1');
  2314. const hallDropdown = document.getElementById('hall1');
  2315. zoneDropdown.value = selectedZone;
  2316. updateDivisions(); // Populate divisions based on selected zone
  2317. // Make sure to set the division and hall values after the dropdowns are populated
  2318. divisionDropdown.value = selectedDivision;
  2319. updateHalls(); // Populate halls based on selected division
  2320. hallDropdown.value = selectedHall;
  2321. }
  2322. // Store selected values before form submission
  2323. function storeSelectedValues() {
  2324. const zoneDropdown = document.getElementById('zone1');
  2325. const divisionDropdown = document.getElementById('division1');
  2326. const hallDropdown = document.getElementById('hall1');
  2327. localStorage.setItem('selectedZone', zoneDropdown.value);
  2328. localStorage.setItem('selectedDivision', divisionDropdown.value);
  2329. localStorage.setItem('selectedHall', hallDropdown.value);
  2330. }
  2331. document.getElementById('myForm').addEventListener('submit', function () {
  2332. storeSelectedValues();
  2333. });
  2334. let hallBookingData = [];
  2335. let hallDetailsData = [];
  2336. window.addEventListener("DOMContentLoaded", () => {
  2337. try {
  2338. const jsonString1 = document.getElementById("hallBookingJsonInput")?.value;
  2339. if (jsonString1) {
  2340. hallBookingData = JSON.parse(jsonString1);
  2341. console.log("Parsed hallBookingData:", hallBookingData);
  2342. }
  2343. const jsonString2 = document.getElementById("hallBookingDetailsJsonInput")?.value;
  2344. if (jsonString2) {
  2345. hallDetailsData = JSON.parse(jsonString2);
  2346. console.log("Parsed hallDetailsData:", hallDetailsData);
  2347. }
  2348. } catch (e) {
  2349. console.error("Failed to parse JSON inputs", e);
  2350. }
  2351. // Delegate click event for dynamically added booking links
  2352. $(document).on('click', '.hall-detail-link', function (e) {
  2353. e.preventDefault();
  2354. const hallName = $(this).data('hall-name');
  2355. showHallBookingDetails(hallName);
  2356. });
  2357. });
  2358. function showCounterTable(elem) {
  2359. const counterId = elem.getAttribute("data-counter-id");
  2360. const filtered = hallBookingData.filter(row => row[0] == counterId);
  2361. const table = $('#modalBookingTable').DataTable();
  2362. table.clear();
  2363. filtered.forEach((row, index) => {
  2364. table.row.add([
  2365. index + 1,
  2366. row[1], // Zone
  2367. row[2], // Division
  2368. row[3], // Hall Name
  2369. `<button href="#" class="hall-detail-link"
  2370. style="background-color: #2a807f; color: white; border: none; padding: 6px 12px; border-radius: 4px;"
  2371. data-hall-name="${row[3]}">${row[4]}</button>`
  2372. ]);
  2373. });
  2374. table.draw();
  2375. table.columns.adjust().responsive.recalc();
  2376. // Show modal after data is loaded
  2377. $('#bookingModal').modal('show');
  2378. }
  2379. function formatDateFromTimestamp(timestamp) {
  2380. const date = new Date(parseInt(timestamp));
  2381. const year = date.getFullYear();
  2382. const month = String(date.getMonth() + 1).padStart(2, '0');
  2383. const day = String(date.getDate()).padStart(2, '0');
  2384. return `${year}-${month}-${day}`;
  2385. }
  2386. function getSlotLabel(slot) {
  2387. return slot === 1 ? 'Morning' : (slot === 2 ? 'Evening' : '');
  2388. }
  2389. function showHallBookingDetails(hallName) {
  2390. const filtered = hallDetailsData.filter(row => row[1] === hallName);
  2391. const table = $('#hallDetailsTable').DataTable();
  2392. table.clear();
  2393. filtered.forEach((row, index) => {
  2394. table.row.add([
  2395. index + 1,
  2396. row[0],
  2397. row[1],
  2398. formatDateFromTimestamp(row[2]),
  2399. row[3],
  2400. row[4],
  2401. getSlotLabel(row[5]),
  2402. getSlotLabel(row[6]),
  2403. row[7],
  2404. row[8],
  2405. row[9],
  2406. row[10],
  2407. row[11],
  2408. row[12],
  2409. row[13],
  2410. row[14],
  2411. ` <button class="btn btn-sm btn-primary" onclick="viewDetails('${row[0]}')">View</button>`
  2412. ]);
  2413. });
  2414. table.draw();
  2415. table.columns.adjust().responsive.recalc();
  2416. $('#hallDetailModal').modal('show');
  2417. }
  2418. function viewCounterBookingDetails(bookingId) {
  2419. viewDetails(bookingId);
  2420. }
  2421. // for review report
  2422. let halldetailcount = [];
  2423. let counterdetailcount = [];
  2424. window.addEventListener("DOMContentLoaded", () => {
  2425. try {
  2426. const jsonString1 = document.getElementById("hallWiseBookingList")?.value;
  2427. if (jsonString1) {
  2428. halldetailcount = JSON.parse(jsonString1);
  2429. console.log("Parsed hall wise count data:", halldetailcount);
  2430. }
  2431. const jsonString2 = document.getElementById("counterWiseBookingList")?.value;
  2432. if (jsonString2) {
  2433. counterdetailcount = JSON.parse(jsonString2);
  2434. console.log("Parsed counter wise count data:", counterdetailcount);
  2435. }
  2436. } catch (e) {
  2437. console.error("Failed to parse JSON inputs", e);
  2438. }
  2439. $(document).on('click', '.counter-booking-link', function (e) {
  2440. e.preventDefault();
  2441. const hallId = $(this).data('hall-id');
  2442. showCounterCountDetails(hallId);
  2443. });
  2444. });
  2445. function showHallDetailsTable(elem) {
  2446. const zoneId = elem.getAttribute("data-zone-id");
  2447. console.log("Selected Zone:", zoneId);
  2448. console.log("Full Data:", halldetailcount);
  2449. // FIX: Compare correct column (zoneId might be at index 5)
  2450. const filtered = halldetailcount.filter(row => String(row[5]) === String(zoneId));
  2451. console.log("Filtered Data:", filtered);
  2452. const table = $('#hallwiseBookingTable').DataTable();
  2453. table.clear();
  2454. filtered.forEach((row, index) => {
  2455. table.row.add([
  2456. index + 1,
  2457. row[1], // hall name
  2458. row[3], // online booking
  2459. `<button type="button" class="btn btn-sm btn-info counter-booking-link"
  2460. data-hall-id="${row[0]}">${row[4]}</button>`, // clickable counter count
  2461. row[2] // total count
  2462. ]);
  2463. });
  2464. table.draw();
  2465. $('#hallModal').modal('show');
  2466. }
  2467. function showCounterCountDetails(hallId) {
  2468. console.log("Looking for hallId:", hallId);
  2469. console.log("All Counter Data:", counterdetailcount);
  2470. const filtered = counterdetailcount.filter(row => String(row[1]) === String(hallId));
  2471. console.log("Filtered Counter Data:", filtered);
  2472. const table = $('#counterDetailsTable').DataTable();
  2473. table.clear();
  2474. filtered.forEach((row, index) => {
  2475. table.row.add([
  2476. index + 1,
  2477. row[0], // Counter ID
  2478. row[2] // Booking count
  2479. ]);
  2480. });
  2481. table.draw();
  2482. $('#counterDetailModal').modal('show');
  2483. }
  2484. </script>
  2485. </body>
  2486. </html>