Victoria Hall Booking for Events
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2774 lines
142 KiB

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