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.

419 lines
11 KiB

1 year 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@1.9.4/dist/leaflet.css">-->
  5. <!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.css"/>-->
  6. <link rel="stylesheet" type="text/css" href="css\leaflet.css">
  7. <style>
  8. /* Hide button and div2 on small screens */
  9. #map {
  10. width: 100%;
  11. height: 1000px;
  12. /* Set a height for the map */
  13. display: none;
  14. /* Hide initially */
  15. }
  16. @media only screen and (max-width: 768px) {
  17. #toggleButton {
  18. display: none;
  19. }
  20. #div2 {
  21. display: none;
  22. }
  23. .table-container {
  24. height: 300px;
  25. /* Adjust height as needed */
  26. overflow-y: auto;
  27. }
  28. }
  29. /* Optional CSS styling */
  30. .thumbnail {
  31. cursor: pointer;
  32. }
  33. .modal-dialog {
  34. margin: 30px auto;
  35. }
  36. .carousel-item img {
  37. width: 100%;
  38. height: auto;
  39. }
  40. .carousel-image {
  41. max-height: 300px;
  42. /* Adjust height as needed */
  43. width: auto;
  44. margin: 0 auto;
  45. /* Center the image horizontally */
  46. }
  47. /* Custom CSS to change the color of carousel controls */
  48. .carousel-control-prev,
  49. .carousel-control-next {
  50. color: black;
  51. }
  52. #enteredDetails {
  53. display: none
  54. }
  55. .card {
  56. max-height: 75%;
  57. }
  58. .container {
  59. display: flex;
  60. justify-content: flex-end;
  61. /* Align children to the right */
  62. }
  63. .align-right {
  64. text-align: right;
  65. }
  66. .table-responsive-md {
  67. display: block;
  68. width: 100%;
  69. overflow-x: auto;
  70. -webkit-overflow-scrolling: touch;
  71. }
  72. .table {
  73. table-layout: auto;
  74. width: 100%;
  75. word-wrap: break-word;
  76. }
  77. .table td {
  78. word-wrap: break-word;
  79. white-space: normal;
  80. }
  81. .swal2-container {
  82. z-index: 9999999999999 !important;
  83. /* Adjust this value if needed */
  84. }
  85. .border-primary {
  86. border-left: white;
  87. }
  88. </style>
  89. <body>
  90. <!-- Pre-loader start -->
  91. <div class="theme-loader">
  92. <div class="ball-scale">
  93. <div class='contain'>
  94. <div class="ring">
  95. <div class="frame"></div>
  96. </div>
  97. <div class="ring">
  98. <div class="frame"></div>
  99. </div>
  100. <div class="ring">
  101. <div class="frame"></div>
  102. </div>
  103. <div class="ring">
  104. <div class="frame"></div>
  105. </div>
  106. <div class="ring">
  107. <div class="frame"></div>
  108. </div>
  109. <div class="ring">
  110. <div class="frame"></div>
  111. </div>
  112. <div class="ring">
  113. <div class="frame"></div>
  114. </div>
  115. <div class="ring">
  116. <div class="frame"></div>
  117. </div>
  118. <div class="ring">
  119. <div class="frame"></div>
  120. </div>
  121. <div class="ring">
  122. <div class="frame"></div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <!-- Pre-loader end -->
  128. <div id="pcoded" class="pcoded">
  129. <div class="pcoded-container">
  130. <!-- Menu header start -->
  131. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  132. <!-- Menu header end -->
  133. <div class="pcoded-main-container">
  134. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  135. <div class="pcoded-wrapper">
  136. <div class="pcoded-content">
  137. <div class="pcoded-inner-content">
  138. <!-- Main-body start -->
  139. <div class="main-body">
  140. <div class="page-wrapper">
  141. <!-- Page-header start -->
  142. <div class="page-header m-t-20">
  143. </div>
  144. <!-- Page-header end -->
  145. <!-- Page body start -->
  146. <div class="page-body">
  147. <div class="card">
  148. <div class="card-header">
  149. <a href="#" id="termsLink">Click here to view Terms and Conditions</a> |
  150. <a href="#" id="listLink">Click here to view List of Community Centers</a>
  151. </div>
  152. <div class="card-body">
  153. <div id="termsContent" style="display: none;">
  154. <!-- Terms and Conditions content -->
  155. <h4>Rules and Regulations</h4>
  156. <iframe src="media/images/CC Rules & Regulations for Online _Tamil.pdf"
  157. width="100%" height="600px"></iframe>
  158. </div>
  159. <div id="listContent" style="display: none;">
  160. <h4>List of Community Centers</h4>
  161. <iframe src="media/images/Community_Centers_list.pdf"
  162. width="100%" height="600px"></iframe>
  163. </div>
  164. <div id="map" style="display:none">
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <!-- MOdel for Map-->
  178. <div class="modal fade" id="hallDetailsModal" tabindex="-1" aria-labelledby="hallDetailsModalLabel"
  179. aria-hidden="true">
  180. <div class="modal-dialog modal-md">
  181. <div class="modal-content">
  182. <div class="modal-header">
  183. <h5 class="modal-title" id="hallDetailsModalLabel">Hall Details</h5>
  184. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  185. <span aria-hidden="true">&times;</span>
  186. </button>
  187. </div>
  188. <div class="modal-body">
  189. <div id="modalContent"></div>
  190. </div>
  191. <div class="modal-footer">
  192. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  193. <button type="button" class="btn btn-primary booknow">Book Now</button>
  194. </div>
  195. </div>
  196. </div>
  197. </div><!-- end of Model Map-->
  198. <!-- Login Modal-->
  199. <!--<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>-->
  200. <!--<script src="https://cdn.jsdelivr.net/npm/leaflet/dist/leaflet.js"></script>-->
  201. <script type="text/javascript" src="js\leaflet.js"></script>
  202. <div th:replace="~{fragments/loginreg :: div}"></div>
  203. <script th:replace="~{fragments/script :: script}"></script>
  204. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  205. <script>
  206. document.addEventListener("DOMContentLoaded", function () {
  207. const termsLink = document.getElementById("termsLink");
  208. const listLink = document.getElementById("listLink");
  209. const termsContent = document.getElementById("termsContent");
  210. const listContent = document.getElementById("listContent");
  211. const listmap = document.getElementById("maplink");
  212. const mapcontent = document.getElementById("map");
  213. // Show terms content and hide list content
  214. termsLink.addEventListener("click", function (event) {
  215. event.preventDefault();
  216. termsContent.style.display = "block";
  217. listContent.style.display = "none";
  218. mapcontent.style.display = "none";
  219. });
  220. // Show list content and hide terms content
  221. listLink.addEventListener("click", function (event) {
  222. event.preventDefault();
  223. termsContent.style.display = "none";
  224. listContent.style.display = "block";
  225. mapcontent.style.display = "none";
  226. });
  227. listmap.addEventListener("click", function (event) {
  228. event.preventDefault();
  229. showMap()
  230. termsContent.style.display = "none";
  231. listContent.style.display = "none";
  232. });
  233. // Initially hide list content
  234. listContent.style.display = "none";
  235. });
  236. var map;
  237. var mapInitialized = false;
  238. // Define custom icon using Font Awesome
  239. var customIcon = L.divIcon({
  240. html: '<i class="fa fa-map-pin" style="color:red;font-size:15px" title="Click here"></i>',
  241. iconSize: [32, 32],
  242. className: 'custom-icon'
  243. });
  244. function showMap() {
  245. var mapElement = document.getElementById("map");
  246. mapElement.style.display = 'block';
  247. //console.log('Map container made visible');
  248. if (!mapInitialized) {
  249. mapInitialized = true;
  250. //console.log('Initializing map after delay');
  251. setTimeout(mapInit, 100); // Delay to ensure the map container is rendered
  252. }
  253. // Call anotherFunction after the map is shown
  254. anotherFunction();
  255. }
  256. function mapInit() {
  257. //console.log('Initializing map');
  258. map = L.map('map').setView([14.57199865451665, 85.67084692525447], 4);
  259. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  260. attribution: 'Map data © OpenStreetMap contributors',
  261. maxZoom: 19
  262. }).addTo(map);
  263. fetchHallCoordinates();
  264. }
  265. function fetchHallCoordinates() {
  266. //console.log('Fetching hall coordinates');
  267. $.ajax({
  268. url: '/communityhall/user/api/getallhallcoordinates',
  269. type: 'GET',
  270. success: function (data) {
  271. //console.log('Data fetched successfully:', data);
  272. if (data.length === 0) {
  273. console.warn('No data returned from the API');
  274. return;
  275. }
  276. map.setView([parseFloat(data[0].latitude), parseFloat(data[0].longitude)], 10);
  277. data.forEach(function (coord) {
  278. //console.log('Processing coordinate:', coord);
  279. var marker = L.marker([parseFloat(coord.latitude), parseFloat(coord.longitude)], {icon: customIcon}).addTo(map);
  280. var hallImages = coord.hallImage;
  281. // Generate modal content with Bootstrap card and grid
  282. var hallImageHtml = '';
  283. if (hallImages && Array.isArray(hallImages) && hallImages.length > 0) {
  284. hallImageHtml += '<div class="image-container">';
  285. hallImages.forEach(function (image) {
  286. // Add a class to the image to specify fixed size
  287. hallImageHtml += '<img src="' + image.hallImage + '" class="img-fluid fixed-size-image" alt="Hall Image">';
  288. });
  289. hallImageHtml += '</div>';
  290. }
  291. var modalContent = '<div class="card border-primary">' +
  292. hallImageHtml +
  293. '<div class="card-body bg-light" style="text-align:left">' +
  294. '<p class="card-text">Hall Name: <strong>' + coord.hallName + '</strong></p>' +
  295. '<div class="row mb-2" >' +
  296. '<div class="col-12">' +
  297. '<p class="card-text">Address: <strong> ' + coord.doorNo + ',' + coord.area + ',' + coord.street + ',' + coord.landMark + '</strong></p>' +
  298. '</div>' +
  299. '</div>' +
  300. '<div class="row mb-2">' +
  301. '<div class="col-6">' +
  302. '<p class="card-text">Seating Capacity: <strong> ' + coord.seatingCapacity + '</strong></p>' +
  303. '</div>' +
  304. '<div class="col-6">' +
  305. '<p class="card-text">Parking Capacity: <strong> ' + coord.parkingCapacity + '</strong></p>' +
  306. '</div>' +
  307. '</div>' +
  308. '<div class="row mb-2">' +
  309. '<div class="col-6">' +
  310. '<p class="card-text">Deposit Amount: <strong> Rs. ' + coord.depositAmount + '</strong></p>' +
  311. '</div>' +
  312. '<div class="col-6">' +
  313. '<p class="card-text">Full Day Rent: <strong> Rs. ' + coord.fullDayRent + '</strong></p>' +
  314. '</div>' +
  315. '</div>' +
  316. '<div class="row mb-2">' +
  317. '<div class="col-6">' +
  318. '<p class="card-text">Half Day Rent: <strong> Rs. ' + coord.halfDayRent + '</strong></p>' +
  319. '</div>' +
  320. '</div>' +
  321. '</div>' +
  322. '</div>';
  323. marker.on('click', function () {
  324. $('#modalContent').html(modalContent);
  325. $('#hallDetailsModal').modal('show');
  326. // Add event listener to "Book Now" button in modal
  327. $('#hallDetailsModal').on('click', '.booknow', function () {
  328. redirectToPage(coord.hallId); // Pass hallId to redirectToPage function
  329. });
  330. });
  331. // Add hover event to show tooltip
  332. marker.on('mouseover', function (e) {
  333. var tooltip = L.tooltip({
  334. permanent: false,
  335. direction: 'top',
  336. className: 'custom-tooltip'
  337. })
  338. .setContent('Click here')
  339. .setLatLng(e.latlng);
  340. marker.bindTooltip(tooltip).openTooltip();
  341. });
  342. marker.on('mouseout', function () {
  343. marker.closeTooltip();
  344. });
  345. });
  346. },
  347. error: function (xhr, status, error) {
  348. console.error('Error fetching locations:', error);
  349. }
  350. });
  351. }
  352. function redirectToPage(hallId) {
  353. window.location.href = '/hallbookingform?hallId=' + hallId;
  354. }
  355. function anotherFunction() {
  356. //console.log('Another function called');
  357. }
  358. </script>
  359. </body>
  360. </html>