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.

3475 lines
164 KiB

2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
​
2 years ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
2 years ago
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/head :: head}"></head>
  4. <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. /* css fror toast */
  812. /* Toast styling */
  813. #toast {
  814. visibility: hidden;
  815. min-width: 200px;
  816. margin-left: -100px;
  817. background: #333;
  818. color: #fff;
  819. text-align: center;
  820. border-radius: 6px;
  821. padding: 10px;
  822. position: fixed;
  823. z-index: 9999;
  824. left: 50%;
  825. bottom: 30px;
  826. font-size: 14px;
  827. }
  828. #toast.show {
  829. visibility: visible;
  830. animation: fadein 0.5s, fadeout 0.5s 2s;
  831. }
  832. @keyframes fadein {
  833. from {
  834. bottom: 10px;
  835. opacity: 0;
  836. }
  837. to {
  838. bottom: 30px;
  839. opacity: 1;
  840. }
  841. }
  842. @keyframes fadeout {
  843. from {
  844. bottom: 30px;
  845. opacity: 1;
  846. }
  847. to {
  848. bottom: 10px;
  849. opacity: 0;
  850. }
  851. }
  852. </style>
  853. <body>
  854. <!-- Pre-loader start -->
  855. <div class="theme-loader">
  856. <div class="ball-scale">
  857. <div class='contain'>
  858. <div class="ring">
  859. <div class="frame"></div>
  860. </div>
  861. <div class="ring">
  862. <div class="frame"></div>
  863. </div>
  864. <div class="ring">
  865. <div class="frame"></div>
  866. </div>
  867. <div class="ring">
  868. <div class="frame"></div>
  869. </div>
  870. <div class="ring">
  871. <div class="frame"></div>
  872. </div>
  873. <div class="ring">
  874. <div class="frame"></div>
  875. </div>
  876. <div class="ring">
  877. <div class="frame"></div>
  878. </div>
  879. <div class="ring">
  880. <div class="frame"></div>
  881. </div>
  882. <div class="ring">
  883. <div class="frame"></div>
  884. </div>
  885. <div class="ring">
  886. <div class="frame"></div>
  887. </div>
  888. </div>
  889. </div>
  890. </div>
  891. <!-- Pre-loader end -->
  892. <div id="pcoded" class="pcoded">
  893. <div class="pcoded-container">
  894. <!-- Menu header end -->
  895. <div class="pcoded-main-container">
  896. <!-- Menu header start -->
  897. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  898. <!-- Menu header end -->
  899. <div class="pcoded-main-container">
  900. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  901. <div class="pcoded-wrapper">
  902. <div class="pcoded-content">
  903. <div class="pcoded-inner-content">
  904. <div class="page-header m-t-20">
  905. </div>
  906. <!-- Page-header end -->
  907. <!-- Page body start -->
  908. <div class="page-body">
  909. <div class="row">
  910. <!--<div class="col-sm-12">-->
  911. <!-- Register your self card start -->
  912. <div>
  913. <div id="container" class="container mt-5">
  914. <div class="progress px-1" style="height: 3px;">
  915. <div class="progress-bar" role="progressbar" style="width: 0%;"
  916. aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
  917. </div>
  918. </div>
  919. <div class="step-container d-flex justify-content-between">
  920. <div class="step-circle" onclick="displayStep(1)">1</div>
  921. <div class="step-circle" onclick="displayStep(2)">2</div>
  922. <div class="step-circle" onclick="displayStep(3)">3</div>
  923. <div class="step-circle" onclick="displayStep(4)">4</div>
  924. </div>
  925. <form action="javascript:saveBookingDetails()" id="booking"
  926. method="post" enctype="multipart/form-data"
  927. onsubmit="return handleSaveAndContinueStep3()">
  928. <input type="hidden" id="serverDate" th:value=${serverDate}>
  929. <div class="step step-1">
  930. <h5>Step:1</h5>
  931. <div class="container custom-container"
  932. 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;">
  933. <!-- Updated inline styles -->
  934. <div class="row justify-content-center">
  935. <div class="col-sm-6 col-md-6 col-lg-6">
  936. <label class="form-check-label"
  937. for="selecthall">Select Hall:</label>
  938. <select id="selecthall" class="form-control"
  939. name="hallId" required
  940. onchange="toggleHallDetailsContainer()">
  941. <option value="">Select a hall</option>
  942. </select>
  943. </div>
  944. </div>
  945. <br>
  946. <!-- Main content row -->
  947. <div id="hallDetailsContainer" style="display: none;">
  948. <!-- Initially hidden -->
  949. <div class="row">
  950. <!-- Hall Images Carousel -->
  951. <div class="col-md-6 col-lg-6 col-sm-6">
  952. <h6>Hall Images:</h6>
  953. <br>
  954. <div id="hallImagesCarousel"
  955. class="carousel slide" data-ride="carousel">
  956. <div class="carousel-inner">
  957. <div class="carousel-item active">
  958. <img id="hallImage"
  959. class="d-block w-100"
  960. alt="Hall Image">
  961. </div>
  962. </div>
  963. <a class="carousel-control-prev"
  964. href="#hallImagesCarousel" role="button"
  965. data-slide="prev">
  966. <span class="carousel-control-prev-icon"
  967. aria-hidden="true"></span>
  968. <span class="sr-only">Previous</span>
  969. </a>
  970. <a class="carousel-control-next"
  971. href="#hallImagesCarousel" role="button"
  972. data-slide="next">
  973. <span class="carousel-control-next-icon"
  974. aria-hidden="true"></span>
  975. <span class="sr-only">Next</span>
  976. </a>
  977. </div>
  978. </div>
  979. <div class="col-md-6 col-lg-6 col-sm-6">
  980. <div id="datepicker-container"
  981. class="fixedcontainer"></div>
  982. <div class="row">
  983. <div class="col col-lg-2 col-sm-2 col-md-2">
  984. <button type="button"
  985. class="btn btn-primary btn-square-md"
  986. style="background-color:#008000;"></button>
  987. <span style="margin-left: 21px;">Day<br>
  988. (Available)</span>
  989. </div>
  990. <div class="col col-lg-2 col-sm-2 col-md-2">
  991. <button type="button"
  992. class="btn btn-primary btn-square-md"
  993. style="background-color: #ac2bac;"></button>
  994. <span style="margin-left: 14px;">Morning
  995. <br>
  996. &nbsp;&nbsp;(Available)</span>
  997. </div>
  998. <div class="col col-lg-2 col-sm-2 col-md-2">
  999. <button type="button"
  1000. class="btn btn-primary btn-square-md"
  1001. style="background-color:#FFEA00;"></button>
  1002. <span
  1003. style="margin-left: 14px;">Evening<br>
  1004. &nbsp;&nbsp;(Available)</span>
  1005. </div>
  1006. <div class="col col-lg-2 col-sm-2 col-md-2">
  1007. <button type="button"
  1008. class="btn btn-primary btn-square-md"
  1009. style="background-color: red;"></button>
  1010. <span style="margin-left: 14px;">Not
  1011. Available</span>
  1012. </div>
  1013. <div class="col col-lg-2 col-sm-2 col-md-2">
  1014. <button type="button"
  1015. class="btn btn-primary btn-square-md"
  1016. style="background-color: blue"></button>
  1017. <span style="margin-left: 14px;">Gcc
  1018. Blocked</span>
  1019. </div>
  1020. </div>
  1021. </div>
  1022. <br>
  1023. <!-- Hall Details -->
  1024. <div class="col-md-6 col-lg-6 col-sm-6">
  1025. <div id="hallDetails">
  1026. <br>
  1027. <h6><b>Hall Details:</b></h6>
  1028. <p>Zone: <span id="zone"></span></p>
  1029. <p>Address: <span id="address"></span></p>
  1030. <p>Landmark: <span id="landmark"></span></p>
  1031. <p>Total Area: <span
  1032. id="hallareainsqft"></span></p>
  1033. <p>Seating Capacity: <span
  1034. id="seatingCapacity"></span></p>
  1035. <p>Parking Capacity: <span
  1036. id="parkingCapacity"></span></p>
  1037. <input type="hidden" id="statichallId">
  1038. </div>
  1039. </div>
  1040. <br>
  1041. <!-- Amount Details -->
  1042. <div class="col-md-6 col-lg-6 col-sm-6">
  1043. <div id="amountDetails">
  1044. <br>
  1045. <h6><b>Amount Details:</b></h6>
  1046. <p>Security Deposit: Rs <span
  1047. id="rentAmount"></span></p>
  1048. <p>Full Day Rent: Rs <span
  1049. id="fullDayAmount"></span></p>
  1050. <p>Half Day Security Deposit: Rs <span
  1051. id="halfrentAmount"></span></p>
  1052. <p>Half Day Rent: Rs <span
  1053. id="halfDayAmount"></span></p>
  1054. <p>GST: <span id="gst"></span>%</p>
  1055. <p>EB for 1 Unit:* Rs <span
  1056. id="ebunit"></span></p>
  1057. <p>CareTaker Number: <span
  1058. id="caretakerNumber"></span></p>
  1059. <input type="hidden" id="depositAmount"
  1060. name="depositamount" value="100">
  1061. <input type="hidden" id="hallamount"
  1062. name="hallamount" value="100">
  1063. </div>
  1064. </div>
  1065. </div>
  1066. <div
  1067. class="row d-flex justify-content-center align-items-center">
  1068. <div
  1069. class="col-md-12 col-sm-12 col-lg-12 d-flex justify-content-center">
  1070. <!-- Center align the button -->
  1071. <button type="button"
  1072. class="btn btn-primary next-step"
  1073. id="bookandcontinue"
  1074. style="background-color: #016d6f; color: white;">
  1075. Book
  1076. & Continue
  1077. </button>
  1078. </div>
  1079. </div>
  1080. </div>
  1081. </div>
  1082. </div>
  1083. <div class="step step-2">
  1084. <!-- Step 2 form fields here -->
  1085. <h4 style="margin-left:10px">Step 2</h4>
  1086. <div class="container custom-container"
  1087. style="padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); background-color: #FFFFFF; border: 1px solid #CCCCCC;">
  1088. <!-- Updated inline styles -->
  1089. <div class="mb-3">
  1090. <div class="row">
  1091. <div class=" row col-md-12 col-lg-12 col-sm-12">
  1092. <table
  1093. class="table table-bordered table-align center-table">
  1094. <tbody>
  1095. <tr>
  1096. <td class="td-align" style="word-wrap: break-word;
  1097. white-space: normal;"><strong>Hall
  1098. Name:</strong>
  1099. <span
  1100. id="hallNameDisplayStep2"></span>
  1101. </td>
  1102. <td class="td-align"><strong>Zone:
  1103. </strong>
  1104. <span id="zoneStep2"></span>
  1105. </td>
  1106. <td class="td-align">
  1107. <strong>Division: </strong>
  1108. <span id="divisionStep2"></span>
  1109. </td>
  1110. </tr>
  1111. </tbody>
  1112. </table>
  1113. </div>
  1114. <div class="row">
  1115. <div class="col col-lg-2 col-sm-2 col-md-2">
  1116. <button type="button"
  1117. class="btn btn-primary btn-square-md"
  1118. style="background-color:#008000;"></button>
  1119. <p style="margin-left: -7px;">Day(Available)
  1120. </p>
  1121. </div>
  1122. <div class="col col-lg-2 col-sm-2 col-md-2">
  1123. <button type="button"
  1124. class="btn btn-primary btn-square-md"
  1125. style="background-color: #ac2bac;"></button>
  1126. <p style="margin-left: -7px;;">
  1127. &nbsp;&nbsp;Morning(Available)</p>
  1128. </div>
  1129. <div class="col col-lg-2 col-sm-2 col-md-2">
  1130. <button type="button"
  1131. class="btn btn-primary btn-square-md"
  1132. style="background-color:#FFEA00;"></button>
  1133. <p style="margin-left: -8px;">
  1134. Evening(Available)</p>
  1135. </div>
  1136. <div class="col col-lg-2 col-sm-2 col-md-2">
  1137. <button type="button"
  1138. class="btn btn-primary btn-square-md"
  1139. style="background-color: red;"></button>
  1140. <P style="margin-left: -4px;">
  1141. Not(Available)</P>
  1142. </div>
  1143. <div class="col col-lg-2 col-sm-2 col-md-2">
  1144. <button type="button"
  1145. class="btn btn-primary btn-square-md"
  1146. style="background-color: blue"></button>
  1147. <p style="margin-left:-1px;">Gcc
  1148. Blocked</p>
  1149. </div>
  1150. <!--<div class="col col-lg-2 col-sm-2 col-md-2">
  1151. <button type="button"
  1152. class="btn btn-primary btn-square-md"
  1153. style="background-color: lightpink"></button>
  1154. <p style="margin-left: 6px;">Temporary
  1155. Blocked</p>
  1156. </div>-->
  1157. </div>
  1158. <br>
  1159. <br>
  1160. <div class="col-sm-4 col-lg-6 col-md-4">
  1161. <label>Relationship of the Functionary:*</label>
  1162. <select id="relation" name="relation"
  1163. class="form-control"
  1164. onchange="validateForm()" required>
  1165. <option value="0">Select</option>
  1166. <option value="self">Self</option>
  1167. <option value="son">Son</option>
  1168. <option value="daughter">Daughter</option>
  1169. <option value="granddaughter">GrandDaughter
  1170. </option>
  1171. <option value="grandson">GrandSon</option>
  1172. <option value="sister">Sister</option>
  1173. <option value="brother">Brother</option>
  1174. </select>
  1175. </div>
  1176. <!--edit code-->
  1177. <input type="hidden" id="reasonMaxDates">
  1178. <div class="col-sm-4 col-lg-6 col-md-4">
  1179. <label>Reason for
  1180. Booking:*</label>
  1181. <select type="text" class="form-control"
  1182. id="reasonforbooking" name="reasonId"
  1183. required>
  1184. </select>
  1185. </div>
  1186. <br>
  1187. <br>
  1188. <br>
  1189. <br>
  1190. <!--end of edit code-->
  1191. <div class="col-sm-4 col-lg-6 col-md-4">
  1192. <label for="startDateInput">Start Date:*</label>
  1193. <!-- Input field for start date -->
  1194. <input type="text" id="startDateInput"
  1195. name="startDate"
  1196. class="date-input form-control"
  1197. style="background-color:white" readonly
  1198. required>
  1199. </div>
  1200. <div class="col-sm-4 col-lg-6 col-md-4">
  1201. <label for="endDateInput">End Date:*</label>
  1202. <select id="endDateInput" name="endDate"
  1203. class="form-control" disabled>
  1204. <option value="0">Select</option>
  1205. </select>
  1206. </div>
  1207. <br>
  1208. <br>
  1209. <br>
  1210. <br>
  1211. <input type="hidden" id="numDaysCount" val=""
  1212. name="days">
  1213. <input type="hidden" id="noofdaysbetweenstartend"
  1214. val="" name="daysrange">
  1215. <div class="col-sm-4 col-lg-6 col-md-4">
  1216. <label for="startPeriodDropdown">Start
  1217. Period:*</label>
  1218. <select id="startPeriodDropdown"
  1219. name="startingSlot" class="form-control"
  1220. required>
  1221. <option value="0">Select</option>
  1222. <option value="1">Morning (6:00
  1223. AM)
  1224. </option>
  1225. <option value="2">Afternoon (2:00
  1226. PM)
  1227. </option>
  1228. </select>
  1229. </div>
  1230. <div class="col-sm-4 col-lg-6 col-md-4">
  1231. <label>End
  1232. Period:*</label>
  1233. <select id="endPeriodDropdown" name="endingSlot"
  1234. class="form-control" required>
  1235. <option value="0">Select</option>
  1236. <option value="1">Afternoon (2:00
  1237. PM)
  1238. </option>
  1239. <option value="2">Evening (10:00
  1240. PM)
  1241. </option>
  1242. </select>
  1243. </div>
  1244. <br>
  1245. <br>
  1246. <br>
  1247. <br>
  1248. <div class="col-sm-4 col-lg-6 col-md-4">
  1249. <label for="numDaysCountDisplay">Selected
  1250. Slots:</label>
  1251. <textarea type="text" id="numDaysCountDisplay"
  1252. class="form-control" readonly
  1253. style="background-color:white"></textarea>
  1254. </div>
  1255. <div class="col-sm-4 col-lg-6 col-md-4">
  1256. <h4>Booking Summary:</h4>
  1257. <p id="summary" val=""></p>
  1258. </div>
  1259. </div>
  1260. <br>
  1261. <div class="row">
  1262. <div
  1263. class="col-md-12 col-lg-12 col-sm-12 text-center">
  1264. <!-- Center align the button -->
  1265. <button type="button"
  1266. class="btn btn-primary prev-step"
  1267. style="background-color: #016d6f; color: white;float: left;">
  1268. Previous
  1269. </button>
  1270. <button type="button"
  1271. class="btn btn-warning reset-step"
  1272. style=" background-color: orangered; color: white; margin: auto;">
  1273. Reset
  1274. </button>
  1275. <button type="button"
  1276. class="btn btn-primary next-step"
  1277. style="background-color: #016d6f; color: white; float: right;">
  1278. Next
  1279. </button>
  1280. </div>
  1281. </div>
  1282. </div>
  1283. </div>
  1284. </div>
  1285. <div class="step step-3">
  1286. <!-- Step 3 form fields here -->
  1287. <h4 style=" margin-left: 10px;">Step 3</h4>
  1288. <div class="container custom-container"
  1289. style="padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); background-color: #FFFFFF; border: 1px solid #CCCCCC;">
  1290. <div>
  1291. <div class="card-body">
  1292. <div class="col-md-12 col-sm-12 col-lg-12">
  1293. <table
  1294. class="table table-bordered table-align center-table">
  1295. <tbody>
  1296. <tr>
  1297. <td class="td-align" style="word-wrap: break-word;
  1298. white-space: normal;"><strong>Hall
  1299. Name:</strong><span
  1300. id="hallNameDisplayStep3"></span>
  1301. </td>
  1302. <td class="td-align"><strong>Zone:
  1303. </strong><span
  1304. id="zoneStep3"></span>
  1305. </td>
  1306. <td class="td-align">
  1307. <strong>Division:
  1308. </strong><span
  1309. id="divisionStep3"></span>
  1310. </td>
  1311. </tr>
  1312. </tbody>
  1313. </table>
  1314. </div>
  1315. <div class="col-sm-4 col-lg-4 col-md-4">
  1316. <input type="hidden" id="userId" name="userId">
  1317. <label class="form-check-label"
  1318. for="uploadDocument">Upload Document for
  1319. Booking:*</label>
  1320. <input type="text" id="showReasonLabel" readonly
  1321. class="form-control"
  1322. style="background-color:white">
  1323. <!-- <div class="col-sm-4 col-lg-4 col-md-4">
  1324. <label class="form-check-label"
  1325. for="reasonforbooking">Reason for Booking:*</label>
  1326. <select type="text" class="form-control"
  1327. id="reasonforbooking" name="reasonId"
  1328. required>
  1329. </select>
  1330. </div> -->
  1331. </div>
  1332. <br>
  1333. <div id="reasonFieldsContainer">
  1334. </div>
  1335. <input type="hidden" name="bookingId" id="bookingId"
  1336. value="0">
  1337. </div>
  1338. </div>
  1339. <div class="row">
  1340. <div class="col-md-12 col-lg-12 col-sm-12 text-center">
  1341. <!-- Center align the button -->
  1342. <button type="button"
  1343. class="btn btn-primary prev-step"
  1344. style="background-color: #016d6f; color: white; float: left;">
  1345. Previous
  1346. </button>
  1347. <button type="button"
  1348. class="btn btn-warning reset-step"
  1349. style="background-color: orangered; color: white; margin: auto;">
  1350. Reset
  1351. </button>
  1352. <button type="submit"
  1353. class="btn btn-primary next-step"
  1354. style="background-color: #016d6f; color: white; float: right;"
  1355. disabled>Next
  1356. </button>
  1357. </div>
  1358. </div>
  1359. </div>
  1360. </div>
  1361. </form>
  1362. <div class="step step-4">
  1363. <h4 style="margin-left:166px">Step 4</h4>
  1364. <div class="container custom-container">
  1365. <div class="header"
  1366. style="background-color: rgb(21,69,93); position: relative;">
  1367. <img src="media/images/logo-sm.png" alt="Logo"
  1368. style="position: absolute; left: 10px; top: 7px; height: 30px;">
  1369. <h6
  1370. style="color: white; text-align: center; line-height: 3.1;">
  1371. Payment Details for Confirmation
  1372. <span id="timer"
  1373. style="display: inline; float:right;margin-right:10px;">
  1374. <span class="sand-clock"></span>
  1375. <!-- Hourglass icon -->
  1376. <span id="timerText">Payment Closes in 15:00</span>
  1377. <!-- Timer text -->
  1378. </span>
  1379. </h6>
  1380. </div>
  1381. <div class="col-md-12">
  1382. <table
  1383. class="table table-bordered center-table table-align">
  1384. <tbody>
  1385. <tr>
  1386. <td class="td-align"><strong>Full Name:</strong>
  1387. <span id="name_td"></span>
  1388. </td>
  1389. <td class="td-align">
  1390. <strong>Mobile Number:</strong> <span
  1391. id="mobileno_td"></span>
  1392. </td>
  1393. <td class="td-align"><strong>User Type:</strong>
  1394. <span id="usertype_td"></span>
  1395. </td>
  1396. </tr>
  1397. </tbody>
  1398. </table>
  1399. </div>
  1400. <div class="row">
  1401. <div class="col-md-6">
  1402. <table
  1403. class="table table-bordered center-table table-align">
  1404. <tbody>
  1405. <tr>
  1406. <td class="td-align"><strong>Hall
  1407. Name:</strong></td>
  1408. <td class="td-align"
  1409. style="text-wrap:wrap;">
  1410. <span id="selecthall_td"></span>
  1411. </td>
  1412. </tr>
  1413. <tr>
  1414. <td class="td-align"><strong>No. of
  1415. Days:</strong>
  1416. </td>
  1417. <td class="td-align"><span
  1418. id="numDaysCount_td"></span>
  1419. </td>
  1420. </tr>
  1421. <tr>
  1422. <td class="td-align"><strong>Start
  1423. Date:</strong>
  1424. </td>
  1425. <td class="td-align"><span
  1426. id="startDateInput_td"></span>
  1427. </td>
  1428. </tr>
  1429. <tr>
  1430. <td class="td-align"><strong>End
  1431. Date:</strong></td>
  1432. <td class="td-align"><span
  1433. id="endDateInput_td"></span>
  1434. </td>
  1435. </tr>
  1436. <tr>
  1437. <td class="td-align"><strong>Starting Slot &
  1438. Ending Slot:</strong>
  1439. </td>
  1440. <td class="td-align"><span
  1441. id="startingslot_td"></span>
  1442. </td>
  1443. </tr>
  1444. <tr>
  1445. <td class="td-align"><strong>Uploaded
  1446. Documents:</strong></td>
  1447. <td class="td-align">
  1448. <!-- List to display uploaded docs with small images and names -->
  1449. <div id="uploadedDocsList"
  1450. class="uploaded-docs-list">
  1451. <!-- Each item in the list will have a small image and name -->
  1452. </div>
  1453. </td>
  1454. </tr>
  1455. <div>
  1456. <div id="largeImageContainer"
  1457. class="large-image-container"
  1458. style="display: none;">
  1459. <button id="closeButton" type="button"
  1460. class="close-button">
  1461. <i class="fa fa-times"></i>
  1462. </button>
  1463. <img id="largeImage" src=""
  1464. alt="Large Image">
  1465. </div>
  1466. </div>
  1467. </tbody>
  1468. </table>
  1469. </div>
  1470. <div class="col-md-6">
  1471. <table
  1472. class="table table-bordered center-table table-align">
  1473. <tbody>
  1474. <tr>
  1475. <td class="td-align"><strong>Reason for
  1476. Booking:</strong>
  1477. </td>
  1478. <td class="td-align"><span
  1479. id="reasonforbooking_td"></span>
  1480. </td>
  1481. </tr>
  1482. <tr>
  1483. <td class="td-align"><strong> Hall
  1484. Amount:</strong>
  1485. </td>
  1486. <td><span id="actualhallAmount_td">Rs</span>
  1487. </td>
  1488. </tr>
  1489. <tr>
  1490. <td class="td-align">
  1491. <strong>Discount:</strong>
  1492. </td>
  1493. <td><span id="discount_td">0%</span>
  1494. </td>
  1495. </tr>
  1496. <tr id="additionalcharges" style="display:none">
  1497. <td class="td-align">
  1498. <strong>Rent Amount:</strong>
  1499. </td>
  1500. <td><span id="rentamount_td">0</span></td>
  1501. </tr>
  1502. <tr id="additionalcharges_tr"
  1503. style="display:none">
  1504. <td class="td-align">
  1505. <strong>Additional charges (Cleaning +
  1506. P.A.
  1507. System + E.B):</strong>
  1508. </td>
  1509. <td><span id="additionalcharges_td">0</span>
  1510. </td>
  1511. </tr>
  1512. <tr>
  1513. <td class="td-align"><strong>Net
  1514. Amount:</strong>
  1515. </td>
  1516. <td><span id="hallAmount_td">Rs</span>
  1517. </td>
  1518. </tr>
  1519. <tr>
  1520. <td class="td-align"><strong>GST
  1521. Amount:</strong></td>
  1522. <td><span id="gst_td">Rs</span></td>
  1523. </tr>
  1524. <tr>
  1525. <td class="td-align"><strong>Deposit
  1526. Amount:</strong></td>
  1527. <td><span id="depositAmount_td">Rs</span>
  1528. </td>
  1529. </tr>
  1530. <tr>
  1531. <td class="td-align"><strong>Total
  1532. Amount:</strong>
  1533. </td>
  1534. <td><span id="totalAmount_td">Rs</span>
  1535. </td>
  1536. </tr>
  1537. </tbody>
  1538. </table>
  1539. </div>
  1540. </div>
  1541. <div class="row">
  1542. <div class="col-md-12 text-center">
  1543. <!-- Center align the button -->
  1544. <button type="button" class="btn btn-primary prev-step"
  1545. style="background-color: #016d6f; color: white;">
  1546. Previous
  1547. </button>
  1548. </div>
  1549. </div>
  1550. <div align="center">
  1551. <label data-toggle="tooltip" data-placement="top"
  1552. title="Click To View">
  1553. <input type="checkbox" id="checkin"
  1554. onchange="togglePaymentButton(this)" />
  1555. <a href="#" id="termsLink">I agree to the Terms and
  1556. Conditions</a>
  1557. </label>
  1558. <button type="button" id="confirmPaymentBtn"
  1559. class="btn btn-success" onclick="paymentStart()"
  1560. disabled>Confirm Payment
  1561. </button>
  1562. <input type="hidden" id="btnSubmit"></input>
  1563. </div>
  1564. </div>
  1565. </div>
  1566. </div>
  1567. </div>
  1568. <!-- Page body end -->
  1569. </div>
  1570. </div>
  1571. <!-- Main-body end -->
  1572. </div>
  1573. </div>
  1574. </div>
  1575. </div>
  1576. </div>
  1577. </div>
  1578. </div>
  1579. <!-- Modal HTML for Bootstrap 5 -->
  1580. <div class="modal fade" id="termsModal" tabindex="-1" aria-labelledby="termsModalLabel" aria-hidden="true">
  1581. <div class="modal-dialog modal-lg">
  1582. <div class="modal-content">
  1583. <div class="modal-header">
  1584. <h5 class="modal-title" id="termsModalLabel">Terms and Conditions</h5>
  1585. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1586. </div>
  1587. <div class="modal-content" style="height: 100vh;">
  1588. <iframe src="media/images/CC Rules & Regulations for Online _Tamil.pdf" width="100%"
  1589. height="600px"></iframe>
  1590. </div>
  1591. <div class="modal-footer">
  1592. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  1593. </div>
  1594. </div>
  1595. </div>
  1596. </div>
  1597. <div th:replace="~{fragments/loginreg :: div}"></div>
  1598. <script th:replace="~{fragments/script :: script}"></script>
  1599. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  1600. <script th:replace="~{fragments/PaymentScript :: script}"></script>
  1601. <script src="https://cdn.jsdelivr.net/npm/compressorjs@latest/dist/compressor.min.js"></script>
  1602. <!-- Payment script end-->
  1603. <script>
  1604. let reasonMaxData = new Map(); // in beginning
  1605. let reasonLabelData = new Map();
  1606. let reasoncode = new Map();
  1607. document.getElementById('termsLink').addEventListener('click', function (event) {
  1608. event.preventDefault();
  1609. $('#termsModal').modal('show');
  1610. });
  1611. function togglePaymentButton(checkbox) {
  1612. document.getElementById('confirmPaymentBtn').disabled = !checkbox.checked;
  1613. }
  1614. const urlParams = new URLSearchParams(window.location.search);
  1615. const hallId = urlParams.get('hallId');
  1616. $(document).ready(function () {
  1617. if (hallId != null) {
  1618. getHallDetails(hallId);
  1619. $("#selecthall").val(hallId);
  1620. }
  1621. });
  1622. var countdown; // Global variable to hold the interval
  1623. var totalTime = 15 * 60; // 15 minutes in seconds
  1624. // var totalTime = 1 * 60; // for testing
  1625. var timerElement = document.getElementById("timerText");
  1626. var confirmPaymentBtn = document.getElementById("confirmPaymentBtn");
  1627. var checkInCheckbox = document.getElementById("checkin");
  1628. var startTime; // Variable to hold the start timestamp
  1629. // Function to format time in MM:SS
  1630. function formatTime(seconds) {
  1631. var minutes = Math.floor(seconds / 60);
  1632. var seconds = seconds % 60;
  1633. return minutes + ":" + (seconds < 10 ? "0" : "") + seconds;
  1634. }
  1635. // Function to start or restart the timer
  1636. function startTimer() {
  1637. if (countdown) {
  1638. clearInterval(countdown); // Clear existing interval if any
  1639. }
  1640. // Record the start time in milliseconds
  1641. startTime = Date.now();
  1642. // Function to update the timer
  1643. function updateTimer() {
  1644. // Calculate the elapsed time in seconds
  1645. var elapsed = Math.floor((Date.now() - startTime) / 1000);
  1646. var timeLeft = totalTime - elapsed;
  1647. if (timeLeft <= 0) {
  1648. clearInterval(countdown);
  1649. confirmPaymentBtn.disabled = true; // Disable the Confirm Payment button when time is up
  1650. checkInCheckbox.disabled = true; // Disable the Check-in checkbox when time is up
  1651. timerElement.innerHTML = "Time expired"; // Optionally update the message
  1652. } else {
  1653. timerElement.innerHTML = "Payment Closes in " + formatTime(timeLeft);
  1654. confirmPaymentBtn.disabled = !checkInCheckbox.checked;
  1655. checkInCheckbox.disabled = false; // Keep checkbox enabled until time is up
  1656. }
  1657. }
  1658. // Display initial time
  1659. timerElement.innerHTML = "Payment Closes in " + formatTime(totalTime);
  1660. // Update the timer every second
  1661. countdown = setInterval(updateTimer, 1000); // 1 second interval
  1662. }
  1663. // Function to reset the timer
  1664. function resetTimer() {
  1665. startTime = Date.now(); // Reset the start time to now
  1666. startTimer();
  1667. }
  1668. var currentStep = 1;
  1669. var updateProgressBar;
  1670. var userId;
  1671. var bookingId;
  1672. let selectedHallName = '';
  1673. let selectedZone = '';
  1674. // Assume userLoggedIn is a variable indicating the user's login status
  1675. function toggleNextButton(step) {
  1676. var nextButton = document.querySelector('.step-' + step + ' .next-step');
  1677. var fields = document.querySelectorAll('.step-' + step + ' [required]');
  1678. var allFieldsFilled = true;
  1679. fields.forEach(function (field) {
  1680. if (!field.value) {
  1681. allFieldsFilled = false;
  1682. }
  1683. });
  1684. if (allFieldsFilled) {
  1685. nextButton.disabled = false; // Enable the button
  1686. } else {
  1687. nextButton.disabled = true; // Disable the buttonn
  1688. }
  1689. }
  1690. // Call the function for Step 1 when the page loads
  1691. document.addEventListener('DOMContentLoaded', function () {
  1692. // toggleNextButton(1);
  1693. toggleNextButton(2);
  1694. toggleNextButton(3);
  1695. });
  1696. document.querySelectorAll('.step-2 [required]').forEach(function (field) {
  1697. field.addEventListener('input', function () {
  1698. toggleNextButton(2);
  1699. });
  1700. });
  1701. document.querySelectorAll('.step-3 [required]').forEach(function (field) {
  1702. field.addEventListener('input', function () {
  1703. toggleNextButton(3);
  1704. });
  1705. });
  1706. function handleSaveAndContinueStep3() {
  1707. if (isLogin) {
  1708. CheckBookingLimitation(function (isAllowed) {
  1709. if (isAllowed) {
  1710. saveBookingDetails();
  1711. }
  1712. });
  1713. } else {
  1714. showAlertForLogin();
  1715. }
  1716. return false;
  1717. }
  1718. // Function to show SweetAlert for login
  1719. function showAlertForLogin() {
  1720. Swal.fire({
  1721. title: 'Mobile Number Not Registered!',
  1722. text: 'Please log in to proceed.',
  1723. icon: 'info',
  1724. showCancelButton: true,
  1725. confirmButtonText: 'Login',
  1726. cancelButtonText: 'Cancel',
  1727. }).then((result) => {
  1728. if (result.isConfirmed) {
  1729. $('#loginModal').modal('show');
  1730. }
  1731. });
  1732. }
  1733. document.querySelector(".step-3 .next-step").addEventListener("click", function () {
  1734. displayStep(3);
  1735. });
  1736. function fetchReasonsAndPopulateDropdown() {
  1737. // Make an AJAX call to fetch all reasons
  1738. $.ajax({
  1739. url: '/communityhall/admin/api/getReasons',
  1740. type: 'GET',
  1741. dataType: 'json'
  1742. })
  1743. .done(function (data) {
  1744. const reasonDropdown = $('#reasonforbooking');
  1745. reasonDropdown.empty();
  1746. reasonDropdown.append($('<option selected value="0"></option>').text('Select a reason'));
  1747. // Populate the dropdown and store reason metadata
  1748. $.each(data, function (index, reason) {
  1749. reasonDropdown.append($('<option></option>').attr('value', reason.reasonId).text(reason.reason));
  1750. reasonMaxData.set(reason.reasonId, reason.maxdays);
  1751. reasonLabelData.set(reason.reasonId, reason.reason);
  1752. reasoncode.set(reason.reasonId, reason.reasoncode);
  1753. });
  1754. // Add change event listener to the dropdown
  1755. reasonDropdown.change(function () {
  1756. const selectedReasonId = $(this).val();
  1757. const selectedReasonCode = reasoncode.get(parseInt(selectedReasonId));
  1758. const selectedHallId = document.getElementById("statichallId").value; // Getting the selected hall ID
  1759. // Make another AJAX call to get hall details based on the selected hall ID
  1760. $.ajax({
  1761. type: 'GET',
  1762. url: '/communityhall/user/api/gethalldetails/' + selectedHallId,
  1763. success: function (response) {
  1764. // console.log(response);
  1765. const isSGE = response.sge; // Fetch SGE status from the response
  1766. const isCGE = response.cge; // Fetch CGE status from the response
  1767. // Check for State Government Event (SGE)
  1768. if (selectedReasonCode === 'SGE' && !isSGE) {
  1769. // Show popup for State govt event
  1770. Swal.fire({
  1771. title: 'Government Event',
  1772. text: 'Shenoy Nagar Community Center (Auditorium) full Mandapam (Amma Arangam) is available for state government events.',
  1773. icon: 'info',
  1774. confirmButtonText: 'OK'
  1775. }).then((result) => {
  1776. if (result.isConfirmed && !isSGE) {
  1777. window.location.href = '/communityhall/hallbookingform';
  1778. }
  1779. });
  1780. }
  1781. // Check for Central Government Event (CGE)
  1782. else if (selectedReasonCode === 'CGE' && !isCGE) {
  1783. // Show popup for Central govt event
  1784. Swal.fire({
  1785. title: 'Government Event',
  1786. text: 'Shenoy Nagar Community Center (Auditorium) full Mandapam (Amma Arangam) is available for central government events.',
  1787. icon: 'info',
  1788. confirmButtonText: 'OK'
  1789. }).then((result) => {
  1790. if (result.isConfirmed && !isCGE) {
  1791. // Redirect only if hallId is not 3
  1792. window.location.href = '/communityhall/hallbookingform';
  1793. }
  1794. });
  1795. }
  1796. },
  1797. error: function (xhr, status, error) {
  1798. console.error('Error fetching hall details:', error);
  1799. }
  1800. });
  1801. });
  1802. })
  1803. .fail(function (xhr, status, error) {
  1804. console.error('Error fetching reasons:', error);
  1805. });
  1806. }
  1807. var ch = 0;
  1808. function saveBookingDetails() {
  1809. //alert("saveBookingDetails call:-"+ch++);
  1810. $("#startPeriodDropdown").prop("disabled", false);
  1811. $("#endPeriodDropdown").prop("disabled", false);
  1812. var form = document.getElementById('booking');
  1813. var formData = new FormData(form);
  1814. // Debugging: Log each FormData entry
  1815. for (var pair of formData.entries()) {
  1816. //console.log(pair[0] + ', ', pair[1]);
  1817. }
  1818. $.ajax({
  1819. url: '/communityhall/user/api/saveTheRequest2',
  1820. type: 'POST',
  1821. data: formData,
  1822. processData: false,
  1823. contentType: false,
  1824. success: function (response) {
  1825. // console.log("response:--" + response.status);
  1826. if (response.status === 'slotOccupied') {
  1827. Swal.fire({
  1828. icon: 'error',
  1829. title: 'Slot Occupied',
  1830. text: 'The selected slot is already occupied. Please choose a different slot.',
  1831. confirmButtonText: 'OK'
  1832. }).then(function () {
  1833. location.reload(); // Example: reload the page
  1834. });
  1835. } else if (response.status === 'pastdate') {
  1836. Swal.fire({
  1837. icon: 'error',
  1838. title: 'Past Date',
  1839. text: 'Start date cannot be in the past',
  1840. confirmButtonText: 'OK'
  1841. }).then(function () {
  1842. location.reload();
  1843. });
  1844. } else if (response.status === 'futuredate') {
  1845. Swal.fire({
  1846. icon: 'error',
  1847. title: 'Future Date',
  1848. text: 'Start date cannot be more than 6 months from today',
  1849. confirmButtonText: 'OK'
  1850. }).then(function () {
  1851. location.reload();
  1852. });
  1853. } else {
  1854. userId = response.userId;
  1855. bookingId = response.bookingId;
  1856. $("#bookingId").val(response.bookingId);
  1857. $("#userId").val(response.userId);
  1858. $("#selecthall_td").html(response.hallName);
  1859. $("#numDaysCount_td").html(response.NoOfDay);
  1860. $("#startDateInput_td").html(response.startDate);
  1861. $("#endDateInput_td").html(response.endDate);
  1862. $("#reasonforbooking_td").html(response.reason);
  1863. $("#hallAmount_td").html(response.hallAmount);
  1864. function getTimeOfDay(slot) {
  1865. if (slot === 1) {
  1866. return "Morning";
  1867. } else if (slot === 2) {
  1868. return "Evening";
  1869. } else {
  1870. return "Invalid slot";
  1871. }
  1872. }
  1873. $("#startingslot_td").html(getTimeOfDay(response.startingSlot) + " to " + getTimeOfDay(response.endingSlot));
  1874. /*$("#gst_td").html(response.gst);
  1875. $("#depositAmount_td").html(response.depositAmount);
  1876. $("#discount_td").html(response.discount + "%");
  1877. $("#actualhallAmount_td").html(response.actualhallamount);
  1878. $("#totalAmount_td").html(response.totalAmount);*/
  1879. $("#name_td").html(response.username);
  1880. $("#mobileno_td").html(response.mobileNo);
  1881. $("#usertype_td").html(response.userType);
  1882. /*if (response.reasoncode === 'SGE') {
  1883. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1884. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1885. $("#additionalcharges_td").html(response.additionalcharges);
  1886. $("#rentamount_td").html(0);
  1887. $("#actualhallAmount_td").html(response.actualhallamount);
  1888. $("#hallAmount_td").html(response.additionalcharges);
  1889. $("#totalAmount_td").html(response.totalAmount);
  1890. } else {
  1891. document.getElementById("additionalcharges").style.display = 'none'; // Hide row
  1892. document.getElementById("additionalcharges_tr").style.display = 'none'; // Hide row
  1893. }*/
  1894. if (response.reasoncode === 'SGE') {
  1895. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1896. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1897. $("#additionalcharges_td").html(response.additionalcharges);
  1898. $("#rentamount_td").html(0);
  1899. $("#actualhallAmount_td").html(response.actualhallamount);
  1900. $("#hallAmount_td").html(response.additionalcharges);
  1901. $("#totalAmount_td").html(response.totalAmount);
  1902. $("#hallAmount_td").html(response.hallAmount);
  1903. $("#gst_td").html(response.gst);
  1904. $("#depositAmount_td").html(response.depositAmount);
  1905. $("#discount_td").html(response.discount + "%");
  1906. } else if (response.reasoncode === 'CGE') {
  1907. document.getElementById("additionalcharges").style.display = 'table-row'; // Show row
  1908. document.getElementById("additionalcharges_tr").style.display = 'table-row'
  1909. $("#additionalcharges_td").html(response.additionalcharges);
  1910. $("#hallAmount_td").html(response.hallAmount)
  1911. $("#rentamount_td").html(response.rentAmount);
  1912. $("#actualhallAmount_td").html(response.actualhallamount);
  1913. $("#hallAmount_td").html(response.netAmount);
  1914. $("#gst_td").html(response.gstAmount);
  1915. $("#depositAmount_td").html(response.depositAmount);
  1916. $("#discount_td").html(response.discount + "%");
  1917. $("#totalAmount_td").html(response.totalAmount);
  1918. } else {
  1919. document.getElementById("additionalcharges").style.display = 'none'; // Hide row
  1920. document.getElementById("additionalcharges_tr").style.display = 'none'; // Hide row
  1921. $("#gst_td").html(response.gst);
  1922. $("#depositAmount_td").html(response.depositAmount);
  1923. $("#discount_td").html(response.discount + "%");
  1924. $("#actualhallAmount_td").html(response.actualhallamount);
  1925. $("#totalAmount_td").html(response.totalAmount);
  1926. }
  1927. displayDocumentDetails(response.uploadedDocs);
  1928. resetTimer();
  1929. }
  1930. },
  1931. error: function (xhr, status, error) {
  1932. console.error('Error fetching hall names:', error);
  1933. }
  1934. });
  1935. $("#startPeriodDropdown").prop("disabled", true);
  1936. $("#endPeriodDropdown").prop("disabled", true);
  1937. }
  1938. function displayDocumentDetails(uploadedDocs) {
  1939. const uploadedDocsList = $("#uploadedDocsList");
  1940. uploadedDocsList.empty(); // Clear existing items
  1941. uploadedDocs.forEach(function (doc) {
  1942. const listItem = $('<li>');
  1943. const thumbnail = $('<img>').addClass('thumbnail-img');
  1944. // Function to truncate the document name
  1945. function truncateName(name, maxLength) {
  1946. if (name.length <= maxLength) {
  1947. return name;
  1948. }
  1949. const extIndex = name.lastIndexOf('.');
  1950. const ext = name.substring(extIndex);
  1951. const truncatedName = name.substring(0, maxLength - ext.length - 3) + '...' + ext;
  1952. return truncatedName;
  1953. }
  1954. const truncatedName = truncateName(doc.documentName, 10); // Adjust the maxLength as needed
  1955. if (doc.bookingDocUrl.endsWith('.pdf')) {
  1956. // Set the thumbnail to a default image for PDFs
  1957. const defaultPdfThumbnail = 'media/images/pdf.jpg'; // Replace with your default thumbnail image path
  1958. thumbnail.attr('src', defaultPdfThumbnail);
  1959. listItem.append(thumbnail).append(' ' + truncatedName);
  1960. thumbnail.on('click', function () {
  1961. // Create an iframe to display the PDF
  1962. const pdfViewer = $('<iframe>').attr({
  1963. src: doc.bookingDocUrl,
  1964. width: '100%',
  1965. height: '600px' // Adjust as needed
  1966. });
  1967. // Hide the image and show the PDF viewer
  1968. $('#largeImage').hide();
  1969. $('#largeImageContainer').find('iframe').remove();
  1970. $('#largeImageContainer').append(pdfViewer);
  1971. $('#largeImageContainer').show();
  1972. });
  1973. } else {
  1974. // For other document types, show the actual image as thumbnail
  1975. thumbnail.attr('src', doc.bookingDocUrl);
  1976. listItem.append(thumbnail).append(' ' + truncatedName);
  1977. thumbnail.on('click', function () {
  1978. $('#largeImageContainer iframe').remove();
  1979. $('#largeImage').attr('src', doc.bookingDocUrl).show();
  1980. $('#largeImageContainer').show();
  1981. });
  1982. }
  1983. uploadedDocsList.append(listItem);
  1984. });
  1985. }
  1986. $("#closeButton").on('click', function () {
  1987. $('#largeImageContainer').hide(); // Hide the large image container
  1988. $('#largeImage').attr('src', '').hide(); // Reset and hide image
  1989. $('#largeImageContainer iframe').remove(); // Remove iframe if present
  1990. });
  1991. function fetchReasonDocumentDetails(reasonId) {
  1992. $('#reasonMaxDates').val(reasonMaxData.get(reasonId));
  1993. $('#showReasonLabel').val(reasonLabelData.get(reasonId));
  1994. $.ajax({
  1995. url: '/communityhall/admin/api/getReasonDocumentDetails',
  1996. type: 'GET',
  1997. dataType: 'json',
  1998. data: { reasonId: reasonId }
  1999. })
  2000. .done(function (data) {
  2001. validateForm();
  2002. const reasonFieldsContainer = $('#reasonFieldsContainer');
  2003. reasonFieldsContainer.empty();
  2004. const rowDiv = $('<div class="row"></div>');
  2005. $.each(data, function (index, detail) {
  2006. if (detail.addTextField === true) {
  2007. const fieldDiv = $('<div class="col-sm-4 form-group"></div>');
  2008. const label = $('<label>' + detail.fieldName + ' *</label>');
  2009. const input = $('<input type="text" class="form-control" name="' + detail.fieldName + '" required>');
  2010. // Add event listener for input validation
  2011. input.on('input', function () {
  2012. // Replace any non-letter characters with an empty string
  2013. //this.value = this.value.replace(/[^a-zA-Z]/g, '');
  2014. });
  2015. fieldDiv.append(label);
  2016. fieldDiv.append(input);
  2017. rowDiv.append(fieldDiv);
  2018. }
  2019. if (detail.addDocumentField === true) {
  2020. const fieldDiv2 = $('<div class="col-sm-4 form-group"></div>');
  2021. const fileInput = $('<input type="file" class="form-control file-upload-field" id="upload" name="' + detail.docFieldName + '" required accept=".jpg, .jpeg, .pdf">');
  2022. fieldDiv2.append('<label>' + detail.docFieldName + '*</label>').append(fileInput);
  2023. rowDiv.append(fieldDiv2);
  2024. }
  2025. });
  2026. reasonFieldsContainer.append(rowDiv);
  2027. })
  2028. .fail(function (xhr, status, error) {
  2029. console.error('Error fetching reason document details:', error);
  2030. });
  2031. }
  2032. // Call the function to fetch reasons and populate the dropdown when the document is ready
  2033. $(document).ready(function () {
  2034. fetchReasonsAndPopulateDropdown();
  2035. $('#reasonforbooking').change(function () {
  2036. const selectedReasonId = parseInt($(this).val()); // Convert the value to an integer
  2037. fetchReasonDocumentDetails(selectedReasonId);
  2038. });
  2039. });
  2040. // Function to toggle hall details container and fetch hall details
  2041. function toggleHallDetailsContainer() {
  2042. var selectBox = document.getElementById("selecthall");
  2043. var selectedValue = selectBox.options[selectBox.selectedIndex].value;
  2044. var hallDetailsContainer = document.getElementById("hallDetailsContainer");
  2045. if (selectedValue !== "") {
  2046. hallDetailsContainer.style.display = "block"; // Show hall details container if a hall is selected
  2047. // Get the selected hall ID
  2048. var hallId = selectBox.options[selectBox.selectedIndex].value;
  2049. getHallDetails(hallId); // Fetch hall details
  2050. // Other code for displaying selected details
  2051. } else {
  2052. hallDetailsContainer.style.display = "none"; // Hide hall details container if no hall is selected
  2053. // Clear the selected details in Step 2 and Step 3
  2054. $('#hallNameDisplayStep2').text('');
  2055. $('#hallNameDisplayStep3').text('');
  2056. $('#zoneStep2').text('');
  2057. $('#zoneStep3').text('');
  2058. $('#divisionStep2').text('');
  2059. $('#divisionStep3').text('');
  2060. // Clear other details if needed
  2061. }
  2062. }
  2063. function togglePaymentButton(checkbox) {
  2064. var confirmPaymentBtn = document.getElementById('confirmPaymentBtn');
  2065. confirmPaymentBtn.disabled = !checkbox.checked;
  2066. }
  2067. // Update the displayStep function to pass hallName to Step 4
  2068. function displayStep(stepNumber) {
  2069. if (stepNumber >= 1 && stepNumber <= 4) {
  2070. if (validateStep(currentStep)) {
  2071. $(".step-" + currentStep).hide();
  2072. $(".step-" + stepNumber).show();
  2073. currentStep = stepNumber;
  2074. updateProgressBar();
  2075. // Populate hallName, zone, and division in Step 2 and Step 3
  2076. if (stepNumber === 2 || stepNumber === 3) {
  2077. $('#hallNameDisplayStep2').text(selectedHallName);
  2078. $('#hallNameDisplayStep3').text(selectedHallName);
  2079. $('#zoneStep2').text(zone);
  2080. $('#zoneStep3').text(zone);
  2081. $('#divisionStep2').text('');
  2082. $('#divisionStep3').text('');
  2083. $('#selecthall_td').text(selectedHallName);
  2084. }
  2085. // Handle displaying the SweetAlert in Step 3
  2086. } else {
  2087. //alert("Please fill in all required fields before proceeding.");
  2088. }
  2089. }
  2090. }
  2091. function validateStep(stepNumber) {
  2092. }
  2093. $(document).ready(function () {
  2094. $('.step').hide();
  2095. $('.step-1').show();
  2096. var currentStep = 1; // Assuming you have this variable defined somewhere in your code
  2097. // Function to validate step 3
  2098. function validateStep3() {
  2099. let isValid = true;
  2100. let selectedReason = $('#reasonforbooking').val();
  2101. // Check if a reason is selected
  2102. if (!selectedReason) {
  2103. isValid = false;
  2104. } else {
  2105. // Iterate through each input associated with the selected reason
  2106. $(`#reasonFieldsContainer .${selectedReason} input[type="text"], #reasonFieldsContainer .${selectedReason} input[type="file"]`).each(function () {
  2107. if ($(this).prop('required') && !$(this).val()) {
  2108. isValid = false;
  2109. return false; // Exit the loop early if any required field is empty
  2110. }
  2111. });
  2112. }
  2113. // Enable/disable the next button based on validation
  2114. $('.next-step').prop('disabled', !isValid);
  2115. }
  2116. // Event listener for reason dropdown change
  2117. $('#reasonforbooking').change(function () {
  2118. let selectedReason = $(this).val();
  2119. $("#startDateInput").val('');
  2120. $("#endDateInput").val(0);
  2121. $("#startPeriodDropdown").val(0).prop("disabled", false);
  2122. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2123. $("#numDaysCount").val('');
  2124. $("#numDaysCountDisplay").val('');
  2125. $('#summary').html('');
  2126. // Show/hide fields based on selected reason
  2127. $('#reasonFieldsContainer').children().hide();
  2128. if (selectedReason) {
  2129. $(`#reasonFieldsContainer .${selectedReason}`).show();
  2130. }
  2131. // Validate the fields for the selected reason
  2132. validateStep3();
  2133. });
  2134. // Event listener for input changes within reason fields in Step 3
  2135. $('#reasonFieldsContainer').on('change', 'input, select', function () {
  2136. validateStep3();
  2137. });
  2138. $(".next-step").click(function () {
  2139. var valid = true;
  2140. // Validate all required text inputs and file fields in Step 3
  2141. if (currentStep === 3) {
  2142. $('.step-3 input[required], .step-3 select[required]').each(function () {
  2143. if ($(this).val() === '') {
  2144. $(this).addClass('error'); // Add error class
  2145. valid = false;
  2146. return false; // Break the loop
  2147. } else {
  2148. $(this).removeClass('error'); // Remove error class if valid
  2149. }
  2150. });
  2151. $('.step-3 input[type="file"][required]').each(function () {
  2152. if ($(this)[0].files.length === 0) {
  2153. $(this).addClass('error'); // Add error class
  2154. valid = false;
  2155. return false; // Break the loop
  2156. } else {
  2157. $(this).removeClass('error'); // Remove error class if valid
  2158. }
  2159. });
  2160. }
  2161. if (!valid) {
  2162. return; // Stop if validation fails
  2163. }
  2164. if (currentStep < 4) {
  2165. $(".step-" + currentStep).fadeOut(500, function () {
  2166. if (currentStep === 3 && isLogin === false) {
  2167. $(".step-" + currentStep).fadeIn(500);
  2168. updateProgressBar();
  2169. return "";
  2170. } else {
  2171. currentStep++;
  2172. $(".step-" + currentStep).fadeIn(500);
  2173. updateProgressBar();
  2174. }
  2175. });
  2176. }
  2177. });
  2178. $(".prev-step").click(function () {
  2179. $('#bookandcontinue').prop('disabled', false);
  2180. if (currentStep > 1) {
  2181. $(".step-" + currentStep).fadeOut(500, function () {
  2182. currentStep--;
  2183. $(".step-" + currentStep).fadeIn(500);
  2184. updateProgressBar();
  2185. clearInterval(countdown);
  2186. });
  2187. }
  2188. });
  2189. $("#bookandcontinue").click(function () {
  2190. $('#startDateInput').val('');
  2191. $('#endDateInput').prop('disabled', true).val('0');
  2192. $('#startPeriodDropdown').val('0');
  2193. $('#endPeriodDropdown').val('0');
  2194. $('#numDaysCount').val(''); // Reset the number of days input
  2195. $('#numDaysCountDisplay').val('');
  2196. $('#summary').html('');
  2197. $('#relation').val('0');
  2198. $('#reasonforbooking').val(0);
  2199. });
  2200. $(".step-2 .reset-step").click(function () {
  2201. $('.step-2 input[type="text"], .step-2 select').val(function () {
  2202. return this.defaultValue;
  2203. });
  2204. $('.step-2 input[type="checkbox"], .step-2 input[type="radio"]').prop('checked', false);
  2205. $('#endDateInput').prop('disabled', true).val('0');
  2206. $('#startPeriodDropdown').val('0');
  2207. $('#endPeriodDropdown').val('0');
  2208. $('#numDaysCount').val(''); // Reset the number of days input
  2209. $('#numDaysCountDisplay').val('');
  2210. $('#summary').html('');
  2211. $('#relation').val('0');
  2212. $('#reasonforbooking').val(0);
  2213. $('.step-2 .error-message').hide();
  2214. toggleNextButton(2); // Ensure button state reflects field values after reset
  2215. });
  2216. $(".step-3 .reset-step").click(function () {
  2217. // Reset all input fields and select elements to their default values
  2218. $('.step-3 input[type="text"]:not(#showReasonLabel), .step-3 input[type="file"]').val(function () {
  2219. return this.defaultValue;
  2220. });
  2221. //$('.step-3 .error-message').hide();
  2222. //$('.step-3 .form-control').parent().hide();
  2223. //$('#reasonforbooking').parent().show();
  2224. validateStep3();
  2225. });
  2226. $(".step-2 .next-step").click(function () {
  2227. var reasonforbooking = $("#reasonforbooking").val();
  2228. if (reasonforbooking !== "0") {
  2229. $(".step-3 .next-step").prop("disabled", false);
  2230. } else {
  2231. $(".step-3 .next-step").prop("disabled", true);
  2232. }
  2233. ;
  2234. var relationship = $("#relation").val();
  2235. if (relationship !== "0") {
  2236. $(".step-2 .next-step").prop("disabled", false);
  2237. } else {
  2238. $(".step-2 .next-step").prop("disabled", true);
  2239. }
  2240. ;
  2241. });
  2242. $(".cancel-step").click(function () {
  2243. // Redirect to the cancel page or handle cancellation logic here
  2244. window.location.href = "/dashboard";
  2245. });
  2246. updateProgressBar = function () {
  2247. var progressPercentage = ((currentStep - 1) / 3) * 100;
  2248. $(".progress-bar").css("width", progressPercentage + "%");
  2249. };
  2250. // State variable to track compression status
  2251. let isCompressing = false;
  2252. // Attach the validation function to file input change event
  2253. $(document).on('change', '.file-upload-field', function () {
  2254. validateFile(this);
  2255. });
  2256. function validateFile(fileInput) {
  2257. const allowedExtensions = /(\.jpg|\.jpeg|\.pdf)$/i;
  2258. const file = fileInput.files[0];
  2259. const filePath = fileInput.value;
  2260. let errorMessage = '';
  2261. // Clear any previous error message
  2262. clearError(fileInput);
  2263. // Check for duplicate files
  2264. if (isDuplicateFile(file.name, fileInput)) {
  2265. errorMessage = 'This file has already been selected. Please choose a different file.';
  2266. fileInput.value = ''; // Clear the file input
  2267. displayError(fileInput, errorMessage);
  2268. return;
  2269. }
  2270. // Validate file type
  2271. if (!allowedExtensions.exec(filePath)) {
  2272. errorMessage = 'Only JPG, JPEG, and PDF files are allowed.';
  2273. fileInput.value = ''; // Clear the file input
  2274. displayError(fileInput, errorMessage);
  2275. }
  2276. // Handle image files separately
  2277. else if (/(\.jpg|\.jpeg)$/i.test(filePath) && file.size > 2097152) {
  2278. compressImage(file).then(compressedFile => {
  2279. const dataTransfer = new DataTransfer();
  2280. dataTransfer.items.add(compressedFile);
  2281. fileInput.files = dataTransfer.files;
  2282. // Validate file size after compression
  2283. validateFileSize(fileInput);
  2284. }).catch(error => {
  2285. errorMessage = 'Error compressing image.';
  2286. displayError(fileInput, errorMessage);
  2287. });
  2288. }
  2289. // Directly validate PDF file size
  2290. else if (/(\.pdf)$/i.test(filePath) && file.size > 2097152) {
  2291. errorMessage = 'PDF file size exceeds the 2MB limit.';
  2292. fileInput.value = ''; // Clear the file input
  2293. displayError(fileInput, errorMessage);
  2294. } else {
  2295. // console.log('File size is within limit:', file.size, 'bytes');
  2296. clearError(fileInput);
  2297. }
  2298. }
  2299. function isDuplicateFile(fileName, currentInput) {
  2300. const fileInputs = document.querySelectorAll('.file-upload-field');
  2301. for (let input of fileInputs) {
  2302. if (input !== currentInput && input.files.length > 0 && input.files[0].name === fileName) {
  2303. return true;
  2304. }
  2305. }
  2306. return false;
  2307. }
  2308. function clearError(fileInput) {
  2309. const errorElements = fileInput.parentNode.getElementsByClassName('error-message');
  2310. while (errorElements.length > 0) {
  2311. errorElements[0].remove();
  2312. }
  2313. }
  2314. // Function to compress image using canvas
  2315. function compressImage(file) {
  2316. return new Promise((resolve, reject) => {
  2317. const reader = new FileReader();
  2318. reader.onload = function (event) {
  2319. const img = new Image();
  2320. img.onload = function () {
  2321. const canvas = document.createElement('canvas');
  2322. const ctx = canvas.getContext('2d');
  2323. const maxSize = 2097152; // 2MB in bytes
  2324. let scale = 1;
  2325. if (file.size > maxSize) {
  2326. scale = Math.sqrt(maxSize / file.size);
  2327. }
  2328. canvas.width = img.width * scale;
  2329. canvas.height = img.height * scale;
  2330. ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
  2331. // Convert canvas content to blob
  2332. canvas.toBlob(blob => {
  2333. resolve(new File([blob], file.name, {
  2334. type: 'image/jpeg',
  2335. lastModified: Date.now()
  2336. }));
  2337. }, 'image/jpeg', 0.7); // Adjust JPEG quality as needed (0.7 is 70% quality)
  2338. };
  2339. img.src = event.target.result;
  2340. };
  2341. reader.readAsDataURL(file);
  2342. });
  2343. }
  2344. // Function to validate file size after compression
  2345. function validateFileSize(fileInput) {
  2346. const file = fileInput.files[0];
  2347. if (file && file.size > 2097152) {
  2348. //console.log('File size is still greater than 2MB after compression.');
  2349. // Handle the situation where the file size is still greater than 2MB
  2350. displayError(fileInput, 'File size is still greater than 2MB after compression.');
  2351. fileInput.value = ''; // Clear the file input
  2352. } else {
  2353. //console.log('File size is within limit after compression.');
  2354. // Handle the situation where the file size is within the limit
  2355. }
  2356. }
  2357. // Function to display error messages
  2358. function displayError(fileInput, errorMessage) {
  2359. // Example implementation: show error message near the file input
  2360. let errorContainer = fileInput.nextElementSibling;
  2361. if (!errorContainer || !errorContainer.classList.contains('error-message')) {
  2362. errorContainer = document.createElement('div');
  2363. errorContainer.classList.add('error-message');
  2364. fileInput.parentNode.insertBefore(errorContainer, fileInput.nextSibling);
  2365. }
  2366. errorContainer.textContent = errorMessage;
  2367. }
  2368. // Initial validation check for step 3
  2369. validateStep3();
  2370. // Log statement to ensure the button is being enabled
  2371. //console.log("Enabling the button...");
  2372. $('.step-1 .next-step').prop('disabled', false);
  2373. });
  2374. var index = 0;
  2375. var hall;
  2376. $(function () {
  2377. $("#selecthall").select2();
  2378. });
  2379. $.ajax({
  2380. type: 'GET',
  2381. url: '/communityhall/user/api/gethallnames',
  2382. success: function (response) {
  2383. // Populate the dropdown options with the received hall names
  2384. var selectHallDropdown = $('#selecthall');
  2385. $.each(response, function (index, hall) {
  2386. if (hallId == hall.hallId) {
  2387. selectHallDropdown.append($('<option></option>').attr('value', hall.hallId).text(hall.hallName));
  2388. selectHallDropdown.find('option[value="' + hall.hallId + '"]').prop('selected', true);
  2389. } else {
  2390. selectHallDropdown.append($('<option></option>').attr('value', hall.hallId).text(hall.hallName));
  2391. }
  2392. });
  2393. },
  2394. error: function (xhr, status, error) {
  2395. console.error('Error fetching hall names:', error);
  2396. }
  2397. });
  2398. $(document).ready(function () {
  2399. $('#selecthall').change(function () {
  2400. var selectedHallId = $(this).val();
  2401. // Call the getHallDetails function with the selected hall ID
  2402. getHallDetails(selectedHallId);
  2403. });
  2404. });
  2405. // Function to retrieve hall details based on hallId
  2406. function getHallDetails(hallId) {
  2407. $.ajax({
  2408. type: 'GET',
  2409. url: '/communityhall/user/api/gethalldetails/' + hallId,
  2410. success: function (response) {
  2411. // console.log(response);
  2412. // Display the container
  2413. $('#hallDetailsContainer').show();
  2414. // Set hall details
  2415. $('#zone').html('<strong>' + response.zone + '</strong>&nbsp;&nbsp;&nbsp;&nbsp; Division: <strong>' + response.division + '</strong>');
  2416. $('#address').html('<strong>' + response.doorNo + ', ' + response.street + ', ' + response.area + ', ' + response.city + ', ' + response.pinCode + '</strong>');
  2417. $('#landmark').html('<strong>' + response.landMark + '</strong>');
  2418. $('#seatingCapacity').html('<strong>' + response.seatingCapacity + '</strong>');
  2419. var parkingCapacity = response.parkingCapacity;
  2420. var parkingAvailability = parkingCapacity > 0 ? "Yes" : "No";
  2421. $('#parkingCapacity').html('<strong>' + parkingAvailability + '</strong>');
  2422. $('#caretakerNumber').html('<strong>' + response.hallInchargeMobno + '</strong>');
  2423. $('#rentAmount').html('<strong>' + response.depositAmount + '</strong>');
  2424. $('#gst').html('<strong>' + response.gst + '</strong>');
  2425. $('#fullDayAmount').html('<strong>' + response.fullDayRent + '</strong>');
  2426. $('#halfrentAmount').html('<strong>' + response.halfDepositAmount + '</strong>');
  2427. $('#halfDayAmount').html('<strong>' + response.halfDayRent + '</strong>');
  2428. $('#ebunit').html('<strong>' + response.ebCostPerUnit + '</strong>');
  2429. $('#statichallId').val(response.hallId);
  2430. // Set hall images
  2431. var carouselInner = $('#hallImagesCarousel .carousel-inner');
  2432. carouselInner.empty(); // Clear existing images
  2433. $.each(response.hallImagesList, function (index, image) {
  2434. var itemClass = (index === 0) ? 'carousel-item active' : 'carousel-item';
  2435. var img = $('<img>').addClass('d-block w-100').attr('src', image.hallImage).attr('alt', 'Hall Image');
  2436. var carouselItem = $('<div>').addClass(itemClass).append(img);
  2437. carouselInner.append(carouselItem);
  2438. });
  2439. // Clear existing floor details to prevent duplicates
  2440. $('#hallareainsqft').empty();
  2441. // Use a Set to store unique floor details
  2442. var uniqueFloorDetails = new Set();
  2443. $.each(response.floorDetailsList, function (index, hallarea) {
  2444. // Construct the text for each floor's details
  2445. var floorDetailText = hallarea.floor + " - " + hallarea.hallarea + " Sq.ft ,";
  2446. // Add to the Set if it's not a duplicate
  2447. if (!uniqueFloorDetails.has(floorDetailText)) {
  2448. uniqueFloorDetails.add(floorDetailText);
  2449. // Append the floor details to the target element
  2450. $('#hallareainsqft').append('<strong>' + floorDetailText + '</strong>');
  2451. }
  2452. });
  2453. // Initialize ViewerJS on the carousel after images are loaded
  2454. initializeViewerJS();
  2455. getBookingCalendar(hallId);
  2456. // Set hall details in Step 2 and Step 3
  2457. $('#hallNameDisplayStep2').text(response.hallName);
  2458. $('#hallNameDisplayStep3').text(response.hallName);
  2459. $('#zoneStep2').text(response.zone);
  2460. $('#zoneStep3').text(response.zone);
  2461. $('#divisionStep2').text(response.division);
  2462. $('#divisionStep3').text(response.division);
  2463. },
  2464. error: function (xhr, status, error) {
  2465. console.error('Error fetching hall details:', error);
  2466. }
  2467. });
  2468. }
  2469. function initializeViewerJS() {
  2470. // Ensure ViewerJS initialization after images are added to the DOM
  2471. var carouselInner = document.querySelector('#hallImagesCarousel .carousel-inner');
  2472. var floordetails = document.querySelector('#hallareainsqft');
  2473. // Destroy existing viewer instance if it exists
  2474. if (carouselInner.viewer) {
  2475. carouselInner.viewer.destroy();
  2476. }
  2477. if (floordetails.viewer) {
  2478. floordetails.viewer.destroy();
  2479. }
  2480. // Initialize ViewerJS
  2481. var viewer = new Viewer(carouselInner, {
  2482. inline: false,
  2483. viewed: function () {
  2484. viewer.zoomTo(0.5); // Adjust the zoom level here
  2485. },
  2486. toolbar: {
  2487. zoomIn: 4,
  2488. zoomOut: 4,
  2489. oneToOne: 4,
  2490. reset: 4,
  2491. prev: 4,
  2492. play: {
  2493. show: 4,
  2494. size: 'large',
  2495. },
  2496. next: 4,
  2497. rotateLeft: 4,
  2498. rotateRight: 4,
  2499. flipHorizontal: 4,
  2500. flipVertical: 4,
  2501. },
  2502. });
  2503. carouselInner.viewer = viewer;
  2504. }
  2505. function showBookingDetails() {
  2506. var bookingDetailsDiv = document.getElementById('bookingdetails');
  2507. // Toggle the display property (show/hide)
  2508. if (bookingDetailsDiv.style.display === 'none') {
  2509. bookingDetailsDiv.style.display = 'block';
  2510. } else {
  2511. bookingDetailsDiv.style.display = 'none';
  2512. }
  2513. }
  2514. function previewImage(event) {
  2515. const userphoto = event.target;
  2516. const preview = document.getElementById('preview');
  2517. const reader = new FileReader();
  2518. reader.onload = function () {
  2519. preview.src = reader.result;
  2520. };
  2521. reader.readAsDataURL(userphoto.files[0]);
  2522. }
  2523. function getBookingCalendar(hall_id) {
  2524. // Make an AJAX call to fetch booking data
  2525. $.ajax({
  2526. type: 'GET',
  2527. url: '/communityhall/user/api/getPastData',
  2528. data: {
  2529. hall_id: hall_id
  2530. },
  2531. success: function (response) {
  2532. window.bookingResponse = {};
  2533. if (response && Array.isArray(response)) {
  2534. $("#startDateInput").datepicker("destroy");
  2535. for (var i = 0; i < response.length; i++) {
  2536. var dateString = datepickerFormat(response[i].bdate);
  2537. window.bookingResponse[dateString] = [response[i].morningSlot, response[i].eveningSlot, response[i].is_blocked];
  2538. }
  2539. initializeDatepickerWithColors(hall_id);
  2540. if (response.length == 0) {
  2541. initializeDatepickerWithColors(hall_id);
  2542. }
  2543. } else {
  2544. console.error('Invalid or empty response data.');
  2545. }
  2546. },
  2547. error: function (xhr, status, error) {
  2548. console.error('Error fetching hall details:', error);
  2549. }
  2550. });
  2551. }
  2552. // Function to update the end date and slot availability
  2553. function updateEndDate() {
  2554. var startDate = new Date(document.getElementById("startDateInput").value);
  2555. var formatStartDate = formatDate(startDate);
  2556. var endDateInput = document.getElementById("endDateInput");
  2557. endDateInput.innerHTML = '<option value="0">Select</option>';
  2558. endDateInput.disabled = true;
  2559. var maxdays = $('#reasonMaxDates').val();
  2560. // alert("maxdays:--- "+maxdays);
  2561. // Add options for next 7 days from the selected start date
  2562. for (var i = 0; i < maxdays; i++) {
  2563. var date = new Date(startDate);
  2564. date.setDate(startDate.getDate() + i);
  2565. var formattedDate = formatDate(date);
  2566. if (isNaN(date.getTime())) {
  2567. console.error("Invalid date:", date);
  2568. continue;
  2569. }
  2570. var bookingStatus = window.bookingResponse[formattedDate];
  2571. if (bookingStatus) {
  2572. if (bookingStatus[0] && bookingStatus[1]) {
  2573. //alert("slot fulled");
  2574. break;
  2575. } else if (bookingStatus[0]) {
  2576. if (formatStartDate == formattedDate) {
  2577. var option = document.createElement('option');
  2578. option.value = formattedDate;
  2579. option.text = formattedDate;
  2580. endDateInput.appendChild(option);
  2581. } else {
  2582. break;
  2583. }
  2584. } else if (bookingStatus[1]) {
  2585. var option = document.createElement('option');
  2586. option.value = formattedDate;
  2587. option.text = formattedDate;
  2588. endDateInput.appendChild(option);
  2589. break;
  2590. } else {
  2591. var option = document.createElement('option');
  2592. option.value = formattedDate;
  2593. option.text = formattedDate;
  2594. endDateInput.appendChild(option);
  2595. }
  2596. } else {
  2597. var option = document.createElement('option');
  2598. option.value = formattedDate;
  2599. option.text = formattedDate;
  2600. endDateInput.appendChild(option);
  2601. }
  2602. }
  2603. endDateInput.disabled = false;
  2604. }
  2605. // Utility function to format date as yyyy-mm-dd
  2606. function formatDate(date) {
  2607. var year = date.getFullYear();
  2608. var month = ("0" + (date.getMonth() + 1)).slice(-2);
  2609. var day = ("0" + date.getDate()).slice(-2);
  2610. return year + "-" + month + "-" + day;
  2611. }
  2612. // Function to calculate number of days based on start and end dates
  2613. // Function to calculate number of days based on start and end dates
  2614. function calculateNumDays() {
  2615. var startDateStr = document.getElementById("startDateInput").value;
  2616. var endDateStr = document.getElementById("endDateInput").value;
  2617. // Parse dates
  2618. var startDate = new Date(startDateStr);
  2619. var endDate = new Date(endDateStr);
  2620. // Check if dates are valid
  2621. if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {
  2622. console.error("Invalid date format.");
  2623. return;
  2624. }
  2625. // Calculate the difference in days
  2626. var timeDiff = endDate.getTime() - startDate.getTime();
  2627. var numDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
  2628. // Adjust numDays to handle same-day selection
  2629. if (numDays === 0) {
  2630. numDays = 1; // Default to 1 day for same-day booking
  2631. } else if (numDays < 0) {
  2632. numDays = 0; // Handle case where end date is before start date
  2633. } else {
  2634. numDays += 1; // Add one day to include both start and end days
  2635. }
  2636. // Cap numDays between 1 and 7
  2637. numDays = Math.min(Math.max(numDays, 1), 7);
  2638. document.getElementById("numDaysCount").value = numDays;
  2639. // Recalculate days after slots if both dates are selected
  2640. if (startDateStr && endDateStr) {
  2641. calculatenoofdaysafterslots();
  2642. }
  2643. }
  2644. function getEndPeriodValue() {
  2645. const endPeriodDropdown = document.getElementById("endPeriodDropdown");
  2646. return endPeriodDropdown.disabled ? endPeriodDropdown.getAttribute("data-value") : endPeriodDropdown.value;
  2647. }
  2648. function setEndPeriodDataValue() {
  2649. const endPeriodDropdown = document.getElementById("endPeriodDropdown");
  2650. if (endPeriodDropdown.disabled) {
  2651. endPeriodDropdown.setAttribute("data-value", endPeriodDropdown.value);
  2652. }
  2653. }
  2654. function calculatenoofdaysafterslots() {
  2655. const startDateStr = document.getElementById("startDateInput").value;
  2656. const endDateStr = document.getElementById("endDateInput").value;
  2657. const startPeriod = parseInt(document.getElementById("startPeriodDropdown").value);
  2658. const endPeriod = parseInt(getEndPeriodValue()); // Use getEndPeriodValue here
  2659. const periodText = {
  2660. 0: { text: "select", time: "" },
  2661. 1: { text: "Morning", time: "6:00 AM" },
  2662. 2: { text: "Afternoon", time: "2:00 PM" }
  2663. };
  2664. const endPeriodText = {
  2665. 0: { text: "select", time: "" },
  2666. 1: { text: "Afternoon", time: "2:00 PM" },
  2667. 2: { text: "Evening", time: "10:00 PM" }
  2668. };
  2669. const startDate = new Date(startDateStr);
  2670. const endDate = new Date(endDateStr);
  2671. const timeDiff = endDate.getTime() - startDate.getTime();
  2672. let numDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
  2673. if (numDays === 0 && startDate.toDateString() === endDate.toDateString()) {
  2674. if (startPeriod === 1 && endPeriod === 1) {
  2675. numDays = 0.5; // Morning to morning is half day
  2676. } else if (startPeriod === 2 && endPeriod === 2) {
  2677. numDays = 0.5; // Evening to evening is half day
  2678. } else if (startPeriod === 1 && endPeriod === 2) {
  2679. numDays = 1; // Morning to evening is one full day
  2680. } else {
  2681. numDays = 1; // Default to one full day for any other case
  2682. }
  2683. } else {
  2684. if (startPeriod === 1 && endPeriod === 1) {
  2685. numDays += 0.5; // Morning to morning adds half a day
  2686. } else if (startPeriod === 2 && endPeriod === 2) {
  2687. numDays += 0.5; // Evening to evening adds half a day
  2688. } else if (startPeriod === 1 && endPeriod === 2) {
  2689. numDays += 1; // Morning to evening adds one full day
  2690. } else if (startPeriod === 2 && endPeriod === 1) {
  2691. // If the period spans over two days, evening to morning should be counted as one full day
  2692. numDays -= 0;
  2693. } else {
  2694. numDays += 1; // Default case for any other scenario
  2695. }
  2696. }
  2697. //else if (startPeriod === "2" && endPeriod === "2") {
  2698. // amount = fullDayAmount * (numDays - 1) + halfDayAmount;
  2699. //}
  2700. numDays = Math.min(Math.max(numDays, 0), 7);
  2701. const startPeriodText = periodText[startPeriod].text + " (" + periodText[startPeriod].time + ")";
  2702. const endPeriodFullText = endPeriodText[endPeriod].text + " (" + endPeriodText[endPeriod].time + ")";
  2703. const numDaysText = `${startDateStr} (${startPeriodText}) to ${endDateStr} (${endPeriodFullText})`;
  2704. document.getElementById("numDaysCountDisplay").value = numDaysText;
  2705. document.getElementById("numDaysCount").value = numDays;
  2706. }
  2707. function showSummary() {
  2708. const startDate = new Date(document.getElementById("startDateInput").value);
  2709. const endDate = new Date(document.getElementById("endDateInput").value);
  2710. const startPeriod = document.getElementById("startPeriodDropdown").value;
  2711. const endPeriod = getEndPeriodValue(); // Use getEndPeriodValue here
  2712. const startPeriods = {
  2713. "1": "Morning 6:00 AM",
  2714. "2": "Afternoon 2:00 PM"
  2715. };
  2716. const endPeriods = {
  2717. "1": "Afternoon 2:00 PM",
  2718. "2": "Evening 10:00 PM"
  2719. };
  2720. const numofdaysrange = Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
  2721. document.getElementById("noofdaysbetweenstartend").value = numofdaysrange;
  2722. const numDays = Math.ceil((endDate - startDate) / (1000 * 60 * 60 * 24)) + 1;
  2723. let summaryText = `You booked for ${numDays} day(s) with the following slots:\n`;
  2724. let currentDate = new Date(startDate);
  2725. while (currentDate <= endDate) {
  2726. const currentDay = currentDate.toISOString().split('T')[0];
  2727. let currentStartPeriod;
  2728. let currentEndPeriod;
  2729. if (currentDate.getTime() === startDate.getTime()) {
  2730. currentStartPeriod = startPeriod;
  2731. } else {
  2732. currentStartPeriod = "1"; // Default to Morning for subsequent days
  2733. }
  2734. if (currentDate.getTime() === endDate.getTime()) {
  2735. currentEndPeriod = endPeriod;
  2736. } else {
  2737. currentEndPeriod = "2"; // Default to Evening for all days except the last
  2738. }
  2739. summaryText += `${currentDay}: ${startPeriods[currentStartPeriod]} to ${endPeriods[currentEndPeriod]}\n`;
  2740. currentDate.setDate(currentDate.getDate() + 1);
  2741. }
  2742. document.getElementById("summary").innerText = summaryText;
  2743. }
  2744. // Add event listeners to update the summary when dropdowns change
  2745. document.getElementById("startDateInput").addEventListener("change", function () {
  2746. calculatenoofdaysafterslots();
  2747. showSummary();
  2748. });
  2749. document.getElementById("endDateInput").addEventListener("change", function () {
  2750. calculatenoofdaysafterslots();
  2751. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2752. $(".step-2 .next-step").prop("disabled", true);
  2753. const bookingStatus = window.bookingResponse[$("#endDateInput").val()];
  2754. if (bookingStatus) {
  2755. if (bookingStatus[0]) {
  2756. $("#endPeriodDropdown").val(2);
  2757. $("#endPeriodDropdown").prop("disabled", true);
  2758. setEndPeriodDataValue();
  2759. } else if (bookingStatus[1]) {
  2760. $("#endPeriodDropdown").val(1);
  2761. $("#endPeriodDropdown").prop("disabled", true);
  2762. setEndPeriodDataValue();
  2763. }
  2764. } else {
  2765. $("#endPeriodDropdown").prop("disabled", false);
  2766. }
  2767. calculatenoofdaysafterslots();
  2768. if ($("#endDateInput").val() == "0") {
  2769. $('#summary').html('');
  2770. } else {
  2771. showSummary();
  2772. }
  2773. });
  2774. document.getElementById("startPeriodDropdown").addEventListener("change", function () {
  2775. calculatenoofdaysafterslots();
  2776. showSummary();
  2777. });
  2778. document.getElementById("endPeriodDropdown").addEventListener("change", function () {
  2779. calculatenoofdaysafterslots();
  2780. showSummary();
  2781. });
  2782. function initializeDatepickerWithColors(hallId) {
  2783. // Destroy existing datepicker to avoid duplicate initialization
  2784. $("#datepicker-container").datepicker("destroy");
  2785. const serverDate = new Date($("#serverDate").val() + "T00:00:00")
  2786. const maxDate = new Date(serverDate);
  2787. maxDate.setMonth(maxDate.getMonth() + 6);
  2788. // console.log(" hall booking form Max Date: "+maxDate);
  2789. // Initialize the datepicker
  2790. $("#startDateInput,#datepicker-container").datepicker({
  2791. dateFormat: "yy-mm-dd",
  2792. minDate: serverDate,
  2793. maxDate: maxDate,
  2794. beforeShowDay: function (eDate) {
  2795. const dateString = $.datepicker.formatDate("yy-mm-dd", eDate);
  2796. const bookingStatus = window.bookingResponse[dateString] || {};
  2797. // const currentDate = new Date();
  2798. serverDate.setHours(0, 0, 0, 0); // Normalize current date to midnight
  2799. eDate.setHours(0, 0, 0, 0); // Normalize selected date to midnight
  2800. // Logic for other dates
  2801. if (eDate < serverDate) {
  2802. return [false, "highlight-disabled", "Slot not Available"];
  2803. }
  2804. const isToday = eDate.getTime() === serverDate.getTime();
  2805. const currentHour = new Date().getHours();
  2806. const isBefore6AM = currentHour < 6;
  2807. const isAfter2PM = currentHour >= 14;
  2808. // Block 3-day logic for specific event types
  2809. // const today = new Date();
  2810. const blockedDate = new Date(serverDate);
  2811. blockedDate.setDate(serverDate.getDate() + 2);
  2812. if (eDate <= blockedDate && window.isThreeDayBlock) {
  2813. return [false, "highlight-disabled", "Blocked due to event type"];
  2814. }
  2815. // Logic for today
  2816. if (isToday) {
  2817. if (isBefore6AM) {
  2818. // Before 6 AM: Allow full-day booking or adjust based on booking status
  2819. return handleBookingStatus(bookingStatus, "Full Day Available");
  2820. } else if (isAfter2PM) {
  2821. // After 2 PM: Block all bookings
  2822. return handleAfter2PM(bookingStatus);
  2823. } else {
  2824. // Between 6 AM and 2 PM: Check status and disable morning slots
  2825. return handleMorningSlots(bookingStatus);
  2826. }
  2827. }
  2828. return handleBookingStatus(bookingStatus, "Slot Available");
  2829. },
  2830. });
  2831. // Show datepicker when hall is selected
  2832. $('#selecthall').off('click').on('click', function () {
  2833. $('#datepicker-container').datepicker('show');
  2834. });
  2835. // Handle changes in the start date input
  2836. $("#startDateInput").on("change", function () {
  2837. const selectedDate = $(this).val();
  2838. const bookingStatus = window.bookingResponse[selectedDate] || {};
  2839. // const currentDate = new Date();
  2840. const currentHours = new Date().getHours();
  2841. const currentDateString = $("#serverDate").val();
  2842. $("#startPeriodDropdown option").prop("disabled", false); //newly added after server date changes
  2843. $("#startPeriodDropdown").val(0).prop("disabled", false);
  2844. $("#endPeriodDropdown").val(0).prop("disabled", false);
  2845. $("#numDaysCount").val('');
  2846. validateForm();
  2847. if ((selectedDate === currentDateString && currentHours >= 6) || bookingStatus[0]) {
  2848. $("#startPeriodDropdown option[value='1']").prop("disabled", true);
  2849. } else if (bookingStatus[1]) {
  2850. $("#startPeriodDropdown option[value='2']").prop("disabled", true);
  2851. }
  2852. updateEndDate(selectedDate);
  2853. });
  2854. // Event type change logic
  2855. $("#reasonforbooking").on("change", function () {
  2856. const selectedEventType = $(this).find("option:selected").text().trim();
  2857. window.isThreeDayBlock = ["Commercial", "State Govt Event", "Central Govt Event"].includes(selectedEventType);
  2858. $("#datepicker-container").datepicker("refresh");
  2859. });
  2860. }
  2861. function handleBookingStatus(bookingStatus, defaultMessage) {
  2862. if (bookingStatus[2]) {
  2863. return [true, "highlight-blue disabled", "GCC Blocked"];
  2864. } /*else if (bookingStatus[3]) {
  2865. return [true, "highlight-lightpink disabled", "Temporary Blocked"];
  2866. } */ else if (bookingStatus[0] && bookingStatus[1]) {
  2867. return [true, "highlight-pink disabled", "Slot Occupied"];
  2868. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2869. return [true, "highlight-yellow", "Evening Slot Available"];
  2870. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2871. return [true, "highlight-violet", "Only Morning Slot Available"];
  2872. }
  2873. return [true, "highlight-greens", defaultMessage];
  2874. }
  2875. // Helper function: Handles logic after 2 PM
  2876. function handleAfter2PM(bookingStatus) {
  2877. if (bookingStatus[2]) {
  2878. return [true, "highlight-blue disabled", "GCC Blocked"];
  2879. } else if (bookingStatus[0] || bookingStatus[1]) {
  2880. return [true, "highlight-pink disabled", "Slot Occupied"];
  2881. }
  2882. return [false, "highlight-disabled", "Not Allowed to Book"];
  2883. }
  2884. // Helper function: Handles morning slots between 6 AM and 2 PM
  2885. function handleMorningSlots(bookingStatus) {
  2886. if (bookingStatus[2]) {
  2887. return [true, "highlight-blue disabled", "GCC Blocked"];
  2888. } else if (bookingStatus[0] && bookingStatus[1]) {
  2889. return [true, "highlight-pink disabled", "Slot Occupied"];
  2890. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2891. return [true, "highlight-yellow", "Evening Slot Available"];
  2892. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2893. return [false, "highlight-disabled", "Slot Occupied"];
  2894. }
  2895. return [true, "highlight-yellow", "Evening Slot Available"];
  2896. }
  2897. function datepickerFormat(dateString) {
  2898. var dateObject = new Date(dateString);
  2899. var year = dateObject.getFullYear();
  2900. var month = (dateObject.getMonth() + 1).toString().padStart(2, "0");
  2901. var day = dateObject.getDate().toString().padStart(2, "0");
  2902. return `${year}-${month}-${day}`;
  2903. }
  2904. //snackbars
  2905. $("#reasonforbooking").on("click", function () {
  2906. var relationship = $("#relation").val();
  2907. if (relationship == 0) {
  2908. var relationField = $("#relation")[0];
  2909. relationField.setCustomValidity("Relationship for Booking is Missing. Please select.");
  2910. relationField.reportValidity();
  2911. return; // Exit early if relationship is not provided
  2912. } else {
  2913. $("#relation")[0].setCustomValidity(""); // Clear custom validity if valid
  2914. }
  2915. });
  2916. $("#relation").on("change", function () {
  2917. // Clear custom validity when a valid value is selected
  2918. this.setCustomValidity("");
  2919. });
  2920. $("#startDateInput").on("click", function () {
  2921. var reason = $("#reasonforbooking").val();
  2922. if (reason == 0) {
  2923. var reasonField = $("#reasonforbooking")[0];
  2924. reasonField.setCustomValidity("Reason for booking is missed. Please select a reason.");
  2925. reasonField.reportValidity();
  2926. return; // Exit early if reason is not provided
  2927. } else {
  2928. $("#reasonforbooking")[0].setCustomValidity(""); // Clear custom validity if valid
  2929. }
  2930. });
  2931. $("#endDateInput").on("click", function () {
  2932. var reason = $("#reasonforbooking").val();
  2933. var startDate = $("#startDateInput").val();
  2934. if (reason == 0) {
  2935. var reasonField = $("#reasonforbooking")[0];
  2936. reasonField.setCustomValidity("Reason for booking is missed. Please select a reason.");
  2937. reasonField.reportValidity();
  2938. return; // Exit early if reason is not provided
  2939. } else {
  2940. $("#reasonforbooking")[0].setCustomValidity(""); // Clear custom validity if valid
  2941. }
  2942. if (startDate == "") {
  2943. var startDate = $("#startDateInput")[0];
  2944. startDateInput.setCustomValidity("Start Date missed. Please select a Start Date.");
  2945. startDateInput.reportValidity();
  2946. return; // Exit early if reason is not provided
  2947. } else {
  2948. $("#startDateInput")[0].setCustomValidity(""); // Clear custom validity if valid
  2949. }
  2950. });
  2951. $("#reasonforbooking").on("change", function () {
  2952. // Clear custom validity when a valid value is selected
  2953. this.setCustomValidity("");
  2954. });
  2955. // Snackbar function
  2956. function showSnackbar(message) {
  2957. var snackbar = $("<div>")
  2958. .addClass("snackbar")
  2959. .text(message)
  2960. .appendTo("body");
  2961. // Add animation classes for showing and hiding
  2962. snackbar.addClass("show");
  2963. // Remove the snackbar after 3 seconds
  2964. setTimeout(function () {
  2965. snackbar.removeClass("show");
  2966. snackbar.remove();
  2967. }, 3000);
  2968. }
  2969. // Update the event listeners to include date inputs
  2970. $("#endDateInput").on("change", function () {
  2971. var starting = $("#startPeriodDropdown").val();
  2972. var ending = $("#endPeriodDropdown").val();
  2973. var startDate = $("#startDateInput").val();
  2974. var endDate = $("#endDateInput").val();
  2975. // Call validateSlot with updated parameters
  2976. validateSlot(starting, ending, startDate, endDate);
  2977. validateForm();
  2978. });
  2979. // Event listener for changes in startPeriodDropdown
  2980. $("#startPeriodDropdown").on("change", function () {
  2981. var starting = $(this).val();
  2982. var ending = $("#endPeriodDropdown").val();
  2983. var startDate = $("#startDateInput").val();
  2984. var endDate = $("#endDateInput").val();
  2985. // Call validateSlot with updated parameters
  2986. validateSlot(starting, ending, startDate, endDate);
  2987. validateForm();
  2988. showSummary();
  2989. });
  2990. // Event listener for changes in endPeriodDropdown
  2991. $("#endPeriodDropdown").on("change", function () {
  2992. var starting = $("#startPeriodDropdown").val();
  2993. var ending = $(this).val();
  2994. var startDate = $("#startDateInput").val();
  2995. var endDate = $("#endDateInput").val();
  2996. validateSlot(starting, ending, startDate, endDate);
  2997. validateForm();
  2998. calculatenoofdaysafterslots();
  2999. showSummary();
  3000. });
  3001. function validateSlot(starting, ending, startDate, endDate) {
  3002. // Check if startDate is equal to endDate and starting is 2 and ending is 1
  3003. if (startDate === endDate && starting == 2 && ending == 1) {
  3004. Swal.fire({
  3005. icon: 'error',
  3006. title: 'Oops!',
  3007. text: "The starting slot cannot be set to Evening if the ending slot is Morning when the dates are the same.",
  3008. }).then(() => {
  3009. // Reset endPeriodDropdown to 0
  3010. $("#endPeriodDropdown").val(0);
  3011. validateForm();
  3012. });
  3013. }
  3014. validateForm(); // Call validateForm to update form validation status
  3015. }
  3016. function validateForm() {
  3017. var startDate = $("#startDateInput").val();
  3018. var endDate = $("#endDateInput").val();
  3019. var startPeriod = $("#startPeriodDropdown").val();
  3020. var endPeriod = $("#endPeriodDropdown").val();
  3021. var reasonforbooking = $("#reasonforbooking").val();
  3022. var relationship = $("#relation").val();
  3023. if (startDate && endDate !== "0" && startPeriod !== "0" && endPeriod !== "0" && relationship !== "0" && reasonforbooking) {
  3024. $(".next-step").prop("disabled", false);
  3025. } else {
  3026. $(".next-step").prop("disabled", true);
  3027. }
  3028. }
  3029. // Confirm Payment button click event
  3030. $("#confirmPaymentBtn").on('click', function () {
  3031. // Disable the payment button
  3032. $('#confirmPaymentBtn').prop('disabled', true);
  3033. stopTimer();
  3034. });
  3035. function stopTimer() {
  3036. if (countdown) {
  3037. clearInterval(countdown);
  3038. countdown = null; // Clear the countdown reference
  3039. }
  3040. timerElement.innerHTML = "Timer Stopped"; // Optionally update the message
  3041. }
  3042. (function () {
  3043. function block(e) {
  3044. e.preventDefault();
  3045. e.stopPropagation();
  3046. return false;
  3047. }
  3048. // Disable right‑click
  3049. window.addEventListener('contextmenu', block, true);
  3050. // 2) Disable drag (images/text) — optional
  3051. // window.addEventListener('dragstart', block, true);
  3052. // 3) Disable common DevTools / view‑source shortcuts
  3053. window.addEventListener('keydown', function (e) {
  3054. // Normalize: e.key is a string like 'F12' or 'I'; keyCode is a number (deprecated but useful for older browsers)
  3055. var key = e.key;
  3056. var code = e.keyCode || e.which;
  3057. // F12 (DevTools)
  3058. if (key === 'F12' || code === 123) return block(e);
  3059. // Ctrl+Shift+I/J/C (DevTools / Inspect / Console)
  3060. if (e.ctrlKey && e.shiftKey && (key === 'I' || key === 'J' || key === 'C' || code === 73 || code === 74 || code === 67)) return block(e);
  3061. // Ctrl+U (view source)
  3062. if (e.ctrlKey && (key === 'u' || key === 'U' || code === 85)) return block(e);
  3063. // Ctrl+S (save page)
  3064. if (e.ctrlKey && (key === 's' || key === 'S' || code === 83)) return block(e);
  3065. // Firefox specific shortcuts
  3066. // Ctrl+Shift+K opens Web Console
  3067. if (e.ctrlKey && e.shiftKey && (key === 'K' || code === 75)) return block(e);
  3068. // Ctrl+Shift+E opens Network Monitor
  3069. if (e.ctrlKey && e.shiftKey && (key === 'E' || code === 69)) return block(e);
  3070. }, true);
  3071. let threshold = 160;
  3072. setInterval(function () {
  3073. if (window.outerHeight - window.innerHeight > threshold ||
  3074. window.outerWidth - window.innerWidth > threshold) {
  3075. document.body.innerHTML = "<h1 style='color:red;text-align:center;margin-top:20%'>DevTools detected. Page disabled.</h1>";
  3076. }
  3077. }, 500);
  3078. })();
  3079. function showToast(msg) {
  3080. var toast = document.getElementById("toast");
  3081. toast.textContent = msg;
  3082. toast.className = "show";
  3083. setTimeout(function () {
  3084. toast.className = toast.className.replace("show", "");
  3085. }, 2500);
  3086. }
  3087. $(document).on("contextmenu",
  3088. "#ui-datepicker-div td, #ui-datepicker-div a, #ui-datepicker-div .ui-datepicker-title", function (e) {
  3089. e.preventDefault();
  3090. showToast("Right-click disabled");
  3091. return false;
  3092. });
  3093. </script>
  3094. </body>
  3095. </html>