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.

1474 lines
52 KiB

2 years ago
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
2 years ago
​
2 years ago
​
​
2 years ago
​
2 years ago
​
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/head :: head}"></head>
  4. <!--<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
  5. <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
  6. <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.css" />
  7. <link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.Default.css" />
  8. <script src="https://unpkg.com/leaflet.markercluster/dist/leaflet.markercluster.js"></script>-->
  9. <!--datatables-->
  10. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
  11. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.dataTables.min.css">
  12. <!-- Stylesheets -->
  13. <!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.css" />-->
  14. <link rel="stylesheet" type="text/css" href="..\files\assets\css\MarkerCluster.css">
  15. <!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.5.3/MarkerCluster.Default.css" />-->
  16. <link rel="stylesheet" type="text/css" href="..\files\assets\css\MarkerCluster.Default.css">
  17. <!--<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.css" />-->
  18. <link rel="stylesheet" type="text/css" href="..\files\assets\css\leaflet.css">
  19. <!-- JavaScript -->
  20. <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.js"></script>-->
  21. <script type="text/javascript" src="..\files\assets\js\leaflet.js"></script>
  22. <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/1.5.3/leaflet.markercluster.js"></script>-->
  23. <script type="text/javascript" src="..\files\assets\js\leaflet.markercluster.js"></script>
  24. <style>
  25. /* Hide button and div2 on small screens */
  26. @media only screen and (max-width: 768px) {
  27. #toggleButton {
  28. display: none;
  29. }
  30. #div2 {
  31. display: none;
  32. }
  33. .table-container {
  34. height: 300px;
  35. /* Adjust height as needed */
  36. overflow-y: auto;
  37. }
  38. }
  39. /* Optional CSS styling */
  40. .thumbnail {
  41. cursor: pointer;
  42. }
  43. .modal-dialog {
  44. margin: 30px auto;
  45. }
  46. .carousel-item img {
  47. width: 100%;
  48. height: auto;
  49. }
  50. /* Custom CSS to change the color of carousel controls */
  51. .carousel-control-prev,
  52. .carousel-control-next {
  53. color: black;
  54. }
  55. #enteredDetails {
  56. display: none
  57. }
  58. .card {
  59. max-height: 75%;
  60. }
  61. #scrollToTopBtn {
  62. display: none;
  63. position: fixed;
  64. bottom: 20px;
  65. right: 30px;
  66. height: 45px;
  67. width: 45px;
  68. z-index: 99;
  69. border: none;
  70. outline: none;
  71. background-color: #FA7F08;
  72. color: white;
  73. cursor: pointer;
  74. padding: 15px;
  75. border-radius: 50%;
  76. opacity: 50%;
  77. }
  78. #scrollToTopBtn:hover {
  79. background-color: #22BABB;
  80. opacity: 100%;
  81. }
  82. .required-field {
  83. color: red;
  84. }
  85. #amounttable {
  86. border-collapse: separate;
  87. border-spacing: 5px;
  88. /* Set cell spacing */
  89. margin-bottom: 5px;
  90. /* margin-left:30px; */
  91. }
  92. #amounttable th {
  93. padding: 2px;
  94. /* Set cell padding */
  95. border: none;
  96. text-align: center;
  97. padding: 0px 1px;
  98. width: 65%;
  99. font-size: 12px;
  100. }
  101. #amounttable td {
  102. padding: 2px;
  103. /* Set cell padding */
  104. border: none;
  105. text-align: left;
  106. width: 35%;
  107. font-size: 12px;
  108. }
  109. .swal2-container {
  110. z-index: 9999999999999 !important;
  111. /* Adjust this value if needed */
  112. }
  113. .image-container {
  114. overflow: hidden;
  115. white-space: nowrap;
  116. }
  117. .image-container img {
  118. display: inline-block;
  119. margin-right: 10px;
  120. /* Adjust as needed */
  121. animation: scrollImages 5s linear infinite;
  122. /* Adjust duration and timing function as needed */
  123. }
  124. @keyframes scrollImages {
  125. 0% {
  126. transform: translateX(0);
  127. }
  128. 100% {
  129. transform: translateX(-100%);
  130. }
  131. }
  132. #map {
  133. height: 700px;
  134. /* Adjust height as needed */
  135. width: 100%;
  136. position: relative;
  137. overflow: hidden;
  138. max-width: 100%;
  139. /* Ensure the map doesn't overflow its container */
  140. }
  141. .border-primary {
  142. border-left: white;
  143. }
  144. .swal2-container {
  145. z-index: 9999999999999 !important;
  146. /* Adjust this value if needed */
  147. }
  148. .carousel-inner img {
  149. object-fit: cover; /* Ensures images scale uniformly */
  150. height: 250px; /* Fixed height */
  151. width: 300px; /* Fixed width */
  152. margin: auto; /* Centers the image */
  153. margin-top: 20px;
  154. }
  155. .carousel {
  156. display: flex;
  157. justify-content: center; /* Center the carousel itself */
  158. }
  159. .carousel-image {
  160. max-height: 300px;
  161. /* Adjust height as needed */
  162. width: auto;
  163. margin: 0 auto;
  164. /* Center the image horizontally */
  165. }
  166. </style>
  167. <body>
  168. <!-- Pre-loader start -->
  169. <div class="theme-loader">
  170. <div class="ball-scale">
  171. <div class='contain'>
  172. <div class="ring">
  173. <div class="frame"></div>
  174. </div>
  175. <div class="ring">
  176. <div class="frame"></div>
  177. </div>
  178. <div class="ring">
  179. <div class="frame"></div>
  180. </div>
  181. <div class="ring">
  182. <div class="frame"></div>
  183. </div>
  184. <div class="ring">
  185. <div class="frame"></div>
  186. </div>
  187. <div class="ring">
  188. <div class="frame"></div>
  189. </div>
  190. <div class="ring">
  191. <div class="frame"></div>
  192. </div>
  193. <div class="ring">
  194. <div class="frame"></div>
  195. </div>
  196. <div class="ring">
  197. <div class="frame"></div>
  198. </div>
  199. <div class="ring">
  200. <div class="frame"></div>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. <!-- Pre-loader end -->
  206. <div id="pcoded" class="pcoded">
  207. <div class="pcoded-container">
  208. <!-- Menu header start -->
  209. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  210. <!-- Menu header end -->
  211. <div class="pcoded-main-container">
  212. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  213. <div class="pcoded-wrapper">
  214. <div class="pcoded-content">
  215. <div class="pcoded-inner-content">
  216. <!-- Main-body start -->
  217. <div class="main-body">
  218. <div class="page-wrapper">
  219. <!-- Page body start -->
  220. <div class="page-body" style="padding-top: 3%;">
  221. <div id="map" style="display:none;"><br></div>
  222. <div th:if="${newnotification != null && !newnotification.isEmpty()}" id="notification">
  223. <marquee
  224. width="100%"
  225. direction="left"
  226. height="auto"
  227. style="color:red"
  228. onmouseover="this.stop();"
  229. onmouseout="this.start();">
  230. <i class="fas fa-bell"></i> * <span th:text="${newnotification}"></span> *
  231. </marquee>
  232. </div>
  233. <div class="row" id="dashboardbody">
  234. <div class="col-sm-12">
  235. <div class="card">
  236. <!--Check Availability Start-->
  237. <div class="z-depth-0">
  238. <div class="card border-dark mb-3">
  239. <div class="card-body">
  240. <div class="form-row col-sm-12 col-md-12 col-lg-12"
  241. id="formrow">
  242. <div class="col-sm-2">
  243. <label for="fromdate">From Date:<span
  244. class="required-field">*</span></label>
  245. <input class="form-control"
  246. th:value="${fromDate}" name="fromdate"
  247. type="date" id="fromdate"
  248. placeholder="dd-mm-yyyy">
  249. </div>
  250. <div class="col-sm-2">
  251. <label for="todate">To Date:<span
  252. class="required-field">*</span></label>
  253. <select class="form-control" name="todate"
  254. id="todate">
  255. <option th:value="${toDate}"
  256. th:text="${toDate}" selected></option>
  257. </select>
  258. </div>
  259. <div class="col-sm-2">
  260. <label for="startingslot">Starting Slot:</label>
  261. <select class="form-control" id="startingslot"
  262. name="startingslot"
  263. aria-label="Starting Slot">
  264. <option value="0"
  265. th:selected="${startingSlot == 'Select'}">
  266. Select</option>
  267. <option value="1"
  268. th:selected="${startingSlot == 'Morning'}">
  269. Morning</option>
  270. <option value="2"
  271. th:selected="${startingSlot == 'Evening'}">
  272. Evening</option>
  273. </select>
  274. </div>
  275. <div class="col-sm-2">
  276. <label for="endingslot">Ending Slot:</label>
  277. <select class="form-control" id="endingslot"
  278. name="endingslot" aria-label="Ending Slot">
  279. <option value="0"
  280. th:selected="${endingSlot == 'Select'}">
  281. Select</option>
  282. <option value="1"
  283. th:selected="${endingSlot == 'Morning'}">
  284. Morning</option>
  285. <option value="2"
  286. th:selected="${endingSlot == 'Evening'}">
  287. Evening</option>
  288. </select>
  289. </div>
  290. <div style="margin-top: 29px;">
  291. <div class="input-group-append">
  292. <button class="btn btn-outline-secondary"
  293. type="button" id="filterIcon">
  294. <i class="fas fa-filter"></i>
  295. </button>
  296. </div>
  297. </div>
  298. <div style="padding-top: 28px;display:none;margin-left:9px;" id="resetbutton">
  299. <button type="button" class="btn btn-grd-danger"
  300. onclick="resetDate()">Reset</button>
  301. </div>
  302. <div class="col-sm-2" style="padding-top: 28px;">
  303. <button type="button"
  304. class="btn btn-grd-primary"
  305. onclick="displayHallDetails()">Check
  306. Now</button>
  307. </div>
  308. <div class="col-sm-10" style="padding-top:28px;">
  309. <a
  310. href="javascript:initializeMapAndFetchCoordinates()">
  311. <i class="fas fa-map-marker-alt"></i> Click
  312. here to view Map Centers
  313. </a>
  314. </div><br><br>
  315. </div>
  316. </div>
  317. </div>
  318. </div>
  319. </div>
  320. <button id="toggleButton"
  321. class="btn btn-inverse btn-outline-inverse btn-icon">
  322. <i class="icofont icofont-exchange" data-toggle="tooltip"
  323. data-placement="left" title="Table/Grid View"></i>
  324. </button>
  325. <br>
  326. <!-- Toggle button end-->
  327. <!--Grid View start-->
  328. <br>
  329. <div id="div1">
  330. <div class="row" style="align-items: flex-start;margin-right:0">
  331. <div th:each="hall : ${halls}"
  332. class="col-lg-3 col-md-6 default-grid-item">
  333. <div class="card">
  334. <div class="masonry-media">
  335. <!--<div style="height:250px;width:300px"
  336. id="hallImagesCarousel" class="carousel slide"
  337. data-ride="carousel">
  338. <div class="carousel-inner">
  339. <img th:if="${hall.hallImagesList != null && !hall.hallImagesList.isEmpty()}"
  340. th:src="@{${hall.hallImagesList[0].hallImage}}"
  341. th:onclick="viewHallImages([[${hall.hallId}]])"
  342. class="d-block w-100 carousel-image"
  343. alt="Hall Image">
  344. </div>
  345. </div>-->
  346. <div style="height:250px;width:300px" id="hallImagesCarousel" class="carousel slide" data-ride="carousel">
  347. <div class="carousel-inner">
  348. <img th:if="${hall.hallImagesList != null && !hall.hallImagesList.isEmpty()}"
  349. th:src="@{${hall.hallImagesList[0].hallImage}}"
  350. th:onclick="viewHallImages([[${hall.hallId}]])"
  351. class="d-block carousel-image"
  352. alt="Hall Image">
  353. </div>
  354. </div>
  355. </div>
  356. <div class="card-block" id="cardblock">
  357. <h6 class="job-card-desc"><span
  358. th:text="${hall.hallName}"></span></h6>
  359. <table id="amounttable">
  360. <tr>
  361. <th class="text-muted">Full day Rent:</th>
  362. <td th:text="${hall.fullDayRent}"
  363. class="text-muted"></td>
  364. </tr>
  365. <tr>
  366. <th class="text-muted">Half day Rent:</th>
  367. <td th:text="${hall.halfDayRent}"
  368. class="text-muted"></td>
  369. </tr>
  370. <tr>
  371. <th class="text-muted">Security Deposit:
  372. </th>
  373. <td th:text="${hall.depositAmount}"
  374. class="text-muted"></td>
  375. </tr>
  376. </table>
  377. <div class="job-meta-data"><i
  378. class="icofont icofont-location-arrow"></i>
  379. <a th:attr="data-latitude=${hall.latitude}, data-longitude=${hall.longitude}"
  380. th:onclick="showHall(this)"
  381. style="cursor: pointer;">
  382. <span th:text="${hall.doorNo}"></span>,
  383. <span th:text="${hall.street}"></span>,
  384. <span th:text="${hall.area}"></span>,
  385. <br>
  386. <span th:text="${hall.city}"></span> -
  387. <span th:text="${hall.pinCode}"></span>
  388. </a>
  389. </div>
  390. <div class="job-meta-data"><i
  391. class="icofont icofont-university"></i>Capacity:
  392. <span th:text="${hall.seatingCapacity}"></span>
  393. </div>
  394. </div>
  395. <div class="row">
  396. <div class="col-md-6">
  397. <a href="javascript:void(0);"
  398. class="btn btn-primary book-button"
  399. th:onclick="return checkLoginedIn('book',[[${hall.hallId}]]);">
  400. Book
  401. </a>
  402. </div>
  403. <div class="col-md-6">
  404. <a th:href="'/communityhall/viewhallform?hallId=' + ${hall.hallId}"
  405. class="btn btn-primary book-button">View</a>
  406. </div>
  407. </div>
  408. </div>
  409. </div>
  410. <br>
  411. </div>
  412. </div>
  413. <div id="div2" style="display: none;">
  414. <!-- Zero config.table start -->
  415. <div class="card">
  416. <div class="card-header">
  417. <h5>Community Hall Details</h5>
  418. </div>
  419. <div class="card-block">
  420. <div class="block-content p-0">
  421. <div class="p-sm-4 p-0">
  422. <div class="table-responsive">
  423. <table
  424. class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
  425. id="simpletable">
  426. <thead class="thead-light responsive"
  427. style="background-color: rgb(21,69,93);color: white;">
  428. <tr class="table-bordered ">
  429. <th class="text-center no-sort"
  430. width="10%">S.No</th>
  431. <th class="text-center" width="10%">
  432. Hall
  433. Name
  434. </th>
  435. <th class="text-center" width="10%">
  436. Address
  437. </th>
  438. <th class="text-center" width="10%">
  439. Landmark</th>
  440. <th class="text-center" width="10%">
  441. Seating
  442. Capacity
  443. </th>
  444. <th class="text-center" width="10%">
  445. Deposit
  446. Amount
  447. </th>
  448. <th class="text-center" width="10%">
  449. Full Day
  450. Amount
  451. </th>
  452. <th class="text-center" width="10%">
  453. Half Day
  454. Amount
  455. </th>
  456. <th>View Images</th>
  457. <th>Book Now</th>
  458. </tr>
  459. </thead>
  460. <tbody>
  461. <tr th:each="hall, i : ${halls}"
  462. class="${halls}">
  463. <td th:text="${i.count}"></td>
  464. <td th:text="${hall.hallName}"></td>
  465. <td th:text="${hall.area}"></td>
  466. <td th:text="${hall.city}"></td>
  467. <td
  468. th:text="${hall.seatingCapacity}">
  469. </td>
  470. <td th:text="${hall.depositAmount}">
  471. </td>
  472. <td th:text="${hall.fullDayRent}">
  473. </td>
  474. <td th:text="${hall.halfDayRent}">
  475. </td>
  476. <td>
  477. <a class="view-button"><span
  478. class="badge bg-primary"
  479. style="cursor: pointer;"
  480. th:onclick="viewHallImages([[${hall.hallId}]])">View</span></a>
  481. </td>
  482. <td><a href="javascript:void(0);"><span
  483. class="badge bg-success"
  484. th:onclick="return checkLoginedIn('book',[[${hall.hallId}]]);"
  485. style="cursor: pointer;">Book</span></a>
  486. </td>
  487. </tr>
  488. </tbody>
  489. </table>
  490. </div>
  491. </div>
  492. </div>
  493. </div>
  494. </div>
  495. </div>
  496. </div>
  497. <!-- Zero config.table end -->
  498. <div class="modal fade" id="exampleModal" tabindex="-1"
  499. aria-labelledby="exampleModalLabel" aria-hidden="true">
  500. <div class="modal-dialog" style="width:auto;">
  501. <div class="modal-content">
  502. <div class="modal-header">
  503. <h5 class="modal-title" id="exampleModalLabel">Hall Image
  504. </h5>
  505. <button type="button" class="btn-close"
  506. data-bs-dismiss="modal" aria-label="Close"></button>
  507. </div>
  508. <div class="modal-body"
  509. style="height: 350px; overflow: hidden;">
  510. <div id="carouselExample" class="carousel slide"
  511. data-bs-ride="carousel1">
  512. <div class="carousel-inner1"
  513. style="height:auto; width:auto;">
  514. <!-- Slides will be dynamically inserted here -->
  515. </div>
  516. </div>
  517. </div>
  518. <div class="modal-footer">
  519. <!-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>-->
  520. </div>
  521. </div>
  522. </div>
  523. </div>
  524. <!--Image view model END-->
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. <a onclick="topFunction()" id="scrollToTopBtn" title="Go to top"><i
  531. class="icofont icofont-circled-up"></i></a>
  532. <footer th:replace="~{fragments/footer :: footer}"></footer>
  533. </div>
  534. </div>
  535. </div>
  536. </div>
  537. <input type="hidden" id="serverDate" th:value=${serverDate}>
  538. <div class="modal fade" id="filterModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
  539. aria-hidden="true">
  540. <div class="modal-dialog modal-lg" role="document">
  541. <div class="modal-content">
  542. <div class="modal-header">
  543. <h5 class="modal-title" id="exampleModalLabel">Filter Options</h5>
  544. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close" style="color:black">
  545. <span aria-hidden="true">&times;</span>
  546. </button>
  547. </div>
  548. <div class="modal-body">
  549. <div class="row">
  550. <div class="col-sm-6">
  551. <label for="selectedStartDate">Selected Start Date:<span
  552. class="required-field">*</span></label>
  553. <input type="date" class="form-control" id="selectedStartDate">
  554. </div>
  555. <div class="col-sm-6">
  556. <label for="selectedEndDate">Selected End Date:<span
  557. class="required-field">*</span></label>
  558. <select class="form-control" id="selectedEndDate"></select>
  559. </div>
  560. <div class="col-sm-6">
  561. <label for="selectedMorningSlot">Selected Starting Slot:<span
  562. class="required-field">*</span></label>
  563. <select class="form-control" id="selectedMorningSlot">
  564. <option value="0">Select</option>
  565. <option value="1">Morning</option>
  566. <option value="2">Evening</option>
  567. </select>
  568. </div>
  569. <div class="col-sm-6">
  570. <label for="selectedEveningSlot">Selected Ending Slot:<span
  571. class="required-field">*</span></label>
  572. <select class="form-control" id="selectedEveningSlot">
  573. <option value="0">Select</option>
  574. <option value="1">Morning</option>
  575. <option value="2">Evening</option>
  576. </select>
  577. </div>
  578. <div class="col-sm-6">
  579. <label for="zone">Zone:</label>
  580. <select class="form-control" id="zone" name="zone" placeholder="zone"
  581. onclick="getDivision(this),loadHallsbyzone(this)" aria-label="Select Zone">
  582. <option value="">Select a Zone</option>
  583. </select>
  584. </div>
  585. <div class="col-sm-6">
  586. <label for="zone">Division:</label>
  587. <select class="form-control" id="division" name="division"
  588. onchange="loadHallsbydivision(this)" placeholder="division"
  589. aria-label="Select Division">
  590. <option value="">Select a Division</option>
  591. </select>
  592. </div>
  593. <div class="col-sm-6">
  594. <label for="selecthall">Select Hall:</label>
  595. <select class="form-control" id="selecthall" name="selecthall" aria-label="Select Hall">
  596. <option value="">Select a Hall</option>
  597. </select>
  598. </div>
  599. </div>
  600. </div>
  601. <div class="modal-footer">
  602. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  603. <button type="button" class="btn btn-primary" onclick="displayHallDetailswithFilters()">Apply
  604. Filters</button>
  605. </div>
  606. </div>
  607. </div>
  608. </div>
  609. <!-- MOdel for Map-->
  610. <div class="modal fade" id="hallDetailsModal" tabindex="-1" aria-labelledby="hallDetailsModalLabel"
  611. aria-hidden="true">
  612. <div class="modal-dialog modal-md">
  613. <div class="modal-content">
  614. <div class="modal-header">
  615. <h5 class="modal-title" id="hallDetailsModalLabel">Hall Details</h5>
  616. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"
  617. style="color:black">
  618. <span aria-hidden="true">&times;</span>
  619. </button>
  620. </div>
  621. <div class="modal-body">
  622. <div id="modalContent"></div>
  623. </div>
  624. <div class="modal-footer">
  625. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  626. <button type="button" class="btn btn-primary booknow">Book Now</button>
  627. </div>
  628. </div>
  629. </div>
  630. </div><!-- end of Model Map-->
  631. </div>
  632. <div th:replace="~{fragments/loginreg :: div}"></div>
  633. <script th:replace="~{fragments/script :: script}"></script>
  634. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  635. <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
  636. <script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
  637. <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
  638. <script>
  639. $('.carousel').carousel({
  640. interval: 6000
  641. })
  642. </script>
  643. <script>
  644. $(document).ready(function () {
  645. $('#simpletable').DataTable({
  646. responsive: true,
  647. pageLength: 10,
  648. ordering: true,
  649. columnDefs: [{
  650. targets: 'no-sort',
  651. orderable: false
  652. }],
  653. dom: 'Bfrtip',
  654. buttons: [
  655. {
  656. extend: 'excelHtml5',
  657. text: 'Export to Excel',
  658. className: 'btn btn-primary'
  659. }
  660. ]
  661. });
  662. });
  663. </script>
  664. <!--Model Script End-->
  665. <!--script to show next seven days from selected from from date-->
  666. <script>
  667. $(document).ready(function () {
  668. const serverDate =new Date($("#serverDate").val() + "T00:00:00")
  669. console.log("serverDate:", serverDate);
  670. // Get today's date
  671. var today = serverDate;
  672. var sixMonthsFromNow = new Date(serverDate);
  673. sixMonthsFromNow.setMonth(serverDate.getMonth() + 6);
  674. console.log("sixMonthsFromNow:", sixMonthsFromNow);
  675. const day = serverDate.getDate();
  676. // If the new month has fewer days, adjust the date
  677. if (sixMonthsFromNow.getDate() !== day) {
  678. sixMonthsFromNow.setDate(0); // Moves to the last valid day of the previous month
  679. }
  680. // Set the 'min' and 'max' attributes for input fields
  681. const minDateStr = formatDateForValue(serverDate); // YYYY-MM-DD format
  682. const maxDateStr = formatDateForValue(sixMonthsFromNow);
  683. console.log("minDateStr:", minDateStr);
  684. console.log("maxDateStr:", maxDateStr);
  685. $("#fromdate, #todate, #selectedStartDate, #selectedEndDate").attr("min", minDateStr);
  686. $("#fromdate, #todate, #selectedStartDate, #selectedEndDate").attr("max", maxDateStr);
  687. // Populate 'todate' options based on 'fromdate'
  688. // Function to format date as dd-mm-yyyy
  689. function formatDateForText(date) {
  690. var day = ("0" + date.getDate()).slice(-2);
  691. var month = ("0" + (date.getMonth() + 1)).slice(-2); // Months are zero-based
  692. var year = date.getFullYear();
  693. return day + '-' + month + '-' + year;
  694. }
  695. // Function to format date as yyyy-mm-dd
  696. function formatDateForValue(date) {
  697. var day = ("0" + date.getDate()).slice(-2);
  698. var month = ("0" + (date.getMonth() + 1)).slice(-2); // Months are zero-based
  699. var year = date.getFullYear();
  700. return year + '-' + month + '-' + day;
  701. }
  702. // Handle change event for #fromdate
  703. $('#fromdate').change(function () {
  704. var fromDate = new Date($(this).val());
  705. var toDateSelect = $('#todate');
  706. toDateSelect.empty();
  707. for (var i = 0; i <= 1; i++) {
  708. var toDate = new Date(fromDate);
  709. toDate.setDate(fromDate.getDate() + i);
  710. var dateText = formatDateForText(toDate);
  711. var dateValue = formatDateForValue(toDate);
  712. toDateSelect.append($('<option>', {
  713. value: dateValue,
  714. text: dateText
  715. }));
  716. }
  717. });
  718. // Handle change event for #selectedStartDate
  719. $('#selectedStartDate').change(function () {
  720. var selectedStartDate = new Date($(this).val());
  721. var selectedEndDateSelect = $('#selectedEndDate');
  722. selectedEndDateSelect.empty();
  723. for (var i = 0; i <= 1; i++) {
  724. var selectedEndDate = new Date(selectedStartDate);
  725. selectedEndDate.setDate(selectedStartDate.getDate() + i);
  726. var dateText = formatDateForText(selectedEndDate);
  727. var dateValue = formatDateForValue(selectedEndDate);
  728. selectedEndDateSelect.append($('<option>', {
  729. value: dateValue,
  730. text: dateText
  731. }));
  732. }
  733. });
  734. // Show modal with selected values
  735. $('#filterIcon').click(function () {
  736. getZone();
  737. var fromDate = $('#fromdate').val();
  738. var toDate = $('#todate').val();
  739. var startingSlot = $('#startingslot option:selected').val();
  740. var endingSlot = $('#endingslot option:selected').val();
  741. $('#selectedStartDate').val(fromDate);
  742. // Here, we need to manually trigger the change event to ensure selectedEndDate options are populated
  743. $('#selectedStartDate').trigger('change');
  744. // Setting the selected end date after options are populated
  745. setTimeout(() => {
  746. $('#selectedEndDate').val(toDate);
  747. }, 100);
  748. $('#selectedMorningSlot').val(startingSlot);
  749. $('#selectedEveningSlot').val(endingSlot);
  750. $('#filterModal').modal({
  751. backdrop: 'static',
  752. keyboard: false
  753. });
  754. $('#filterModal').modal('show');
  755. });
  756. });
  757. function toggleButtonClicked() {
  758. var div1 = document.getElementById('div1');
  759. var div2 = document.getElementById('div2');
  760. if (div1.style.display === 'none') {
  761. div1.style.display = 'block';
  762. div2.style.display = 'none';
  763. } else {
  764. div1.style.display = 'none';
  765. div2.style.display = 'block';
  766. }
  767. }
  768. document.getElementById('toggleButton').addEventListener('click', toggleButtonClicked);
  769. </script>
  770. <script>
  771. window.dataLayer = window.dataLayer || [];
  772. function gtag() {dataLayer.push(arguments);}
  773. gtag('js', new Date());
  774. gtag('config', 'UA-23581568-13');
  775. /*const serverDate =new Date($("#serverDate").val() + "T00:00:00")
  776. console.log("serverDate:", serverDate);
  777. // Get today's date
  778. var today = serverDate;
  779. var sixMonthsFromNow = new Date(serverDate);
  780. sixMonthsFromNow.setMonth(serverDate.getMonth() + 6);
  781. console.log("sixMonthsFromNow:", sixMonthsFromNow);
  782. const day = serverDate.getDate();
  783. // If the new month has fewer days, adjust the date
  784. if (sixMonthsFromNow.getDate() !== day) {
  785. sixMonthsFromNow.setDate(0); // Moves to the last valid day of the previous month
  786. }
  787. // Set the 'min' and 'max' attributes for input fields
  788. const minDateStr = serverDate.toISOString().split('T')[0]; // YYYY-MM-DD format
  789. const maxDateStr = sixMonthsFromNow.toISOString().split('T')[0];
  790. $("#fromdate, #todate, #selectedStartDate, #selectedEndDate").attr("min", minDateStr);
  791. $("#fromdate, #todate, #selectedStartDate, #selectedEndDate").attr("max", maxDateStr);*/
  792. // Calculate the date 6 months from now
  793. // var sixMonthsFromNow = new Date(today.getFullYear(), today.getMonth() + 6, today.getDate()+1);
  794. // Set the 'min' and 'max' attributes of the input fields to limit the date selection
  795. /*document.getElementById("fromdate").setAttribute("min", today.toISOString().split('T')[0]);
  796. document.getElementById("fromdate").setAttribute("max", sixMonthsFromNow.toISOString().split('T')[0]);
  797. document.getElementById("todate").setAttribute("min", today.toISOString().split('T')[0]);
  798. document.getElementById("todate").setAttribute("max", sixMonthsFromNow.toISOString().split('T')[0]);
  799. document.getElementById("selectedStartDate").setAttribute("min", today.toISOString().split('T')[0]);
  800. document.getElementById("selectedStartDate").setAttribute("max", sixMonthsFromNow.toISOString().split('T')[0]);
  801. document.getElementById("selectedEndDate").setAttribute("min", today.toISOString().split('T')[0]);
  802. document.getElementById("selectedEndDate").setAttribute("max", sixMonthsFromNow.toISOString().split('T')[0]);*/
  803. //Function for toggle button
  804. function toggleButtonClicked() {
  805. var hallDetailsVisible = document.getElementById('hallDetails').style.display !== 'none';
  806. // Toggle visibility of hallDetails and div4
  807. document.getElementById('hallDetails').style.display = hallDetailsVisible ? 'none' : 'block';
  808. document.getElementById('div4').style.display = hallDetailsVisible ? 'block' : 'none';
  809. }
  810. // Function to display hall details
  811. function displayHallDetails() {
  812. var fromdate = $("#fromdate").val();
  813. var todate = $("#todate").val();
  814. var startingSlot = $("#startingslot").val();
  815. var endingSlot = $("#endingslot").val();
  816. var hallId = $("#selecthall").val();
  817. if (fromdate == "" || fromdate == undefined || todate == "" || todate == undefined || startingSlot == "0" || endingSlot == "0") {
  818. Swal.fire({
  819. icon: 'error',
  820. title: 'Missing Information',
  821. text: 'Please ensure that all date and slot fields are selected.',
  822. });
  823. }
  824. else {
  825. window.location.href = '/communityhall/user/checkAvail?fromDate=' + fromdate + '&toDate=' + todate + '&starting=' + startingSlot + '&ending=' + endingSlot;
  826. $("#notification").css("display", "none");
  827. }
  828. }
  829. function checkResetButtonVisibility() {
  830. // Get the current URL
  831. var currentUrl = window.location.pathname; // Use pathname to get the path only
  832. var urlPattern = "/communityhall/user/dashboard";
  833. // Check if the current URL is exactly the pattern
  834. if (currentUrl === urlPattern) {
  835. // Hide the resetButton if the URL matches the pattern exactly
  836. document.getElementById("resetbutton").style.display = "none";
  837. } else {
  838. // Show the resetButton if the URL does not match the pattern exactly
  839. document.getElementById("resetbutton").style.display = "block";
  840. }
  841. }
  842. // Call the function on page load
  843. window.onload = checkResetButtonVisibility;
  844. function displayHallDetailswithFilters() {
  845. var fromdate = $("#selectedStartDate").val();
  846. var todate = $("#selectedEndDate").val();
  847. var startingSlot = $("#selectedMorningSlot").val();
  848. var endingSlot = $("#selectedEveningSlot").val();
  849. var zone = $("#zone").val();
  850. var division = $("#division").val();
  851. var hallId = $("#selecthall").val();
  852. if (fromdate == "" || fromdate == undefined || todate == "" || todate == undefined || startingSlot == "0" || endingSlot == "0") {
  853. Swal.fire({
  854. icon: 'error',
  855. title: 'Missing Information',
  856. text: 'Please ensure that all date and slot fields are selected.',
  857. });
  858. }
  859. else {
  860. window.location.href = '/communityhall/user/checkAvail?fromDate=' + fromdate + '&toDate=' + todate + '&starting=' + startingSlot + '&ending=' + endingSlot + '&hallId=' + hallId + '&zone=' + zone;
  861. }
  862. }
  863. function viewHallImages(hallId) {
  864. $.ajax({
  865. type: "GET",
  866. url: '/communityhall/admin/api/getImageById',
  867. data: {
  868. 'hallId': hallId
  869. },
  870. success: function (res) {
  871. getHallImagesById(res);
  872. }
  873. });
  874. }
  875. function getHallImagesById(images) {
  876. const modalSlidesContainer = document.querySelector('.carousel-inner1');
  877. modalSlidesContainer.innerHTML = '';
  878. // Loop through the images and create thumbnail elements dynamically
  879. images.forEach((image, index) => {
  880. const slide = document.createElement('div');
  881. slide.classList.add('carousel-item');
  882. if (index === 0) {
  883. slide.classList.add('active');
  884. }
  885. const img = document.createElement('img');
  886. img.src = image.hallImage;
  887. img.alt = `Slide ${image.hallImageId}`; // Corrected this line to properly set the alt text
  888. slide.appendChild(img);
  889. modalSlidesContainer.appendChild(slide);
  890. });
  891. $('#exampleModal').modal('show'); // Show Bootstrap modal
  892. }
  893. function loadHallsbydivision(x) {
  894. var division = x.value;
  895. // Make an AJAX request to fetch halls based on the selected zone and division
  896. $.ajax({
  897. url: '/communityhall/user/api/hallsbydivision', // Replace 'backend_url' with the actual backend endpoint
  898. method: 'GET',
  899. data: {division: division},
  900. success: function (response) {
  901. // Clear existing options
  902. $('#selecthall').empty();
  903. var selectHallDropdown = $('#selecthall'); // Select the select hall dropdown
  904. selectHallDropdown.empty(); // Clear existing options
  905. // Add the default "Select Hall" option
  906. selectHallDropdown.append('<option value="" selected>Select Hall</option>');
  907. response.forEach(function (hall) {
  908. $('#selecthall').append('<option value="' + hall.hallId + '">' + hall.hallName + '</option>');
  909. });
  910. },
  911. error: function (xhr, status, error) {
  912. console.error('Error loading halls:', error);
  913. }
  914. });
  915. }
  916. function loadHallsbyzone(x) {
  917. var zone = x.value;
  918. // Make an AJAX request to fetch halls based on the selected zone and division
  919. $.ajax({
  920. url: '/communityhall/user/api/findhallsbyzone', // Replace 'backend_url' with the actual backend endpoint
  921. method: 'GET',
  922. data: {zone: zone},
  923. success: function (response) {
  924. // Clear existing options
  925. $('#selecthall').empty();
  926. var selectHallDropdown = $('#selecthall'); // Select the select hall dropdown
  927. selectHallDropdown.empty(); // Clear existing options
  928. // Add the default "Select Hall" option
  929. selectHallDropdown.append('<option value="" selected>Select Hall</option>');
  930. response.forEach(function (hall) {
  931. $('#selecthall').append('<option value="' + hall.hallId + '">' + hall.hallName + '</option>');
  932. });
  933. },
  934. error: function (xhr, status, error) {
  935. console.error('Error loading halls:', error);
  936. }
  937. });
  938. }
  939. window.onscroll = function () {scrollFunction()};
  940. function scrollFunction() {
  941. if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
  942. document.getElementById("scrollToTopBtn").style.display = "block";
  943. } else {
  944. document.getElementById("scrollToTopBtn").style.display = "none";
  945. }
  946. }
  947. // When the user clicks on the button, scroll to the top of the document
  948. function topFunction() {
  949. document.body.scrollTop = 0;
  950. document.documentElement.scrollTop = 0;
  951. }
  952. //Filter option date block
  953. function setMinDate() {
  954. var today = new Date();
  955. var dd = String(today.getDate()).padStart(2, '0');
  956. var mm = String(today.getMonth() + 1).padStart(2, '0'); // January is 0!
  957. var yyyy = today.getFullYear();
  958. today = yyyy + '-' + mm + '-' + dd;
  959. document.getElementById("selectedStartDate").setAttribute("min", today);
  960. }
  961. document.addEventListener("DOMContentLoaded", function () {
  962. setMinDate(); // Set minimum date for selectedStartDate input on page load
  963. document.getElementById('filterIcon').addEventListener('click', function () {
  964. // Populate selectedStartDate and selectedEndDate inputs with values from regular form
  965. document.getElementById('selectedStartDate').value = document.getElementById('fromdate').value;
  966. document.getElementById('selectedEndDate').value = document.getElementById('todate').value;
  967. document.getElementById('selectedMorningSlot').value = document.getElementById('startingslot').value;
  968. document.getElementById('selectedEveningSlot').value = document.getElementById('endingslot').value;
  969. $('#filterModal').modal({
  970. backdrop: 'static',
  971. keyboard: false
  972. });
  973. $('#filterModal').modal('show');
  974. });
  975. document.getElementById('selectedStartDate').addEventListener('change', function () {
  976. var selectedStartDate = new Date($(this).val());
  977. var selectedEndDate = document.getElementById('selectedEndDate');
  978. selectedEndDate.innerHTML = ''; // Clear previous options
  979. for (var i = 1; i <= 7; i++) {
  980. var endDate = new Date(selectedStartDate);
  981. endDate.setDate(selectedStartDate.getDate() + i);
  982. var dateString = endDate.toISOString().split('T')[0];
  983. selectedEndDate.innerHTML += '<option value="' + dateString + '">' + dateString + '</option>';
  984. }
  985. });
  986. });
  987. //filter option date end
  988. var zoneAndDivision;
  989. function getZone() {
  990. $.ajax({
  991. type: "GET",
  992. url: '/communityhall/user/api/getZone',
  993. success: function (data) {
  994. zoneAndDivision = data;
  995. const uniqueZones = [...new Set(data.map(item => item.zone))];
  996. // Get the select element
  997. const selectElement = document.getElementById('zone');
  998. // Populate the select element with options
  999. uniqueZones.forEach(zone => {
  1000. const option = document.createElement('option');
  1001. option.value = zone;
  1002. option.textContent = zone;
  1003. selectElement.appendChild(option);
  1004. });
  1005. //alert(reszone);
  1006. //$('#zone').val(reszone.zone);
  1007. }
  1008. });
  1009. }
  1010. function getDivision(x) {
  1011. const selectedZone = x.value;
  1012. const divisionSelect = document.getElementById('division');
  1013. // Clear existing options in division select
  1014. divisionSelect.innerHTML = '';
  1015. // Add the default "Select Division" option
  1016. const defaultOption = document.createElement('option');
  1017. defaultOption.value = '';
  1018. defaultOption.textContent = 'Select Division';
  1019. divisionSelect.appendChild(defaultOption);
  1020. // Filter data to get divisions for the selected zone
  1021. const divisions = [...new Set(zoneAndDivision.filter(item => item.zone === selectedZone).map(item => item.division))];
  1022. // Populate the division select element with options
  1023. divisions.forEach(division => {
  1024. const option = document.createElement('option');
  1025. option.value = division;
  1026. option.textContent = division;
  1027. divisionSelect.appendChild(option);
  1028. });
  1029. }
  1030. document.getElementById('fromdate').addEventListener('change', checkDates);
  1031. document.getElementById('todate').addEventListener('change', checkDates);
  1032. document.getElementById('startingslot').addEventListener('change', checkSlots);
  1033. document.getElementById('selectedStartDate').addEventListener('change', checkfilterDates);
  1034. document.getElementById('selectedEndDate').addEventListener('change', checkfilterDates);
  1035. document.getElementById('selectedMorningSlot').addEventListener('change', checkfilterSlots);
  1036. function checkDates() {
  1037. var fromDate = document.getElementById('fromdate').value;
  1038. var toDate = document.getElementById('todate').value;
  1039. var endingSlot = document.getElementById('endingslot');
  1040. if (fromDate && toDate && fromDate === toDate) {
  1041. var startingSlot = document.getElementById('startingslot').value;
  1042. if (startingSlot === '2') { // Evening
  1043. endingSlot.value = '2'; // Set Ending Slot to Evening
  1044. document.getElementById('endingslot').disabled = true;
  1045. endingSlot.getElementsByTagName('option')[1].disabled = true; // Disable Morning option
  1046. } else {
  1047. document.getElementById('endingslot').disabled = false;
  1048. endingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1049. }
  1050. } else {
  1051. document.getElementById('endingslot').disabled = false;
  1052. endingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1053. }
  1054. }
  1055. function checkfilterDates() {
  1056. var filterfromDate = document.getElementById('selectedStartDate').value;
  1057. var filtertoDate = document.getElementById('selectedEndDate').value;
  1058. var filterendingSlot = document.getElementById('selectedEveningSlot');
  1059. if (filterfromDate && filtertoDate && filterfromDate === filtertoDate) {
  1060. var filterstartingSlot = document.getElementById('selectedMorningSlot').value;
  1061. if (filterstartingSlot === '2') { // Evening
  1062. filterendingSlot.value = '2'; // Set Ending Slot to Evening
  1063. document.getElementById('selectedEveningSlot').disabled = true;
  1064. filterendingSlot.getElementsByTagName('option')[1].disabled = true; // Disable Morning option
  1065. } else {
  1066. document.getElementById('selectedEveningSlot').disabled = false;
  1067. filterendingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1068. }
  1069. } else {
  1070. document.getElementById('selectedEveningSlot').disabled = false;
  1071. filterendingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1072. }
  1073. }
  1074. function checkfilterSlots() {
  1075. var filterfromDate = document.getElementById('selectedStartDate').value;
  1076. var filtertoDate = document.getElementById('selectedEndDate').value;
  1077. var filterendingSlot = document.getElementById('selectedEveningSlot');
  1078. var filterstartingSlot = document.getElementById('selectedMorningSlot').value;
  1079. if (filterfromDate && filtertoDate && filterfromDate === filtertoDate) {
  1080. if (filterstartingSlot === '2') { // Evening
  1081. filterendingSlot.value = '2'; // Set Ending Slot to Evening
  1082. document.getElementById('selectedEveningSlot').disabled = true;
  1083. filterendingSlot.getElementsByTagName('option')[1].disabled = true; // Disable Morning option
  1084. } else {
  1085. document.getElementById('selectedEveningSlot').disabled = false;
  1086. filterendingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1087. }
  1088. } else {
  1089. document.getElementById('selectedEveningSlot').disabled = false;
  1090. filterendingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1091. }
  1092. }
  1093. function checkSlots() {
  1094. var fromDate = document.getElementById('fromdate').value;
  1095. var toDate = document.getElementById('todate').value;
  1096. var startingSlot = document.getElementById('startingslot').value;
  1097. var endingSlot = document.getElementById('endingslot');
  1098. if (fromDate && toDate && fromDate === toDate) {
  1099. if (startingSlot === '2') { // Evening
  1100. endingSlot.value = '2'; // Set Ending Slot to Evening
  1101. document.getElementById('endingslot').disabled = true;
  1102. endingSlot.getElementsByTagName('option')[1].disabled = true; // Disable Morning option
  1103. } else {
  1104. document.getElementById('endingslot').disabled = false;
  1105. endingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1106. }
  1107. } else {
  1108. document.getElementById('endingslot').disabled = false;
  1109. endingSlot.getElementsByTagName('option')[1].disabled = false; // Enable Morning option
  1110. }
  1111. }
  1112. var map;
  1113. var mapInitialized = false;
  1114. function initializeMapAndFetchCoordinates() {
  1115. var mapElement = document.getElementById("map");
  1116. var dashboardBody = document.getElementById("dashboardbody");
  1117. if (mapElement.style.display === "none") {
  1118. mapElement.style.display = "block";
  1119. dashboardBody.style.display = "none";
  1120. } else {
  1121. mapElement.style.display = "none";
  1122. dashboardBody.style.display = "block";
  1123. }
  1124. mapElement.style.display = 'block';
  1125. if (!mapInitialized) {
  1126. mapInitialized = true;
  1127. setTimeout(() => {
  1128. map = L.map('map', {attributionControl: false}).setView([13.0827, 80.2707], 9);
  1129. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1130. attributionControl: false,
  1131. maxZoom: 19
  1132. }).addTo(map);
  1133. var markers = L.markerClusterGroup();
  1134. $.ajax({
  1135. url: '/communityhall/user/api/getallhallcoordinates',
  1136. type: 'GET',
  1137. success: function (data) {
  1138. if (data.length === 0) {
  1139. console.warn('No data returned from the API');
  1140. return;
  1141. }
  1142. data.forEach(function (coord) {
  1143. var marker = L.marker([parseFloat(coord.latitude), parseFloat(coord.longitude)], /{icon: customIcon}/);
  1144. var hallImageHtml = '';
  1145. if (coord.hallImage && Array.isArray(coord.hallImage) && coord.hallImage.length > 0) {
  1146. hallImageHtml = `
  1147. <div id="hallImageCarousel" class="carousel slide" data-ride="carousel">
  1148. <div class="carousel-inner">
  1149. ${coord.hallImage.map((image, index) => `
  1150. <div class="carousel-item ${index === 0 ? 'active' : ''}">
  1151. <img src="${image.hallImage}" class="d-block w-100 fixed-size-image" alt="Hall Image">
  1152. </div>
  1153. `).join('')}
  1154. </div>
  1155. <a class="carousel-control-prev" href="#hallImageCarousel" role="button" data-slide="prev">
  1156. <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  1157. <span class="sr-only">Previous</span>
  1158. </a>
  1159. <a class="carousel-control-next" href="#hallImageCarousel" role="button" data-slide="next">
  1160. <span class="carousel-control-next-icon" aria-hidden="true"></span>
  1161. <span class="sr-only">Next</span>
  1162. </a>
  1163. </div>
  1164. `;
  1165. } else {
  1166. console.warn('coord.hallImage is either undefined, not an array, or empty.');
  1167. }
  1168. //console.log(hallImageHtml); // Log the final HTML for debugging purposes
  1169. var modalContent = `
  1170. <div class="card border-primary">
  1171. <div class="imagecontainer">${hallImageHtml}</div>
  1172. <div class="card-body bg-light" style="text-align:left">
  1173. <p class="card-text">Hall Name: <strong>${coord.hallName}</strong></p>
  1174. <p class="card-text">Address: <strong>${coord.doorNo}, ${coord.area}, ${coord.street}, ${coord.landMark}</strong></p>
  1175. <p class="card-text">Seating Capacity: <strong>${coord.seatingCapacity}</strong></p>
  1176. <p class="card-text">Parking Capacity: <strong>${coord.parkingCapacity}</strong></p>
  1177. <p class="card-text">Deposit Amount: <strong>Rs. ${coord.depositAmount}</strong></p>
  1178. <p class="card-text">Full Day Rent: <strong>Rs. ${coord.fullDayRent}</strong></p>
  1179. <p class="card-text">Half Day Rent: <strong>Rs. ${coord.halfDayRent}</strong></p>
  1180. <p class="card-text">Hall Area: <strong>${coord.hallArea} (sq.ft)</strong></p>
  1181. </div>
  1182. </div>`;
  1183. marker.on('click', function () {
  1184. $('#modalContent').html(modalContent);
  1185. $('#hallDetailsModal').modal('show');
  1186. $('#hallDetailsModal').on('click', '.booknow', function () {
  1187. redirectToPage(coord.hallId);
  1188. });
  1189. });
  1190. var tooltipContent = `<p class="card-text">Hall Name: <strong>${coord.hallName}</strong></p>`;
  1191. marker.bindTooltip(tooltipContent, {
  1192. direction: 'top',
  1193. permanent: false,
  1194. className: 'custom-tooltip'
  1195. });
  1196. markers.addLayer(marker);
  1197. });
  1198. map.addLayer(markers);
  1199. },
  1200. error: function (xhr, status, error) {
  1201. console.error('Error fetching locations:', error);
  1202. }
  1203. });
  1204. }, 100); // Delay to ensure the map container is rendered
  1205. }
  1206. // Call anotherFunction after the map is shown
  1207. anotherFunction();
  1208. }
  1209. function redirectToPage(hallId) {
  1210. alert(hallId);
  1211. window.location.href = '/communityhall/hallbookingform?hallId=' + hallId;
  1212. }
  1213. function anotherFunction() {
  1214. //console.log('Another function called');
  1215. }
  1216. function resetDate() {
  1217. window.location.href = "/communityhall/user/dashboard";
  1218. }
  1219. function showHall(element) {
  1220. const latitude = element.getAttribute('data-latitude');
  1221. const longitude = element.getAttribute('data-longitude');
  1222. var mapElement = document.getElementById("map");
  1223. var dashboardBody = document.getElementById("dashboardbody");
  1224. if (mapElement.style.display === "none") {
  1225. mapElement.style.display = "block";
  1226. dashboardBody.style.display = "none";
  1227. } else {
  1228. mapElement.style.display = "none";
  1229. dashboardBody.style.display = "block";
  1230. }
  1231. mapElement.style.display = 'block';
  1232. //console.log('Map container made visible');
  1233. if (!mapInitialized) {
  1234. mapInitialized = true;
  1235. setTimeout(() => {
  1236. map = L.map('map', {attributionControl: false}).setView([latitude, longitude], 18);
  1237. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  1238. attributionControl: false,
  1239. maxZoom: 19
  1240. }).addTo(map);
  1241. var markers = L.markerClusterGroup();
  1242. $.ajax({
  1243. url: '/communityhall/user/api/getallhallcoordinates',
  1244. type: 'GET',
  1245. success: function (data) {
  1246. if (data.length === 0) {
  1247. console.warn('No data returned from the API');
  1248. return;
  1249. }
  1250. data.forEach(function (coord) {
  1251. var marker = L.marker([parseFloat(coord.latitude), parseFloat(coord.longitude)], /{icon: customIcon}/);
  1252. if (coord.hallImage && Array.isArray(coord.hallImage) && coord.hallImage.length > 0) {
  1253. hallImageHtml = `
  1254. <div id="hallImageCarousel" class="carousel slide" data-ride="carousel">
  1255. <div class="carousel-inner">
  1256. ${coord.hallImage.map((image, index) => `
  1257. <div class="carousel-item ${index === 0 ? 'active' : ''}">
  1258. <img src="${image.hallImage}" class="d-block w-100 fixed-size-image" alt="Hall Image">
  1259. </div>
  1260. `).join('')}
  1261. </div>
  1262. <a class="carousel-control-prev" href="#hallImageCarousel" role="button" data-slide="prev">
  1263. <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  1264. <span class="sr-only">Previous</span>
  1265. </a>
  1266. <a class="carousel-control-next" href="#hallImageCarousel" role="button" data-slide="next">
  1267. <span class="carousel-control-next-icon" aria-hidden="true"></span>
  1268. <span class="sr-only">Next</span>
  1269. </a>
  1270. </div>
  1271. `;
  1272. } else {
  1273. console.warn('coord.hallImage is either undefined, not an array, or empty.');
  1274. }
  1275. var modalContent = `
  1276. <div class="card border-primary">
  1277. <div class="imagecontainer">${hallImageHtml}</div>
  1278. <div class="card-body bg-light" style="text-align:left">
  1279. <p class="card-text">Hall Name: <strong>${coord.hallName}</strong></p>
  1280. <p class="card-text">Address: <strong>${coord.doorNo}, ${coord.area}, ${coord.street}, ${coord.landMark}</strong></p>
  1281. <p class="card-text">Seating Capacity: <strong>${coord.seatingCapacity}</strong></p>
  1282. <p class="card-text">Parking Capacity: <strong>${coord.parkingCapacity}</strong></p>
  1283. <p class="card-text">Deposit Amount: <strong>Rs. ${coord.depositAmount}</strong></p>
  1284. <p class="card-text">Full Day Rent: <strong>Rs. ${coord.fullDayRent}</strong></p>
  1285. <p class="card-text">Half Day Rent: <strong>Rs. ${coord.halfDayRent}</strong></p>
  1286. <p class="card-text">Hall Area: <strong>${coord.hallArea} (sq.ft)</strong></p>
  1287. </div>
  1288. </div>`;
  1289. marker.on('click', function () {
  1290. $('#modalContent').html(modalContent);
  1291. $('#hallDetailsModal').modal('show');
  1292. $('#hallDetailsModal').on('click', '.booknow', function () {
  1293. redirectToPage(coord.hallId);
  1294. });
  1295. });
  1296. var tooltipContent = `<p class="card-text">Hall Name: <strong>${coord.hallName}</strong></p>`;
  1297. marker.bindTooltip(tooltipContent, {
  1298. direction: 'top',
  1299. permanent: false,
  1300. className: 'custom-tooltip'
  1301. });
  1302. markers.addLayer(marker);
  1303. });
  1304. map.addLayer(markers);
  1305. },
  1306. error: function (xhr, status, error) {
  1307. console.error('Error fetching locations:', error);
  1308. }
  1309. });
  1310. }, 100); // Delay to ensure the map container is rendered
  1311. }
  1312. }
  1313. </script>
  1314. </body>
  1315. </html>