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.

1342 lines
68 KiB

11 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
11 months ago
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
11 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
11 months ago
​
11 months ago
​
11 months ago
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
11 months ago
​
​
11 months ago
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/user-head :: head}"></head>
  4. <header th:replace="~{user/razor-pay :: header}"></header>
  5. <style>
  6. .radio-button-group {
  7. display: flex;
  8. }
  9. .radio-button-group input[type="radio"] {
  10. display: none;
  11. }
  12. .radio-button {
  13. padding: 10px 20px;
  14. margin: 5px;
  15. /* Adds space between buttons */
  16. border: 1px solid #007bff;
  17. border-radius: 5px;
  18. cursor: pointer;
  19. background-color: #f0f0f0;
  20. color: #007bff;
  21. transition: background-color 0.3s, color 0.3s;
  22. }
  23. .radio-button:hover {
  24. background-color: #E29D25;
  25. color: white;
  26. }
  27. .radio-button-group input[type="radio"]:checked+.radio-button {
  28. background-color: #E29D25;
  29. color: white;
  30. }
  31. .carousel-inner img {
  32. height: 500px;
  33. object-fit: cover;
  34. }
  35. .time-slot-box {
  36. /*width: 100px;
  37. height: 50px;*/
  38. margin: 10px;
  39. border: 2px solid green;
  40. display: flex;
  41. justify-content: center;
  42. align-items: center;
  43. border-radius: 10px;
  44. cursor: pointer;
  45. background-color: #f0f0f0;
  46. padding: 10px;
  47. }
  48. .time-slot-box.booked {
  49. border-color: red;
  50. color: red;
  51. cursor: not-allowed;
  52. }
  53. .time-slot-box.available {
  54. border-color: green;
  55. color: green;
  56. }
  57. .time-slot-box input[type="radio"] {
  58. display: none;
  59. }
  60. .time-slot-box:hover {
  61. background-color: #e0e0e0;
  62. }
  63. #timeSlots {
  64. display: flex;
  65. flex-wrap: wrap;
  66. }
  67. .book-now-btn {
  68. background-color: #2c3e50;
  69. color: white;
  70. border: none;
  71. padding: 10px;
  72. border-radius: 5px;
  73. cursor: pointer;
  74. transition: background-color 0.3s ease;
  75. align-self: center;
  76. /* Centers the button horizontally */
  77. margin-bottom: 5px;
  78. /* Pushes the button to the bottom of the .card */
  79. }
  80. .book-now-btn:hover {
  81. background-color: #E29D25;
  82. }
  83. .reset-now-btn {
  84. background-color: #868e96;
  85. color: white;
  86. border: none;
  87. padding: 10px;
  88. border-radius: 5px;
  89. cursor: pointer;
  90. transition: background-color 0.3s ease;
  91. align-self: center;
  92. /* Centers the button horizontally */
  93. margin-bottom: 5px;
  94. /* Pushes the button to the bottom of the .card */
  95. }
  96. .reset-now-btn:hover {
  97. background-color: #E29D25;
  98. }
  99. .btn-primary2 {
  100. background-color: #FFF;
  101. border-color: green;
  102. color: gray;
  103. cursor: pointer;
  104. -webkit-transition: all ease-in 0.3s;
  105. transition: all ease-in 0.3s;
  106. }
  107. .btn-primary2.active {
  108. background-color: #E29D25 !important;
  109. color: #FFF;
  110. border-color: green !important;
  111. }
  112. .scrolling-text {
  113. overflow: hidden;
  114. white-space: nowrap;
  115. position: relative;
  116. width: 100%;
  117. }
  118. .scrolling-text span {
  119. display: inline-block;
  120. font-size: 24px;
  121. font-weight: bold;
  122. color: #E29D25;
  123. will-change: transform;
  124. animation: scroll-text 20s linear infinite;
  125. }
  126. .scrolling-text span:hover {
  127. animation-play-state: paused;
  128. }
  129. @keyframes scroll-text {
  130. 0% {
  131. transform: translateX(100%);
  132. }
  133. 100% {
  134. transform: translateX(-100%);
  135. }
  136. }
  137. </style>
  138. <body>
  139. <!-- Pre-loader start -->
  140. <div th:replace="~{fragments/preloader :: div}"></div>
  141. <!-- Pre-loader end -->
  142. <div id="pcoded" class="pcoded">
  143. <div class="pcoded-container">
  144. <!-- Menu header start -->
  145. <nav th:replace="~{fragments/user-nav :: nav}"></nav>
  146. <!-- Menu header end -->
  147. <div class="pcoded-main-container">
  148. <nav th:replace="~{fragments/user-navmenu :: nav}"></nav>
  149. <div class="pcoded-content">
  150. <div class="pcoded-inner-content">
  151. <!-- Main-body start -->
  152. <div class="main-body">
  153. <div class="page-wrapper">
  154. <div class="page-body" style="padding-top: 5%;">
  155. <!-- Page-header start -->
  156. <div class="page-header">
  157. <div class="row align-items-end">
  158. <div class="col-lg-8">
  159. <div class="page-header-title">
  160. <div class="d-inline">
  161. <h4 style="font-weight:bold;">Book Desk Space</h4>
  162. <!--<span class="address">Jeganathan street, Agaram, Chennai - 600082</span>-->
  163. <span class="address" th:text="${buildingAddress}">Address not
  164. available</span>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="col-lg-4">
  169. <div class="page-header-breadcrumb">
  170. <ul class="breadcrumb-title">
  171. <li class="breadcrumb-item">
  172. <a href="#"> <i class="feather icon-home"></i> </a>
  173. </li>
  174. <li class="breadcrumb-item"><a href="#">Desk Space</a>
  175. </li>
  176. </ul>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <!-- Page-header end -->
  182. <!--
  183. <div class="row">
  184. <div class="col-sm-6 col-lg-6">
  185. <div class="photo-text mt-3">
  186. <h4 style="font-weight:bold;">Learning Centre</h4>
  187. <div class="rating">
  188. <span class="address">Jeganathan street, Agaram, Chennai - 600082</span>
  189. </div>
  190. </div>
  191. </div>
  192. </div> -->
  193. <hr>
  194. <div class="scrolling-text"><span>Loading announcement...</span></div>
  195. <input type="hidden" id="buildingId" th:value="${buildingId}">
  196. <input type="hidden" id="categoryId" th:value="${categoryId}">
  197. <input type="hidden" id="subId" th:value="${subId}">
  198. <div class="row" id="conferenceHallDiv" style="border-radius: 10px; margin:0px;">
  199. <div class="col-lg-12 col-sm-12">
  200. <div
  201. style="border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; padding: 20px; margin-top: 20px;">
  202. <form id="conferenceHallForm">
  203. <div class="row">
  204. <div class="col-lg-6 col-sm-0" style="padding:0px;">
  205. <!--photo grid start-->
  206. <div id="carouselExampleIndicators" class="carousel slide"
  207. data-ride="carousel">
  208. <ol class="carousel-indicators">
  209. <!-- <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
  210. <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
  211. <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> -->
  212. <li th:each="homeImg, iterStat : ${homeImg}"
  213. class=""
  214. th:classappend="${iterStat.index == 0} ? ' active'"
  215. data-target="#carouselExampleIndicators"
  216. th:data-slide-to="${iterStat.index}">
  217. </li>
  218. </ol>
  219. <div class="carousel-inner">
  220. <div th:each="homeImg, iterStat : ${homeImg}"
  221. class="carousel-item"
  222. th:classappend="${iterStat.index == 0} ? ' active'">
  223. <img style="border-radius:15px;"
  224. class="d-block w-100"
  225. th:src="${homeImg.imageurl}" width="100%"
  226. alt="Slide Image">
  227. </div>
  228. <!-- <div class="carousel-caption">
  229. Welcome to Desk Space
  230. </div> -->
  231. </div>
  232. <a class="carousel-control-prev"
  233. href="#carouselExampleIndicators" role="button"
  234. data-slide="prev">
  235. <span class="carousel-control-prev-icon"
  236. aria-hidden="true"></span>
  237. <span class="sr-only">Previous</span>
  238. </a>
  239. <a class="carousel-control-next"
  240. href="#carouselExampleIndicators" role="button"
  241. data-slide="next">
  242. <span class="carousel-control-next-icon"
  243. aria-hidden="true"></span>
  244. <span class="sr-only">Next</span>
  245. </a>
  246. </div>
  247. <!-- Photo Grid End-->
  248. </div>
  249. <div
  250. class="col-lg-6 col-sm-12 justify-content-center align-items-center">
  251. <!-- Enter Details -->
  252. <!-- <h5 class="mb-3" style="color:#E29D25">Select Your Preference: <button id="backBtn" class="btn btn-sm btn-outline-primary">Back </button></h5> -->
  253. <div
  254. class="d-flex justify-content-between align-items-center mb-3">
  255. <h5 class="mb-0" style="color:#E29D25">Select Your
  256. Preference:</h5>
  257. <button id="backBtn2" onclick="history.back()"
  258. class="btn btn-primary">Back</button>
  259. </div>
  260. <div class="mb-3 row">
  261. <label style="font-weight:bold;" for="numSeats"
  262. class="col-sm-12 col-md-4 col-form-label"><strong>Number
  263. of Seats :</strong></label>
  264. <div class="col-sm-6 col-md-6">
  265. <select class="form-control" id="numSeats">
  266. <option value="1">1 Seat</option>
  267. <option value="2">2 Seats</option>
  268. <option value="3">3 Seats</option>
  269. <option value="4">4 Seats</option>
  270. <option value="5">5 Seats</option>
  271. </select>
  272. </div>
  273. </div>
  274. <!-- <div class="mb-3 row">
  275. <label style="font-weight:bold;" for="buildingname" class="col-sm-4 col-form-label text-end fw-semibold">
  276. Building name:
  277. </label>
  278. <div class="col-sm-8">
  279. <input type="text" id="buildingname" class="form-control"
  280. th:value="${buildingName}" readonly>
  281. </div>
  282. </div>-->
  283. <div class="mb-3 row align-items-center">
  284. <label for="buildingname"
  285. class="col-sm-4 col-form-label text-end fw-semibold"
  286. style="font-weight:bold;">
  287. Location :
  288. </label>
  289. <div class="col-sm-6 d-flex align-items-center">
  290. <input type="text" id="buildingname"
  291. class="form-control" th:value="${buildingName}"
  292. readonly> <br>
  293. </div>
  294. <button type="button" id="viewBuildingBtn"
  295. class="btn btn-primary">Change</button>
  296. </div>
  297. <!-- Date Picker -->
  298. <div class="row mb-3">
  299. <label style="font-weight:bold;" for="selectDate"
  300. class="col-sm-4 col-form-label text-end">Select Date
  301. :</label>
  302. <div class="col-sm-6">
  303. <!-- <input type="date" class="form-control" id="selectDate" onchange="loadTimeSlots()"> -->
  304. <input class="form-control" id="selectDate"
  305. type="text" placeholder="Select a date "
  306. readonly>
  307. </div>
  308. </div>
  309. <!-- Time Slots -->
  310. <div class="row mb-3">
  311. <label style="font-weight:bold;"
  312. class="col-sm-4 col-form-label text-end">Seat
  313. required for :</label>
  314. <div class="col-sm-8">
  315. <div id="seatfor" class="d-flex flex-wrap">
  316. <div class="btn-group" data-toggle="buttons">
  317. <label class="btn btn-primary2 me-2 mb-2"
  318. style="margin: 5px;">
  319. <input type="radio" name="booking_type"
  320. id="halfDay" autocomplete="off"
  321. value=""> Half Day
  322. </label>
  323. <label class="btn btn-primary2 me-2 mb-2"
  324. style="margin: 5px;">
  325. <input type="radio" name="booking_type"
  326. id="fullDay" autocomplete="off"
  327. value=""> Full Day
  328. </label>
  329. <label class="btn btn-primary2 mb-2"
  330. style="margin: 5px;">
  331. <input type="radio" name="booking_type"
  332. id="month" autocomplete="off"
  333. value=""> Month
  334. </label>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. <!-- Time Slots -->
  340. <div class="row mb-3">
  341. <label style="font-weight:bold;"
  342. class="col-sm-4 col-form-label text-end">Available
  343. Time Slot :</label>
  344. <div class="col-sm-8">
  345. <div id="timeSlots" class="d-flex flex-wrap">
  346. <!-- Time slots will be generated here dynamically -->
  347. </div>
  348. <div id="seatAvailabilityMsg" style="margin-top:5px; font-size:13px; color:red;"></div>
  349. </div>
  350. </div>
  351. <!-- Selected Time Slot
  352. <div class="row mb-3">
  353. <label style="font-weight:bold;" class="col-sm-4 col-form-label text-end">Selected Time Slot</label>
  354. <div class="col-sm-6">-->
  355. <input type="hidden" id="selectedSlot" class="form-control"
  356. readonly>
  357. <!-- </div>
  358. </div> -->
  359. <div class="row mb-3">
  360. <label style="font-weight:bold;" for="selectType"
  361. class="col-sm-4 col-form-label text-end">Select Type
  362. :</label>
  363. <div class="col-sm-6">
  364. <select class="form-control" id="selectType">
  365. <option value="Individual">Individual</option>
  366. <option value="Corporate">Corporate</option>
  367. </select>
  368. </div>
  369. </div>
  370. <div class="row mb-3">
  371. <label style="font-weight:bold;" for="personName"
  372. class="col-sm-4 col-form-label text-end">Name
  373. :</label>
  374. <div class="col-sm-6">
  375. <input type="text" class="form-control"
  376. id="personName">
  377. </div>
  378. </div>
  379. <div class="row mb-3">
  380. <label style="font-weight:bold;" for="personPhone"
  381. class="col-sm-4 col-form-label text-end">Mobile
  382. Number :</label>
  383. <div class="col-sm-6">
  384. <input type="text" class="form-control"
  385. id="personPhone"
  386. placeholder="Enter mobile number"
  387. pattern="^\d{10}$" maxlength="10" minlength="10"
  388. required>
  389. </div>
  390. </div>
  391. <!-- Total Payable Amount -->
  392. <!-- Action Buttons -->
  393. <div class="d-flex justify-content-center">
  394. <button type="button" style="width:100px;"
  395. class="reset-now-btn mr-1"
  396. onclick="resetForm()">Reset</button>
  397. <button type="button" style="width:100px;"
  398. class="book-now-btn" onclick="saveBooking()">Book
  399. Now</button>
  400. </div>
  401. <div style="margin-top: 10px">
  402. <center>
  403. <!-- <h5 onclick="showTour(1,3);" class="scroll-link" style="font-size:14px;text-decoration: none; color:#1a73e8;font-weight: normal;cursor:pointer;">
  404. <img src="/co-workspaceDocuments/360.png" width="200px" title="Click here to view Virtual Tour">
  405. </h5> -->
  406. </center>
  407. </div>
  408. </div>
  409. <!-- <div class="col-lg-2 col-sm-0"></div> -->
  410. </div>
  411. </form>
  412. <!-- </div>
  413. </div>
  414. </div>
  415. <div class="row" id="conferenceHallDiv2" style="border-radius: 10px; margin:0px;">
  416. <div class="col-lg-12 col-sm-12">
  417. <div style="border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; padding: 20px; margin-top: 20px;">-->
  418. <br>
  419. <hr>
  420. <br>
  421. <div class="row">
  422. <div class="col-lg-6 col-sm-0" style="padding:0px;">
  423. <h4 style="font-weight: bold;">Timing Details</h4>
  424. <div class="row">
  425. <!-- First Column -->
  426. <div class="col-lg-6 col-sm-6">
  427. <ul class="list-unstyled">
  428. <li style="margin-bottom: 21px;"><img
  429. src="/co-workspaceDocuments/icons/cal.png"
  430. class="mr-1" width="25px;"> Available days:
  431. S M T W T F S </li>
  432. <li style="margin-bottom: 21px;"><img
  433. src="/co-workspaceDocuments/icons/clo.png"
  434. class="mr-1" width="25px;"> Available time :
  435. 09:00 AM to 09:00 PM</li>
  436. </ul>
  437. </div>
  438. </div>
  439. <hr>
  440. <h4 style="font-weight: bold;margin-bottom: 27px;">Amenities
  441. </h4>
  442. <div class="row">
  443. <!-- First Column -->
  444. <div class="col-lg-4 col-sm-4">
  445. <ul class="list-unstyled">
  446. <li style="margin-bottom: 21px;"><img
  447. src="/co-workspaceDocuments/icons/1.png"
  448. class="mr-1" width="15px;"> Wifi / Internet
  449. </li>
  450. <li style="margin-bottom: 21px;"><img
  451. src="/co-workspaceDocuments/icons/2.png"
  452. class="mr-1" width="15px;"> 24/7 Security
  453. </li>
  454. <li style="margin-bottom: 21px;"><img
  455. src="/co-workspaceDocuments/icons/3.png"
  456. class="mr-1" width="15px;"> Housekeeping
  457. </li>
  458. </ul>
  459. </div>
  460. <!-- Second Column -->
  461. <div class="col-lg-4 col-sm-4">
  462. <ul class="list-unstyled">
  463. <li style="margin-bottom: 21px;"><img
  464. src="/co-workspaceDocuments/icons/4.png"
  465. class="mr-1" width="15px;"> Vehicle Parking
  466. </li>
  467. <li style="margin-bottom: 21px;"><img
  468. src="/co-workspaceDocuments/icons/5.png"
  469. class="mr-1" width="15px;"> Reception</li>
  470. <li style="margin-bottom: 21px;"><img
  471. src="/co-workspaceDocuments/icons/6.png"
  472. class="mr-1" width="15px;"> Tea / Coffee
  473. </li>
  474. </ul>
  475. </div>
  476. <!-- Third Column -->
  477. <div class="col-lg-4 col-sm-4">
  478. <ul class="list-unstyled">
  479. <li style="margin-bottom: 21px;"><img
  480. src="/co-workspaceDocuments/icons/7.png"
  481. class="mr-1" width="15px;"> Comfy
  482. Workstations</li>
  483. <li style="margin-bottom: 21px;"><img
  484. src="/co-workspaceDocuments/icons/8.png"
  485. class="mr-1" width="15px;"> Air Conditioning
  486. </li>
  487. <li style="margin-bottom: 21px;"><img
  488. src="/co-workspaceDocuments/icons/9.png"
  489. class="mr-1" width="15px;"> ⁠Informal Collab
  490. Area</li>
  491. </ul>
  492. </div>
  493. </div>
  494. </div>
  495. <div
  496. class="col-lg-6 col-sm-12 justify-content-center align-items-center">
  497. <h4 style="font-weight: bold;">Muthalvar Padaippagam Location
  498. </h4>
  499. <div class="locationmap">
  500. <iframe
  501. th:src="'https://www.google.com/maps?q=' + ${latitude} + ',' + ${longitude} + '&hl=en&z=14&output=embed'"
  502. width="100%" height="450" style="border:0;"
  503. allowfullscreen loading="lazy"
  504. referrerpolicy="no-referrer-when-downgrade">
  505. </iframe>
  506. <!--- <iframe src="https://www.google.com/maps/embed?pb=!1m17!1m12!1m3!1d3885.7981508771118!2d80.232587!3d13.111970000000001!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m2!1m1!2zMTPCsDA2JzQzLjEiTiA4MMKwMTMnNTcuMyJF!5e0!3m2!1sen!2sin!4v1730288154721!5m2!1sen!2sin" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>-->
  507. <!-- <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d5919.7511602058585!2d80.22612333567244!3d13.112778597995147!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3a52644d2af36f2f%3A0xab9239a0f5506f51!2sChennai%20Corporation%20Office!5e1!3m2!1sen!2sin!4v1729756217765!5m2!1sen!2sin" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe> -->
  508. </div>
  509. </div>
  510. </div>
  511. </div>
  512. </div>
  513. </div>
  514. </div>
  515. </div>
  516. <!-- Main-body end -->
  517. </div>
  518. </div>
  519. </div>
  520. <footer th:replace="~{fragments/footer :: footer}"></footer>
  521. </div>
  522. <div class="modal fade" id="visitTourModal" tabindex="-1" aria-labelledby="visitTourModalLabel"
  523. aria-hidden="true">
  524. <div class="modal-dialog modal-lg">
  525. <div class="modal-content">
  526. <div class="modal-header">
  527. <h5 class="modal-title" id="visitTourModalLabel">Virtual Tour</h5>
  528. <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Close</button>
  529. </div>
  530. <div class="modal-body">
  531. <iframe id="visitTourIframe" src=""
  532. style="width: 100%; height: 500px; border: none;"></iframe>
  533. </div>
  534. </div>
  535. </div>
  536. </div>
  537. <!-- modal for confrim booking -->
  538. <div class="modal fade" id="ackModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  539. aria-hidden="true">
  540. <div class="modal-dialog modal-md" role="document">
  541. <div class="modal-content">
  542. <div class="modal-header">
  543. <h5>Review and confirm your booking details.</h5>
  544. </div>
  545. <div class="modal-body">
  546. <table class="table table-bordered">
  547. <tbody>
  548. <tr>
  549. <th scope="row">Booking Type:</th>
  550. <td>Desk Space</td>
  551. </tr>
  552. <tr>
  553. <th scope="row">Name:</th>
  554. <td><span class="name"></span></td>
  555. </tr>
  556. <tr>
  557. <th scope="row">Mobile:</th>
  558. <td><span class="mnum"></span></td>
  559. </tr>
  560. <tr>
  561. <th scope="row">Selected Date:</th>
  562. <td><span class="date"></span></td>
  563. </tr>
  564. <tr>
  565. <th scope="row">Selected Slot:</th>
  566. <td><span class="slot"></span></td>
  567. </tr>
  568. <tr>
  569. <th scope="row">Number of Seats:</th>
  570. <td><span class="adultcount"></span></td>
  571. </tr>
  572. <!-- <tr>
  573. <th scope="row">Seat required for:</th>
  574. <td><span class="seatfor"></span></td>
  575. </tr> -->
  576. <tr>
  577. <th scope="row">Amount:</th>
  578. <td><span class="amounttxt"></span></td>
  579. </tr>
  580. </tbody>
  581. </table>
  582. </div>
  583. <div class="modal-footer text-center">
  584. <div style="text-align: center;" id="paynow"></div>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. </div>
  590. <script th:replace="~{fragments/user-script :: script}"></script>
  591. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
  592. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  593. <script>
  594. //ak
  595. document.addEventListener('DOMContentLoaded', () => {
  596. const viewBuildingBtn = document.getElementById('viewBuildingBtn');
  597. if (viewBuildingBtn) {
  598. viewBuildingBtn.addEventListener('click', () => {
  599. window.location.href = '/muthalvarpadaippagam';
  600. });
  601. }
  602. });
  603. $(document).on('click', '#backBtn', function () {
  604. //window.location.href = '/muthalvarpadaippagam/home';
  605. });
  606. fetch('/muthalvarpadaippagam/book/api/marquee')
  607. .then(response => response.json())
  608. .then(data => {
  609. const marqueeContainer = document.querySelector(".scrolling-text span");
  610. if (marqueeContainer && data.content) {
  611. marqueeContainer.textContent = data.content;
  612. }
  613. })
  614. .catch(error => console.error("Failed to load marquee:", error));
  615. //let catId=2;
  616. //let subId =2;
  617. //let buildId= 1;
  618. // Extract query parameters from the URL
  619. // const urlParams = new URLSearchParams(window.location.search);
  620. // const catId = urlParams.get('categoryId');
  621. // const buildId = urlParams.get('buildingId');
  622. // let subId = urlParams.get('subId');
  623. // console.log("Category ID:", catId);
  624. // console.log("Building ID:", buildId);
  625. // console.log("Sub ID:", subId);
  626. // Optional: fallback if parameters missing
  627. const buildId = document.getElementById("#buildingId")
  628. const catId = document.getElementById("#categoryId")
  629. let subId = document.getElementById("#subId")
  630. console.log("Category ID:", catId);
  631. console.log("Building ID:", buildId);
  632. console.log("Sub ID:", subId);
  633. let slots = [];
  634. let timeSlots = [];
  635. let selectedSeatType = 4; // default to 4 seater
  636. let ratePerHour = 150; // default rate for 4 seater
  637. const bookedSlots = ['9:00 AM', '6:00 PM', '8:00 PM']; // Sample booked slots, will show in red
  638. // Load available time slots
  639. // Global variable to store selected slots
  640. let selectedSlots = [];
  641. async function loadSlots(scid) {
  642. timeSlots = []; // Clear previous slots
  643. subId = scid;
  644. try {
  645. const response = await $.ajax({
  646. url: '/muthalvarpadaippagam/api/getSlotBySid',
  647. type: 'GET',
  648. data: { scid: scid }
  649. });
  650. timeSlots = response; // Populate timeSlots after response
  651. console.log("Slots loaded:", timeSlots);
  652. } catch (error) {
  653. console.error('Error loading slots:', error);
  654. }
  655. }
  656. //ak dynamic
  657. async function assignScidToStaticRadios() {
  658. let catId = $('#categoryId').val();
  659. try {
  660. const response = await $.ajax({
  661. url: '/muthalvarpadaippagam/api/getSubCategoryByCid',
  662. type: 'GET',
  663. data: { cid: catId }
  664. });
  665. response.forEach(function(item) {
  666. if (item.display_name.toLowerCase().includes("half")) {
  667. $('#halfDay').val(item.scid);
  668. }
  669. else if (item.display_name.toLowerCase().includes("full")) {
  670. $('#fullDay').val(item.scid);
  671. }
  672. else if (item.display_name.toLowerCase().includes("month")) {
  673. $('#month').val(item.scid);
  674. }
  675. });
  676. } catch (error) {
  677. console.error("Error assigning scid:", error);
  678. }
  679. }
  680. function loadTimeSlots(selectedDate) {
  681. const timeSlotsDiv = document.getElementById('timeSlots');
  682. timeSlotsDiv.innerHTML = ''; // Clear previous slots
  683. const currentTime = new Date();
  684. let endDate = currentTime;
  685. let day = String(endDate.getDate()).padStart(2, '0');
  686. let month = String(endDate.getMonth() + 1).padStart(2, '0');
  687. let year = endDate.getFullYear();
  688. toDate = year + "-" + month + "-" + day;
  689. const hours = String(currentTime.getHours()).padStart(2, '0');
  690. const minutes = String(currentTime.getMinutes()).padStart(2, '0');
  691. const formattedTime = `${hours}:${minutes}`;
  692. timeSlots.forEach(slot => {
  693. if (selectedDate == toDate) {
  694. if (slot.end_time > formattedTime) {
  695. const isBooked = bookedSlots.includes(slot.value); // Use slot value to check if it's booked
  696. const slotDiv = `
  697. <label class="time-slot-box ${isBooked ? 'booked' : 'available'}">
  698. <input type="radio" name="timeSlot" id="${slot.slotid}" value="${slot.slotid}"
  699. ${isBooked ? 'disabled' : ''} onclick="selectTimeSlot(this)">
  700. ${slot.name} <!-- Display time here -->
  701. </label>`;
  702. timeSlotsDiv.insertAdjacentHTML('beforeend', slotDiv);
  703. }
  704. }
  705. else {
  706. const isBooked = bookedSlots.includes(slot.value); // Use slot value to check if it's booked
  707. const slotDiv = `
  708. <label class="time-slot-box ${isBooked ? 'booked' : 'available'}">
  709. <input type="radio" name="timeSlot" id="${slot.slotid}" value="${slot.slotid}"
  710. ${isBooked ? 'disabled' : ''} onclick="selectTimeSlot(this)">
  711. ${slot.name} <!-- Display time here -->
  712. </label>`;
  713. timeSlotsDiv.insertAdjacentHTML('beforeend', slotDiv);
  714. }
  715. });
  716. }
  717. $('#numSeats').change(function () {
  718. document.getElementById('timeSlots').innerHTML = '';
  719. document.getElementById('selectDate').value = '';
  720. // clear availability text
  721. $('#seatAvailabilityMsg').text('');
  722. console.log("Slots reset because number of seats changed");
  723. });
  724. $('input[name="booking_type"]').change(function () {
  725. // clear seat availability message
  726. $('#seatAvailabilityMsg').text('');
  727. // optional: reset selected slot
  728. });
  729. function selectTimeSlot(element) {
  730. slots = [];
  731. let slotId = element.value;
  732. let bid = $('#buildingId').val();
  733. let cid = $('#categoryId').val();
  734. let scid = $('#subId').val();
  735. let bDate = $('#selectDate').val();
  736. let noOfPerson = $('#numSeats').val();
  737. $.ajax({
  738. url: '/muthalvarpadaippagam/book/api/checkAvailslots',
  739. type: 'GET',
  740. data: {
  741. bid: bid,
  742. cid: cid,
  743. bDate: bDate,
  744. scid: scid,
  745. slotId: slotId
  746. },
  747. success: function (availableSeats) {
  748. // show message below slots
  749. $('#seatAvailabilityMsg').text("Available Seats : " + availableSeats);
  750. if (availableSeats == 0) {
  751. $('#seatAvailabilityMsg').text("Slot Full");
  752. // show slot as selected
  753. document.querySelectorAll('input[name="timeSlot"]').forEach(slot => {
  754. slot.parentElement.style.backgroundColor = '';
  755. slot.parentElement.style.color = '';
  756. });
  757. element.parentElement.style.backgroundColor = '#E29D25';
  758. element.parentElement.style.color = '#FFF';
  759. return;
  760. }
  761. if (parseInt(noOfPerson) > availableSeats) {
  762. $('#seatAvailabilityMsg').text("Only " + availableSeats + " seats available");
  763. // still store selected slot
  764. document.getElementById('selectedSlot').value =
  765. element.nextSibling.nodeValue.trim();
  766. slots.push(slotId);
  767. document.querySelectorAll('input[name="timeSlot"]').forEach(slot => {
  768. slot.parentElement.style.backgroundColor = '';
  769. slot.parentElement.style.color = '';
  770. });
  771. element.parentElement.style.backgroundColor = '#E29D25';
  772. element.parentElement.style.color = '#FFF';
  773. return;
  774. }
  775. document.getElementById('selectedSlot').value =
  776. element.nextSibling.nodeValue.trim();
  777. slots.push(slotId);
  778. console.log("Selected slots:", slots);
  779. // reset colors
  780. document.querySelectorAll('input[name="timeSlot"]').forEach(slot => {
  781. slot.parentElement.style.backgroundColor = '';
  782. slot.parentElement.style.color = '';
  783. });
  784. if (element.checked) {
  785. element.parentElement.style.backgroundColor = '#E29D25';
  786. element.parentElement.style.color = '#FFF';
  787. }
  788. }
  789. });
  790. }
  791. //exisisting
  792. /* function selectTimeSlot(element) {
  793. slots = [];
  794. document.getElementById('selectedSlot').value = element.nextSibling.nodeValue.trim(); // Get the displayed time
  795. slots.push(element.value);
  796. console.log("Selected slots:", slots);
  797. // Reset background color for all time slot radio buttons
  798. document.querySelectorAll('input[name="timeSlot"]').forEach(slot => {
  799. slot.parentElement.style.backgroundColor = ''; // Reset background color
  800. slot.parentElement.style.color = ''; // Reset background color
  801. });
  802. // Set background color to red for the selected radio button's parent element
  803. if (element.checked) {
  804. element.parentElement.style.backgroundColor = '#E29D25';
  805. element.parentElement.style.color = '#FFF';
  806. }
  807. }*/
  808. // Calculate Total Payable Amount
  809. // Reset the form
  810. function resetForm() {
  811. document.getElementById('conferenceHallForm').reset(); // Reset the form fields
  812. document.getElementById('timeSlots').innerHTML = ''; // Clear the time slots
  813. document.getElementById('selectedSlot').value = ''; // Clear selected slot
  814. document.getElementById('totalAmount').value = 'Rs. 0.00'; // Reset total amount
  815. $('#seatAvailabilityMsg').text(''); // Clear seat availability message
  816. }
  817. // Booking Action
  818. function validatePersonName() {
  819. const personName = $('#personName').val();
  820. const isValid = /^[a-zA-Z\s]+$/.test(personName); // Only letters and spaces
  821. if (isValid && personName.trim() !== "") {
  822. $('#personName').css('border-color', ''); // Clear any error styling
  823. } else {
  824. $('#personName').css('border-color', 'red'); // Highlight the field with error styling
  825. }
  826. return isValid;
  827. }
  828. function validateMobileNumber() {
  829. const mobileNumber = $('#personPhone').val();
  830. const isValid = /^\d{10}$/.test(mobileNumber); // Checks if it's exactly 10 digits
  831. if (isValid) {
  832. $('#personPhone').css('border-color', ''); // Clear any error styling
  833. } else {
  834. $('#personPhone').css('border-color', 'red'); // Highlight the field with error styling
  835. }
  836. return isValid;
  837. }
  838. // Validate Select Date (yy-mm-dd format)
  839. function validateSelectDate() {
  840. const selectDate = $('#selectDate').val();
  841. const isValid = /^\d{4}-\d{2}-\d{2}$/.test(selectDate); // Regex for yy-mm-dd format
  842. if (isValid) {
  843. $('#selectDate').css('border-color', ''); // Clear any error styling
  844. } else {
  845. $('#selectDate').css('border-color', 'red'); // Highlight the field with error styling
  846. }
  847. return isValid;
  848. }
  849. // Validate Selected Slot (Radio Button)
  850. function validateSelectedSlot() {
  851. const selectedSlot = $('#selectedSlot').val(); // Checks if any radio button is selected
  852. const isValid = !!selectedSlot;
  853. if (isValid) {
  854. $('input[name="selectedSlot"]').parent().css('border-color', ''); // Clear any error styling
  855. } else {
  856. $('input[name="selectedSlot"]').parent().css('border-color', 'red'); // Highlight the field with error styling
  857. }
  858. return isValid;
  859. }
  860. // Validate Number of Seats (Dropdown)
  861. function validateNumSeats() {
  862. const numSeats = $('#numSeats').val();
  863. const isValid = numSeats !== "default"; // Assumes 'default' is the value for unselected dropdown option
  864. if (isValid) {
  865. $('#numSeats').css('border-color', ''); // Clear any error styling
  866. } else {
  867. $('#numSeats').css('border-color', 'red'); // Highlight the field with error styling
  868. }
  869. return isValid;
  870. }
  871. function validateBookingType() {
  872. const isBookingTypeSelected = $('input[name="booking_type"]:checked').length > 0;
  873. const isValid = !!isBookingTypeSelected;
  874. if (isValid) {
  875. $('input[name="selectedSlot"]').parent().css('border-color', ''); // Clear any error styling
  876. } else {
  877. $('input[name="selectedSlot"]').parent().css('border-color', 'red'); // Highlight the field with error styling
  878. }
  879. return isValid;
  880. }
  881. function saveBooking() {
  882. let msg = $('#seatAvailabilityMsg').text();
  883. if (msg.includes("Only")) {
  884. // alert(msg);
  885. swal.fire({
  886. title: "Seat Availability",
  887. text: msg,
  888. icon: "warning",
  889. button: "OK",
  890. });
  891. return;
  892. }
  893. if (msg.includes("Slot Full")) {
  894. swal.fire({
  895. title: "Slot Full",
  896. text: "This slot is full. Please select another slot.",
  897. icon: "error",
  898. button: "OK",
  899. });
  900. return;
  901. }
  902. // console.log(catId);
  903. // console.log(buildId);
  904. // console.log(subId);
  905. //console.log(from_date);
  906. //e.preventDefault(); // Prevent form submission for this example
  907. const isMobileValid = validateMobileNumber();
  908. const isNameValid = validatePersonName();
  909. const isDateValid = validateSelectDate();
  910. const isBookingTypeValid = validateBookingType();
  911. const isSlotValid = validateSelectedSlot();
  912. const isSeatsValid = validateNumSeats();
  913. //alert(isMobileValid +" - "+ isNameValid +" - "+ isDateValid +" - "+ isSlotValid +" - "+ isSeatsValid );
  914. if (isMobileValid && isNameValid && isDateValid && isBookingTypeValid && isSlotValid && isSeatsValid) {
  915. // Proceed with form submission
  916. //alert("Form is valid!");
  917. } else {
  918. // alert("Please correct the errors in the form.");
  919. swal.fire({
  920. title: "Form Validation",
  921. text: "Please correct the errors in the form.",
  922. icon: "error",
  923. button: "OK",
  924. });
  925. return false;
  926. }
  927. // Populate the input values
  928. let name = $('#personName').val();
  929. let phone = $('#personPhone').val();
  930. let fromDate = $('#selectDate').val(); // Ensure this is a different element
  931. let subId = $('input[name="booking_type"]:checked').val();
  932. //let subId = $('#subId').val();
  933. let buildId = $('#buildingId').val();
  934. let catId = $('#categoryId').val();
  935. console.log(subId);
  936. let toDate = fromDate; // Ensure this is a different element
  937. if (subId == 4 || subId==12 || subId==24) {
  938. //toDate = convertDateFormat(toDate);
  939. let endDate = new Date(fromDate);
  940. endDate.setDate(endDate.getDate() + 30);
  941. let day = String(endDate.getDate()).padStart(2, '0');
  942. let month = String(endDate.getMonth() + 1).padStart(2, '0');
  943. let year = endDate.getFullYear();
  944. toDate = year + "-" + month + "-" + day;
  945. }
  946. let selectedSlot = $('#selectedSlot').val();
  947. let noOfPeople = $('#numSeats').val();
  948. // Populate the span elements with the retrieved values
  949. $('.name').text(name);
  950. $('.mnum').text(phone);
  951. $('.date').text(`${fromDate} to ${toDate}`);
  952. $('.adultcount').text(noOfPeople);
  953. $('.slot').text(selectedSlot);
  954. $(".noOfPeoplecount").text(noOfPeople);
  955. $.ajax({
  956. url: '/muthalvarpadaippagam/book/api/saveInTemp',
  957. type: 'POST',
  958. data: {
  959. catId: catId,
  960. buildId: buildId,
  961. subId: subId,
  962. noOfPeople: noOfPeople, // Use dynamic value from the input
  963. fromDate: fromDate,
  964. toDate: toDate,
  965. userName: name,
  966. userMobile: phone,
  967. slots: slots // Ensure this is defined and populated
  968. },
  969. success: function (response) {
  970. //console.log("Akg Response:"+response);
  971. if (response) {
  972. let tempId = response.tempBookId;
  973. $(".amount").text(response.amount);
  974. let finalAmount = response.amount;
  975. $(".amounttxt").text("Rs. " + finalAmount);
  976. // Update the modal with a dynamic Pay Now button
  977. $('#paynow').html(
  978. '<button type="button" class="btn book-now-btn" data-bs-dismiss="modal" style="margin-right:10px;">Close</button>' +
  979. '<button style="" class="btn book-now-btn" onclick="paymentStart(' + tempId + ',' + finalAmount + ')">Pay Now (Rs. ' + finalAmount + ')</button>' +
  980. ''
  981. );
  982. // Open the modal
  983. $('#ackModal').modal('show');
  984. }
  985. },
  986. /*error: function (xhr, status, error) {
  987. alert("Please select another slot. The selected slot is now full.");
  988. console.log('Error sending data:', error);
  989. console.log('Response text:', xhr.responseText); // Log response text for debugging
  990. }*/
  991. error: function (xhr) {
  992. let msg = "Booking failed. Please try again.";
  993. if (xhr.responseJSON && xhr.responseJSON.message) {
  994. msg = xhr.responseJSON.message;
  995. }
  996. // alert(msg);
  997. swal.fire({
  998. title: "Booking Failed",
  999. text: msg,
  1000. icon: "error",
  1001. button: "OK",
  1002. });
  1003. }
  1004. });
  1005. }
  1006. //date valisdation
  1007. $(document).ready(function () {
  1008. $("#selectDate").datepicker({
  1009. minDate: 0, // Current date
  1010. maxDate: 60, // Next 60 days
  1011. dateFormat: 'yy-mm-dd'
  1012. //dateFormat: 'dd-mm-yy'
  1013. });
  1014. /* $(document).ready(function () {
  1015. $("#selectDate").attr("readonly", true); // prevent manual edit
  1016. $("#selectDate").datepicker({
  1017. minDate: 0,
  1018. maxDate: 60,
  1019. dateFormat: 'yy-mm-dd',
  1020. onSelect: function(dateText) {
  1021. $("#selectDate").val(dateText);
  1022. }
  1023. });
  1024. // Block typing and pasting
  1025. $("#selectDate").on("keydown paste", function(e){
  1026. e.preventDefault();
  1027. return false;
  1028. });
  1029. // Allow opening datepicker on click
  1030. $("#selectDate").on("click", function () {
  1031. $(this).datepicker("show");
  1032. });*/
  1033. /* $("#selectDate").datepicker({
  1034. minDate: 0, // Prevent past dates
  1035. maxDate: 60, // Allow next 60 days
  1036. dateFormat: 'yy-mm-dd',
  1037. onSelect: function(dateText) {
  1038. $(this).attr("readonly", true); // Make the field read-only after selection
  1039. }
  1040. });
  1041. // Block manual typing or pasting
  1042. $("#selectDate").on("keydown paste", function(e){
  1043. e.preventDefault();
  1044. return false;
  1045. });
  1046. // Allow reopening the datepicker on click even after readonly
  1047. $("#selectDate").on("click", function () {
  1048. $(this).datepicker("show");
  1049. });*/
  1050. // Function to load available time slots
  1051. //ak dynamic
  1052. assignScidToStaticRadios();
  1053. $('#selectDate').on('change', async function () {
  1054. //alert('Date changed');
  1055. // const bookingType = document.querySelector('input[name="booking_type"]:checked').value;
  1056. // const scid = bookingType; // Retrieve scid dynamically if needed
  1057. const selectedRadio = document.querySelector('input[name="booking_type"]:checked');
  1058. $('#seatAvailabilityMsg').text('');
  1059. if (!selectedRadio || !selectedRadio.value) {
  1060. console.log("Invalid scid. Skipping slot load.");
  1061. return;
  1062. }
  1063. const scid = selectedRadio.value;
  1064. const selectedDate = $("#selectDate").val();
  1065. let catId = $('#categoryId').val();
  1066. console.log("cat")
  1067. console.log(catId);
  1068. console.log("sleted")
  1069. console.log(scid);
  1070. if (scid) {
  1071. await loadSlots(scid);
  1072. loadTimeSlots(selectedDate);
  1073. }
  1074. $('#selectedSlot').val('');
  1075. });
  1076. $('input[name="booking_type"]').on('change', async function () {
  1077. const selectedRadio = document.querySelector('input[name="booking_type"]:checked');
  1078. if (!selectedRadio || !selectedRadio.value) {
  1079. console.log("Invalid scid. Skipping slot load.");
  1080. return;
  1081. }
  1082. const scid = selectedRadio.value;
  1083. // const bookingType = document.querySelector('input[name="booking_type"]:checked').value;
  1084. // const scid = bookingType; // Retrieve scid dynamically if needed
  1085. // const scid = $('#subId').val();
  1086. let catId = $('#categoryId').val();
  1087. console.log("cat12")
  1088. console.log(catId);
  1089. const selectedDate = $("#selectDate").val();
  1090. await loadSlots(scid);
  1091. loadTimeSlots(selectedDate);
  1092. $('#selectedSlot').val('');
  1093. });
  1094. });
  1095. document.getElementById('personPhone').addEventListener('input', function (e) {
  1096. const value = e.target.value;
  1097. // Allow only digits and limit to 10 characters
  1098. e.target.value = value.replace(/\D/g, '').slice(0, 10);
  1099. // Display an error message if necessary
  1100. if (value.length < 10 && value.length > 0) {
  1101. e.target.setCustomValidity("Please enter a 10-digit mobile number.");
  1102. } else {
  1103. e.target.setCustomValidity(""); // Clear any error message
  1104. }
  1105. });
  1106. </script>
  1107. <script>
  1108. function showTour(buildingId, categoryId) {
  1109. console.log("Visit Tour Triggered - Bid:", buildingId, "Cid:", categoryId);
  1110. let url = "";
  1111. let modalId = "";
  1112. // Ensure categoryId is parsed correctly
  1113. categoryId = parseInt(categoryId);
  1114. // Determine the URL and modal ID based on the categoryId
  1115. if (categoryId === 1) {
  1116. url = "https://my.matterport.com/show/?m=gKmjwFBqnwa";
  1117. modalId = "visitTourModal";
  1118. } else if (categoryId === 3) {
  1119. url = "https://my.matterport.com/show/?m=2n8cHdtUfs8";
  1120. modalId = "visitTourModal";
  1121. } else {
  1122. // alert("No tour available for this category."); // Fallback for other cases
  1123. swal.fire({
  1124. title: "No Tour Available",
  1125. text: "No tour available for this category.",
  1126. icon: "info",
  1127. button: "OK",
  1128. });
  1129. return;
  1130. }
  1131. console.log("Resolved URL:", url, "Modal ID:", modalId);
  1132. // Dynamically set the iframe source
  1133. const iframeId = modalId === "visitTourModal" ? "visitTourIframe" : "visitTourIframe1";
  1134. document.getElementById(iframeId).src = url;
  1135. // Open the appropriate modal
  1136. const modalElement = document.getElementById(modalId);
  1137. const modalInstance = new bootstrap.Modal(modalElement);
  1138. modalInstance.show();
  1139. console.log("Modal Displayed:", modalId);
  1140. }
  1141. function showTourPopup1(link) {
  1142. const iframe = document.getElementById('visitTourIframe1');
  1143. iframe.src = link;
  1144. // Show the modal
  1145. const modal = new bootstrap.Modal(document.getElementById('visitTourModal1'));
  1146. modal.show();
  1147. }
  1148. </script>
  1149. </div>
  1150. </body>
  1151. </html>