Victoria Hall Booking for Events
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.

3496 lines
168 KiB

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