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.

3337 lines
150 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. <script src="https://cdn.jsdelivr.net/npm/compressorjs@5.0.3/dist/compressor.js"></script>
  5. <style>
  6. .table-align {
  7. width: 100%;
  8. }
  9. .td-align {
  10. padding: 8px;
  11. border: 1px solid #ddd;
  12. }
  13. @media (max-width: 600px) {
  14. .td-align {
  15. display: block;
  16. width: 100%;
  17. box-sizing: border-box;
  18. }
  19. }
  20. .center-table {
  21. justify-content: center;
  22. align-items: center;
  23. }
  24. .highlight-greens .ui-state-default {
  25. background: green !important;
  26. color: #FFF !important;
  27. }
  28. .highlight-yellow .ui-state-default {
  29. background: yellow !important;
  30. color: #000 !important;
  31. }
  32. .highlight-violet .ui-state-default {
  33. background: #a93da9 !important;
  34. color: #000 !important;
  35. }
  36. .highlight-pink .ui-state-default {
  37. background: red !important;
  38. color: #000 !important;
  39. }
  40. .btn-square-md {
  41. width: 16px !important;
  42. max-width: 100% !important;
  43. max-height: 50% !important;
  44. height: 30px !important;
  45. text-align: center;
  46. padding: 0px;
  47. font-size: 2px;
  48. }
  49. .disabled {
  50. pointer-events: none;
  51. opacity: 1;
  52. /* Example: reduce opacity to indicate disabled state */
  53. }
  54. .ui-datepicker {
  55. width: 100%;
  56. background-color: #333;
  57. }
  58. .ui-datepicker-header {
  59. background-color: #f0f0f0;
  60. /* Light gray background for header */
  61. border: none;
  62. border-radius: 5px 5px 0 0;
  63. }
  64. .ui-datepicker-title {
  65. font-size: 1.2em;
  66. margin: 0;
  67. padding: 10px;
  68. text-align: center;
  69. }
  70. .ui-datepicker-calendar {
  71. margin: 0;
  72. padding: 0;
  73. color: white;
  74. /* Text color for dates */
  75. font-weight: bold;
  76. /* Bold font for dates */
  77. }
  78. .ui-datepicker-calendar th,
  79. .ui-datepicker-calendar td {
  80. text-align: center;
  81. }
  82. .ui-datepicker-week-end {
  83. color: yellow;
  84. font-weight: bold;
  85. }
  86. /* Style for the label */
  87. .date-label {
  88. display: block;
  89. margin-bottom: 6px;
  90. font-weight: bold;
  91. }
  92. .highlight-current-date a {
  93. background-color: green;
  94. /* Current date highlight color */
  95. color: white;
  96. }
  97. .highlight-greens a {
  98. background-color: green;
  99. color: white;
  100. }
  101. .highlight-yellow a {
  102. background-color: yellow;
  103. color: black;
  104. /* Change text color for visibility */
  105. }
  106. .highlight-pink a,
  107. input[type=button]:disabled {
  108. background-color: pink;
  109. /* Pink highlight for disabled or booked dates */
  110. color: white;
  111. }
  112. .highlight-orange a {
  113. background-color: orange;
  114. /* Orange highlight color */
  115. color: white;
  116. }
  117. input[type=button]:disabled {
  118. background: red;
  119. }
  120. .hidden {
  121. display: none;
  122. }
  123. #selecthall.select2-container--default .select2-selection--single {
  124. height: 35px;
  125. border: 1px solid #ddd;
  126. padding-left: 10px;
  127. }
  128. .select2-container--default .select2-selection--single .select2-selection__rendered {
  129. color: #444;
  130. line-height: 28px;
  131. margin-top: -8px;
  132. }
  133. #hallDetailsContainer {
  134. display: flex;
  135. flex-direction: column;
  136. align-items: center;
  137. /* Center items horizontally */
  138. justify-content: center;
  139. /* Center items vertically */
  140. border: 1px solid #ccc;
  141. border-radius: 5px;
  142. padding: 20px;
  143. margin-top: 20px;
  144. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  145. background-color: #fff;
  146. }
  147. /* Style for the image */
  148. #hallImagesCarousel {
  149. margin-bottom: 20px;
  150. }
  151. .row {
  152. display: flex;
  153. flex-wrap: wrap;
  154. margin-right: 0px;
  155. margin-left: 0px;
  156. }
  157. .col-md-6 {
  158. width: 50%;
  159. padding: 0 10px;
  160. /* Optional: Add padding to columns */
  161. }
  162. @media (max-width: 768px) {
  163. .col-md-6 {
  164. width: 100%;
  165. /* Full width on smaller screens */
  166. }
  167. }
  168. #hallDetailsContainer p {
  169. margin: 0;
  170. padding: 5px 0;
  171. }
  172. #hallDetailsContainer p:nth-child(even) {
  173. background-color: #f9f9f9;
  174. }
  175. /* CSS styles for the amount details container */
  176. #amountDetailsContainer {
  177. border: 1px solid #ccc;
  178. border-radius: 5px;
  179. padding: 20px;
  180. margin-top: 20px;
  181. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  182. background-color: #fff;
  183. }
  184. #amountDetailsContainer h4 {
  185. margin-top: 0;
  186. margin-bottom: 10px;
  187. }
  188. #amountDetailsContainer div {
  189. list-style: none;
  190. padding: 0;
  191. }
  192. #amountDetailsContainer p {
  193. margin-bottom: 10px;
  194. }
  195. #amountDetailsContainer p span {
  196. font-weight: bold;
  197. }
  198. #amountDetailsContainer p:nth-child(even) {
  199. background-color: #f9f9f9;
  200. }
  201. /* Style for the image container */
  202. #hallImagesCarousel {
  203. display: flex;
  204. justify-content: center;
  205. /* Center content horizontally */
  206. align-items: center;
  207. /* Center content vertically */
  208. margin-bottom: 20px;
  209. position: relative;
  210. }
  211. /* Style for the images inside the carousel */
  212. .carousel-item img {
  213. max-width: 100%;
  214. /* Ensure image does not exceed container width */
  215. min-height: 9%;
  216. /* Maintain aspect ratio */
  217. display: block;
  218. /* Ensure image is block-level element */
  219. max-width: 100%;
  220. max-height: 100%;
  221. display: block;
  222. margin: 0 auto;
  223. /* Center the image horizontally */
  224. }
  225. .content-container {
  226. padding: 20px;
  227. }
  228. .otp-input {
  229. width: 30px;
  230. height: 30px;
  231. border: 1px solid #ccc;
  232. border-radius: 5px;
  233. text-align: center;
  234. font-size: 16px;
  235. margin-right: 10px;
  236. }
  237. /* Ensures content within these classes is centered */
  238. .modal-header,
  239. .modal-body,
  240. .modal-footer,
  241. #resend-container {
  242. text-align: center;
  243. }
  244. /* Center content with Flexbox if needed */
  245. .center-flex {
  246. display: flex;
  247. justify-content: center;
  248. align-items: center;
  249. flex-direction: column;
  250. /* Stack elements vertically */
  251. }
  252. /* Adjust the margin of the otp-input-box for better alignment */
  253. .otp-input-box {
  254. justify-content: center;
  255. margin: 0 auto;
  256. /* Centers the box horizontally */
  257. align-items: center;
  258. /* Align items in the center for flex containers */
  259. width: 100%;
  260. }
  261. .center-content {
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. height: 100%;
  266. /* Or set a specific height */
  267. flex-direction: column;
  268. /* Stack children vertically */
  269. }
  270. /* To ensure the form takes up the necessary width */
  271. .form-group {
  272. width: 100%;
  273. /* Adjust based on your layout's needs */
  274. }
  275. /* Custom styles for the jQuery UI Dialog */
  276. .custom-dialog .ui-dialog-content {
  277. background-color: #fff;
  278. color: #333;
  279. padding: 20px;
  280. }
  281. .custom-dialog .ui-dialog-titlebar {
  282. background: #007bff;
  283. color: #ffffff;
  284. }
  285. .custom-dialog .ui-dialog-buttonpane {
  286. background-color: #f1f1f1;
  287. }
  288. .custom-dialog .ui-dialog-buttonpane .ui-dialog-buttonset button {
  289. background-color: #007bff;
  290. color: #ffffff;
  291. border-color: #007bff;
  292. }
  293. .custom-dialog a {
  294. color: #007bff;
  295. text-decoration: none;
  296. }
  297. .custom-dialog a:hover {
  298. text-decoration: underline;
  299. }
  300. table {
  301. width: 100%;
  302. border-collapse: collapse;
  303. }
  304. th,
  305. td {
  306. border: 1px solid black;
  307. padding: 8px;
  308. text-align: center;
  309. }
  310. .date-box {
  311. border: 1px solid #ccc;
  312. padding: 10px;
  313. margin: 5px;
  314. text-align: center;
  315. background-color: #f8f9fa;
  316. border-radius: 5px;
  317. }
  318. .checkbox-label {
  319. display: block;
  320. margin-top: 5px;
  321. }
  322. #calendar {
  323. margin-top: 20px;
  324. padding: 20px;
  325. border: 1px solid #ccc;
  326. border-radius: 5px;
  327. background-color: #f8f9fa;
  328. }
  329. /* Style for date checkboxes */
  330. .date-checkboxes {
  331. margin-top: 10px;
  332. }
  333. label {
  334. margin-right: 10px;
  335. }
  336. .ui-datepicker-container {
  337. width: 100%
  338. }
  339. .fixedcontainer {
  340. width: 250%;
  341. margin: 40px 0;
  342. }
  343. .ui-widget {
  344. width: 40%
  345. }
  346. .ui-datepicker {
  347. padding: 3px;
  348. border: 1px solid #ccc;
  349. border-radius: 5px;
  350. background-color: white;
  351. left: 29.1418px;
  352. }
  353. .ui-datepicker-header {
  354. background-color: #f0f0f0;
  355. border: none;
  356. border-radius: 5px 5px 0 0;
  357. }
  358. .ui-datepicker-title {
  359. font-size: 1.2em;
  360. margin: 0;
  361. padding: 10px;
  362. text-align: center;
  363. }
  364. .ui-datepicker-calendar {
  365. margin: 0;
  366. padding: 0;
  367. font-weight: bold;
  368. /* Bold font for dates */
  369. }
  370. .ui-datepicker-calendar th,
  371. .ui-datepicker-calendar td {
  372. padding: 5px;
  373. text-align: center;
  374. }
  375. .ui-datepicker-calendar .ui-state-default {
  376. cursor: pointer;
  377. width: 100%;
  378. height: 100%;
  379. display: flex;
  380. justify-content: center;
  381. align-items: center;
  382. }
  383. .ui-datepicker-week-end {
  384. color: black;
  385. font-weight: bold;
  386. }
  387. .ui-datepicker-calendar th span {
  388. color: black;
  389. font-weight: bold;
  390. }
  391. .booking-form-container {
  392. margin: 20px auto;
  393. padding: 20px;
  394. border: 1px solid #ddd;
  395. border-radius: 8px;
  396. background-color: #f9f9f9;
  397. max-width: 960px;
  398. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  399. }
  400. .booking-form-container label {
  401. font-weight: bold;
  402. }
  403. .booking-form-container .form-control {
  404. margin-bottom: 10px;
  405. }
  406. .booking-form-container .btn-primary {
  407. background-color: #017bff;
  408. }
  409. .white-background {
  410. background-color: white;
  411. /* Set the background color as needed */
  412. border: 1px solid #ccc;
  413. /* Optional: Add border for better visualization */
  414. padding: 20px;
  415. margin-bottom: 20px;
  416. overflow: hidden;
  417. /* Hide overflow content during animation */
  418. position: relative;
  419. }
  420. .slide-left {
  421. animation: slideLeft 0.5s ease both;
  422. }
  423. .slide-right {
  424. animation: slideRight 0.5s ease both;
  425. }
  426. @keyframes slideLeft {
  427. 0% {
  428. transform: translateX(0);
  429. }
  430. 100% {
  431. transform: translateX(-100%);
  432. opacity: 0;
  433. }
  434. }
  435. @keyframes slideRight {
  436. 0% {
  437. transform: translateX(-100%);
  438. opacity: 0;
  439. }
  440. 100% {
  441. transform: translateX(0);
  442. opacity: 1;
  443. }
  444. }
  445. /* Apply styles to the booking-section container */
  446. .booking-section {
  447. margin: 20px auto;
  448. padding: 20px;
  449. border: 1px solid #ddd;
  450. border-radius: 8px;
  451. background-color: #f9f9f9;
  452. max-width: 960px;
  453. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  454. }
  455. .booking-section label {
  456. font-weight: bold;
  457. }
  458. .booking-section .form-control {
  459. margin-bottom: 10px;
  460. }
  461. .booking-section .btn-primary {
  462. background-color: #017bff;
  463. }
  464. /* Apply white background to the booking-section */
  465. #reasonforbookingSection {
  466. background-color: #ffffff;
  467. /* White background color */
  468. padding: 20px;
  469. /* Optional: Add padding for spacing */
  470. }
  471. body {
  472. font-family: Arial, sans-serif;
  473. margin: 0;
  474. padding: 0;
  475. }
  476. .progressbar {
  477. display: flex;
  478. margin-bottom: 20px;
  479. }
  480. .progress-step {
  481. width: 100%;
  482. height: 9px;
  483. background-color: #e0e0e0;
  484. /* Light gray background */
  485. border-radius: 10px;
  486. /* Rounded corners */
  487. margin-right: 10px;
  488. }
  489. .progress-step-active {
  490. background-color: #4caf50;
  491. /* Green active step */
  492. color: white;
  493. /* White text color */
  494. font-weight: bold;
  495. /* Bold font for active step */
  496. }
  497. .progress {
  498. width: 100%;
  499. height: 10px;
  500. background-color: #ddd;
  501. position: relative;
  502. }
  503. .progress-step::before {
  504. content: attr(data-title);
  505. display: block;
  506. position: absolute;
  507. top: 20px;
  508. left: 50%;
  509. transform: translateX(-50%);
  510. font-size: 12px;
  511. color: #888;
  512. }
  513. .form {
  514. margin-bottom: 20px;
  515. }
  516. .form-step {
  517. display: none;
  518. margin-bottom: 20px;
  519. }
  520. .form-step-active {
  521. display: block;
  522. }
  523. .btn-prev,
  524. .btn-next {
  525. padding: 10px 20px;
  526. font-size: 14px;
  527. cursor: pointer;
  528. border: none;
  529. background-color: #337ab7;
  530. color: #fff;
  531. }
  532. .btn-prev {
  533. margin-right: 10px;
  534. }
  535. /* Media Query for small screens */
  536. @media (max-width: 768px) {
  537. .progress-step::before {
  538. display: none;
  539. /* Hide step titles on small screens */
  540. }
  541. }
  542. #container {
  543. max-width: 1183px;
  544. }
  545. .step-container {
  546. position: relative;
  547. text-align: center;
  548. transform: translateY(-60%);
  549. }
  550. .step-circle {
  551. width: 30px;
  552. height: 30px;
  553. line-height: 29px;
  554. text-align: center;
  555. border-radius: 50%;
  556. cursor: pointer;
  557. background-color: #016d6f;
  558. color: white;
  559. border: 2px solid #016d6f;
  560. }
  561. .step-circle.active {
  562. background-color: #FFFFFF;
  563. color: #016d6f;
  564. }
  565. .step-line {
  566. position: absolute;
  567. top: 16px;
  568. left: 50px;
  569. width: calc(100% - 100px);
  570. height: 2px;
  571. background-color: #FFFFFF;
  572. /* Set the line color here */
  573. z-index: -1;
  574. }
  575. #multi-step-form {
  576. overflow-x: hidden;
  577. }
  578. body {
  579. font-family: Arial, sans-serif;
  580. margin: 0;
  581. padding: 0;
  582. }
  583. .custom-container {
  584. padding: 20px;
  585. border-radius: 8px;
  586. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  587. background-color: #FFFFFF;
  588. border: 1px solid #CCCCCC;
  589. overflow: auto;
  590. }
  591. .header {
  592. z-index: 1000;
  593. margin-bottom: 20px;
  594. }
  595. .logo-img {
  596. height: 30px;
  597. position: absolute;
  598. left: 10px;
  599. top: 10px;
  600. }
  601. .header h6 {
  602. color: white;
  603. text-align: center;
  604. margin: 0;
  605. line-height: 2.1;
  606. }
  607. .invoice-details h3 {
  608. margin: 5px 0;
  609. }
  610. .invoice-details p {
  611. margin: 5px 0;
  612. /* Adjusted margin for <p> tags */
  613. }
  614. .total-section {
  615. margin-top: 20px;
  616. text-align: right;
  617. }
  618. .step-content p {
  619. display: inline-block;
  620. margin-right: 20px;
  621. margin-bottom: 20px;
  622. }
  623. .error {
  624. border: 1px solid red;
  625. }
  626. .error-message {
  627. color: red;
  628. font-size: 12px;
  629. padding-top: 5px;
  630. }
  631. /* Style for small thumbnail images */
  632. .thumbnail-img {
  633. width: 44px;
  634. /* Adjust the width as needed */
  635. height: 35px;
  636. /* Adjust the height as needed */
  637. cursor: pointer;
  638. /* Show cursor as pointer on hover */
  639. margin-right: 10px;
  640. /* Optional margin between images */
  641. }
  642. .large-image-container {
  643. position: fixed;
  644. top: 10%;
  645. left: 34%;
  646. width: 36%;
  647. height: 72%;
  648. background-color: slategrey;
  649. z-index: 1050;
  650. /* High z-index to ensure it's on top of other content */
  651. padding: 25px;
  652. box-sizing: border-box;
  653. overflow: hidden;
  654. /* Prevents scrollbars from iframe from appearing outside the container */
  655. }
  656. #largeImage {
  657. max-width: 90%;
  658. /* Limit maximum width of large image */
  659. max-height: 90vh;
  660. /* Limit maximum height of large image */
  661. display: block;
  662. /* Ensure it behaves as a block element */
  663. margin: 0 auto;
  664. /* Center horizontally */
  665. }
  666. .btn-square-md {
  667. width: 72px !important;
  668. max-width: 100% !important;
  669. max-height: 50% !important;
  670. height: 18px !important;
  671. text-align: center;
  672. padding: 0px;
  673. font-size: 2px;
  674. }
  675. .close-button {
  676. position: absolute;
  677. top: 5px;
  678. right: 5px;
  679. z-index: 1051;
  680. /* Ensure close button is above the iframe */
  681. }
  682. iframe {
  683. width: 100%;
  684. height: 100%;
  685. /* Take full size of the container minus any paddings if necessary */
  686. border: none;
  687. }
  688. #uploadedDocsList {
  689. list-style-type: none;
  690. /* Removes the bullet points */
  691. padding: 0;
  692. /* Removes padding */
  693. margin: 0;
  694. /* Removes margin */
  695. }
  696. #uploadedDocsList li {
  697. margin-bottom: 10px;
  698. text-wrap: balance;
  699. /* Adds space between items */
  700. }
  701. #termsModal .table td,
  702. #termsModal .table th {
  703. padding: 0.5rem;
  704. /* Reducing padding */
  705. font-size: 0.8rem;
  706. /* Smaller font size */
  707. }
  708. .table-wrap td {
  709. white-space: normal;
  710. word-wrap: break-word;
  711. }
  712. .swal2-container {
  713. z-index: 9999999999999 !important;
  714. /* Adjust this value if needed */
  715. }
  716. #ui-datepicker-div {
  717. width: 40%;
  718. }
  719. /* Media query for mobile screens */
  720. @media (max-width: 768px) {
  721. #ui-datepicker-div {
  722. width: 72%;
  723. }
  724. }
  725. .highlight-disabled {
  726. cursor: default !important;
  727. /* Default cursor for disabled dates */
  728. }
  729. .form-check-label {
  730. padding-left: 0px
  731. }
  732. h5 {
  733. margin-left: 10px;
  734. }
  735. .table-bordered {
  736. border: 1px solid black;
  737. /* Set the border color to black */
  738. }
  739. .table-bordered td,
  740. .table-bordered th {
  741. border-color: black;
  742. /* Ensure that all table cells and headers have a black border */
  743. }
  744. .sand-clock::before {
  745. content: "\231B";
  746. /* Unicode for hourglass icon */
  747. display: inline-block;
  748. animation: move 1.5s infinite;
  749. font-size: 1.2em;
  750. /* Adjust size as needed */
  751. }
  752. /* Animation keyframes */
  753. @keyframes move {
  754. 0% {
  755. transform: translateY(0);
  756. }
  757. 50% {
  758. transform: translateY(-5px);
  759. }
  760. 100% {
  761. transform: translateY(0);
  762. }
  763. }
  764. .snackbar {
  765. visibility: hidden;
  766. min-width: 250px;
  767. margin-left: -125px;
  768. background-color: #333;
  769. color: #fff;
  770. text-align: center;
  771. border-radius: 5px;
  772. padding: 16px;
  773. position: fixed;
  774. z-index: 1;
  775. left: 50%;
  776. bottom: 30px;
  777. font-size: 17px;
  778. }
  779. .snackbar.show {
  780. visibility: visible;
  781. animation: fadeInOut 0.5s, fadeOut 0.5s 2.5s;
  782. }
  783. @keyframes fadeInOut {
  784. from {
  785. bottom: 0;
  786. opacity: 0;
  787. }
  788. to {
  789. bottom: 30px;
  790. opacity: 1;
  791. }
  792. }
  793. @keyframes fadeOut {
  794. from {
  795. bottom: 30px;
  796. opacity: 1;
  797. }
  798. to {
  799. bottom: 0;
  800. opacity: 0;
  801. }
  802. }
  803. .highlight-blue .ui-state-default {
  804. background: blue !important;
  805. color: #FFF !important;
  806. }
  807. .highlight-blue a {
  808. background-color: blue;
  809. color: white;
  810. }
  811. </style>
  812. <body>
  813. <!-- Pre-loader start -->
  814. <div class="theme-loader">
  815. <div class="ball-scale">
  816. <div class='contain'>
  817. <div class="ring">
  818. <div class="frame"></div>
  819. </div>
  820. <div class="ring">
  821. <div class="frame"></div>
  822. </div>
  823. <div class="ring">
  824. <div class="frame"></div>
  825. </div>
  826. <div class="ring">
  827. <div class="frame"></div>
  828. </div>
  829. <div class="ring">
  830. <div class="frame"></div>
  831. </div>
  832. <div class="ring">
  833. <div class="frame"></div>
  834. </div>
  835. <div class="ring">
  836. <div class="frame"></div>
  837. </div>
  838. <div class="ring">
  839. <div class="frame"></div>
  840. </div>
  841. <div class="ring">
  842. <div class="frame"></div>
  843. </div>
  844. <div class="ring">
  845. <div class="frame"></div>
  846. </div>
  847. </div>
  848. </div>
  849. </div>
  850. <!-- Pre-loader end -->
  851. <div id="pcoded" class="pcoded">
  852. <div class="pcoded-container">
  853. <!-- Menu header end -->
  854. <div class="pcoded-main-container">
  855. <!-- Menu header start -->
  856. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  857. <!-- Menu header end -->
  858. <div class="pcoded-main-container">
  859. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  860. <div class="pcoded-wrapper">
  861. <div class="pcoded-content">
  862. <div class="pcoded-inner-content">
  863. <div class="page-header m-t-20">
  864. </div>
  865. <!-- Page-header end -->
  866. <!-- Page body start -->
  867. <div class="page-body">
  868. <div class="row">
  869. <!--<div class="col-sm-12">-->
  870. <!-- Register your self card start -->
  871. <div>
  872. <div id="container" class="container mt-5">
  873. <div class="progress px-1" style="height: 3px;">
  874. <div class="progress-bar" role="progressbar" style="width: 0%;"
  875. aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
  876. </div>
  877. </div>
  878. <div class="step-container d-flex justify-content-between">
  879. <div class="step-circle" onclick="displayStep(1)">1</div>
  880. <div class="step-circle" onclick="displayStep(2)">2</div>
  881. <div class="step-circle" onclick="displayStep(3)">3</div>
  882. <div class="step-circle" onclick="displayStep(4)">4</div>
  883. </div>
  884. <form action="javascript:saveBookingDetails()" id="booking"
  885. method="post" enctype="multipart/form-data"
  886. onsubmit="return handleSaveAndContinueStep3()">
  887. <input type="hidden" id="serverDate" th:value=${serverDate}>
  888. <div class="step step-1">
  889. <h5>Step:1</h5>
  890. <div class="container custom-container"
  891. style="border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); background-color: #FFFFFF; border: 1px solid #CCCCCC;overflow-x: hidden;">
  892. <!-- Updated inline styles -->
  893. <div class="row justify-content-center">
  894. <div class="col-sm-6 col-md-6 col-lg-6">
  895. <label class="form-check-label"
  896. for="selecthall">Select Hall:</label>
  897. <select id="selecthall" class="form-control"
  898. name="hallId" required
  899. onchange="toggleHallDetailsContainer()">
  900. <option value="">Select a hall</option>
  901. </select>
  902. </div>
  903. </div>
  904. <br>
  905. <!-- Main content row -->
  906. <div id="hallDetailsContainer" style="display: none;">
  907. <!-- Initially hidden -->
  908. <div class="row">
  909. <!-- Hall Images Carousel -->
  910. <div class="col-md-6 col-lg-6 col-sm-6">
  911. <h6>Hall Images:</h6>
  912. <br>
  913. <div id="hallImagesCarousel"
  914. class="carousel slide" data-ride="carousel">
  915. <div class="carousel-inner">
  916. <div class="carousel-item active">
  917. <img id="hallImage"
  918. class="d-block w-100"
  919. alt="Hall Image">
  920. </div>
  921. </div>
  922. <a class="carousel-control-prev"
  923. href="#hallImagesCarousel" role="button"
  924. data-slide="prev">
  925. <span class="carousel-control-prev-icon"
  926. aria-hidden="true"></span>
  927. <span class="sr-only">Previous</span>
  928. </a>
  929. <a class="carousel-control-next"
  930. href="#hallImagesCarousel" role="button"
  931. data-slide="next">
  932. <span class="carousel-control-next-icon"
  933. aria-hidden="true"></span>
  934. <span class="sr-only">Next</span>
  935. </a>
  936. </div>
  937. </div>
  938. <div class="col-md-6 col-lg-6 col-sm-6">
  939. <div id="datepicker-container"
  940. class="fixedcontainer"></div>
  941. <div class="row">
  942. <div class="col col-lg-2 col-sm-2 col-md-2">
  943. <button type="button"
  944. class="btn btn-primary btn-square-md"
  945. style="background-color:#008000;"></button>
  946. <span style="margin-left: 21px;">Day<br>
  947. (Available)</span>
  948. </div>
  949. <div class="col col-lg-2 col-sm-2 col-md-2">
  950. <button type="button"
  951. class="btn btn-primary btn-square-md"
  952. style="background-color: #ac2bac;"></button>
  953. <span style="margin-left: 14px;">Morning
  954. <br>
  955. &nbsp;&nbsp;(Available)</span>
  956. </div>
  957. <div class="col col-lg-2 col-sm-2 col-md-2">
  958. <button type="button"
  959. class="btn btn-primary btn-square-md"
  960. style="background-color:#FFEA00;"></button>
  961. <span
  962. style="margin-left: 14px;">Evening<br>
  963. &nbsp;&nbsp;(Available)</span>
  964. </div>
  965. <div class="col col-lg-2 col-sm-2 col-md-2">
  966. <button type="button"
  967. class="btn btn-primary btn-square-md"
  968. style="background-color: red;"></button>
  969. <span style="margin-left: 14px;">Not
  970. Available</span>
  971. </div>
  972. <div class="col col-lg-2 col-sm-2 col-md-2">
  973. <button type="button"
  974. class="btn btn-primary btn-square-md"
  975. style="background-color: blue"></button>
  976. <span style="margin-left: 14px;">Gcc
  977. Blocked</span>
  978. </div>
  979. </div>
  980. </div>
  981. <br>
  982. <!-- Hall Details -->
  983. <div class="col-md-6 col-lg-6 col-sm-6">
  984. <div id="hallDetails">
  985. <br>
  986. <h6><b>Hall Details:</b></h6>
  987. <p>Zone: <span id="zone"></span></p>
  988. <p>Address: <span id="address"></span></p>
  989. <p>Landmark: <span id="landmark"></span></p>
  990. <p>Total Area: <span
  991. id="hallareainsqft"></span></p>
  992. <p>Seating Capacity: <span
  993. id="seatingCapacity"></span></p>
  994. <p>Parking Capacity: <span
  995. id="parkingCapacity"></span></p>
  996. <input type="hidden" id="statichallId">
  997. </div>
  998. </div>
  999. <br>
  1000. <!-- Amount Details -->
  1001. <div class="col-md-6 col-lg-6 col-sm-6">
  1002. <div id="amountDetails">
  1003. <br>
  1004. <h6><b>Amount Details:</b></h6>
  1005. <p>Security Deposit: Rs <span
  1006. id="rentAmount"></span></p>
  1007. <p>Full Day Rent: Rs <span
  1008. id="fullDayAmount"></span></p>
  1009. <p>Half Day Security Deposit: Rs <span
  1010. id="halfrentAmount"></span></p>
  1011. <p>Half Day Rent: Rs <span
  1012. id="halfDayAmount"></span></p>
  1013. <p>GST: <span id="gst"></span>%</p>
  1014. <p>EB for 1 Unit:* Rs <span
  1015. id="ebunit"></span></p>
  1016. <p>CareTaker Number: <span
  1017. id="caretakerNumber"></span></p>
  1018. <input type="hidden" id="depositAmount"
  1019. name="depositamount" value="100">
  1020. <input type="hidden" id="hallamount"
  1021. name="hallamount" value="100">
  1022. </div>
  1023. </div>
  1024. </div>
  1025. <div
  1026. class="row d-flex justify-content-center align-items-center">
  1027. <div
  1028. class="col-md-12 col-sm-12 col-lg-12 d-flex justify-content-center">
  1029. <!-- Center align the button -->
  1030. <button type="button"
  1031. class="btn btn-primary next-step"
  1032. id="bookandcontinue"
  1033. style="background-color: #016d6f; color: white;">
  1034. Book
  1035. & Continue
  1036. </button>
  1037. </div>
  1038. </div>
  1039. </div>
  1040. </div>
  1041. </div>
  1042. <div class="step step-2">
  1043. <!-- Step 2 form fields here -->
  1044. <h4 style="margin-left:10px">Step 2</h4>
  1045. <div class="container custom-container"
  1046. style="padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); background-color: #FFFFFF; border: 1px solid #CCCCCC;">
  1047. <!-- Updated inline styles -->
  1048. <div class="mb-3">
  1049. <div class="row">
  1050. <div class=" row col-md-12 col-lg-12 col-sm-12">
  1051. <table
  1052. class="table table-bordered table-align center-table">
  1053. <tbody>
  1054. <tr>
  1055. <td class="td-align" style="word-wrap: break-word;
  1056. white-space: normal;"><strong>Hall
  1057. Name:</strong>
  1058. <span
  1059. id="hallNameDisplayStep2"></span>
  1060. </td>
  1061. <td class="td-align"><strong>Zone:
  1062. </strong>
  1063. <span id="zoneStep2"></span>
  1064. </td>
  1065. <td class="td-align">
  1066. <strong>Division: </strong>
  1067. <span id="divisionStep2"></span>
  1068. </td>
  1069. </tr>
  1070. </tbody>
  1071. </table>
  1072. </div>
  1073. <div class="row">
  1074. <div class="col col-lg-2 col-sm-2 col-md-2">
  1075. <button type="button"
  1076. class="btn btn-primary btn-square-md"
  1077. style="background-color:#008000;"></button>
  1078. <p style="margin-left: -7px;">Day(Available)</p>
  1079. </div>
  1080. <div class="col col-lg-2 col-sm-2 col-md-2">
  1081. <button type="button"
  1082. class="btn btn-primary btn-square-md"
  1083. style="background-color: #ac2bac;"></button>
  1084. <p style="margin-left: -7px;;">
  1085. &nbsp;&nbsp;Morning(Available)</p>
  1086. </div>
  1087. <div class="col col-lg-2 col-sm-2 col-md-2">
  1088. <button type="button"
  1089. class="btn btn-primary btn-square-md"
  1090. style="background-color:#FFEA00;"></button>
  1091. <p
  1092. style="margin-left: -8px;">
  1093. Evening(Available)</p>
  1094. </div>
  1095. <div class="col col-lg-2 col-sm-2 col-md-2">
  1096. <button type="button"
  1097. class="btn btn-primary btn-square-md"
  1098. style="background-color: red;"></button>
  1099. <P style="margin-left: -4px;">
  1100. Not(Available)</P>
  1101. </div>
  1102. <div class="col col-lg-2 col-sm-2 col-md-2">
  1103. <button type="button"
  1104. class="btn btn-primary btn-square-md"
  1105. style="background-color: blue"></button>
  1106. <p style="margin-left:-1px;">Gcc
  1107. Blocked</p>
  1108. </div>
  1109. <!--<div class="col col-lg-2 col-sm-2 col-md-2">
  1110. <button type="button"
  1111. class="btn btn-primary btn-square-md"
  1112. style="background-color: lightpink"></button>
  1113. <p style="margin-left: 6px;">Temporary
  1114. Blocked</p>
  1115. </div>-->
  1116. </div>
  1117. <br>
  1118. <br>
  1119. <div class="col-sm-4 col-lg-6 col-md-4">
  1120. <label>Relationship of the Functionary:*</label>
  1121. <select id="relation" name="relation"
  1122. class="form-control"
  1123. onchange="validateForm()" required>
  1124. <option value="0">Select</option>
  1125. <option value="self">Self</option>
  1126. <option value="son">Son</option>
  1127. <option value="daughter">Daughter</option>
  1128. <option value="granddaughter">GrandDaughter
  1129. </option>
  1130. <option value="grandson">GrandSon</option>
  1131. <option value="sister">Sister</option>
  1132. <option value="brother">Brother</option>
  1133. </select>
  1134. </div>
  1135. <!--edit code-->
  1136. <input type="hidden" id="reasonMaxDates">
  1137. <div class="col-sm-4 col-lg-6 col-md-4">
  1138. <label>Reason for
  1139. Booking:*</label>
  1140. <select type="text" class="form-control"
  1141. id="reasonforbooking" name="reasonId"
  1142. required>
  1143. </select>
  1144. </div>
  1145. <br>
  1146. <br>
  1147. <br>
  1148. <br>
  1149. <!--end of edit code-->
  1150. <div class="col-sm-4 col-lg-6 col-md-4">
  1151. <label for="startDateInput">Start Date:*</label>
  1152. <!-- Input field for start date -->
  1153. <input type="text" id="startDateInput"
  1154. name="startDate"
  1155. class="date-input form-control"
  1156. style="background-color:white" readonly
  1157. required>
  1158. </div>
  1159. <div class="col-sm-4 col-lg-6 col-md-4">
  1160. <label for="endDateInput">End Date:*</label>
  1161. <select id="endDateInput" name="endDate"
  1162. class="form-control" disabled>
  1163. <option value="0">Select</option>
  1164. </select>
  1165. </div>
  1166. <br>
  1167. <br>
  1168. <br>
  1169. <br>
  1170. <input type="hidden" id="numDaysCount" val=""
  1171. name="days">
  1172. <input type="hidden" id="noofdaysbetweenstartend"
  1173. val="" name="daysrange">
  1174. <div class="col-sm-4 col-lg-6 col-md-4">
  1175. <label for="startPeriodDropdown">Start
  1176. Period:*</label>
  1177. <select id="startPeriodDropdown"
  1178. name="startingSlot" class="form-control"
  1179. required>
  1180. <option value="0">Select</option>
  1181. <option value="1">Morning (6:00
  1182. AM)
  1183. </option>
  1184. <option value="2">Afternoon (2:00
  1185. PM)
  1186. </option>
  1187. </select>
  1188. </div>
  1189. <div class="col-sm-4 col-lg-6 col-md-4">
  1190. <label>End
  1191. Period:*</label>
  1192. <select id="endPeriodDropdown" name="endingSlot"
  1193. class="form-control" required>
  1194. <option value="0">Select</option>
  1195. <option value="1">Afternoon (2:00
  1196. PM)
  1197. </option>
  1198. <option value="2">Evening (10:00
  1199. PM)
  1200. </option>
  1201. </select>
  1202. </div>
  1203. <br>
  1204. <br>
  1205. <br>
  1206. <br>
  1207. <div class="col-sm-4 col-lg-6 col-md-4">
  1208. <label for="numDaysCountDisplay">Selected
  1209. Slots:</label>
  1210. <textarea type="text" id="numDaysCountDisplay"
  1211. class="form-control" readonly
  1212. style="background-color:white"></textarea>
  1213. </div>
  1214. <div class="col-sm-4 col-lg-6 col-md-4">
  1215. <h4>Booking Summary:</h4>
  1216. <p id="summary" val=""></p>
  1217. </div>
  1218. </div>
  1219. <br>
  1220. <div class="row">
  1221. <div
  1222. class="col-md-12 col-lg-12 col-sm-12 text-center">
  1223. <!-- Center align the button -->
  1224. <button type="button"
  1225. class="btn btn-primary prev-step"
  1226. style="background-color: #016d6f; color: white;float: left;">
  1227. Previous
  1228. </button>
  1229. <button type="button"
  1230. class="btn btn-warning reset-step"
  1231. style=" background-color: orangered; color: white; margin: auto;">
  1232. Reset
  1233. </button>
  1234. <button type="button"
  1235. class="btn btn-primary next-step"
  1236. style="background-color: #016d6f; color: white; float: right;">
  1237. Next
  1238. </button>
  1239. </div>
  1240. </div>
  1241. </div>
  1242. </div>
  1243. </div>
  1244. <div class="step step-3">
  1245. <!-- Step 3 form fields here -->
  1246. <h4 style=" margin-left: 10px;">Step 3</h4>
  1247. <div class="container custom-container"
  1248. style="padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); background-color: #FFFFFF; border: 1px solid #CCCCCC;">
  1249. <div>
  1250. <div class="card-body">
  1251. <div class="col-md-12 col-sm-12 col-lg-12">
  1252. <table
  1253. class="table table-bordered table-align center-table">
  1254. <tbody>
  1255. <tr>
  1256. <td class="td-align" style="word-wrap: break-word;
  1257. white-space: normal;"><strong>Hall
  1258. Name:</strong><span
  1259. id="hallNameDisplayStep3"></span>
  1260. </td>
  1261. <td class="td-align"><strong>Zone:
  1262. </strong><span
  1263. id="zoneStep3"></span>
  1264. </td>
  1265. <td class="td-align">
  1266. <strong>Division:
  1267. </strong><span
  1268. id="divisionStep3"></span>
  1269. </td>
  1270. </tr>
  1271. </tbody>
  1272. </table>
  1273. </div>
  1274. <div class="col-sm-4 col-lg-4 col-md-4">
  1275. <input type="hidden" id="userId" name="userId">
  1276. <label class="form-check-label"
  1277. for="uploadDocument">Upload Document for
  1278. Booking:*</label>
  1279. <input type="text" id="showReasonLabel" readonly
  1280. class="form-control"
  1281. style="background-color:white">
  1282. <!-- <div class="col-sm-4 col-lg-4 col-md-4">
  1283. <label class="form-check-label"
  1284. for="reasonforbooking">Reason for Booking:*</label>
  1285. <select type="text" class="form-control"
  1286. id="reasonforbooking" name="reasonId"
  1287. required>
  1288. </select>
  1289. </div> -->
  1290. </div>
  1291. <br>
  1292. <div id="reasonFieldsContainer">
  1293. </div>
  1294. <input type="hidden" name="bookingId" id="bookingId"
  1295. value="0">
  1296. </div>
  1297. </div>
  1298. <div class="row">
  1299. <div class="col-md-12 col-lg-12 col-sm-12 text-center">
  1300. <!-- Center align the button -->
  1301. <button type="button"
  1302. class="btn btn-primary prev-step"
  1303. style="background-color: #016d6f; color: white; float: left;">
  1304. Previous
  1305. </button>
  1306. <button type="button"
  1307. class="btn btn-warning reset-step"
  1308. style="background-color: orangered; color: white; margin: auto;">
  1309. Reset
  1310. </button>
  1311. <button type="submit"
  1312. class="btn btn-primary next-step"
  1313. style="background-color: #016d6f; color: white; float: right;"
  1314. disabled>Next
  1315. </button>
  1316. </div>
  1317. </div>
  1318. </div>
  1319. </div>
  1320. </form>
  1321. <div class="step step-4">
  1322. <h4 style="margin-left:166px">Step 4</h4>
  1323. <div class="container custom-container">
  1324. <div class="header"
  1325. style="background-color: rgb(21,69,93); position: relative;">
  1326. <img src="media/images/logo-sm.png" alt="Logo"
  1327. style="position: absolute; left: 10px; top: 7px; height: 30px;">
  1328. <h6 style="color: white; text-align: center; line-height: 3.1;">
  1329. Payment Details for Confirmation
  1330. <span id="timer"
  1331. style="display: inline; float:right;margin-right:10px;">
  1332. <span class="sand-clock"></span> <!-- Hourglass icon -->
  1333. <span id="timerText">Payment Closes in 15:00</span>
  1334. <!-- Timer text -->
  1335. </span>
  1336. </h6>
  1337. </div>
  1338. <div class="col-md-12">
  1339. <table class="table table-bordered center-table table-align">
  1340. <tbody>
  1341. <tr>
  1342. <td class="td-align"><strong>Full Name:</strong>
  1343. <span id="name_td"></span>
  1344. </td>
  1345. <td class="td-align">
  1346. <strong>Mobile Number:</strong> <span
  1347. id="mobileno_td"></span>
  1348. </td>
  1349. <td class="td-align"><strong>User Type:</strong>
  1350. <span id="usertype_td"></span>
  1351. </td>
  1352. </tr>
  1353. </tbody>
  1354. </table>
  1355. </div>
  1356. <div class="row">
  1357. <div class="col-md-6">
  1358. <table
  1359. class="table table-bordered center-table table-align">
  1360. <tbody>
  1361. <tr>
  1362. <td class="td-align"><strong>Hall
  1363. Name:</strong></td>
  1364. <td class="td-align" style="text-wrap:wrap;">
  1365. <span id="selecthall_td"></span>
  1366. </td>
  1367. </tr>
  1368. <tr>
  1369. <td class="td-align"><strong>No. of
  1370. Days:</strong>
  1371. </td>
  1372. <td class="td-align"><span
  1373. id="numDaysCount_td"></span>
  1374. </td>
  1375. </tr>
  1376. <tr>
  1377. <td class="td-align"><strong>Start
  1378. Date:</strong>
  1379. </td>
  1380. <td class="td-align"><span
  1381. id="startDateInput_td"></span>
  1382. </td>
  1383. </tr>
  1384. <tr>
  1385. <td class="td-align"><strong>End
  1386. Date:</strong></td>
  1387. <td class="td-align"><span
  1388. id="endDateInput_td"></span>
  1389. </td>
  1390. </tr>
  1391. <tr>
  1392. <td class="td-align"><strong>Starting Slot &
  1393. Ending Slot:</strong>
  1394. </td>
  1395. <td class="td-align"><span
  1396. id="startingslot_td"></span>
  1397. </td>
  1398. </tr>
  1399. <tr>
  1400. <td class="td-align"><strong>Uploaded
  1401. Documents:</strong></td>
  1402. <td class="td-align">
  1403. <!-- List to display uploaded docs with small images and names -->
  1404. <div id="uploadedDocsList"
  1405. class="uploaded-docs-list">
  1406. <!-- Each item in the list will have a small image and name -->
  1407. </div>
  1408. </td>
  1409. </tr>
  1410. <div>
  1411. <div id="largeImageContainer"
  1412. class="large-image-container"
  1413. style="display: none;">
  1414. <button id="closeButton" type="button"
  1415. class="close-button">
  1416. <i class="fa fa-times"></i>
  1417. </button>
  1418. <img id="largeImage" src=""
  1419. alt="Large Image">
  1420. </div>
  1421. </div>
  1422. </tbody>
  1423. </table>
  1424. </div>
  1425. <div class="col-md-6">
  1426. <table
  1427. class="table table-bordered center-table table-align">
  1428. <tbody>
  1429. <tr>
  1430. <td class="td-align"><strong>Reason for
  1431. Booking:</strong>
  1432. </td>
  1433. <td class="td-align"><span
  1434. id="reasonforbooking_td"></span>
  1435. </td>
  1436. </tr>
  1437. <tr>
  1438. <td class="td-align"><strong> Hall
  1439. Amount:</strong>
  1440. </td>
  1441. <td><span id="actualhallAmount_td">Rs</span>
  1442. </td>
  1443. </tr>
  1444. <tr>
  1445. <td class="td-align">
  1446. <strong>Discount:</strong>
  1447. </td>
  1448. <td><span id="discount_td">0%</span>
  1449. </td>
  1450. </tr>
  1451. <tr id="additionalcharges" style="display:none">
  1452. <td class="td-align">
  1453. <strong>Rent Amount:</strong>
  1454. </td>
  1455. <td><span id="rentamount_td">0</span></td>
  1456. </tr>
  1457. <tr id="additionalcharges_tr" style="display:none">
  1458. <td class="td-align">
  1459. <strong>Additional charges (Cleaning + P.A.
  1460. System + E.B):</strong>
  1461. </td>
  1462. <td><span id="additionalcharges_td">0</span>
  1463. </td>
  1464. </tr>
  1465. <tr>
  1466. <td class="td-align"><strong>Net
  1467. Amount:</strong>
  1468. </td>
  1469. <td><span id="hallAmount_td">Rs</span>
  1470. </td>
  1471. </tr>
  1472. <tr>
  1473. <td class="td-align"><strong>GST
  1474. Amount:</strong></td>
  1475. <td><span id="gst_td">Rs</span></td>
  1476. </tr>
  1477. <tr>
  1478. <td class="td-align"><strong>Deposit
  1479. Amount:</strong></td>
  1480. <td><span id="depositAmount_td">Rs</span>
  1481. </td>
  1482. </tr>
  1483. <tr>
  1484. <td class="td-align"><strong>Total
  1485. Amount:</strong>
  1486. </td>
  1487. <td><span id="totalAmount_td">Rs</span>
  1488. </td>
  1489. </tr>
  1490. </tbody>
  1491. </table>
  1492. </div>
  1493. </div>
  1494. <div class="row">
  1495. <div class="col-md-12 text-center">
  1496. <!-- Center align the button -->
  1497. <button type="button" class="btn btn-primary prev-step"
  1498. style="background-color: #016d6f; color: white;">
  1499. Previous
  1500. </button>
  1501. </div>
  1502. </div>
  1503. <div align="center">
  1504. <label data-toggle="tooltip" data-placement="top"
  1505. title="Click To View">
  1506. <input type="checkbox" id="checkin"
  1507. onchange="togglePaymentButton(this)"/>
  1508. <a href="#" id="termsLink">I agree to the Terms and
  1509. Conditions</a>
  1510. </label>
  1511. <button type="button" id="confirmPaymentBtn"
  1512. class="btn btn-success" onclick="paymentStart()"
  1513. disabled>Confirm Payment
  1514. </button>
  1515. <input type="hidden" id="btnSubmit"></input>
  1516. </div>
  1517. </div>
  1518. </div>
  1519. </div>
  1520. </div>
  1521. <!-- Page body end -->
  1522. </div>
  1523. </div>
  1524. <!-- Main-body end -->
  1525. </div>
  1526. </div>
  1527. </div>
  1528. </div>
  1529. </div>
  1530. </div>
  1531. </div>
  1532. <!-- Modal HTML for Bootstrap 5 -->
  1533. <div class="modal fade" id="termsModal" tabindex="-1" aria-labelledby="termsModalLabel" aria-hidden="true">
  1534. <div class="modal-dialog modal-lg">
  1535. <div class="modal-content">
  1536. <div class="modal-header">
  1537. <h5 class="modal-title" id="termsModalLabel">Terms and Conditions</h5>
  1538. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1539. </div>
  1540. <div class="modal-content" style="height: 100vh;">
  1541. <iframe src="media/images/CC Rules & Regulations for Online _Tamil.pdf" width="100%"
  1542. height="600px"></iframe>
  1543. </div>
  1544. <div class="modal-footer">
  1545. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  1546. </div>
  1547. </div>
  1548. </div>
  1549. </div>
  1550. <div th:replace="~{fragments/loginreg :: div}"></div>
  1551. <script th:replace="~{fragments/script :: script}"></script>
  1552. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  1553. <script th:replace="~{fragments/PaymentScript :: script}"></script>
  1554. <script src="https://cdn.jsdelivr.net/npm/compressorjs@latest/dist/compressor.min.js"></script>
  1555. <!-- Payment script end-->
  1556. <script>
  1557. let reasonMaxData = new Map(); // in beginning
  1558. let reasonLabelData = new Map();
  1559. let reasoncode = new Map();
  1560. document.getElementById('termsLink').addEventListener('click', function (event) {
  1561. event.preventDefault();
  1562. $('#termsModal').modal('show');
  1563. });
  1564. function togglePaymentButton(checkbox) {
  1565. document.getElementById('confirmPaymentBtn').disabled = !checkbox.checked;
  1566. }
  1567. const urlParams = new URLSearchParams(window.location.search);
  1568. const hallId = urlParams.get('hallId');
  1569. $(document).ready(function () {
  1570. if (hallId != null) {
  1571. getHallDetails(hallId);
  1572. $("#selecthall").val(hallId);
  1573. }
  1574. });
  1575. var countdown; // Global variable to hold the interval
  1576. var totalTime = 15 * 60; // 15 minutes in seconds
  1577. // var totalTime = 1 * 60; // for testing
  1578. var timerElement = document.getElementById("timerText");
  1579. var confirmPaymentBtn = document.getElementById("confirmPaymentBtn");
  1580. var checkInCheckbox = document.getElementById("checkin");
  1581. var startTime; // Variable to hold the start timestamp
  1582. // Function to format time in MM:SS
  1583. function formatTime(seconds) {
  1584. var minutes = Math.floor(seconds / 60);
  1585. var seconds = seconds % 60;
  1586. return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
  1587. }
  1588. // Function to start or restart the timer
  1589. function startTimer() {
  1590. if (countdown) {
  1591. clearInterval(countdown); // Clear existing interval if any
  1592. }
  1593. // Record the start time in milliseconds
  1594. startTime = Date.now();
  1595. // Function to update the timer
  1596. function updateTimer() {
  1597. // Calculate the elapsed time in seconds
  1598. var elapsed = Math.floor((Date.now() - startTime) / 1000);
  1599. var timeLeft = totalTime - elapsed;
  1600. if (timeLeft <= 0) {
  1601. clearInterval(countdown);
  1602. confirmPaymentBtn.disabled = true; // Disable the Confirm Payment button when time is up
  1603. checkInCheckbox.disabled = true; // Disable the Check-in checkbox when time is up
  1604. timerElement.innerHTML = "Time expired"; // Optionally update the message
  1605. } else {
  1606. timerElement.innerHTML = "Payment Closes in " + formatTime(timeLeft);
  1607. confirmPaymentBtn.disabled = !checkInCheckbox.checked;
  1608. checkInCheckbox.disabled = false; // Keep checkbox enabled until time is up
  1609. }
  1610. }
  1611. // Display initial time
  1612. timerElement.innerHTML = "Payment Closes in " + formatTime(totalTime);
  1613. // Update the timer every second
  1614. countdown = setInterval(updateTimer, 1000); // 1 second interval
  1615. }
  1616. // Function to reset the timer
  1617. function resetTimer() {
  1618. startTime = Date.now(); // Reset the start time to now
  1619. startTimer();
  1620. }
  1621. var currentStep = 1;
  1622. var updateProgressBar;
  1623. var userId;
  1624. var bookingId;
  1625. let selectedHallName = '';
  1626. let selectedZone = '';
  1627. // Assume userLoggedIn is a variable indicating the user's login status
  1628. function toggleNextButton(step) {
  1629. var nextButton = document.querySelector('.step-' + step + ' .next-step');
  1630. var fields = document.querySelectorAll('.step-' + step + ' [required]');
  1631. var allFieldsFilled = true;
  1632. fields.forEach(function (field) {
  1633. if (!field.value) {
  1634. allFieldsFilled = false;
  1635. }
  1636. });
  1637. if (allFieldsFilled) {
  1638. nextButton.disabled = false; // Enable the button
  1639. } else {
  1640. nextButton.disabled = true; // Disable the buttonn
  1641. }
  1642. }
  1643. // Call the function for Step 1 when the page loads
  1644. document.addEventListener('DOMContentLoaded', function () {
  1645. // toggleNextButton(1);
  1646. toggleNextButton(2);
  1647. toggleNextButton(3);
  1648. });
  1649. document.querySelectorAll('.step-2 [required]').forEach(function (field) {
  1650. field.addEventListener('input', function () {
  1651. toggleNextButton(2);
  1652. });
  1653. });
  1654. document.querySelectorAll('.step-3 [required]').forEach(function (field) {
  1655. field.addEventListener('input', function () {
  1656. toggleNextButton(3);
  1657. });
  1658. });
  1659. function handleSaveAndContinueStep3() {
  1660. if (isLogin) {
  1661. CheckBookingLimitation(function (isAllowed) {
  1662. if (isAllowed) {
  1663. saveBookingDetails();
  1664. }
  1665. });
  1666. } else {
  1667. showAlertForLogin();
  1668. }
  1669. return false;
  1670. }
  1671. // Function to show SweetAlert for login
  1672. function showAlertForLogin() {
  1673. Swal.fire({
  1674. title: 'Mobile Number Not Registered!',
  1675. text: 'Please log in to proceed.',
  1676. icon: 'info',
  1677. showCancelButton: true,
  1678. confirmButtonText: 'Login',
  1679. cancelButtonText: 'Cancel',
  1680. }).then((result) => {
  1681. if (result.isConfirmed) {
  1682. $('#loginModal').modal('show');
  1683. }
  1684. });
  1685. }
  1686. document.querySelector(".step-3 .next-step").addEventListener("click", function () {
  1687. displayStep(3);
  1688. });
  1689. function fetchReasonsAndPopulateDropdown() {
  1690. // Make an AJAX call to fetch all reasons
  1691. $.ajax({
  1692. url: '/communityhall/admin/api/getReasons',
  1693. type: 'GET',
  1694. dataType: 'json'
  1695. })
  1696. .done(function (data) {
  1697. const reasonDropdown = $('#reasonforbooking');
  1698. reasonDropdown.empty();
  1699. reasonDropdown.append($('<option selected value="0"></option>').text('Select a reason'));
  1700. // Populate the dropdown and store reason metadata
  1701. $.each(data, function (index, reason) {
  1702. reasonDropdown.append($('<option></option>').attr('value', reason.reasonId).text(reason.reason));
  1703. reasonMaxData.set(reason.reasonId, reason.maxdays);
  1704. reasonLabelData.set(reason.reasonId, reason.reason);
  1705. reasoncode.set(reason.reasonId, reason.reasoncode);
  1706. });
  1707. // Add change event listener to the dropdown
  1708. reasonDropdown.change(function () {
  1709. const selectedReasonId = $(this).val();
  1710. const selectedReasonCode = reasoncode.get(parseInt(selectedReasonId));
  1711. const selectedHallId = document.getElementById("statichallId").value; // Getting the selected hall ID
  1712. // Make another AJAX call to get hall details based on the selected hall ID
  1713. $.ajax({
  1714. type: 'GET',
  1715. url: '/communityhall/user/api/gethalldetails/' + selectedHallId,
  1716. success: function (response) {
  1717. // console.log(response);
  1718. const isSGE = response.sge; // Fetch SGE status from the response
  1719. const isCGE = response.cge; // Fetch CGE status from the response
  1720. // Check for State Government Event (SGE)
  1721. if (selectedReasonCode === 'SGE' && !isSGE) {
  1722. // Show popup for State govt event
  1723. Swal.fire({
  1724. title: 'Government Event',
  1725. text: 'Shenoy Nagar Community Center (Auditorium) full Mandapam (Amma Arangam) is available for state government events.',
  1726. icon: 'info',
  1727. confirmButtonText: 'OK'
  1728. }).then((result) => {
  1729. if (result.isConfirmed && !isSGE) {
  1730. window.location.href = '/communityhall/hallbookingform';
  1731. }
  1732. });
  1733. }
  1734. // Check for Central Government Event (CGE)
  1735. else if (selectedReasonCode === 'CGE' && !isCGE) {
  1736. // Show popup for Central govt event
  1737. Swal.fire({
  1738. title: 'Government Event',
  1739. text: 'Shenoy Nagar Community Center (Auditorium) full Mandapam (Amma Arangam) is available for central government events.',
  1740. icon: 'info',
  1741. confirmButtonText: 'OK'
  1742. }).then((result) => {
  1743. if (result.isConfirmed && !isCGE) {
  1744. // Redirect only if hallId is not 3
  1745. window.location.href = '/communityhall/hallbookingform';
  1746. }
  1747. });
  1748. }
  1749. },
  1750. error: function (xhr, status, error) {
  1751. console.error('Error fetching hall details:', error);
  1752. }
  1753. });
  1754. });
  1755. })
  1756. .fail(function (xhr, status, error) {
  1757. console.error('Error fetching reasons:', error);
  1758. });
  1759. }
  1760. var ch = 0;
  1761. function saveBookingDetails() {
  1762. //alert("saveBookingDetails call:-"+ch++);
  1763. $("#startPeriodDropdown").prop("disabled", false);
  1764. $("#endPeriodDropdown").prop("disabled", false);
  1765. var form = document.getElementById('booking');
  1766. var formData = new FormData(form);
  1767. // Debugging: Log each FormData entry
  1768. for (var pair of formData.entries()) {
  1769. //console.log(pair[0] + ', ', pair[1]);
  1770. }
  1771. $.ajax({
  1772. url: '/communityhall/user/api/saveTheRequest2',
  1773. type: 'POST',
  1774. data: formData,
  1775. processData: false,
  1776. contentType: false,
  1777. success: function (response) {
  1778. // console.log("response:--" + response.status);
  1779. if (response.status === 'slotOccupied') {
  1780. Swal.fire({
  1781. icon: 'error',
  1782. title: 'Slot Occupied',
  1783. text: 'The selected slot is already occupied. Please choose a different slot.',
  1784. confirmButtonText: 'OK'
  1785. }).then(function () {
  1786. location.reload(); // Example: reload the page
  1787. });
  1788. } else {
  1789. userId = response.userId;
  1790. bookingId = response.bookingId;
  1791. $("#bookingId").val(response.bookingId);
  1792. $("#userId").val(response.userId);
  1793. $("#selecthall_td").html(response.hallName);
  1794. $("#numDaysCount_td").html(response.NoOfDay);
  1795. $("#startDateInput_td").html(response.startDate);
  1796. $("#endDateInput_td").html(response.endDate);
  1797. $("#reasonforbooking_td").html(response.reason);
  1798. $("#hallAmount_td").html(response.hallAmount);
  1799. function getTimeOfDay(slot) {
  1800. if (slot === 1) {
  1801. return "Morning";
  1802. } else if (slot === 2) {
  1803. return "Evening";
  1804. } else {
  1805. return "Invalid slot";
  1806. }
  1807. }
  1808. $("#startingslot_td").html(getTimeOfDay(response.startingSlot) + " to " + getTimeOfDay(response.endingSlot));
  1809. /*$("#gst_td").html(response.gst);
  1810. $("#depositAmount_td").html(response.depositAmount);
  1811. $("#discount_td").html(response.discount + "%");
  1812. $("#actualhallAmount_td").html(response.actualhallamount);
  1813. $("#totalAmount_td").html(response.totalAmount);*/
  1814. $("#name_td").html(response.username);
  1815. $("#mobileno_td").html(response.mobileNo);
  1816. $("#usertype_td").html(response.userType);
  1817. /*if (response.reasoncode === 'SGE') {
  1818. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1819. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1820. $("#additionalcharges_td").html(response.additionalcharges);
  1821. $("#rentamount_td").html(0);
  1822. $("#actualhallAmount_td").html(response.actualhallamount);
  1823. $("#hallAmount_td").html(response.additionalcharges);
  1824. $("#totalAmount_td").html(response.totalAmount);
  1825. } else {
  1826. document.getElementById("additionalcharges").style.display = 'none'; // Hide row
  1827. document.getElementById("additionalcharges_tr").style.display = 'none'; // Hide row
  1828. }*/
  1829. if (response.reasoncode === 'SGE') {
  1830. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1831. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1832. $("#additionalcharges_td").html(response.additionalcharges);
  1833. $("#rentamount_td").html(0);
  1834. $("#actualhallAmount_td").html(response.actualhallamount);
  1835. $("#hallAmount_td").html(response.additionalcharges);
  1836. $("#totalAmount_td").html(response.totalAmount);
  1837. $("#hallAmount_td").html(response.hallAmount);
  1838. $("#gst_td").html(response.gst);
  1839. $("#depositAmount_td").html(response.depositAmount);
  1840. $("#discount_td").html(response.discount + "%");
  1841. } else if (response.reasoncode === 'CGE') {
  1842. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1843. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1844. $("#additionalcharges_td").html(response.additionalcharges);
  1845. $("#hallAmount_td").html(response.hallAmount)
  1846. $("#rentamount_td").html(response.rentAmount);
  1847. $("#actualhallAmount_td").html(response.actualhallamount);
  1848. $("#hallAmount_td").html(response.netAmount);
  1849. $("#gst_td").html(response.gstAmount);
  1850. $("#depositAmount_td").html(response.depositAmount);
  1851. $("#discount_td").html(response.discount + "%");
  1852. $("#totalAmount_td").html(response.totalAmount);
  1853. } else {
  1854. document.getElementById("additionalcharges").style.display = 'none'; // Hide row
  1855. document.getElementById("additionalcharges_tr").style.display = 'none'; // Hide row
  1856. $("#gst_td").html(response.gst);
  1857. $("#depositAmount_td").html(response.depositAmount);
  1858. $("#discount_td").html(response.discount + "%");
  1859. $("#actualhallAmount_td").html(response.actualhallamount);
  1860. $("#totalAmount_td").html(response.totalAmount);
  1861. }
  1862. displayDocumentDetails(response.uploadedDocs);
  1863. resetTimer();
  1864. }
  1865. },
  1866. error: function (xhr, status, error) {
  1867. console.error('Error fetching hall names:', error);
  1868. }
  1869. });
  1870. $("#startPeriodDropdown").prop("disabled", true);
  1871. $("#endPeriodDropdown").prop("disabled", true);
  1872. }
  1873. function displayDocumentDetails(uploadedDocs) {
  1874. const uploadedDocsList = $("#uploadedDocsList");
  1875. uploadedDocsList.empty(); // Clear existing items
  1876. uploadedDocs.forEach(function (doc) {
  1877. const listItem = $('<li>');
  1878. const thumbnail = $('<img>').addClass('thumbnail-img');
  1879. // Function to truncate the document name
  1880. function truncateName(name, maxLength) {
  1881. if (name.length <= maxLength) {
  1882. return name;
  1883. }
  1884. const extIndex = name.lastIndexOf('.');
  1885. const ext = name.substring(extIndex);
  1886. const truncatedName = name.substring(0, maxLength - ext.length - 3) + '...' + ext;
  1887. return truncatedName;
  1888. }
  1889. const truncatedName = truncateName(doc.documentName, 10); // Adjust the maxLength as needed
  1890. if (doc.bookingDocUrl.endsWith('.pdf')) {
  1891. // Set the thumbnail to a default image for PDFs
  1892. const defaultPdfThumbnail = 'media/images/pdf.jpg'; // Replace with your default thumbnail image path
  1893. thumbnail.attr('src', defaultPdfThumbnail);
  1894. listItem.append(thumbnail).append(' ' + truncatedName);
  1895. thumbnail.on('click', function () {
  1896. // Create an iframe to display the PDF
  1897. const pdfViewer = $('<iframe>').attr({
  1898. src: doc.bookingDocUrl,
  1899. width: '100%',
  1900. height: '600px' // Adjust as needed
  1901. });
  1902. // Hide the image and show the PDF viewer
  1903. $('#largeImage').hide();
  1904. $('#largeImageContainer').find('iframe').remove();
  1905. $('#largeImageContainer').append(pdfViewer);
  1906. $('#largeImageContainer').show();
  1907. });
  1908. } else {
  1909. // For other document types, show the actual image as thumbnail
  1910. thumbnail.attr('src', doc.bookingDocUrl);
  1911. listItem.append(thumbnail).append(' ' + truncatedName);
  1912. thumbnail.on('click', function () {
  1913. $('#largeImageContainer iframe').remove();
  1914. $('#largeImage').attr('src', doc.bookingDocUrl).show();
  1915. $('#largeImageContainer').show();
  1916. });
  1917. }
  1918. uploadedDocsList.append(listItem);
  1919. });
  1920. }
  1921. $("#closeButton").on('click', function () {
  1922. $('#largeImageContainer').hide(); // Hide the large image container
  1923. $('#largeImage').attr('src', '').hide(); // Reset and hide image
  1924. $('#largeImageContainer iframe').remove(); // Remove iframe if present
  1925. });
  1926. function fetchReasonDocumentDetails(reasonId) {
  1927. $('#reasonMaxDates').val(reasonMaxData.get(reasonId));
  1928. $('#showReasonLabel').val(reasonLabelData.get(reasonId));
  1929. $.ajax({
  1930. url: '/communityhall/admin/api/getReasonDocumentDetails',
  1931. type: 'GET',
  1932. dataType: 'json',
  1933. data: {reasonId: reasonId}
  1934. })
  1935. .done(function (data) {
  1936. validateForm();
  1937. const reasonFieldsContainer = $('#reasonFieldsContainer');
  1938. reasonFieldsContainer.empty();
  1939. const rowDiv = $('<div class="row"></div>');
  1940. $.each(data, function (index, detail) {
  1941. if (detail.addTextField === true) {
  1942. const fieldDiv = $('<div class="col-sm-4 form-group"></div>');
  1943. const label = $('<label>' + detail.fieldName + ' *</label>');
  1944. const input = $('<input type="text" class="form-control" name="' + detail.fieldName + '" required>');
  1945. // Add event listener for input validation
  1946. input.on('input', function () {
  1947. // Replace any non-letter characters with an empty string
  1948. //this.value = this.value.replace(/[^a-zA-Z]/g, '');
  1949. });
  1950. fieldDiv.append(label);
  1951. fieldDiv.append(input);
  1952. rowDiv.append(fieldDiv);
  1953. }
  1954. if (detail.addDocumentField === true) {
  1955. const fieldDiv2 = $('<div class="col-sm-4 form-group"></div>');
  1956. const fileInput = $('<input type="file" class="form-control file-upload-field" id="upload" name="' + detail.docFieldName + '" required accept=".jpg, .jpeg, .pdf">');
  1957. fieldDiv2.append('<label>' + detail.docFieldName + '*</label>').append(fileInput);
  1958. rowDiv.append(fieldDiv2);
  1959. }
  1960. });
  1961. reasonFieldsContainer.append(rowDiv);
  1962. })
  1963. .fail(function (xhr, status, error) {
  1964. console.error('Error fetching reason document details:', error);
  1965. });
  1966. }
  1967. // Call the function to fetch reasons and populate the dropdown when the document is ready
  1968. $(document).ready(function () {
  1969. fetchReasonsAndPopulateDropdown();
  1970. $('#reasonforbooking').change(function () {
  1971. const selectedReasonId = parseInt($(this).val()); // Convert the value to an integer
  1972. fetchReasonDocumentDetails(selectedReasonId);
  1973. });
  1974. });
  1975. // Function to toggle hall details container and fetch hall details
  1976. function toggleHallDetailsContainer() {
  1977. var selectBox = document.getElementById("selecthall");
  1978. var selectedValue = selectBox.options[selectBox.selectedIndex].value;
  1979. var hallDetailsContainer = document.getElementById("hallDetailsContainer");
  1980. if (selectedValue !== "") {
  1981. hallDetailsContainer.style.display = "block"; // Show hall details container if a hall is selected
  1982. // Get the selected hall ID
  1983. var hallId = selectBox.options[selectBox.selectedIndex].value;
  1984. getHallDetails(hallId); // Fetch hall details
  1985. // Other code for displaying selected details
  1986. } else {
  1987. hallDetailsContainer.style.display = "none"; // Hide hall details container if no hall is selected
  1988. // Clear the selected details in Step 2 and Step 3
  1989. $('#hallNameDisplayStep2').text('');
  1990. $('#hallNameDisplayStep3').text('');
  1991. $('#zoneStep2').text('');
  1992. $('#zoneStep3').text('');
  1993. $('#divisionStep2').text('');
  1994. $('#divisionStep3').text('');
  1995. // Clear other details if needed
  1996. }
  1997. }
  1998. function togglePaymentButton(checkbox) {
  1999. var confirmPaymentBtn = document.getElementById('confirmPaymentBtn');
  2000. confirmPaymentBtn.disabled = !checkbox.checked;
  2001. }
  2002. // Update the displayStep function to pass hallName to Step 4
  2003. function displayStep(stepNumber) {
  2004. if (stepNumber >= 1 && stepNumber <= 4) {
  2005. if (validateStep(currentStep)) {
  2006. $(".step-" + currentStep).hide();
  2007. $(".step-" + stepNumber).show();
  2008. currentStep = stepNumber;
  2009. updateProgressBar();
  2010. // Populate hallName, zone, and division in Step 2 and Step 3
  2011. if (stepNumber === 2 || stepNumber === 3) {
  2012. $('#hallNameDisplayStep2').text(selectedHallName);
  2013. $('#hallNameDisplayStep3').text(selectedHallName);
  2014. $('#zoneStep2').text(zone);
  2015. $('#zoneStep3').text(zone);
  2016. $('#divisionStep2').text('');
  2017. $('#divisionStep3').text('');
  2018. $('#selecthall_td').text(selectedHallName);
  2019. }
  2020. // Handle displaying the SweetAlert in Step 3
  2021. } else {
  2022. //alert("Please fill in all required fields before proceeding.");
  2023. }
  2024. }
  2025. }
  2026. function validateStep(stepNumber) {
  2027. }
  2028. $(document).ready(function () {
  2029. $('.step').hide();
  2030. $('.step-1').show();
  2031. var currentStep = 1; // Assuming you have this variable defined somewhere in your code
  2032. // Function to validate step 3
  2033. function validateStep3() {
  2034. let isValid = true;
  2035. let selectedReason = $('#reasonforbooking').val();
  2036. // Check if a reason is selected
  2037. if (!selectedReason) {
  2038. isValid = false;
  2039. } else {
  2040. // Iterate through each input associated with the selected reason
  2041. $(`#reasonFieldsContainer .${selectedReason} input[type="text"], #reasonFieldsContainer .${selectedReason} input[type="file"]`).each(function () {
  2042. if ($(this).prop('required') && !$(this).val()) {
  2043. isValid = false;
  2044. return false; // Exit the loop early if any required field is empty
  2045. }
  2046. });
  2047. }
  2048. // Enable/disable the next button based on validation
  2049. $('.next-step').prop('disabled', !isValid);
  2050. }
  2051. // Event listener for reason dropdown change
  2052. $('#reasonforbooking').change(function () {
  2053. let selectedReason = $(this).val();
  2054. $("#startDateInput").val('');
  2055. $("#endDateInput").val(0);
  2056. $("#startPeriodDropdown").val(0).prop("disabled", false);
  2057. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2058. $("#numDaysCount").val('');
  2059. $("#numDaysCountDisplay").val('');
  2060. $('#summary').html('');
  2061. // Show/hide fields based on selected reason
  2062. $('#reasonFieldsContainer').children().hide();
  2063. if (selectedReason) {
  2064. $(`#reasonFieldsContainer .${selectedReason}`).show();
  2065. }
  2066. // Validate the fields for the selected reason
  2067. validateStep3();
  2068. });
  2069. // Event listener for input changes within reason fields in Step 3
  2070. $('#reasonFieldsContainer').on('change', 'input, select', function () {
  2071. validateStep3();
  2072. });
  2073. $(".next-step").click(function () {
  2074. var valid = true;
  2075. // Validate all required text inputs and file fields in Step 3
  2076. if (currentStep === 3) {
  2077. $('.step-3 input[required], .step-3 select[required]').each(function () {
  2078. if ($(this).val() === '') {
  2079. $(this).addClass('error'); // Add error class
  2080. valid = false;
  2081. return false; // Break the loop
  2082. } else {
  2083. $(this).removeClass('error'); // Remove error class if valid
  2084. }
  2085. });
  2086. $('.step-3 input[type="file"][required]').each(function () {
  2087. if ($(this)[0].files.length === 0) {
  2088. $(this).addClass('error'); // Add error class
  2089. valid = false;
  2090. return false; // Break the loop
  2091. } else {
  2092. $(this).removeClass('error'); // Remove error class if valid
  2093. }
  2094. });
  2095. }
  2096. if (!valid) {
  2097. return; // Stop if validation fails
  2098. }
  2099. if (currentStep < 4) {
  2100. $(".step-" + currentStep).fadeOut(500, function () {
  2101. if (currentStep === 3 && isLogin === false) {
  2102. $(".step-" + currentStep).fadeIn(500);
  2103. updateProgressBar();
  2104. return "";
  2105. } else {
  2106. currentStep++;
  2107. $(".step-" + currentStep).fadeIn(500);
  2108. updateProgressBar();
  2109. }
  2110. });
  2111. }
  2112. });
  2113. $(".prev-step").click(function () {
  2114. $('#bookandcontinue').prop('disabled', false);
  2115. if (currentStep > 1) {
  2116. $(".step-" + currentStep).fadeOut(500, function () {
  2117. currentStep--;
  2118. $(".step-" + currentStep).fadeIn(500);
  2119. updateProgressBar();
  2120. clearInterval(countdown);
  2121. });
  2122. }
  2123. });
  2124. $("#bookandcontinue").click(function () {
  2125. $('#startDateInput').val('');
  2126. $('#endDateInput').prop('disabled', true).val('0');
  2127. $('#startPeriodDropdown').val('0');
  2128. $('#endPeriodDropdown').val('0');
  2129. $('#numDaysCount').val(''); // Reset the number of days input
  2130. $('#numDaysCountDisplay').val('');
  2131. $('#summary').html('');
  2132. $('#relation').val('0');
  2133. $('#reasonforbooking').val(0);
  2134. });
  2135. $(".step-2 .reset-step").click(function () {
  2136. $('.step-2 input[type="text"], .step-2 select').val(function () {
  2137. return this.defaultValue;
  2138. });
  2139. $('.step-2 input[type="checkbox"], .step-2 input[type="radio"]').prop('checked', false);
  2140. $('#endDateInput').prop('disabled', true).val('0');
  2141. $('#startPeriodDropdown').val('0');
  2142. $('#endPeriodDropdown').val('0');
  2143. $('#numDaysCount').val(''); // Reset the number of days input
  2144. $('#numDaysCountDisplay').val('');
  2145. $('#summary').html('');
  2146. $('#relation').val('0');
  2147. $('#reasonforbooking').val(0);
  2148. $('.step-2 .error-message').hide();
  2149. toggleNextButton(2); // Ensure button state reflects field values after reset
  2150. });
  2151. $(".step-3 .reset-step").click(function () {
  2152. // Reset all input fields and select elements to their default values
  2153. $('.step-3 input[type="text"]:not(#showReasonLabel), .step-3 input[type="file"]').val(function () {
  2154. return this.defaultValue;
  2155. });
  2156. //$('.step-3 .error-message').hide();
  2157. //$('.step-3 .form-control').parent().hide();
  2158. //$('#reasonforbooking').parent().show();
  2159. validateStep3();
  2160. });
  2161. $(".step-2 .next-step").click(function () {
  2162. var reasonforbooking = $("#reasonforbooking").val();
  2163. if (reasonforbooking !== "0") {
  2164. $(".step-3 .next-step").prop("disabled", false);
  2165. } else {
  2166. $(".step-3 .next-step").prop("disabled", true);
  2167. }
  2168. ;
  2169. var relationship = $("#relation").val();
  2170. if (relationship !== "0") {
  2171. $(".step-2 .next-step").prop("disabled", false);
  2172. } else {
  2173. $(".step-2 .next-step").prop("disabled", true);
  2174. }
  2175. ;
  2176. });
  2177. $(".cancel-step").click(function () {
  2178. // Redirect to the cancel page or handle cancellation logic here
  2179. window.location.href = "/dashboard";
  2180. });
  2181. updateProgressBar = function () {
  2182. var progressPercentage = ((currentStep - 1) / 3) * 100;
  2183. $(".progress-bar").css("width", progressPercentage + "%");
  2184. };
  2185. // State variable to track compression status
  2186. let isCompressing = false;
  2187. // Attach the validation function to file input change event
  2188. $(document).on('change', '.file-upload-field', function () {
  2189. validateFile(this);
  2190. });
  2191. function validateFile(fileInput) {
  2192. const allowedExtensions = /(\.jpg|\.jpeg|\.pdf)$/i;
  2193. const file = fileInput.files[0];
  2194. const filePath = fileInput.value;
  2195. let errorMessage = '';
  2196. // Clear any previous error message
  2197. clearError(fileInput);
  2198. // Check for duplicate files
  2199. if (isDuplicateFile(file.name, fileInput)) {
  2200. errorMessage = 'This file has already been selected. Please choose a different file.';
  2201. fileInput.value = ''; // Clear the file input
  2202. displayError(fileInput, errorMessage);
  2203. return;
  2204. }
  2205. // Validate file type
  2206. if (!allowedExtensions.exec(filePath)) {
  2207. errorMessage = 'Only JPG, JPEG, and PDF files are allowed.';
  2208. fileInput.value = ''; // Clear the file input
  2209. displayError(fileInput, errorMessage);
  2210. }
  2211. // Handle image files separately
  2212. else if (/(\.jpg|\.jpeg)$/i.test(filePath) && file.size > 2097152) {
  2213. compressImage(file).then(compressedFile => {
  2214. const dataTransfer = new DataTransfer();
  2215. dataTransfer.items.add(compressedFile);
  2216. fileInput.files = dataTransfer.files;
  2217. // Validate file size after compression
  2218. validateFileSize(fileInput);
  2219. }).catch(error => {
  2220. errorMessage = 'Error compressing image.';
  2221. displayError(fileInput, errorMessage);
  2222. });
  2223. }
  2224. // Directly validate PDF file size
  2225. else if (/(\.pdf)$/i.test(filePath) && file.size > 2097152) {
  2226. errorMessage = 'PDF file size exceeds the 2MB limit.';
  2227. fileInput.value = ''; // Clear the file input
  2228. displayError(fileInput, errorMessage);
  2229. } else {
  2230. // console.log('File size is within limit:', file.size, 'bytes');
  2231. clearError(fileInput);
  2232. }
  2233. }
  2234. function isDuplicateFile(fileName, currentInput) {
  2235. const fileInputs = document.querySelectorAll('.file-upload-field');
  2236. for (let input of fileInputs) {
  2237. if (input !== currentInput && input.files.length > 0 && input.files[0].name === fileName) {
  2238. return true;
  2239. }
  2240. }
  2241. return false;
  2242. }
  2243. function clearError(fileInput) {
  2244. const errorElements = fileInput.parentNode.getElementsByClassName('error-message');
  2245. while (errorElements.length > 0) {
  2246. errorElements[0].remove();
  2247. }
  2248. }
  2249. // Function to compress image using canvas
  2250. function compressImage(file) {
  2251. return new Promise((resolve, reject) => {
  2252. const reader = new FileReader();
  2253. reader.onload = function (event) {
  2254. const img = new Image();
  2255. img.onload = function () {
  2256. const canvas = document.createElement('canvas');
  2257. const ctx = canvas.getContext('2d');
  2258. const maxSize = 2097152; // 2MB in bytes
  2259. let scale = 1;
  2260. if (file.size > maxSize) {
  2261. scale = Math.sqrt(maxSize / file.size);
  2262. }
  2263. canvas.width = img.width * scale;
  2264. canvas.height = img.height * scale;
  2265. ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
  2266. // Convert canvas content to blob
  2267. canvas.toBlob(blob => {
  2268. resolve(new File([blob], file.name, {
  2269. type: 'image/jpeg',
  2270. lastModified: Date.now()
  2271. }));
  2272. }, 'image/jpeg', 0.7); // Adjust JPEG quality as needed (0.7 is 70% quality)
  2273. };
  2274. img.src = event.target.result;
  2275. };
  2276. reader.readAsDataURL(file);
  2277. });
  2278. }
  2279. // Function to validate file size after compression
  2280. function validateFileSize(fileInput) {
  2281. const file = fileInput.files[0];
  2282. if (file && file.size > 2097152) {
  2283. //console.log('File size is still greater than 2MB after compression.');
  2284. // Handle the situation where the file size is still greater than 2MB
  2285. displayError(fileInput, 'File size is still greater than 2MB after compression.');
  2286. fileInput.value = ''; // Clear the file input
  2287. } else {
  2288. //console.log('File size is within limit after compression.');
  2289. // Handle the situation where the file size is within the limit
  2290. }
  2291. }
  2292. // Function to display error messages
  2293. function displayError(fileInput, errorMessage) {
  2294. // Example implementation: show error message near the file input
  2295. let errorContainer = fileInput.nextElementSibling;
  2296. if (!errorContainer || !errorContainer.classList.contains('error-message')) {
  2297. errorContainer = document.createElement('div');
  2298. errorContainer.classList.add('error-message');
  2299. fileInput.parentNode.insertBefore(errorContainer, fileInput.nextSibling);
  2300. }
  2301. errorContainer.textContent = errorMessage;
  2302. }
  2303. // Initial validation check for step 3
  2304. validateStep3();
  2305. // Log statement to ensure the button is being enabled
  2306. //console.log("Enabling the button...");
  2307. $('.step-1 .next-step').prop('disabled', false);
  2308. });
  2309. var index = 0;
  2310. var hall;
  2311. $(function () {
  2312. $("#selecthall").select2();
  2313. });
  2314. $.ajax({
  2315. type: 'GET',
  2316. url: '/communityhall/user/api/gethallnames',
  2317. success: function (response) {
  2318. // Populate the dropdown options with the received hall names
  2319. var selectHallDropdown = $('#selecthall');
  2320. $.each(response, function (index, hall) {
  2321. if (hallId == hall.hallId) {
  2322. selectHallDropdown.append($('<option></option>').attr('value', hall.hallId).text(hall.hallName));
  2323. selectHallDropdown.find('option[value="' + hall.hallId + '"]').prop('selected', true);
  2324. } else {
  2325. selectHallDropdown.append($('<option></option>').attr('value', hall.hallId).text(hall.hallName));
  2326. }
  2327. });
  2328. },
  2329. error: function (xhr, status, error) {
  2330. console.error('Error fetching hall names:', error);
  2331. }
  2332. });
  2333. $(document).ready(function () {
  2334. $('#selecthall').change(function () {
  2335. var selectedHallId = $(this).val();
  2336. // Call the getHallDetails function with the selected hall ID
  2337. getHallDetails(selectedHallId);
  2338. });
  2339. });
  2340. // Function to retrieve hall details based on hallId
  2341. function getHallDetails(hallId) {
  2342. $.ajax({
  2343. type: 'GET',
  2344. url: '/communityhall/user/api/gethalldetails/' + hallId,
  2345. success: function (response) {
  2346. // console.log(response);
  2347. // Display the container
  2348. $('#hallDetailsContainer').show();
  2349. // Set hall details
  2350. $('#zone').html('<strong>' + response.zone + '</strong>&nbsp;&nbsp;&nbsp;&nbsp; Division: <strong>' + response.division + '</strong>');
  2351. $('#address').html('<strong>' + response.doorNo + ', ' + response.street + ', ' + response.area + ', ' + response.city + ', ' + response.pinCode + '</strong>');
  2352. $('#landmark').html('<strong>' + response.landMark + '</strong>');
  2353. $('#seatingCapacity').html('<strong>' + response.seatingCapacity + '</strong>');
  2354. var parkingCapacity = response.parkingCapacity;
  2355. var parkingAvailability = parkingCapacity > 0 ? "Yes" : "No";
  2356. $('#parkingCapacity').html('<strong>' + parkingAvailability + '</strong>');
  2357. $('#caretakerNumber').html('<strong>' + response.hallInchargeMobno + '</strong>');
  2358. $('#rentAmount').html('<strong>' + response.depositAmount + '</strong>');
  2359. $('#gst').html('<strong>' + response.gst + '</strong>');
  2360. $('#fullDayAmount').html('<strong>' + response.fullDayRent + '</strong>');
  2361. $('#halfrentAmount').html('<strong>' + response.halfDepositAmount + '</strong>');
  2362. $('#halfDayAmount').html('<strong>' + response.halfDayRent + '</strong>');
  2363. $('#ebunit').html('<strong>' + response.ebCostPerUnit + '</strong>');
  2364. $('#statichallId').val(response.hallId);
  2365. // Set hall images
  2366. var carouselInner = $('#hallImagesCarousel .carousel-inner');
  2367. carouselInner.empty(); // Clear existing images
  2368. $.each(response.hallImagesList, function (index, image) {
  2369. var itemClass = (index === 0) ? 'carousel-item active' : 'carousel-item';
  2370. var img = $('<img>').addClass('d-block w-100').attr('src', image.hallImage).attr('alt', 'Hall Image');
  2371. var carouselItem = $('<div>').addClass(itemClass).append(img);
  2372. carouselInner.append(carouselItem);
  2373. });
  2374. // Clear existing floor details to prevent duplicates
  2375. $('#hallareainsqft').empty();
  2376. // Use a Set to store unique floor details
  2377. var uniqueFloorDetails = new Set();
  2378. $.each(response.floorDetailsList, function (index, hallarea) {
  2379. // Construct the text for each floor's details
  2380. var floorDetailText = hallarea.floor + " - " + hallarea.hallarea + " Sq.ft ,";
  2381. // Add to the Set if it's not a duplicate
  2382. if (!uniqueFloorDetails.has(floorDetailText)) {
  2383. uniqueFloorDetails.add(floorDetailText);
  2384. // Append the floor details to the target element
  2385. $('#hallareainsqft').append('<strong>' + floorDetailText + '</strong>');
  2386. }
  2387. });
  2388. // Initialize ViewerJS on the carousel after images are loaded
  2389. initializeViewerJS();
  2390. getBookingCalendar(hallId);
  2391. // Set hall details in Step 2 and Step 3
  2392. $('#hallNameDisplayStep2').text(response.hallName);
  2393. $('#hallNameDisplayStep3').text(response.hallName);
  2394. $('#zoneStep2').text(response.zone);
  2395. $('#zoneStep3').text(response.zone);
  2396. $('#divisionStep2').text(response.division);
  2397. $('#divisionStep3').text(response.division);
  2398. },
  2399. error: function (xhr, status, error) {
  2400. console.error('Error fetching hall details:', error);
  2401. }
  2402. });
  2403. }
  2404. function initializeViewerJS() {
  2405. // Ensure ViewerJS initialization after images are added to the DOM
  2406. var carouselInner = document.querySelector('#hallImagesCarousel .carousel-inner');
  2407. var floordetails = document.querySelector('#hallareainsqft');
  2408. // Destroy existing viewer instance if it exists
  2409. if (carouselInner.viewer) {
  2410. carouselInner.viewer.destroy();
  2411. }
  2412. if (floordetails.viewer) {
  2413. floordetails.viewer.destroy();
  2414. }
  2415. // Initialize ViewerJS
  2416. var viewer = new Viewer(carouselInner, {
  2417. inline: false,
  2418. viewed: function () {
  2419. viewer.zoomTo(0.5); // Adjust the zoom level here
  2420. },
  2421. toolbar: {
  2422. zoomIn: 4,
  2423. zoomOut: 4,
  2424. oneToOne: 4,
  2425. reset: 4,
  2426. prev: 4,
  2427. play: {
  2428. show: 4,
  2429. size: 'large',
  2430. },
  2431. next: 4,
  2432. rotateLeft: 4,
  2433. rotateRight: 4,
  2434. flipHorizontal: 4,
  2435. flipVertical: 4,
  2436. },
  2437. });
  2438. carouselInner.viewer = viewer;
  2439. }
  2440. function showBookingDetails() {
  2441. var bookingDetailsDiv = document.getElementById('bookingdetails');
  2442. // Toggle the display property (show/hide)
  2443. if (bookingDetailsDiv.style.display === 'none') {
  2444. bookingDetailsDiv.style.display = 'block';
  2445. } else {
  2446. bookingDetailsDiv.style.display = 'none';
  2447. }
  2448. }
  2449. function previewImage(event) {
  2450. const userphoto = event.target;
  2451. const preview = document.getElementById('preview');
  2452. const reader = new FileReader();
  2453. reader.onload = function () {
  2454. preview.src = reader.result;
  2455. };
  2456. reader.readAsDataURL(userphoto.files[0]);
  2457. }
  2458. function getBookingCalendar(hall_id) {
  2459. // Make an AJAX call to fetch booking data
  2460. $.ajax({
  2461. type: 'GET',
  2462. url: '/communityhall/user/api/getPastData',
  2463. data: {
  2464. hall_id: hall_id
  2465. },
  2466. success: function (response) {
  2467. window.bookingResponse = {};
  2468. if (response && Array.isArray(response)) {
  2469. $("#startDateInput").datepicker("destroy");
  2470. for (var i = 0; i < response.length; i++) {
  2471. var dateString = datepickerFormat(response[i].bdate);
  2472. window.bookingResponse[dateString] = [response[i].morningSlot, response[i].eveningSlot, response[i].is_blocked];
  2473. }
  2474. initializeDatepickerWithColors(hall_id);
  2475. if (response.length == 0) {
  2476. initializeDatepickerWithColors(hall_id);
  2477. }
  2478. } else {
  2479. console.error('Invalid or empty response data.');
  2480. }
  2481. },
  2482. error: function (xhr, status, error) {
  2483. console.error('Error fetching hall details:', error);
  2484. }
  2485. });
  2486. }
  2487. // Function to update the end date and slot availability
  2488. function updateEndDate() {
  2489. var startDate = new Date(document.getElementById("startDateInput").value);
  2490. var formatStartDate = formatDate(startDate);
  2491. var endDateInput = document.getElementById("endDateInput");
  2492. endDateInput.innerHTML = '<option value="0">Select</option>';
  2493. endDateInput.disabled = true;
  2494. var maxdays = $('#reasonMaxDates').val();
  2495. // alert("maxdays:--- "+maxdays);
  2496. // Add options for next 7 days from the selected start date
  2497. for (var i = 0; i < maxdays; i++) {
  2498. var date = new Date(startDate);
  2499. date.setDate(startDate.getDate() + i);
  2500. var formattedDate = formatDate(date);
  2501. if (isNaN(date.getTime())) {
  2502. console.error("Invalid date:", date);
  2503. continue;
  2504. }
  2505. var bookingStatus = window.bookingResponse[formattedDate];
  2506. if (bookingStatus) {
  2507. if (bookingStatus[0] && bookingStatus[1]) {
  2508. //alert("slot fulled");
  2509. break;
  2510. } else if (bookingStatus[0]) {
  2511. if (formatStartDate == formattedDate) {
  2512. var option = document.createElement('option');
  2513. option.value = formattedDate;
  2514. option.text = formattedDate;
  2515. endDateInput.appendChild(option);
  2516. } else {
  2517. break;
  2518. }
  2519. } else if (bookingStatus[1]) {
  2520. var option = document.createElement('option');
  2521. option.value = formattedDate;
  2522. option.text = formattedDate;
  2523. endDateInput.appendChild(option);
  2524. break;
  2525. } else {
  2526. var option = document.createElement('option');
  2527. option.value = formattedDate;
  2528. option.text = formattedDate;
  2529. endDateInput.appendChild(option);
  2530. }
  2531. } else {
  2532. var option = document.createElement('option');
  2533. option.value = formattedDate;
  2534. option.text = formattedDate;
  2535. endDateInput.appendChild(option);
  2536. }
  2537. }
  2538. endDateInput.disabled = false;
  2539. }
  2540. // Utility function to format date as yyyy-mm-dd
  2541. function formatDate(date) {
  2542. var year = date.getFullYear();
  2543. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  2544. var day = ("0" + date.getDate()).slice(-2);
  2545. return year + "-" + month + "-" + day;
  2546. }
  2547. // Function to calculate number of days based on start and end dates
  2548. // Function to calculate number of days based on start and end dates
  2549. function calculateNumDays() {
  2550. var startDateStr = document.getElementById("startDateInput").value;
  2551. var endDateStr = document.getElementById("endDateInput").value;
  2552. // Parse dates
  2553. var startDate = new Date(startDateStr);
  2554. var endDate = new Date(endDateStr);
  2555. // Check if dates are valid
  2556. if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
  2557. console.error("Invalid date format.");
  2558. return;
  2559. }
  2560. // Calculate the difference in days
  2561. var timeDiff = endDate.getTime() - startDate.getTime();
  2562. var numDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
  2563. // Adjust numDays to handle same-day selection
  2564. if (numDays === 0) {
  2565. numDays = 1; // Default to 1 day for same-day booking
  2566. } else if (numDays < 0) {
  2567. numDays = 0; // Handle case where end date is before start date
  2568. } else {
  2569. numDays += 1; // Add one day to include both start and end days
  2570. }
  2571. // Cap numDays between 1 and 7
  2572. numDays = Math.min(Math.max(numDays, 1), 7);
  2573. document.getElementById("numDaysCount").value = numDays;
  2574. // Recalculate days after slots if both dates are selected
  2575. if (startDateStr && endDateStr) {
  2576. calculatenoofdaysafterslots();
  2577. }
  2578. }
  2579. function getEndPeriodValue() {
  2580. const endPeriodDropdown = document.getElementById("endPeriodDropdown");
  2581. return endPeriodDropdown.disabled ? endPeriodDropdown.getAttribute("data-value") : endPeriodDropdown.value;
  2582. }
  2583. function setEndPeriodDataValue() {
  2584. const endPeriodDropdown = document.getElementById("endPeriodDropdown");
  2585. if (endPeriodDropdown.disabled) {
  2586. endPeriodDropdown.setAttribute("data-value", endPeriodDropdown.value);
  2587. }
  2588. }
  2589. function calculatenoofdaysafterslots() {
  2590. const startDateStr = document.getElementById("startDateInput").value;
  2591. const endDateStr = document.getElementById("endDateInput").value;
  2592. const startPeriod = parseInt(document.getElementById("startPeriodDropdown").value);
  2593. const endPeriod = parseInt(getEndPeriodValue()); // Use getEndPeriodValue here
  2594. const periodText = {
  2595. 0: {text: "select", time: ""},
  2596. 1: {text: "Morning", time: "6:00 AM"},
  2597. 2: {text: "Afternoon", time: "2:00 PM"}
  2598. };
  2599. const endPeriodText = {
  2600. 0: {text: "select", time: ""},
  2601. 1: {text: "Afternoon", time: "2:00 PM"},
  2602. 2: {text: "Evening", time: "10:00 PM"}
  2603. };
  2604. const startDate = new Date(startDateStr);
  2605. const endDate = new Date(endDateStr);
  2606. const timeDiff = endDate.getTime() - startDate.getTime();
  2607. let numDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
  2608. if (numDays === 0 && startDate.toDateString() === endDate.toDateString()) {
  2609. if (startPeriod === 1 && endPeriod === 1) {
  2610. numDays = 0.5; // Morning to morning is half day
  2611. } else if (startPeriod === 2 && endPeriod === 2) {
  2612. numDays = 0.5; // Evening to evening is half day
  2613. } else if (startPeriod === 1 && endPeriod === 2) {
  2614. numDays = 1; // Morning to evening is one full day
  2615. } else {
  2616. numDays = 1; // Default to one full day for any other case
  2617. }
  2618. } else {
  2619. if (startPeriod === 1 && endPeriod === 1) {
  2620. numDays += 0.5; // Morning to morning adds half a day
  2621. } else if (startPeriod === 2 && endPeriod === 2) {
  2622. numDays += 0.5; // Evening to evening adds half a day
  2623. } else if (startPeriod === 1 && endPeriod === 2) {
  2624. numDays += 1; // Morning to evening adds one full day
  2625. } else if (startPeriod === 2 && endPeriod === 1) {
  2626. // If the period spans over two days, evening to morning should be counted as one full day
  2627. numDays -= 0;
  2628. } else {
  2629. numDays += 1; // Default case for any other scenario
  2630. }
  2631. }
  2632. //else if (startPeriod === "2" && endPeriod === "2") {
  2633. // amount = fullDayAmount * (numDays - 1) + halfDayAmount;
  2634. //}
  2635. numDays = Math.min(Math.max(numDays, 0), 7);
  2636. const startPeriodText = periodText[startPeriod].text + " (" + periodText[startPeriod].time + ")";
  2637. const endPeriodFullText = endPeriodText[endPeriod].text + " (" + endPeriodText[endPeriod].time + ")";
  2638. const numDaysText = `${startDateStr} (${startPeriodText}) to ${endDateStr} (${endPeriodFullText})`;
  2639. document.getElementById("numDaysCountDisplay").value = numDaysText;
  2640. document.getElementById("numDaysCount").value = numDays;
  2641. }
  2642. function showSummary() {
  2643. const startDate = new Date(document.getElementById("startDateInput").value);
  2644. const endDate = new Date(document.getElementById("endDateInput").value);
  2645. const startPeriod = document.getElementById("startPeriodDropdown").value;
  2646. const endPeriod = getEndPeriodValue(); // Use getEndPeriodValue here
  2647. const startPeriods = {
  2648. "1": "Morning 6:00 AM",
  2649. "2": "Afternoon 2:00 PM"
  2650. };
  2651. const endPeriods = {
  2652. "1": "Afternoon 2:00 PM",
  2653. "2": "Evening 10:00 PM"
  2654. };
  2655. const numofdaysrange = Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
  2656. document.getElementById("noofdaysbetweenstartend").value = numofdaysrange;
  2657. const numDays = Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
  2658. let summaryText = `You booked for ${numDays} day(s) with the following slots:\n`;
  2659. let currentDate = new Date(startDate);
  2660. while (currentDate <= endDate) {
  2661. const currentDay = currentDate.toISOString().split('T')[0];
  2662. let currentStartPeriod;
  2663. let currentEndPeriod;
  2664. if (currentDate.getTime() === startDate.getTime()) {
  2665. currentStartPeriod = startPeriod;
  2666. } else {
  2667. currentStartPeriod = "1"; // Default to Morning for subsequent days
  2668. }
  2669. if (currentDate.getTime() === endDate.getTime()) {
  2670. currentEndPeriod = endPeriod;
  2671. } else {
  2672. currentEndPeriod = "2"; // Default to Evening for all days except the last
  2673. }
  2674. summaryText += `${currentDay}: ${startPeriods[currentStartPeriod]} to ${endPeriods[currentEndPeriod]}\n`;
  2675. currentDate.setDate(currentDate.getDate() + 1);
  2676. }
  2677. document.getElementById("summary").innerText = summaryText;
  2678. }
  2679. // Add event listeners to update the summary when dropdowns change
  2680. document.getElementById("startDateInput").addEventListener("change", function () {
  2681. calculatenoofdaysafterslots();
  2682. showSummary();
  2683. });
  2684. document.getElementById("endDateInput").addEventListener("change", function () {
  2685. calculatenoofdaysafterslots();
  2686. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2687. $(".step-2 .next-step").prop("disabled", true);
  2688. const bookingStatus = window.bookingResponse[$("#endDateInput").val()];
  2689. if (bookingStatus) {
  2690. if (bookingStatus[0]) {
  2691. $("#endPeriodDropdown").val(2);
  2692. $("#endPeriodDropdown").prop("disabled", true);
  2693. setEndPeriodDataValue();
  2694. } else if (bookingStatus[1]) {
  2695. $("#endPeriodDropdown").val(1);
  2696. $("#endPeriodDropdown").prop("disabled", true);
  2697. setEndPeriodDataValue();
  2698. }
  2699. } else {
  2700. $("#endPeriodDropdown").prop("disabled", false);
  2701. }
  2702. calculatenoofdaysafterslots();
  2703. if ($("#endDateInput").val() == "0") {
  2704. $('#summary').html('');
  2705. } else {
  2706. showSummary();
  2707. }
  2708. });
  2709. document.getElementById("startPeriodDropdown").addEventListener("change", function () {
  2710. calculatenoofdaysafterslots();
  2711. showSummary();
  2712. });
  2713. document.getElementById("endPeriodDropdown").addEventListener("change", function () {
  2714. calculatenoofdaysafterslots();
  2715. showSummary();
  2716. });
  2717. function initializeDatepickerWithColors(hallId) {
  2718. // Destroy existing datepicker to avoid duplicate initialization
  2719. $("#datepicker-container").datepicker("destroy");
  2720. const serverDate = new Date($("#serverDate").val() + "T00:00:00")
  2721. const maxDate = new Date(serverDate);
  2722. maxDate.setMonth(maxDate.getMonth() + 6);
  2723. // console.log(" hall booking form Max Date: "+maxDate);
  2724. // Initialize the datepicker
  2725. $("#startDateInput,#datepicker-container").datepicker({
  2726. dateFormat: "yy-mm-dd",
  2727. minDate: serverDate,
  2728. maxDate: maxDate,
  2729. beforeShowDay: function (eDate) {
  2730. const dateString = $.datepicker.formatDate("yy-mm-dd", eDate);
  2731. const bookingStatus = window.bookingResponse[dateString] || {};
  2732. // const currentDate = new Date();
  2733. serverDate.setHours(0, 0, 0, 0); // Normalize current date to midnight
  2734. eDate.setHours(0, 0, 0, 0); // Normalize selected date to midnight
  2735. // Logic for other dates
  2736. if (eDate < serverDate) {
  2737. return [false, "highlight-disabled", "Slot not Available"];
  2738. }
  2739. const isToday = eDate.getTime() === serverDate.getTime();
  2740. const currentHour = new Date().getHours();
  2741. const isBefore6AM = currentHour < 6;
  2742. const isAfter2PM = currentHour >= 14;
  2743. // Block 3-day logic for specific event types
  2744. // const today = new Date();
  2745. const blockedDate = new Date(serverDate);
  2746. blockedDate.setDate(serverDate.getDate() + 2);
  2747. if (eDate <= blockedDate && window.isThreeDayBlock) {
  2748. return [false, "highlight-disabled", "Blocked due to event type"];
  2749. }
  2750. // Logic for today
  2751. if (isToday) {
  2752. if (isBefore6AM) {
  2753. // Before 6 AM: Allow full-day booking or adjust based on booking status
  2754. return handleBookingStatus(bookingStatus, "Full Day Available");
  2755. } else if (isAfter2PM) {
  2756. // After 2 PM: Block all bookings
  2757. return handleAfter2PM(bookingStatus);
  2758. } else {
  2759. // Between 6 AM and 2 PM: Check status and disable morning slots
  2760. return handleMorningSlots(bookingStatus);
  2761. }
  2762. }
  2763. return handleBookingStatus(bookingStatus, "Slot Available");
  2764. },
  2765. });
  2766. // Show datepicker when hall is selected
  2767. $('#selecthall').off('click').on('click', function () {
  2768. $('#datepicker-container').datepicker('show');
  2769. });
  2770. // Handle changes in the start date input
  2771. $("#startDateInput").on("change", function () {
  2772. const selectedDate = $(this).val();
  2773. const bookingStatus = window.bookingResponse[selectedDate] || {};
  2774. // const currentDate = new Date();
  2775. const currentHours = new Date().getHours();
  2776. const currentDateString = $("#serverDate").val();
  2777. $("#startPeriodDropdown option").prop("disabled", false); //newly added after server date changes
  2778. $("#startPeriodDropdown").val(0).prop("disabled", false);
  2779. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2780. $("#numDaysCount").val('');
  2781. validateForm();
  2782. if ((selectedDate === currentDateString && currentHours >= 6 )|| bookingStatus[0]) {
  2783. $("#startPeriodDropdown option[value='1']").prop("disabled", true);
  2784. }else if (bookingStatus[1]) {
  2785. $("#startPeriodDropdown option[value='2']").prop("disabled", true);
  2786. }
  2787. updateEndDate(selectedDate);
  2788. });
  2789. // Event type change logic
  2790. $("#reasonforbooking").on("change", function () {
  2791. const selectedEventType = $(this).find("option:selected").text().trim();
  2792. window.isThreeDayBlock = ["Commercial", "State Govt Event", "Central Govt Event"].includes(selectedEventType);
  2793. $("#datepicker-container").datepicker("refresh");
  2794. });
  2795. }
  2796. function handleBookingStatus(bookingStatus, defaultMessage) {
  2797. if (bookingStatus[2]) {
  2798. return [true, "highlight-blue disabled", "GCC Blocked"];
  2799. } /*else if (bookingStatus[3]) {
  2800. return [true, "highlight-lightpink disabled", "Temporary Blocked"];
  2801. } */ else if (bookingStatus[0] && bookingStatus[1]) {
  2802. return [true, "highlight-pink disabled", "Slot Occupied"];
  2803. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2804. return [true, "highlight-yellow", "Evening Slot Available"];
  2805. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2806. return [true, "highlight-violet", "Only Morning Slot Available"];
  2807. }
  2808. return [true, "highlight-greens", defaultMessage];
  2809. }
  2810. // Helper function: Handles logic after 2 PM
  2811. function handleAfter2PM(bookingStatus) {
  2812. if (bookingStatus[2]) {
  2813. return [true, "highlight-blue disabled", "GCC Blocked"];
  2814. } else if (bookingStatus[0] || bookingStatus[1]) {
  2815. return [true, "highlight-pink disabled", "Slot Occupied"];
  2816. }
  2817. return [false, "highlight-disabled", "Not Allowed to Book"];
  2818. }
  2819. // Helper function: Handles morning slots between 6 AM and 2 PM
  2820. function handleMorningSlots(bookingStatus) {
  2821. if (bookingStatus[2]) {
  2822. return [true, "highlight-blue disabled", "GCC Blocked"];
  2823. } else if (bookingStatus[0] && bookingStatus[1]) {
  2824. return [true, "highlight-pink disabled", "Slot Occupied"];
  2825. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2826. return [true, "highlight-yellow", "Evening Slot Available"];
  2827. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2828. return [false, "highlight-disabled", "Slot Occupied"];
  2829. }
  2830. return [true, "highlight-yellow", "Evening Slot Available"];
  2831. }
  2832. function datepickerFormat(dateString) {
  2833. var dateObject = new Date(dateString);
  2834. var year = dateObject.getFullYear();
  2835. var month = (dateObject.getMonth() + 1).toString().padStart(2, "0");
  2836. var day = dateObject.getDate().toString().padStart(2, "0");
  2837. return `${year}-${month}-${day}`;
  2838. }
  2839. //snackbars
  2840. $("#reasonforbooking").on("click", function () {
  2841. var relationship = $("#relation").val();
  2842. if (relationship == 0) {
  2843. var relationField = $("#relation")[0];
  2844. relationField.setCustomValidity("Relationship for Booking is Missing. Please select.");
  2845. relationField.reportValidity();
  2846. return; // Exit early if relationship is not provided
  2847. } else {
  2848. $("#relation")[0].setCustomValidity(""); // Clear custom validity if valid
  2849. }
  2850. });
  2851. $("#relation").on("change", function () {
  2852. // Clear custom validity when a valid value is selected
  2853. this.setCustomValidity("");
  2854. });
  2855. $("#startDateInput").on("click", function () {
  2856. var reason = $("#reasonforbooking").val();
  2857. if (reason == 0) {
  2858. var reasonField = $("#reasonforbooking")[0];
  2859. reasonField.setCustomValidity("Reason for booking is missed. Please select a reason.");
  2860. reasonField.reportValidity();
  2861. return; // Exit early if reason is not provided
  2862. } else {
  2863. $("#reasonforbooking")[0].setCustomValidity(""); // Clear custom validity if valid
  2864. }
  2865. });
  2866. $("#endDateInput").on("click", function () {
  2867. var reason = $("#reasonforbooking").val();
  2868. var startDate = $("#startDateInput").val();
  2869. if (reason == 0) {
  2870. var reasonField = $("#reasonforbooking")[0];
  2871. reasonField.setCustomValidity("Reason for booking is missed. Please select a reason.");
  2872. reasonField.reportValidity();
  2873. return; // Exit early if reason is not provided
  2874. } else {
  2875. $("#reasonforbooking")[0].setCustomValidity(""); // Clear custom validity if valid
  2876. }
  2877. if (startDate == "") {
  2878. var startDate = $("#startDateInput")[0];
  2879. startDateInput.setCustomValidity("Start Date missed. Please select a Start Date.");
  2880. startDateInput.reportValidity();
  2881. return; // Exit early if reason is not provided
  2882. } else {
  2883. $("#startDateInput")[0].setCustomValidity(""); // Clear custom validity if valid
  2884. }
  2885. });
  2886. $("#reasonforbooking").on("change", function () {
  2887. // Clear custom validity when a valid value is selected
  2888. this.setCustomValidity("");
  2889. });
  2890. // Snackbar function
  2891. function showSnackbar(message) {
  2892. var snackbar = $("<div>")
  2893. .addClass("snackbar")
  2894. .text(message)
  2895. .appendTo("body");
  2896. // Add animation classes for showing and hiding
  2897. snackbar.addClass("show");
  2898. // Remove the snackbar after 3 seconds
  2899. setTimeout(function () {
  2900. snackbar.removeClass("show");
  2901. snackbar.remove();
  2902. }, 3000);
  2903. }
  2904. // Update the event listeners to include date inputs
  2905. $("#endDateInput").on("change", function () {
  2906. var starting = $("#startPeriodDropdown").val();
  2907. var ending = $("#endPeriodDropdown").val();
  2908. var startDate = $("#startDateInput").val();
  2909. var endDate = $("#endDateInput").val();
  2910. // Call validateSlot with updated parameters
  2911. validateSlot(starting, ending, startDate, endDate);
  2912. validateForm();
  2913. });
  2914. // Event listener for changes in startPeriodDropdown
  2915. $("#startPeriodDropdown").on("change", function () {
  2916. var starting = $(this).val();
  2917. var ending = $("#endPeriodDropdown").val();
  2918. var startDate = $("#startDateInput").val();
  2919. var endDate = $("#endDateInput").val();
  2920. // Call validateSlot with updated parameters
  2921. validateSlot(starting, ending, startDate, endDate);
  2922. validateForm();
  2923. showSummary();
  2924. });
  2925. // Event listener for changes in endPeriodDropdown
  2926. $("#endPeriodDropdown").on("change", function () {
  2927. var starting = $("#startPeriodDropdown").val();
  2928. var ending = $(this).val();
  2929. var startDate = $("#startDateInput").val();
  2930. var endDate = $("#endDateInput").val();
  2931. validateSlot(starting, ending, startDate, endDate);
  2932. validateForm();
  2933. calculatenoofdaysafterslots();
  2934. showSummary();
  2935. });
  2936. function validateSlot(starting, ending, startDate, endDate) {
  2937. // Check if startDate is equal to endDate and starting is 2 and ending is 1
  2938. if (startDate === endDate && starting == 2 && ending == 1) {
  2939. Swal.fire({
  2940. icon: 'error',
  2941. title: 'Oops!',
  2942. text: "The starting slot cannot be set to Evening if the ending slot is Morning when the dates are the same.",
  2943. }).then(() => {
  2944. // Reset endPeriodDropdown to 0
  2945. $("#endPeriodDropdown").val(0);
  2946. validateForm();
  2947. });
  2948. }
  2949. validateForm(); // Call validateForm to update form validation status
  2950. }
  2951. function validateForm() {
  2952. var startDate = $("#startDateInput").val();
  2953. var endDate = $("#endDateInput").val();
  2954. var startPeriod = $("#startPeriodDropdown").val();
  2955. var endPeriod = $("#endPeriodDropdown").val();
  2956. var reasonforbooking = $("#reasonforbooking").val();
  2957. var relationship = $("#relation").val();
  2958. if (startDate && endDate !== "0" && startPeriod !== "0" && endPeriod !== "0" && relationship !== "0" && reasonforbooking) {
  2959. $(".next-step").prop("disabled", false);
  2960. } else {
  2961. $(".next-step").prop("disabled", true);
  2962. }
  2963. }
  2964. // Confirm Payment button click event
  2965. $("#confirmPaymentBtn").on('click', function () {
  2966. // Disable the payment button
  2967. $('#confirmPaymentBtn').prop('disabled', true);
  2968. stopTimer();
  2969. });
  2970. function stopTimer() {
  2971. if (countdown) {
  2972. clearInterval(countdown);
  2973. countdown = null; // Clear the countdown reference
  2974. }
  2975. timerElement.innerHTML = "Timer Stopped"; // Optionally update the message
  2976. }
  2977. </script>
  2978. </body>
  2979. </html>