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.

3233 lines
180 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/head :: head}">
  4. </head>
  5. <!--datatables-->
  6. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
  7. <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/2.4.1/css/buttons.dataTables.min.css">
  8. <style>
  9. .card-body table {
  10. width: 100%;
  11. padding: 100px;
  12. }
  13. .card-body th,
  14. td {
  15. padding: 8px;
  16. text-align: left;
  17. }
  18. .amount-cell {
  19. text-align: right;
  20. padding-right: 1rem;
  21. /* Adjust padding as needed */
  22. }
  23. .ui-datepicker-container {
  24. width: 100%;
  25. }
  26. .fixedcontainer {
  27. width: 250%;
  28. margin: 40px 0;
  29. display: none
  30. }
  31. .disabled {
  32. pointer-events: none;
  33. opacity: 1;
  34. }
  35. .ui-widget {
  36. width: 40%
  37. }
  38. .ui-datepicker {
  39. padding: 3px;
  40. border: 1px solid #ccc;
  41. border-radius: 5px;
  42. background-color: white;
  43. left: 29.1418px;
  44. }
  45. .ui-datepicker-header {
  46. background-color: #f0f0f0;
  47. border: none;
  48. border-radius: 5px 5px 0 0;
  49. }
  50. .ui-datepicker-title {
  51. font-size: 1.2em;
  52. margin: 0;
  53. padding: 10px;
  54. text-align: center;
  55. }
  56. .ui-datepicker-calendar {
  57. margin: 0;
  58. padding: 0;
  59. font-weight: bold;
  60. }
  61. .ui-datepicker-calendar th,
  62. .ui-datepicker-calendar td {
  63. padding: 5px;
  64. text-align: center;
  65. }
  66. .ui-datepicker-calendar .ui-state-default {
  67. cursor: pointer;
  68. width: 100%;
  69. height: 100%;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. }
  74. .ui-datepicker-week-end {
  75. color: black;
  76. font-weight: bold;
  77. }
  78. .ui-datepicker-calendar th span {
  79. color: black;
  80. font-weight: bold;
  81. }
  82. .highlight-greens .ui-state-default {
  83. background: green !important;
  84. color: #FFF !important;
  85. }
  86. .highlight-yellow .ui-state-default {
  87. background: yellow !important;
  88. color: #000 !important;
  89. }
  90. .highlight-violet .ui-state-default {
  91. background: #a93da9 !important;
  92. color: #000 !important;
  93. }
  94. .highlight-pink .ui-state-default {
  95. background: red !important;
  96. color: #000 !important;
  97. }
  98. .form-control[readonly] {
  99. background-color: white;
  100. }
  101. .modal {
  102. overflow-y: auto;
  103. }
  104. .stepper-wrapper {
  105. display: flex;
  106. justify-content: space-between;
  107. margin-bottom: 20px;
  108. position: relative;
  109. }
  110. .stepper-item {
  111. display: flex;
  112. flex-direction: column;
  113. position: relative;
  114. width: 100%;
  115. z-index: 1;
  116. }
  117. .stepper-item::before {
  118. content: '';
  119. position: absolute;
  120. top: 15px;
  121. left: 50%;
  122. height: 4px;
  123. background-color: #dcdcdc;
  124. /* Default grey line */
  125. z-index: -1;
  126. }
  127. .stepper-item:first-child::before {
  128. left: 50%;
  129. width: 0;
  130. }
  131. .stepper-item:last-child::before {
  132. content: none;
  133. }
  134. .stepper-item.completed:not(:last-child)::after {
  135. content: '';
  136. position: absolute;
  137. top: 15px;
  138. left: 50%;
  139. width: calc(100% - 30px);
  140. height: 4px;
  141. background-color: #28a745;
  142. z-index: -1;
  143. transform: translateX(-50%);
  144. }
  145. .step-counter {
  146. width: 30px;
  147. height: 30px;
  148. border-radius: 50%;
  149. background-color: #dcdcdc;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. font-weight: bold;
  154. color: white;
  155. }
  156. .step-name {
  157. margin-top: 10px;
  158. font-size: 11px;
  159. }
  160. .stepper-item.completed .step-counter {
  161. background-color: #28a745;
  162. }
  163. .stepper-item.completed .step-name {
  164. font-weight: bold;
  165. }
  166. .tracking-container {
  167. padding: 10px;
  168. background: #f9f9f9;
  169. border-radius: 8px;
  170. overflow: hidden;
  171. max-height: 500px;
  172. }
  173. .tracking-steps {
  174. list-style: none;
  175. padding: 0;
  176. margin: 0;
  177. position: relative;
  178. }
  179. .tracking-steps::before {
  180. content: '';
  181. position: absolute;
  182. top: 0;
  183. left: 8px;
  184. width: 4px;
  185. height: 100%;
  186. background: yellowgreen;
  187. z-index: 0;
  188. }
  189. .tracking-step {
  190. display: flex;
  191. align-items: flex-start;
  192. margin-bottom: 20px;
  193. position: relative;
  194. padding-left: 40px;
  195. text-align: center;
  196. border-bottom: 1px solid #ddd;
  197. transition: background-color 0.3s ease-in-out;
  198. background-color: #fff;
  199. /* White background for steps */
  200. border-radius: 5px;
  201. /* Optional rounded corners */
  202. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  203. }
  204. /* Line adjustments between steps */
  205. .tracking-step::before {
  206. width: 100%;
  207. height: 5px;
  208. background: yellowgreen;
  209. /* Line color */
  210. position: absolute;
  211. top: 10px;
  212. /* Adjust position to connect icons */
  213. left: 8px;
  214. /* Aligns with step icons */
  215. margin: 0;
  216. }
  217. .tracking-step:first-child::before {
  218. background: none;
  219. /* No line before the first step */
  220. }
  221. /* Step icon styling */
  222. .step-icon {
  223. flex-shrink: 0;
  224. font-size: 1.5em;
  225. margin-right: 15px;
  226. position: absolute;
  227. left: 0;
  228. top: 0;
  229. width: 20px;
  230. height: 20px;
  231. border-radius: 50%;
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. background: #ccc;
  236. /* Default icon background */
  237. border: 4px solid #ccc;
  238. /* Default border */
  239. color: #eee;
  240. font-size: 14px;
  241. line-height: 20px;
  242. z-index: 1;
  243. font-family: "Ionicons";
  244. /* Icon font */
  245. }
  246. /* Completed step icon and line color */
  247. .tracking-step.completed .step-icon {
  248. background: #56B500;
  249. /* Green for completed */
  250. border-color: #56B500;
  251. color: #fff;
  252. }
  253. .tracking-step.completed::before {
  254. background: #56B500;
  255. /* Green line for completed steps */
  256. }
  257. .tracking-step.completed {
  258. background-color: #e6ffe6;
  259. }
  260. /* Waiting step icon and line color */
  261. .tracking-step.waiting .step-icon {
  262. background: #ffeb3b;
  263. /* Yellow for waiting */
  264. border-color: #ffeb3b;
  265. }
  266. .tracking-step.waiting {
  267. background-color: #fff3cd;
  268. }
  269. /* Initiated step icon and line color */
  270. .tracking-step.initiated .step-icon {
  271. background: #03a9f4;
  272. /* Blue for initiated */
  273. border-color: #03a9f4;
  274. }
  275. .tracking-step.initiated {
  276. background-color: #cce5ff;
  277. }
  278. /* Pending step icon and line color */
  279. .tracking-step.pending .step-icon {
  280. background: #9e9e9e;
  281. /* Grey for pending */
  282. border-color: #9e9e9e;
  283. }
  284. /* Cancelled step icon and line color */
  285. .tracking-step.cancelled .step-icon {
  286. background: #dc3545 !important;
  287. /* Red for cancelled */
  288. border-color: #dc3545 !important;
  289. color: #fff !important;
  290. }
  291. .tracking-step.cancelled::before {
  292. background: #dc3545 !important;
  293. /* Red line for cancelled steps */
  294. }
  295. .tracking-step.cancelled {
  296. background-color: #fdecea;
  297. /* Light red background for cancelled steps */
  298. }
  299. /* Rejected step icon and line color */
  300. .tracking-step.rejected .step-icon {
  301. background: #ff0000;
  302. /* Dark red for rejected */
  303. border-color: #ff0000;
  304. color: #fff;
  305. }
  306. .tracking-step.rejected {
  307. background-color: #ffe6e6;
  308. }
  309. .tracking-step.rejected::before {
  310. background: #ff0000;
  311. /* Dark red line for rejected steps */
  312. }
  313. /* GCC Blocked step icon and line color */
  314. .tracking-step.gcc-blocked .step-icon {
  315. background: #ff6600;
  316. /* Orange for GCC blocked */
  317. border-color: #ff6600;
  318. color: #fff;
  319. }
  320. .tracking-step.gcc-blocked {
  321. background-color: #ffe0cc;
  322. }
  323. .tracking-step.gcc-blocked::before {
  324. background: #ff6600;
  325. /* Orange line for GCC blocked steps */
  326. }
  327. /* Step content styling */
  328. .step-content {
  329. padding: 2px 15px;
  330. background: #fff;
  331. border: 1px solid #ddd;
  332. border-radius: 5px;
  333. width: 100%;
  334. flex-grow: 1;
  335. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  336. }
  337. .step-content h5 {
  338. margin: 0 0 5px;
  339. font-size: 16px;
  340. font-weight: bold;
  341. }
  342. .step-date {
  343. color: #666;
  344. font-size: 14px;
  345. }
  346. /* Icon color customization */
  347. .fas,
  348. .fa-solid {
  349. font-weight: 900;
  350. color: white;
  351. }
  352. #transactionmodel {
  353. max-width: 90%;
  354. /* Make modal wider */
  355. }
  356. .table-responsive {
  357. max-height: 400px;
  358. /* Adjust the table's maximum height */
  359. overflow-y: auto;
  360. /* Enable vertical scrolling if needed */
  361. }
  362. body {
  363. font-family: Arial, sans-serif;
  364. }
  365. .chat-icon {
  366. position: fixed;
  367. bottom: 20px;
  368. right: 20px;
  369. width: 60px;
  370. height: 60px;
  371. background-color: #007bff;
  372. border-radius: 50%;
  373. cursor: pointer;
  374. display: flex;
  375. align-items: center;
  376. justify-content: center;
  377. }
  378. .chat-icon img {
  379. width: 30px;
  380. height: 30px;
  381. }
  382. .chat-notification {
  383. position: absolute;
  384. top: -10px;
  385. right: -10px;
  386. background-color: red;
  387. color: white;
  388. border-radius: 50%;
  389. padding: 5px;
  390. font-size: 12px;
  391. }
  392. .chat-box {
  393. position: fixed;
  394. bottom: 90px;
  395. right: 20px;
  396. width: 300px;
  397. height: 400px;
  398. background-color: white;
  399. border: 1px solid #ccc;
  400. display: none;
  401. flex-direction: column;
  402. box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
  403. }
  404. .chat-header {
  405. background-color: #007bff;
  406. color: white;
  407. padding: 10px;
  408. display: flex;
  409. justify-content: space-between;
  410. align-items: center;
  411. }
  412. .chat-body {
  413. flex-grow: 1;
  414. padding: 10px;
  415. overflow-y: scroll;
  416. border-top: 1px solid #ccc;
  417. border-bottom: 1px solid #ccc;
  418. }
  419. .chat-footer {
  420. display: flex;
  421. padding: 10px;
  422. }
  423. .chat-footer input {
  424. flex-grow: 1;
  425. padding: 5px;
  426. margin-right: 10px;
  427. }
  428. .chat-footer button {
  429. background-color: #007bff;
  430. color: white;
  431. border: none;
  432. padding: 5px 10px;
  433. cursor: pointer;
  434. }
  435. .otp-input-box {
  436. display: flex;
  437. justify-content: center;
  438. gap: 10px;
  439. margin: 20px 0;
  440. }
  441. .otp-input-box .otp-input {
  442. width: 40px;
  443. height: 40px;
  444. text-align: center;
  445. font-size: 16px;
  446. border: 1px solid #ccc;
  447. border-radius: 5px;
  448. }
  449. </style>
  450. <body>
  451. <!-- Pre-loader start -->
  452. <div class="theme-loader">
  453. <div class="ball-scale">
  454. <div class='contain'>
  455. <div class="ring">
  456. <div class="frame"></div>
  457. </div>
  458. <div class="ring">
  459. <div class="frame"></div>
  460. </div>
  461. <div class="ring">
  462. <div class="frame"></div>
  463. </div>
  464. <div class="ring">
  465. <div class="frame"></div>
  466. </div>
  467. <div class="ring">
  468. <div class="frame"></div>
  469. </div>
  470. <div class="ring">
  471. <div class="frame"></div>
  472. </div>
  473. <div class="ring">
  474. <div class="frame"></div>
  475. </div>
  476. <div class="ring">
  477. <div class="frame"></div>
  478. </div>
  479. <div class="ring">
  480. <div class="frame"></div>
  481. </div>
  482. <div class="ring">
  483. <div class="frame"></div>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. <!-- Pre-loader end -->
  489. <div id="pcoded" class="pcoded">
  490. <div class="pcoded-container">
  491. <!-- Menu header start -->
  492. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  493. <!-- Menu header end -->
  494. <div class="pcoded-main-container">
  495. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  496. <div class="pcoded-wrapper">
  497. <div class="pcoded-content">
  498. <div class="pcoded-inner-content">
  499. <!-- Main-body start -->
  500. <div class="main-body" style="background-color: white">
  501. <div class="page-wrapper" style="padding: 0;">
  502. <!-- Page-header start -->
  503. <div class="page-header m-t-50">
  504. </div>
  505. <div id="futureEventsContainer" class="page-body" style="display: none;"></div>
  506. <div class="card">
  507. <div class="card-header">
  508. <h5>Hall Booking Details</h5>
  509. <button type="button" class="btn btn-primary btn-square-md"
  510. th:if="${userBookingspast.size() > 0}"
  511. th:onclick="'transactionHistory(' + ${userBookingspast[0].users_user_id} + ')'">
  512. Transaction History
  513. </button>
  514. </div>
  515. <div class="card-block">
  516. <div class="table-responsive">
  517. <table
  518. class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
  519. id="detailstable" style="width: 100%">
  520. <thead class="thead-light">
  521. <tr>
  522. <th class="text-center no-sort" width="10%">S.No</th>
  523. <th>Booking Id</th>
  524. <th>Booking date</th>
  525. <th>Hall Name</th>
  526. <th>Starting Date</th>
  527. <th>Ending Date</th>
  528. <th>Starting Period</th>
  529. <th>Ending Period</th>
  530. <th>Reason for booking</th>
  531. <th>Booking Status</th>
  532. <th>Payment Status</th>
  533. <th>Event Status</th>
  534. <th class="text-center no-sort" width="10%">Action</th>
  535. <th>View</th>
  536. </tr>
  537. </thead>
  538. <tbody>
  539. <tr th:each="booking, i : ${userBookingspast}"
  540. class="${userBookingspast}">
  541. <td th:text="${i.count}"></td>
  542. <td th:text="${booking.booking_id}"></td>
  543. <td th:text="${booking.booking_date}"></td>
  544. <td th:text="${booking.hall_name}"></td>
  545. <td th:text="${booking.start_date}"></td>
  546. <td th:text="${booking.end_date}"></td>
  547. <td
  548. th:text="${booking.starting_slot == 1 ? 'morning' : (booking.starting_slot == 2 ? 'evening' : '')}">
  549. </td>
  550. <td
  551. th:text="${booking.ending_slot == 1 ? 'morning' : (booking.ending_slot == 2 ? 'evening' : '')}">
  552. </td>
  553. <td th:text="${booking.reason}"></td>
  554. <td
  555. th:text="${#strings.replace(booking.booking_status, '_', ' ')}">
  556. </td>
  557. <td
  558. th:text="${booking.payment_status != null ? booking.payment_status : 'NA'}">
  559. </td>
  560. <td>
  561. <span th:if="${booking.booking_status == 'APPROVED'}">
  562. <span th:switch="${booking.event_category}">
  563. <span th:case="'Current'">Current Event</span>
  564. <span th:case="'Past'">Completed Event</span>
  565. <span th:case="'Future'">Upcoming Event</span>
  566. <span th:case="'Reschedule'">Upcoming
  567. Event</span>
  568. <span th:case="'noaction'">Govt Event</span>
  569. </span>
  570. </span>
  571. <span th:if="${booking.booking_status == 'COMPLETED'}">
  572. <span>Refund Completed Event</span>
  573. </span>
  574. <span th:if="${booking.booking_status == 'CANCELED'}">
  575. <span>User Canceled Event</span>
  576. </span>
  577. <span th:if="${booking.booking_status == 'REJECTED'}">
  578. <span>GCC Rejected Event</span>
  579. </span>
  580. <span
  581. th:if="${booking.booking_status == 'GCC_BLOCKED'}">
  582. <span>GCC Blocked Event</span>
  583. </span>
  584. <span
  585. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  586. <span>Waiting For NOC Document</span>
  587. </span>
  588. <span
  589. th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL'}">
  590. <span>Waiting For Admin Approval</span>
  591. </span>
  592. </td>
  593. <td th:switch="${booking.event_category}">
  594. <p th:case="'Future'">
  595. <a class="view-button"
  596. th:if="${booking.booking_status == 'APPROVED'}">
  597. <span class="badge bg-danger"
  598. style="cursor: pointer;"
  599. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  600. Booking</span>
  601. </a>
  602. </p>
  603. <p th:case="'waitingfornoc'">
  604. <a class="view-button"
  605. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  606. <span class="badge bg-danger"
  607. style="cursor: pointer;"
  608. data-bs-toggle="modal"
  609. data-bs-target="#uploadNocModal"
  610. th:attr="data-booking-id=${booking.booking_id}">Upload
  611. NOC</span>
  612. </a>
  613. <a class="view-button"
  614. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  615. <span class="badge bg-danger"
  616. style="cursor: pointer;"
  617. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  618. Booking</span>
  619. </a>
  620. <!--<a class="reschedule-button"
  621. th:if="${booking.booking_status == 'WAITING_FOR_NOC' and booking.schedule_count < 1}">
  622. &lt;!&ndash;th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">&ndash;&gt;
  623. <span class="badge bg-danger"
  624. style="cursor: pointer;"
  625. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  626. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  627. Booking</span>
  628. </a>-->
  629. </p>
  630. <p th:case="'waitingfornocapproval'">
  631. <a class="view-button"
  632. th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL'}">
  633. <span class="badge bg-danger"
  634. style="cursor: pointer;"
  635. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  636. Booking</span>
  637. </a>
  638. </p>
  639. <!--<p th:case="'noaction'">
  640. <a class="view-button">
  641. <span>&#45;&#45;No Action&#45;&#45;</span>
  642. </a>
  643. </p>-->
  644. <p th:case="'noaction'">
  645. <a class="view-button">
  646. <a class="view-button"
  647. th:if="${booking.booking_status == 'APPROVED'}">
  648. <span class="badge bg-danger"
  649. style="cursor: pointer;"
  650. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  651. Booking</span>
  652. </a>
  653. </a>
  654. </p>
  655. <p th:case="'noaction'">
  656. <a class="view-button">
  657. <span>--No Action--</span>
  658. </a>
  659. </p>
  660. <p th:case="'Reschedule'">
  661. <a class="view-button"
  662. th:if="${booking.booking_status == 'APPROVED'}">
  663. <span class="badge bg-danger"
  664. style="cursor: pointer;"
  665. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  666. Booking</span>
  667. </a>
  668. <a class="reschedule-button"
  669. th:if="${booking.booking_status == 'APPROVED'}">
  670. <span class="badge bg-danger"
  671. style="cursor: pointer;"
  672. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  673. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  674. Booking</span>
  675. </a>
  676. <a class="reschedule-button"
  677. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  678. <span class="badge bg-danger"
  679. style="cursor: pointer;"
  680. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  681. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  682. Booking</span>
  683. </a>
  684. </p>
  685. </td>
  686. <td>
  687. <a class="view-button">
  688. <!-- <span class="badge bg-primary"
  689. style="cursor: pointer;"
  690. th:onclick="showBookingDetails([[${booking.booking_id}]])">View</span>-->
  691. <span class="badge bg-primary"
  692. style="cursor: pointer;"
  693. th:onclick="showBookingDetails([[${booking.booking_id}]], [[${bookingRefIds[booking.booking_id]}]])">
  694. View
  695. </span>
  696. </a>
  697. <!--<a class="view-button">
  698. <span class="badge bg-primary"
  699. style="cursor: pointer;"
  700. th:onclick="trackBooking([[${booking.booking_id}]])">Track</span>
  701. </a>-->
  702. </td>
  703. </tr>
  704. </tbody>
  705. </table>
  706. </div>
  707. </div>
  708. </div>
  709. <input type="hidden" id="serverDate" th:value=${serverDate}>
  710. <div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static"
  711. tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel"
  712. aria-hidden="true">
  713. <div class="modal-dialog modal-lg" role="document">
  714. <div class="modal-content" id="printableContent">
  715. <form id="regform" onsubmit="return rejectsubmit();">
  716. <!--ak-->
  717. <!-- Add these -->
  718. <input type="hidden" id="modalBookingId">
  719. <input type="hidden" id="modalRefId">
  720. <div
  721. class="block block-rounded block-themed block-transparent mb-0">
  722. <div class="block-header bg-primary-dark">
  723. <h3 class="block-title" id="2mtitle">Booking
  724. Information</h3>
  725. <div class="block-options">
  726. <button type="button" class="btn-block-option"
  727. data-bs-dismiss="modal" aria-label="Close">
  728. <i class="fa fa-fw fa-times"></i>
  729. </button>
  730. </div>
  731. </div>
  732. <div class="block-content row"
  733. style="margin-right:0px;margin:0;padding:0;">
  734. <div class="col-md-12 col-lg-12 col-sm-12">
  735. <div class="card-body">
  736. <table>
  737. <tr>
  738. <th colspan="10"
  739. style="background-color: lightgrey;">
  740. User Details
  741. </th>
  742. </tr>
  743. <tr>
  744. <th
  745. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  746. User Name:
  747. </th>
  748. <td class="fw-semibold"
  749. style="padding: 0.45rem 0.45rem;"
  750. id="td_userName"></td>
  751. <th
  752. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  753. Mobile Number:
  754. </th>
  755. <td class="fw-semibold"
  756. style="padding: 0.45rem 0.45rem;"
  757. id="td_mobileNumber"></td>
  758. <th
  759. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  760. User Type:
  761. </th>
  762. <td class="fw-semibold"
  763. style="padding: 0.45rem 0.45rem;"
  764. id="td_usertype"></td>
  765. </tr>
  766. <tr>
  767. <th
  768. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  769. User Address:
  770. </th>
  771. <td colspan="5" class="fw-semibold"
  772. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  773. id="td_useraddress"></td>
  774. </tr>
  775. <input type="hidden"
  776. class="form-control text-center"
  777. name="bookingid" id="bookingid" disabled />
  778. <tr>
  779. <th colspan="10"
  780. style="background-color: lightgrey;">
  781. Hall Details
  782. </th>
  783. </tr>
  784. <tr>
  785. <th
  786. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  787. Hall Name:
  788. </th>
  789. <td colspan="10" class="fw-semibold"
  790. style="padding: 0.45rem 0.45rem;text-wrap:pretty;"
  791. id="td_hallName"></td>
  792. </tr>
  793. <th
  794. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  795. Hall Address:
  796. </th>
  797. <td colspan="10" class="fw-semibold"
  798. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  799. id="td_halladdress"></td>
  800. </tr>
  801. <tr>
  802. <th
  803. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  804. Caretaker Name:
  805. </th>
  806. <td colspan="2" class="fw-semibold"
  807. style="padding: 0.45rem 0.45rem;"
  808. id="td_caretakername"></td>
  809. <th
  810. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  811. Caretaker Mobile Number:
  812. </th>
  813. <td colspan="2" class="fw-semibold"
  814. style="padding: 0.45rem 0.45rem;"
  815. id="td_caretakermobileNumber"></td>
  816. </tr>
  817. <tr>
  818. <th colspan="10"
  819. style="background-color: lightgrey;">
  820. Booking
  821. Details (Booking Id:-<span
  822. id="booking_id"
  823. style="color:blue"></span>)
  824. </th>
  825. </tr>
  826. <tr>
  827. <th
  828. style="padding: 0.45rem 0.45rem;font-weight: normal">
  829. Booking Date:
  830. </th>
  831. <td colspan="2" class="fw-semibold"
  832. style="padding: 0.45rem 0.45rem;"
  833. id="td_bookingDate"></td>
  834. <th
  835. style="padding: 0.45rem 0.45rem;font-weight: normal">
  836. Deposit Amount (in Rs):
  837. </th>
  838. <td colspan="2"
  839. class="fw-semibold amount-cell"
  840. style="padding: 0.45rem 0.45rem;"
  841. id="td_depositeAmount"></td>
  842. </tr>
  843. <tr>
  844. <th
  845. style="padding: 0.45rem 0.45rem;font-weight: normal">
  846. Start Date:
  847. </th>
  848. <td colspan="2" class="fw-semibold"
  849. style="padding: 0.45rem 0.45rem;"
  850. id="td_startDate"></td>
  851. <th
  852. style="padding: 0.45rem 0.45rem;font-weight: normal">
  853. Hall Amount (in Rs):
  854. </th>
  855. <td colspan="2"
  856. class="fw-semibold amount-cell"
  857. style="padding: 0.45rem 0.45rem;"
  858. id="td_hallAmount"></td>
  859. </tr>
  860. <tr>
  861. <th
  862. style="padding: 0.45rem 0.45rem;font-weight: normal">
  863. END Date:
  864. </th>
  865. <td colspan="2" class="fw-semibold"
  866. style="padding: 0.45rem 0.45rem;"
  867. id="td_endDate"></td>
  868. <th
  869. style="padding: 0.45rem 0.45rem;font-weight: normal">
  870. GST @18% (in Rs):
  871. </th>
  872. <td colspan="2"
  873. class="fw-semibold amount-cell"
  874. style="padding: 0.45rem 0.45rem;"
  875. id="td_gst"></td>
  876. </tr>
  877. <tr>
  878. <th
  879. style="padding: 0.45rem 0.45rem;font-weight: normal">
  880. Starting Slot:
  881. </th>
  882. <td colspan="2" class="fw-semibold"
  883. style="padding: 0.45rem 0.45rem;"
  884. id="td_startingSlot"></td>
  885. <th
  886. style="padding: 0.45rem 0.45rem;font-weight: normal">
  887. Total Amount (in Rs):
  888. </th>
  889. <td colspan="2"
  890. class="fw-semibold amount-cell"
  891. style="padding: 0.45rem 0.45rem;"
  892. id="td_totalAmount"></td>
  893. </tr>
  894. <tr>
  895. <th
  896. style="padding: 0.45rem 0.45rem;font-weight: normal">
  897. Ending Slot:
  898. </th>
  899. <td colspan="2" class="fw-semibold"
  900. style="padding: 0.45rem 0.45rem;"
  901. id="td_endingSlot"></td>
  902. <!--<th style="display:none;padding: 0.45rem 0.45rem;border:none"
  903. id="rejectionreasondiv">Rejection
  904. Reason:</th>
  905. <td class="fw-semibold"
  906. style="padding: 0.45rem 0.45rem;"
  907. id="reasonforrejection"></td>-->
  908. <th
  909. style="padding: 0.45rem 0.45rem;border:none">
  910. Booking Status:
  911. </th>
  912. <td colspan="2" class="fw-semibold"
  913. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  914. id="bookingstatus_td"></td>
  915. </tr>
  916. <tr>
  917. <th style="display:none;padding: 0.45rem 0.45rem;border:none"
  918. id="rejectionreasondiv">Rejection
  919. Reason:
  920. </th>
  921. <td class="fw-semibold"
  922. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  923. id="reasonforrejection"></td>
  924. </tr>
  925. </table>
  926. </div>
  927. </div>
  928. <div class="row col-md-12 col-lg-12 col-sm-12"
  929. style="margin-left:6px;margin-top:-21px">
  930. <div class="documents" id="documents"></div>
  931. </div>
  932. <div class="col-md-12 col-lg-12 col-sm-12 mb-2"
  933. id="paymentsdetails"
  934. style="display:none; margin-top: -26px;">
  935. <div class="card-body">
  936. <table>
  937. <tr>
  938. <th colspan="10"
  939. style="background-color: lightgrey;">
  940. Booking Payment Details
  941. </th>
  942. </tr>
  943. <tr>
  944. <th
  945. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  946. Transaction ID:
  947. </th>
  948. <td colspan="10" class="fw-semibold"
  949. style="padding: 0.45rem 0.45rem;"
  950. id="td_transactionId"></td>
  951. </tr>
  952. <th
  953. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  954. Amount Received (in Rs):
  955. </th>
  956. <td colspan="10" class="fw-semibold"
  957. style="padding: 0.45rem 0.45rem;"
  958. id="td_payamountReceived"></td>
  959. </tr>
  960. <tr>
  961. <th
  962. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  963. Transaction Status:
  964. </th>
  965. <td class="fw-semibold"
  966. style="padding: 0.45rem 0.45rem;"
  967. id="td_paymentStatus"></td>
  968. </tr>
  969. </table>
  970. </div>
  971. </div>
  972. <div class="row col-md-12 col-lg-12 col-sm-12"
  973. id="ebdetails"
  974. style="display:none;margin-left: 0px;margin-top: -49px">
  975. <div class="card-body">
  976. <table>
  977. <tr>
  978. <th colspan="4"
  979. style="background-color: lightgrey;">EB
  980. Details
  981. </th>
  982. </tr>
  983. <tr>
  984. <th
  985. style="padding: 0.45rem 0.45rem;font-weight: normal">
  986. Consumer Number:
  987. </th>
  988. <td class="fw-semibold"
  989. style="padding: 0.45rem 0.45rem;"
  990. id="td_EBNumber"></td>
  991. <th
  992. style="padding: 0.45rem 0.45rem;font-weight: normal">
  993. EB Amount Per Unit (in Rs):
  994. </th>
  995. <td class="fw-semibold"
  996. style="padding: 0.45rem 0.45rem;"
  997. id="td_ebamountperunit"></td>
  998. </tr>
  999. <tr>
  1000. <th
  1001. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1002. Start Reading:
  1003. </th>
  1004. <td class="fw-semibold"
  1005. style="padding: 0.45rem 0.45rem;"
  1006. id="td_startingReading"></td>
  1007. <th
  1008. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1009. Unit Consumed:
  1010. </th>
  1011. <td class="fw-semibold"
  1012. style="padding: 0.45rem 0.45rem;"
  1013. id="td_usedunit"></td>
  1014. </tr>
  1015. <tr>
  1016. <th
  1017. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1018. END Reading:
  1019. </th>
  1020. <td class="fw-semibold"
  1021. style="padding: 0.45rem 0.45rem;"
  1022. id="td_endingReading"></td>
  1023. <th
  1024. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1025. EB Amount (in Rs):
  1026. </th>
  1027. <td class="fw-semibold"
  1028. style="padding: 0.45rem 0.45rem;"
  1029. id="td_electricityamount"></td>
  1030. </tr>
  1031. </tbody>
  1032. </table>
  1033. </div>
  1034. </div>
  1035. <div class="row col-md-12 col-lg-12 col-sm-12"
  1036. id="damagelist" style="disaply:none">
  1037. <div id="damageDetails"></div>
  1038. </div>
  1039. <div class="col-md-12 col-lg-12 col-sm-12"
  1040. id="refunddetails" style="margin-top:-41px">
  1041. <div class="card-body">
  1042. <table>
  1043. <tr>
  1044. <th colspan="2"
  1045. style="background-color: lightgrey;">
  1046. Amount to be Refunded (in Rs)
  1047. </th>
  1048. </tr>
  1049. <tr>
  1050. <th
  1051. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1052. Deposit Amount:
  1053. </th>
  1054. <td class="fw-semibold amount-cell"
  1055. style="padding: 0.45rem 0.45rem;"
  1056. id="td_depositeamountforrefund">0
  1057. </td>
  1058. </tr>
  1059. <tr>
  1060. <th
  1061. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1062. EB Amount:
  1063. </th>
  1064. <td class="fw-semibold amount-cell"
  1065. style="padding: 0.45rem 0.45rem;"
  1066. id="td_ebAmount"></td>
  1067. </tr>
  1068. <tr>
  1069. <th
  1070. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1071. Damage Amount:
  1072. </th>
  1073. <td class="fw-semibold amount-cell"
  1074. style="padding: 0.45rem 0.45rem;"
  1075. id="td_damage"></td>
  1076. </tr>
  1077. <tr id="pendingcolumn">
  1078. <th id="th_settel_label"
  1079. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1080. Collection Pending Amount:
  1081. </th>
  1082. <td class="fw-semibold amount-cell"
  1083. style="padding: 0.45rem 0.45rem; color: green;"
  1084. id="td_pending_amt">0
  1085. </td>
  1086. </tr>
  1087. <tr id="collectionstatuscolumn">
  1088. <th id="label"
  1089. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1090. Collection Pending Status
  1091. :
  1092. </th>
  1093. <td class="fw-semibold amount-cell"
  1094. style="padding: 0.45rem 0.45rem; color: green;"
  1095. id="td_collection_status">
  1096. </td>
  1097. </tr>
  1098. <tr>
  1099. <th
  1100. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1101. Actual refundable Amount:
  1102. </th>
  1103. <td class="fw-semibold amount-cell"
  1104. style="padding: 0.45rem 0.45rem; color: green;"
  1105. id="td_settel_amt">0
  1106. </td>
  1107. </tr>
  1108. </table>
  1109. </div>
  1110. </div>
  1111. <div class="row col-md-12 col-lg-12 col-sm-12"
  1112. id="refundamountDetails"
  1113. style="display:none;margin-left: 0px;margin-top: -49px">
  1114. <div class="card-body">
  1115. <table>
  1116. <tr>
  1117. <th colspan="4"
  1118. style="background-color: lightgrey;">
  1119. Refund Details
  1120. </th>
  1121. </tr>
  1122. <tr>
  1123. <th
  1124. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1125. Booking Status:
  1126. </th>
  1127. <td class="fw-semibold"
  1128. style="padding: 0.45rem 0.45rem;"
  1129. id="td_bookingStatus"></td>
  1130. <th
  1131. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1132. Refund Status:
  1133. </th>
  1134. <td class="fw-semibold"
  1135. style="padding: 0.45rem 0.45rem;"
  1136. id="td_refundStatus"></td>
  1137. </tr>
  1138. <tr>
  1139. <th
  1140. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  1141. Refund amount:
  1142. </th>
  1143. <td class="fw-semibold" colspan="5"
  1144. style="padding: 0.45rem 0.45rem;"
  1145. id="td_refundamount"></td>
  1146. </tr>
  1147. </tbody>
  1148. </table>
  1149. </div>
  1150. </div>
  1151. <div id="refundMessage" style="display: none;">
  1152. <h1 id="refundText"
  1153. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1154. </h1>
  1155. </div>
  1156. <div id="rejectrefundMessage" style="display: none;">
  1157. <h1 id="rejectrefundText"
  1158. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1159. </h1>
  1160. </div>
  1161. <div id="blockedrefundMessage" style="display: none;">
  1162. <h1 id="blockedrefundText"
  1163. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1164. </h1>
  1165. </div>
  1166. <!--Newly added for Reschedule Details-->
  1167. <!--<div class="row col-md-12 col-lg-12 col-sm-12"
  1168. id="rescheduleDetails"
  1169. style="display:none;margin-left: 0px;margin-top: -49px">
  1170. <div class="card-body">
  1171. <table>
  1172. <tr>
  1173. <th colspan="4"
  1174. style="background-color: lightgrey;">
  1175. Reschedule Details
  1176. </th>
  1177. </tr>
  1178. <tr>
  1179. <th
  1180. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1181. Event Start Date:
  1182. </th>
  1183. <td class="fw-semibold"
  1184. style="padding: 0.45rem 0.45rem;"
  1185. id="td_res_start_date"></td>
  1186. <th
  1187. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1188. Event End Date:
  1189. </th>
  1190. <td class="fw-semibold"
  1191. style="padding: 0.45rem 0.45rem;"
  1192. id="td_res_end_date"></td>
  1193. </tr>
  1194. <tr>
  1195. <th
  1196. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  1197. Rescheduled Date:</th>
  1198. <td class="fw-semibold" colspan="5"
  1199. style="padding: 0.45rem 0.45rem;"
  1200. id="td_res_date"></td>
  1201. </tr>
  1202. </tbody>
  1203. </table>
  1204. </div>
  1205. </div>-->
  1206. </div>
  1207. </div>
  1208. <div class="block-content block-content-full text-end bg-body"
  1209. id="mbutton">
  1210. <button class="btn btn-success"
  1211. onclick="downloadAcknowledgment(event)"
  1212. style="background: #FB6340;">View
  1213. Acknowledgement
  1214. </button>
  1215. <button type="button"
  1216. style="background-color: rgb(21,69,93);color: white;"
  1217. class="btn btn-sm btn-alt-secondary"
  1218. data-bs-dismiss="modal">Close
  1219. </button>
  1220. </div>
  1221. </form>
  1222. </div>
  1223. </div>
  1224. </div>
  1225. </div>
  1226. <br>
  1227. </div>
  1228. </div>
  1229. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog"
  1230. aria-labelledby="fileModalLabel" aria-hidden="true">
  1231. <div class="modal-dialog modal-lg" role="document">
  1232. <div class="modal-content">
  1233. <div class="modal-header">
  1234. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  1235. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"
  1236. style="border: 1px solid black; padding: 5px;
  1237. display: inline-flex; align-items: center; justify-content: center;
  1238. background-color: transparent; color: black; font-size: 20px;">
  1239. <span aria-hidden="true">&times;</span>
  1240. </button>
  1241. </div>
  1242. <div class="modal-body">
  1243. <embed id="filePreview" src="" width="100%" height="600px">
  1244. </div>
  1245. <div class="modal-footer">
  1246. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close
  1247. </button>
  1248. </div>
  1249. </div>
  1250. </div>
  1251. </div>
  1252. </div>
  1253. <div class="modal fade" id="bookingRescheduleModal" tabindex="-1"
  1254. aria-labelledby="bookingModalLabel" aria-hidden="true">
  1255. <div class="modal-dialog modal-dialog-centered modal-lg">
  1256. <div class="modal-content">
  1257. <!-- Modal Header -->
  1258. <div class="modal-header" style="color:black">
  1259. <h5 class="modal-title" id="bookingModalLabel" style="color:black">Booking
  1260. Reschedule</h5>
  1261. <br>
  1262. <br>
  1263. <div style="margin-bottom: -59px; margin-left: -185px;">
  1264. <!-- Adding margin-top for separation -->
  1265. <p style="font-size: 14px; color: #6c757d;"> the Start Date can be
  1266. changed.</p>
  1267. </div>
  1268. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1269. aria-label="Close"></button>
  1270. </div>
  1271. <!-- Modal Body -->
  1272. <div class="modal-body">
  1273. <div class="container-fluid">
  1274. <div class="row">
  1275. <!-- Datepicker and Availability Buttons Column -->
  1276. <div id="datepicker-container" class="fixedcontainer"></div>
  1277. <!-- Start Date, End Date, Number of Days Inputs Column -->
  1278. <div class="col">
  1279. <input type="hidden" class="form-control" id="bookingId"
  1280. name="bookingId" required>
  1281. <label for="startDateInput" class="form-label">Start Date:</label>
  1282. <input type="text" class="form-control" id="startDateInput"
  1283. name="startDateInput" required readonly>
  1284. <input type="hidden" class="form-control" id="startDatetext"
  1285. name="startDatetext" required>
  1286. </div>
  1287. <div class="col">
  1288. <label for="endDateInput" class="form-label">End Date:</label>
  1289. <input type="date" class="form-control" id="endDateInput"
  1290. name="endDateInput" readonly>
  1291. </div>
  1292. <div class="col">
  1293. <label for="noOfDaysInput" class="form-label">Number of Days:</label>
  1294. <input type="number" class="form-control" id="noOfDaysInput"
  1295. name="noOfDaysInput" readonly>
  1296. </div>
  1297. </div>
  1298. <div class="row">
  1299. <div class="col">
  1300. <input type="hidden" id="daysDiff">
  1301. <label for="startingSlot" class="form-label">Starting Slot:</label>
  1302. <input type="text" class="form-control" id="startingSlotText"
  1303. name="startingSlot" readonly>
  1304. <input type="hidden" class="form-control" id="startingSlot"
  1305. name="startingSlot" required>
  1306. </div>
  1307. <div class="col">
  1308. <label for="endingSlot" class="form-label">Ending Slot:</label>
  1309. <input type="text" class="form-control" id="endingSlotText"
  1310. name="endDateInput" readonly>
  1311. <input type="hidden" class="form-control" id="endingSlot"
  1312. name="endDateInput" readonly>
  1313. </div>
  1314. </div>
  1315. <div class="row" style="margin-top: 39px;">
  1316. <div class="col col-lg-2 col-sm-2 col-md-2">
  1317. <button type="button" class="btn btn-primary btn-square-md"
  1318. style="background-color:#008000;"></button>
  1319. <p style="margin-left: 14px;">Day<br>(Available)</p>
  1320. </div>
  1321. <div class="col col-lg-2 col-sm-2 col-md-2">
  1322. <button type="button" class="btn btn-primary btn-square-md"
  1323. style="background-color: #ac2bac;"></button>
  1324. <p style="margin-left: 14px;">Morning<br>(Available)</p>
  1325. </div>
  1326. <div class="col col-lg-2 col-sm-2 col-md-2">
  1327. <button type="button" class="btn btn-primary btn-square-md"
  1328. style="background-color:#FFEA00;"></button>
  1329. <p style="margin-left: 14px;">Evening<br>(Available)</p>
  1330. </div>
  1331. <div class="col col-lg-2 col-sm-2 col-md-2">
  1332. <button type="button" class="btn btn-primary btn-square-md"
  1333. style="background-color: red;"></button>
  1334. <p style="margin-left: 14px;">Not Available</p>
  1335. </div>
  1336. <div class="col col-lg-2 col-sm-2 col-md-2">
  1337. <button type="button" class="btn btn-primary btn-square-md"
  1338. style="background-color: blue;"></button>
  1339. <p style="margin-left: 14px;">GCC Blocked</p>
  1340. </div>
  1341. <!--<div class="col col-lg-2 col-sm-2 col-md-2">
  1342. <button type="button" class="btn btn-primary btn-square-md"
  1343. style="background-color: lightpink;"></button>
  1344. <p style="margin-left: 14px;">Temporary Blocked</p>
  1345. </div>-->
  1346. </div>
  1347. </div>
  1348. </div>
  1349. <!-- Modal Footer -->
  1350. <div class="modal-footer">
  1351. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close
  1352. </button>
  1353. <button type="button" class="btn btn-primary" onclick="Reschedule()">Save
  1354. Changes
  1355. </button>
  1356. </div>
  1357. </div>
  1358. </div>
  1359. </div>
  1360. <!-- Reschedule OTP Verification Modal -->
  1361. <div class="modal fade" id="rescheduleOtpModal" tabindex="-1" role="dialog"
  1362. aria-labelledby="rescheduleOtpModalLabel" aria-hidden="true">
  1363. <div class="modal-dialog" role="document">
  1364. <div class="modal-content">
  1365. <div class="modal-header">
  1366. <h6 class="modal-title m-0" id="rescheduleOtpModalLabel">Reschedule Verification
  1367. </h6>
  1368. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1369. aria-label="Close"></button>
  1370. </div>
  1371. <div class="modal-body">
  1372. <div class="row">
  1373. <div class="mb-3 text-center">
  1374. <img src="media/images/mobileotp.png" width="50%" alt="Mobileotp">
  1375. </div>
  1376. <div class="mb-0 text-center">
  1377. <h4>OTP Verification</h4>
  1378. <p class="text-mute">Enter the OTP sent to <b class="text-info"
  1379. id="rescheduleMobileTxt"></b></p>
  1380. <p class="text-danger" id="rescheduleOtpError"></p>
  1381. </div>
  1382. <div class="mb-3 text-center">
  1383. <div class="otp-input-box">
  1384. <input type="text" maxlength="1" class="otp-input" id="rescheduleOtp1"
  1385. required />
  1386. <input type="text" maxlength="1" class="otp-input" id="rescheduleOtp2"
  1387. required />
  1388. <input type="text" maxlength="1" class="otp-input" id="rescheduleOtp3"
  1389. required />
  1390. <input type="text" maxlength="1" class="otp-input" id="rescheduleOtp4"
  1391. required />
  1392. <input type="text" maxlength="1" class="otp-input" id="rescheduleOtp5"
  1393. required />
  1394. </div>
  1395. </div>
  1396. <div class="mb-3 text-center">
  1397. <div id="rescheduleResendContainer">
  1398. <p class="mb-0">Didn't receive OTP?</p>
  1399. <p class="mb-0 text-info" id="rescheduleResendLink">Please wait..<span
  1400. id="rescheduleCountdown">60</span>s</p>
  1401. </div>
  1402. </div>
  1403. </div>
  1404. </div>
  1405. <div class="modal-footer">
  1406. <button type="button" class="btn btn-secondary btn-sm"
  1407. data-bs-dismiss="modal">Close</button>
  1408. <button type="button" class="btn btn-primary btn-sm"
  1409. onclick="verifyRescheduleOtp()">Verify OTP</button>
  1410. </div>
  1411. </div>
  1412. </div>
  1413. </div>
  1414. <!-- Tracking Log Modal -->
  1415. <!-- Tracking Modal -->
  1416. <div class="modal fade" id="trackingModal" tabindex="-1" aria-labelledby="trackingModalLabel"
  1417. aria-hidden="true">
  1418. <div class="modal-dialog modal-lg">
  1419. <div class="modal-content">
  1420. <div class="modal-header">
  1421. <h4 class="modal-title">Booking Tracking</h4>
  1422. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1423. aria-label="Close"></button>
  1424. </div>
  1425. <div class="modal-body">
  1426. <div class="tracking-container">
  1427. <ul id="trackingList" class="tracking-steps list-unstyled">
  1428. <!-- Steps will be dynamically appended here -->
  1429. </ul>
  1430. </div>
  1431. </div>
  1432. </div>
  1433. </div>
  1434. </div>
  1435. <!-- Modal -->
  1436. <div class="modal fade" id="uploadNocModal" tabindex="-1" aria-labelledby="uploadNocModalLabel"
  1437. aria-hidden="true">
  1438. <div class="modal-dialog">
  1439. <div class="modal-content">
  1440. <div class="modal-header">
  1441. <h5 class="modal-title" id="uploadNocModalLabel">Upload NOC</h5>
  1442. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1443. aria-label="Close"></button>
  1444. </div>
  1445. <div class="modal-body">
  1446. <div class="mb-3">
  1447. <label for="nocFile" class="form-label">Select NOC File</label>
  1448. <input type="file" class="form-control nocfile" id="nocFile" name="nocFile"
  1449. required>
  1450. <input type="hidden" id="bookingssId" name="bookingssId">
  1451. </div>
  1452. </div>
  1453. <div class="modal-footer">
  1454. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close
  1455. </button>
  1456. <button type="button" class="btn btn-primary" id="submitNocButton">Submit</button>
  1457. </div>
  1458. </div>
  1459. </div>
  1460. </div>
  1461. <!-- Modal -->
  1462. <div class="modal fade" id="transactionHistoryModal" tabindex="-1"
  1463. aria-labelledby="transactionHistoryModalLabel" aria-hidden="true">
  1464. <div class="modal-dialog modal-lg" id="transactionmodel"> <!-- modal-lg makes it larger -->
  1465. <div class="modal-content">
  1466. <div class="modal-header">
  1467. <h5 class="modal-title" id="transactionHistoryModalLabel">Transaction History</h5>
  1468. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1469. aria-label="Close"></button>
  1470. </div>
  1471. <div class="modal-body">
  1472. <!-- Scrollable Table -->
  1473. <div class="table-responsive"> <!-- Make the table scrollable if too large -->
  1474. <table class="table table-bordered" id="transactionTable">
  1475. <thead>
  1476. <tr>
  1477. <th>S.NO</th>
  1478. <th>Booking ID</th>
  1479. <th>Amount</th>
  1480. <th>Date</th>
  1481. <th>Transaction ID</th>
  1482. <th>Status</th>
  1483. </tr>
  1484. </thead>
  1485. <tbody>
  1486. <!-- Data will be populated dynamically here -->
  1487. </tbody>
  1488. </table>
  1489. </div>
  1490. <div class="table-responsive" id="refunddetails" style="display: none;">
  1491. <h2>Refund Details</h2>
  1492. <table class="table table-bordered" id="refunddetailsTable">
  1493. <thead>
  1494. <tr>
  1495. <th>S.NO</th>
  1496. <th>Booking ID</th>
  1497. <th>Amount</th>
  1498. <th>Date</th>
  1499. <th>Transaction ID</th>
  1500. <th>Refund Amount</th>
  1501. </tr>
  1502. </thead>
  1503. <tbody>
  1504. <!-- Data will be populated dynamically here -->
  1505. </tbody>
  1506. </table>
  1507. </div>
  1508. </div>
  1509. <div class="modal-footer">
  1510. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close
  1511. </button>
  1512. </div>
  1513. </div>
  1514. </div>
  1515. </div>
  1516. <footer th:replace="~{fragments/footer :: footer}"></footer>
  1517. </div>
  1518. </div>
  1519. </div>
  1520. <!--otp form-->
  1521. <div th:replace="~{fragments/loginreg :: div}"></div>
  1522. <!--otp form-->
  1523. <script src="js/html2pdf.bundle.min.js"></script>
  1524. <script th:replace="~{fragments/script :: script}"></script>
  1525. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  1526. <script type="text/javascript" src="https://www.paynimo.com/paynimocheckout/server/lib/checkout.js"></script>
  1527. <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
  1528. <script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
  1529. <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
  1530. <script type="text/javascript">
  1531. // Reschedule variables
  1532. var rescheduleBookingId = null;
  1533. var rescheduleStartDate = null;
  1534. var rescheduleEndDate = null;
  1535. var rescheduleMobileNumber = null;
  1536. var rescheduleHallId = null;
  1537. var rescheduleStartingSlot = null;
  1538. var rescheduleEndingSlot = null;
  1539. var rescheduleReason = null;
  1540. $(document).ready(function () {
  1541. $('#detailstable').DataTable({
  1542. responsive: true,
  1543. pageLength: 10,
  1544. ordering: true,
  1545. columnDefs: [{
  1546. targets: 'no-sort',
  1547. orderable: false
  1548. }],
  1549. dom: 'Bfrtip',
  1550. buttons: [
  1551. {
  1552. extend: 'excelHtml5',
  1553. text: 'Export to Excel',
  1554. className: 'btn btn-primary'
  1555. }
  1556. ]
  1557. });
  1558. });
  1559. $(document).ready(function () {
  1560. $('#submitNocButton').on('click', function (e) {
  1561. e.preventDefault();
  1562. // Get the form data
  1563. var formData = new FormData();
  1564. var fileInput = $('#nocFile')[0].files[0]; // Get the selected file
  1565. var bookingssId = $('#bookingssId').val(); // Get the bookingId
  1566. // Check if a file is selected
  1567. if (!fileInput) {
  1568. Swal.fire({
  1569. icon: 'warning',
  1570. title: 'No File Selected',
  1571. text: 'Please select a file to upload.',
  1572. });
  1573. return;
  1574. }
  1575. // Append file and bookingId to formData
  1576. formData.append('nocFile', fileInput);
  1577. formData.append('bookingssId', bookingssId);
  1578. // Perform Ajax request
  1579. $.ajax({
  1580. url: '/victoriahallbooking/user/api/uploaddocs', // API endpoint
  1581. type: 'POST',
  1582. data: formData,
  1583. contentType: false,
  1584. processData: false,
  1585. success: function (response) {
  1586. // Show success message and refresh the page
  1587. Swal.fire({
  1588. icon: 'success',
  1589. title: 'Success',
  1590. text: 'NOC uploaded successfully!',
  1591. }).then(() => {
  1592. $('#uploadNocModal').modal('hide'); // Close the modal
  1593. location.reload(); // Refresh the page
  1594. });
  1595. },
  1596. error: function (xhr, status, error) {
  1597. // Show error message
  1598. Swal.fire({
  1599. icon: 'error',
  1600. title: 'Upload Failed',
  1601. text: 'Failed to upload NOC: ' + error,
  1602. });
  1603. }
  1604. });
  1605. });
  1606. // Populate bookingId when opening the modal
  1607. $('#uploadNocModal').on('show.bs.modal', function (event) {
  1608. var button = $(event.relatedTarget); // Button that triggered the modal
  1609. var bookingId = button.data('booking-id'); // Extract bookingId from the button
  1610. $('#bookingssId').val(bookingId); // Set the bookingId in the hidden input field
  1611. });
  1612. });
  1613. // Function to track booking
  1614. function trackBooking(bookingId) {
  1615. $.ajax({
  1616. url: '/victoriahallbooking/user/api/trackBooking',
  1617. method: 'GET',
  1618. data: { bookingId: bookingId }, // Send booking ID to the server
  1619. success: function (data) {
  1620. // console.log("Received tracking data:", data);
  1621. // Clear the list initially before appending steps
  1622. $('#trackingList').empty();
  1623. if (Array.isArray(data) && data.length > 0) {
  1624. // Show the modal first
  1625. $('#trackingModal').modal('show');
  1626. // Create a Set to track seen statuses
  1627. const seenStatuses = new Set();
  1628. // Append steps one by one
  1629. data.forEach((event) => {
  1630. // Append each step if it hasn't been seen before
  1631. if (!seenStatuses.has(event.status)) {
  1632. seenStatuses.add(event.status); // Add status to Set
  1633. appendStep(event); // Call to append the event step
  1634. }
  1635. });
  1636. } else {
  1637. // Show a message when no tracking events are available
  1638. $('#trackingList').append('<li class="no-events">No tracking events available.</li>');
  1639. }
  1640. },
  1641. error: function (xhr, status, error) {
  1642. console.error("Failed to fetch booking details:", status, error);
  1643. alert('Failed to fetch booking details. Please try again later.');
  1644. }
  1645. });
  1646. }
  1647. function appendStep(event) {
  1648. const formattedDate = moment(event.dateTime).isValid()
  1649. ? moment(event.dateTime).format('MMM DD, YYYY, h:mm A') // Format date using Moment.js
  1650. : 'Invalid date';
  1651. const statusClass = getStatusClass(event.status); // Get CSS class for the status
  1652. const statusIcon = getStatusIcon(event.status); // Get icon for the status
  1653. // Create and append a step element for each event
  1654. const stepElement = `
  1655. <li class="tracking-step ${statusClass}">
  1656. <div class="step-icon">
  1657. <i class="fas ${statusIcon}"></i> <!-- Add the icon -->
  1658. </div>
  1659. <div class="step-content">
  1660. <h5>${event.description || 'No Description Available'}</h5> <!-- Event description -->
  1661. <p class="step-date">${formattedDate}</p> <!-- Formatted date -->
  1662. </div>
  1663. </li>
  1664. `;
  1665. // Append the element to the list
  1666. $('#trackingList').append(stepElement);
  1667. }
  1668. function getStatusClass(status) {
  1669. switch (status) {
  1670. case 'PAYMENT_SUCCESS':
  1671. case 'APPROVED':
  1672. case 'EVENT_COMPLETED':
  1673. case 'COMPLETED':
  1674. return 'completed'; // Returns 'completed' class for these statuses
  1675. case 'SETTLEMENT_RAISING':
  1676. return 'waiting';
  1677. case 'CANCELED':
  1678. return 'cancelled';
  1679. case 'REJECTED':
  1680. return 'rejected';
  1681. case 'GCC_BLOCKED':
  1682. return 'gcc-blocked';
  1683. default:
  1684. return 'pending'; // Default class if status is unknown
  1685. }
  1686. }
  1687. function getStatusIcon(status) {
  1688. switch (status) {
  1689. case 'PAYMENT_SUCCESS':
  1690. return 'fa-check-circle'; // Icon for payment success
  1691. case 'APPROVED':
  1692. return 'fa-thumbs-up';
  1693. case 'EVENT_COMPLETED':
  1694. return 'fa-calendar-check';
  1695. case 'CANCELED':
  1696. return 'fa-ban';
  1697. case 'REJECTED':
  1698. return 'fa-times-circle';
  1699. case 'GCC_BLOCKED':
  1700. return 'fa-lock';
  1701. default:
  1702. return 'fa-clock'; // Default icon for pending steps
  1703. }
  1704. }
  1705. function showFutureEvents() {
  1706. document.getElementById('futureEventsContainer').style.display = 'block';
  1707. }
  1708. function downloadAcknowledgment(event) {
  1709. event.preventDefault();
  1710. var bookingId = document.getElementById("booking_id").innerHTML;
  1711. var refId = document.getElementById("modalRefId").value;
  1712. // Redirect to the acknowledgment URL in the same tab
  1713. window.location.href = '/victoriahallbooking/user/acknowledgement?bookingId=' + encodeURIComponent(bookingId);
  1714. // var refId = document.getElementById("ref_" + bookingId).value;
  1715. console.log("Ref ID: " + refId);
  1716. window.location.href = '/victoriahallbooking/user/acknowledgement?ref_id=' + encodeURIComponent(refId);
  1717. }
  1718. function getTimeSlot(slotValue) {
  1719. var timeSlot;
  1720. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  1721. if (trimmedSlotValue === '1') {
  1722. timeSlot = 'Morning';
  1723. } else if (trimmedSlotValue === '2') {
  1724. timeSlot = 'Evening';
  1725. } else {
  1726. timeSlot = 'Unknown';
  1727. }
  1728. return timeSlot;
  1729. }
  1730. // function showBookingDetails(bookingId) {
  1731. function showBookingDetails(bookingId, refId) {
  1732. $.ajax({
  1733. url: '/victoriahallbooking/user/api/viewAllBookingDetails',
  1734. method: 'GET',
  1735. data: { bookingId: bookingId },
  1736. success: function (response) {
  1737. document.getElementById("td_userName").innerHTML = response.users.name;
  1738. document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo;
  1739. document.getElementById("td_usertype").innerHTML = response.users.usertype;
  1740. var userDetails = response.users;
  1741. var userDetailsString =
  1742. userDetails.doorNo + ", " +
  1743. userDetails.street + ", " +
  1744. userDetails.area + ", " +
  1745. userDetails.location + " ,Chennai- " +
  1746. userDetails.pinCode;
  1747. document.getElementById("td_useraddress").innerHTML = userDetailsString;
  1748. document.getElementById("td_hallName").innerHTML = response.hallDetails.hallName;
  1749. var hallDetails = response.hallDetails;
  1750. var hallDetailsString =
  1751. hallDetails.doorNo + ", " +
  1752. hallDetails.street + ", " +
  1753. hallDetails.area + ", " +
  1754. hallDetails.city + "- " +
  1755. hallDetails.pinCode;
  1756. document.getElementById("td_halladdress").innerHTML = hallDetailsString;
  1757. document.getElementById("td_caretakername").innerHTML = response.hallDetails.hallInchargeName;
  1758. document.getElementById("td_caretakermobileNumber").innerHTML = response.hallDetails.hallInchargeMobno;
  1759. document.getElementById("td_bookingDate").innerHTML = response.bookingDate;
  1760. document.getElementById("td_depositeAmount").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1761. document.getElementById("td_hallAmount").innerHTML = parseFloat(response.hallAmount).toFixed(2);
  1762. // Calculate GST and total amount
  1763. var gstAmount = (parseFloat(response.hallAmount) * (response.hallDetails.gst / 100)).toFixed(2);
  1764. var totalAmount = parseFloat(response.amountReceived).toFixed(2);
  1765. document.getElementById("td_gst").innerHTML = gstAmount;
  1766. document.getElementById("td_totalAmount").innerHTML = totalAmount;
  1767. document.getElementById("td_startDate").innerHTML = response.startDate;
  1768. document.getElementById("td_endDate").innerHTML = response.endDate;
  1769. document.getElementById("booking_id").innerHTML = response.bookingId;
  1770. function getTimeSlot(slotValue) {
  1771. var timeSlot;
  1772. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  1773. if (trimmedSlotValue === '1') {
  1774. timeSlot = 'Morning';
  1775. } else if (trimmedSlotValue === '2') {
  1776. timeSlot = 'Evening';
  1777. } else {
  1778. timeSlot = 'Unknown';
  1779. }
  1780. return timeSlot;
  1781. }
  1782. document.getElementById("td_startingSlot").innerHTML = getTimeSlot(response.startingSlot);
  1783. document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot);
  1784. document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus;
  1785. console.log("before comments user view history...");
  1786. console.log("Comments..." + response.comments);
  1787. if (response.bookingStatus === 'REJECTED' && response.comments) {
  1788. document.getElementById("rejectionreasondiv").style.display = "block";
  1789. const rejectionCell = document.getElementById("reasonforrejection");
  1790. rejectionCell.innerHTML = response.comments;
  1791. } else {
  1792. document.getElementById("rejectionreasondiv").style.display = "none";
  1793. document.getElementById("reasonforrejection").style.display = "none";
  1794. }
  1795. showReasonDocuments(response);
  1796. if (response.payments) {
  1797. document.getElementById("paymentsdetails").style.display = "block";
  1798. document.getElementById("td_transactionId").innerHTML = response.payments.transactionId;
  1799. document.getElementById("td_payamountReceived").innerHTML = response.payments.amountReceived;
  1800. document.getElementById("td_paymentStatus").innerHTML = response.payments.paymentStatus;
  1801. } else {
  1802. document.getElementById("paymentsdetails").style.display = "none";
  1803. }
  1804. if (response.ebDetails) {
  1805. document.getElementById("ebdetails").style.display = "block";
  1806. document.getElementById("td_EBNumber").innerHTML = response.hallDetails.ebNumber;
  1807. document.getElementById("td_startingReading").innerHTML = response.ebDetails.startingReading;
  1808. document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
  1809. document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
  1810. document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
  1811. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1812. } else {
  1813. document.getElementById("ebdetails").style.display = "none";
  1814. }
  1815. if (response.damageList && response.damageList.length > 0) {
  1816. document.getElementById("damagelist").style.display = "block";
  1817. } else {
  1818. document.getElementById("damagelist").style.display = "none";
  1819. }
  1820. if (response.settlement) {
  1821. document.getElementById("refunddetails").style.display = "block";
  1822. document.getElementById("td_depositeamountforrefund").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1823. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1824. document.getElementById("td_ebAmount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1825. document.getElementById("td_damage").innerHTML = parseFloat(response.settlement.damageAmount).toFixed(2);
  1826. var eb_amt = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1827. var deposit_amt = parseFloat(response.depositAmount).toFixed(2);
  1828. var tem_total = (deposit_amt - eb_amt).toFixed(2);
  1829. $("#td_settel_amt").html(tem_total);
  1830. } else {
  1831. document.getElementById("refunddetails").style.display = "none";
  1832. }
  1833. showDamageDetails(response);
  1834. if (response.bookingStatus === 'CANCELED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1835. document.getElementById("td_refundamount").innerHTML = `Your booking has been cancelled. Deposit amount of ₹ ${parseFloat(response.depositAmount).toFixed(2)} will be refund 3 to 15 Days`;
  1836. document.getElementById("refundamountDetails").style.display = "block";
  1837. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1838. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1839. } else if (response.bookingStatus === 'CANCELED' && response.refundStatus === 'COMPLETED') {
  1840. document.getElementById("td_refundamount").innerHTML = `Deposit amount of ₹ ${parseFloat(response.depositAmount).toFixed(2)} refunded successfully`;
  1841. document.getElementById("refundamountDetails").style.display = "block";
  1842. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1843. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1844. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus) && response.amountReceived == 0) {
  1845. document.getElementById("refundamountDetails").style.display = "none";
  1846. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1847. document.getElementById("td_refundamount").innerHTML = `Your booking has been Rejected by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1848. document.getElementById("refundamountDetails").style.display = "block";
  1849. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1850. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1851. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'COMPLETED') {
  1852. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1853. document.getElementById("refundamountDetails").style.display = "block";
  1854. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1855. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1856. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'NA') {
  1857. document.getElementById("td_refundamount").innerHTML = `Your Booking has been rejected by GCC`;
  1858. document.getElementById("refundamountDetails").style.display = "block";
  1859. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1860. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1861. } else if (response.bookingStatus === 'GCC_BLOCKED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1862. document.getElementById("td_refundamount").innerHTML = `Your booking has been Blocked by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1863. document.getElementById("refundamountDetails").style.display = "block";
  1864. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1865. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1866. } else if (response.bookingStatus === 'GCC_BLOCKED' && response.refundStatus === 'COMPLETED') {
  1867. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1868. document.getElementById("refundamountDetails").style.display = "block";
  1869. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1870. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1871. } /*else if(response.scheduleCount === 1){
  1872. document.getElementById("rescheduleDetails").style.display = "block";
  1873. document.getElementById("td_res_start_date").innerHTML = response.startDate;
  1874. document.getElementById("td_res_end_date").innerHTML = response.endDate;
  1875. document.getElementById("td_res_date").innerHTML = response.updatedDate;
  1876. }*/ else {
  1877. document.getElementById("refundamountDetails").style.display = "none";
  1878. }
  1879. // Show the modal
  1880. document.getElementById("modalBookingId").value = bookingId;
  1881. document.getElementById("modalRefId").value = refId;
  1882. $('#showBookingDetails').modal('show');
  1883. },
  1884. error: function () {
  1885. console.error("An error occurred while fetching booking details.");
  1886. }
  1887. });
  1888. }
  1889. function showDamageDetails(data) {
  1890. var damageFieldContainer = $('#damageDetails');
  1891. damageFieldContainer.empty();
  1892. // Create a div for table responsiveness
  1893. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({
  1894. 'margin-top': '-19px',
  1895. 'margin-left': '19px'
  1896. });
  1897. ;
  1898. // Create table with similar classes and styles to the modal table
  1899. var table = $('<table>').addClass('table table-bordered table-striped').css({
  1900. 'width': '97%',
  1901. 'border-color': 'black',
  1902. 'border-top-color': 'white',
  1903. 'width': ' 730px'
  1904. });
  1905. var thead = $('<thead>').addClass('thead-light');
  1906. var tbody = $('<tbody>');
  1907. // Create Damage Details header row
  1908. var headerRow = $('<tr>').appendTo(thead);
  1909. $('<th>').attr('colspan', '6').text('Damage Details (if any)').css({
  1910. 'padding': '0.45rem 0.45rem',
  1911. 'background-color': 'lightgrey',
  1912. 'font-weight': 'bold',
  1913. 'color': 'black',
  1914. }).appendTo(headerRow);
  1915. // Create table header row
  1916. var columnHeadersRow = $('<tr>').css('background-color', 'white').appendTo(thead);
  1917. $('<th>').text('S.No').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1918. $('<th>').text('Asset Name').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1919. $('<th>').text('Damage Img').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1920. $('<th>').text('Cost').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1921. $('<th>').text('Qty').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1922. $('<th>').text('Amount').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1923. var totalAmount = 0;
  1924. $.each(data.damageList, function (index, detail) {
  1925. var row = $('<tr>').appendTo(tbody);
  1926. $('<td>').text(index + 1).css('padding', '0.45rem 0.45rem').appendTo(row);
  1927. $('<td>').text(detail.assetName).css('padding', '0.45rem 0.45rem').appendTo(row);
  1928. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
  1929. showDamageImage(detail.damageImageUrl);
  1930. });
  1931. var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
  1932. $('<td>').css('padding', '0.45rem 0.45rem').append(viewLink).appendTo(row);
  1933. $('<td>').text(assetamt).css('padding', '0.45rem 0.45rem').appendTo(row);
  1934. $('<td>').text(detail.quantity).css('padding', '0.45rem 0.45rem').appendTo(row);
  1935. var amount = detail.assetAmount;
  1936. totalAmount += amount;
  1937. $('<td>').text(amount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(row);
  1938. $("#td_dam_amt").html(totalAmount.toFixed(2));
  1939. });
  1940. // Add row for total amount
  1941. var totalRow = $('<tr>').appendTo(tbody);
  1942. $('<td>').attr('colspan', '5').text('Total Amount').css('padding', '0.45rem 0.45rem; font-weight: bold; background-color: #f2f2f2').appendTo(totalRow);
  1943. $('<td>').text(totalAmount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(totalRow);
  1944. // Append the table elements to the container div
  1945. table.append(thead, tbody);
  1946. tableResponsiveDiv.append(table);
  1947. damageFieldContainer.append(tableResponsiveDiv);
  1948. var temp_total = parseFloat($("#td_settel_amt").html());
  1949. var settleAmount = temp_total - totalAmount;
  1950. if (settleAmount < 0) {
  1951. var pendingstatus = data.settlement.collectionStatus
  1952. $("#td_settel_amt").html(0.00);
  1953. $("#pendingcolumn").show();
  1954. $("#collectionstatuscolumn").show();
  1955. $('#td_collection_status').html(pendingstatus);
  1956. $("#td_pending_amt").html(Math.abs(settleAmount).toFixed(2));
  1957. $("#td_pending_amt").css("color", "red");
  1958. } else {
  1959. $("#td_settel_amt").html(settleAmount.toFixed(2));
  1960. $("#pendingcolumn").hide();
  1961. $("#collectionstatuscolumn").hide();
  1962. $("#td_settel_amt").css("color", "green"); // Set color to green for positive amounts
  1963. }
  1964. }
  1965. function showDamageImage(damageImageUrl) {
  1966. document.getElementById('filePreview').src = damageImageUrl;
  1967. $('#fileModal').modal('show');
  1968. }
  1969. function showchallonimage(challanImgLink) {
  1970. document.getElementById('filePreview').src = challanImgLink;
  1971. $('#fileModal').modal('show');
  1972. }
  1973. function showReasonDocuments(list) {
  1974. $.ajax({
  1975. type: "GET",
  1976. url: '/victoriahallbooking/api/officer/getReasonByName',
  1977. data: {
  1978. 'reasonName': list.reason
  1979. },
  1980. success: function (x) {
  1981. showReasonWithDocument(x, list);
  1982. }
  1983. });
  1984. }
  1985. // Display booking documents
  1986. function showReasonWithDocument(reasonData, list) {
  1987. var reasonDocumentData = reasonData.reasonDocumentMasterList;
  1988. var bookingDocumentsList = list.bookingDocumentsList;
  1989. const reasonFieldsContainer = $('#documents');
  1990. reasonFieldsContainer.empty();
  1991. // Create a responsive table container
  1992. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({
  1993. 'width': '729px',
  1994. 'border': '1px solid black'
  1995. });
  1996. // Create the table with Bootstrap classes and custom styles
  1997. var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
  1998. 'width': '100%',
  1999. 'height': 'auto',
  2000. 'border': '1px solid black'
  2001. });
  2002. // Create the table header (thead)
  2003. var thead = $('<thead>').appendTo(table);
  2004. var headerRow = $('<tr>').appendTo(thead);
  2005. $('<th>').attr('colspan', '3').text('Document Details').css({
  2006. 'color': 'black',
  2007. 'background-color': 'lightgrey',
  2008. 'padding': '0.45rem 0.45rem'
  2009. }).appendTo(headerRow);
  2010. // Create header row for columns
  2011. var columnHeadersRow = $('<tr>').appendTo(thead);
  2012. $('<th>').text('S.No').appendTo(columnHeadersRow);
  2013. $('<th>').text('Required Info').appendTo(columnHeadersRow);
  2014. $('<th>').text('Required Documents').appendTo(columnHeadersRow);
  2015. // Create the table body (tbody)
  2016. var tbody = $('<tbody>').appendTo(table);
  2017. // Iterate through the documents list and populate rows
  2018. for (var i = 0; i < bookingDocumentsList.length; i++) {
  2019. (function (index) {
  2020. var row = $('<tr>').appendTo(tbody);
  2021. $('<td>').text(index + 1).appendTo(row);
  2022. // Determine the text content for the second cell
  2023. var name = bookingDocumentsList[index].name ? bookingDocumentsList[index].name : ''; // Empty string if name is null or undefined
  2024. var fieldText = reasonDocumentData[index].fieldName;
  2025. var fullText = name ? fieldText + ': ' + name : fieldText; // Include colon only if name is not empty
  2026. $('<td>').text(fullText).appendTo(row);
  2027. // Create a link to view document image
  2028. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text(reasonDocumentData[index].docFieldName).on('click', function () {
  2029. showDocumentImage(bookingDocumentsList[index].bookingDocUrl);
  2030. });
  2031. $('<td>').append(viewLink).appendTo(row);
  2032. })(i);
  2033. }
  2034. // Append table to the responsive container
  2035. tableResponsiveDiv.append(table);
  2036. // Append table to the container in the DOM
  2037. reasonFieldsContainer.append(tableResponsiveDiv);
  2038. }
  2039. function showDocumentImage(fileURL) {
  2040. openFileModal(fileURL);
  2041. }
  2042. // Event delegation for dynamically added elements
  2043. $(document).on('click', '.view-document', function () {
  2044. const fileURL = $(this).data('url');
  2045. openFileModal(fileURL);
  2046. });
  2047. function openFileModal(fileURL) {
  2048. $('#filePreview').attr('src', fileURL);
  2049. $('#fileModal').modal('show');
  2050. }
  2051. // For OTP input box
  2052. $('.otp-input').on('keyup', function (e) {
  2053. var $this = $(this);
  2054. if ($this.val().length === 1) {
  2055. $this.next('.otp-input').focus();
  2056. }
  2057. if ($this.val().length === 0) {
  2058. $this.prev('.otp-input').focus();
  2059. }
  2060. });
  2061. function cancelBooking(bookingId, mobileNo, bookingType) {
  2062. var mobileNum = mobileNo;
  2063. var bookingId = bookingId;
  2064. // Check if the booking type is OFFLINE
  2065. if (bookingType === "OFFLINE") {
  2066. Swal.fire({
  2067. title: 'Cancellation Not Available',
  2068. text: 'Cancellation is not available for offline bookings.',
  2069. icon: 'error'
  2070. });
  2071. } else {
  2072. Swal.fire({
  2073. title: 'Are you sure?',
  2074. text: 'Once canceled, this action can\'t be undo. Only the deposit Amount will be refunded within 3 to 15 days.',
  2075. icon: 'warning',
  2076. showCancelButton: true,
  2077. confirmButtonColor: '#3085d6',
  2078. cancelButtonColor: '#d33',
  2079. confirmButtonText: 'Yes, cancel it!',
  2080. cancelButtonText: 'Close',
  2081. }).then((result) => {
  2082. if (result.isConfirmed) {
  2083. // If user confirms, show OTP form
  2084. mobileNumberForCancel = mobileNum;
  2085. cancelBookingId = bookingId;
  2086. cancelBookingLogin = true;
  2087. sendOTP(mobileNum);
  2088. }
  2089. });
  2090. }
  2091. }
  2092. function resetRescheduleOTPSection() {
  2093. // Hide OTP section
  2094. var otpSection = document.getElementById("otpSection");
  2095. if (otpSection) {
  2096. otpSection.style.display = "none";
  2097. }
  2098. // Show reschedule button and hide verify button
  2099. var rescheduleBtn = document.getElementById("rescheduleBtn");
  2100. var verifyOtpBtn = document.getElementById("verifyOtpBtn");
  2101. if (rescheduleBtn) {
  2102. rescheduleBtn.style.display = "inline-block";
  2103. }
  2104. if (verifyOtpBtn) {
  2105. verifyOtpBtn.style.display = "none";
  2106. }
  2107. // Clear OTP input fields
  2108. for (let i = 1; i <= 6; i++) {
  2109. var otpField = document.getElementById("otp" + i);
  2110. if (otpField) {
  2111. otpField.value = "";
  2112. }
  2113. }
  2114. // Reset variables
  2115. rescheduleBookingId = null;
  2116. rescheduleStartDate = null;
  2117. rescheduleEndDate = null;
  2118. rescheduleMobileNumber = null;
  2119. rescheduleHallId = null;
  2120. rescheduleStartingSlot = null;
  2121. rescheduleEndingSlot = null;
  2122. rescheduleReason = null;
  2123. }
  2124. function openRescheduleModal(bookingId, startDate, endDate, noOfDays, hallId, startingSlot, endingSlot, reason) {
  2125. // Function to map slot values to their text representation
  2126. function getSlotText(slot) {
  2127. return slot === 1 ? 'Morning' : 'Evening';
  2128. }
  2129. // Populate modal inputs
  2130. const start = new Date(startDate);
  2131. const end = new Date(endDate);
  2132. const timeDiff = end - start;
  2133. // Convert time difference from milliseconds to days
  2134. const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)) + 1;
  2135. // Set values for inputs
  2136. document.getElementById("bookingId").value = bookingId;
  2137. document.getElementById("startDateInput").value = startDate;
  2138. document.getElementById("endDateInput").value = endDate;
  2139. document.getElementById("noOfDaysInput").value = noOfDays;
  2140. document.getElementById("startingSlot").value = startingSlot;
  2141. document.getElementById("endingSlot").value = endingSlot;
  2142. document.getElementById("daysDiff").value = daysDiff;
  2143. // Display slot text in the modal
  2144. document.getElementById("startDatetext").value = startDate;
  2145. document.getElementById("startingSlotText").value = getSlotText(startingSlot);
  2146. document.getElementById("endingSlotText").value = getSlotText(endingSlot);
  2147. // Store booking details for OTP verification
  2148. rescheduleBookingId = bookingId;
  2149. rescheduleStartDate = startDate;
  2150. rescheduleEndDate = endDate;
  2151. rescheduleHallId = hallId;
  2152. rescheduleStartingSlot = startingSlot;
  2153. rescheduleEndingSlot = endingSlot;
  2154. rescheduleReason = reason;
  2155. // Optionally, fetch and update calendar or availability based on hallId
  2156. getBookingCalendar(hallId, reason);
  2157. // Show the date change modal
  2158. $('#bookingRescheduleModal').modal('show');
  2159. }
  2160. function getBookingCalendar(hall_id, reason) {
  2161. // Make an AJAX call to fetch booking data
  2162. $.ajax({
  2163. type: 'GET',
  2164. url: '/victoriahallbooking/user/api/getPastData',
  2165. data: {
  2166. hall_id: hall_id
  2167. },
  2168. success: function (response) {
  2169. window.bookingResponse = {};
  2170. if (response && Array.isArray(response)) {
  2171. $("#startDateInput").datepicker("destroy");
  2172. for (var i = 0; i < response.length; i++) {
  2173. var dateString = datepickerFormat(response[i].bdate);
  2174. window.bookingResponse[dateString] = [response[i].morningSlot, response[i].eveningSlot];
  2175. }
  2176. initializeDatepickerWithColors(hall_id, reason);
  2177. if (response.length == 0) {
  2178. initializeDatepickerWithColors(hall_id, reason);
  2179. }
  2180. } else {
  2181. console.error('Invalid or empty response data.');
  2182. }
  2183. },
  2184. error: function (xhr, status, error) {
  2185. console.error('Error fetching hall details:', error);
  2186. }
  2187. });
  2188. }
  2189. function initializeDatepickerWithColors(hallId, reason) { // Confirm hallId is passed here
  2190. $("#datepicker-container").datepicker("destroy");
  2191. const serverDate = new Date($("#serverDate").val() + "T00:00:00");
  2192. const minDate = new Date(serverDate);
  2193. minDate.setDate(minDate.getDate() + 30);
  2194. const maxDate = new Date(minDate);
  2195. maxDate.setDate(maxDate.getDate() + 30);
  2196. // console.log("View History: "+maxDate);
  2197. $("#startDateInput,#datepicker-container").datepicker({
  2198. dateFormat: "yy-mm-dd",
  2199. minDate: serverDate,
  2200. maxDate: maxDate,
  2201. beforeShowDay: function (eDate) {
  2202. const day = eDate.getDay(); // 0=Sun, 5=Fri, 6=Sat
  2203. if (![0, 5, 6].includes(day)) {
  2204. return [false, "highlight-disabled", "Bookings allowed only on Fri, Sat & Sun"];
  2205. }
  2206. const dateString = $.datepicker.formatDate("yy-mm-dd", eDate);
  2207. const bookingStatus = window.bookingResponse[dateString] || {};
  2208. // const currentDate = new Date();
  2209. serverDate.setHours(0, 0, 0, 0); // Normalize current date to midnight
  2210. eDate.setHours(0, 0, 0, 0); // Normalize selected date to midnight
  2211. // Logic for other dates
  2212. if (eDate < serverDate) {
  2213. return [false, "highlight-disabled", "Slot not Available"];
  2214. }
  2215. const isToday = eDate.getTime() === serverDate.getTime();
  2216. const currentHour = new Date().getHours();
  2217. const isBefore6AM = currentHour < 6;
  2218. const isAfter2PM = currentHour >= 14;
  2219. // Block 3-day logic for specific event types
  2220. // const today = new Date();
  2221. const blockedDate = new Date(serverDate);
  2222. blockedDate.setDate(serverDate.getDate() + 2);
  2223. const isThreeDayBlock = ["Commercial", "State Govt Event", "Central Govt Event"].includes(reason);
  2224. if (eDate <= blockedDate && isThreeDayBlock) {
  2225. return [false, "highlight-disabled", "Blocked due to event type"];
  2226. }
  2227. // Logic for currentdate
  2228. if (isToday) {
  2229. if (isBefore6AM) {
  2230. // Before 6 AM: Allow full-day booking or adjust based on booking status
  2231. return handleBookingStatus(bookingStatus, "Full Day Available");
  2232. } else if (isAfter2PM) {
  2233. // After 2 PM: Block all bookings
  2234. return handleAfter2PM(bookingStatus);
  2235. } else {
  2236. // Between 6 AM and 2 PM: Check status and disable morning slots
  2237. return handleMorningSlots(bookingStatus);
  2238. }
  2239. }
  2240. return handleBookingStatus(bookingStatus, "Slot Available");
  2241. },
  2242. });
  2243. $("#startDateInput").on("change", function () {
  2244. var selectedDate = $(this).val();
  2245. var noOfDays = document.getElementById('noOfDaysInput').value;
  2246. var startingSlot = document.getElementById("startingSlot").value;
  2247. var endingSlot = document.getElementById("endingSlot").value;
  2248. var noofdays = document.getElementById("noOfDaysInput").value;
  2249. updateEndDate(selectedDate, noofdays, startingSlot, endingSlot);
  2250. });
  2251. }
  2252. function handleBookingStatus(bookingStatus, defaultMessage) {
  2253. if (bookingStatus[2]) {
  2254. return [true, "highlight-blue disabled", "GCC Blocked"];
  2255. } /*else if (bookingStatus[3]) {
  2256. return [true, "highlight-lightpink disabled", "Temporary Blocked"];
  2257. }*/ else if (bookingStatus[0] && bookingStatus[1]) {
  2258. return [true, "highlight-pink disabled", "Slot Occupied"];
  2259. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2260. return [true, "highlight-pink disabled", "Slot Occupied"];
  2261. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2262. return [true, "highlight-violet", "Only Morning Slot Available"];
  2263. }
  2264. return [true, "highlight-greens", defaultMessage];
  2265. }
  2266. // Helper function: Handles logic after 2 PM
  2267. function handleAfter2PM(bookingStatus) {
  2268. if (bookingStatus[2]) {
  2269. return [true, "highlight-blue disabled", "GCC Blocked"];
  2270. } else if (bookingStatus[0] || bookingStatus[1]) {
  2271. return [true, "highlight-pink disabled", "Slot Occupied"];
  2272. }
  2273. return [false, "highlight-disabled", "Not Allowed to Book"];
  2274. }
  2275. // Helper function: Handles morning slots between 6 AM and 2 PM
  2276. function handleMorningSlots(bookingStatus) {
  2277. if (bookingStatus[2]) {
  2278. return [true, "highlight-blue disabled", "GCC Blocked"];
  2279. } else if (bookingStatus[0] && bookingStatus[1]) {
  2280. return [true, "highlight-pink disabled", "Slot Occupied"];
  2281. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2282. return [true, "highlight-pink disabled", "Slot Occupied"];
  2283. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2284. return [false, "highlight-disabled", "Slot Occupied"];
  2285. }
  2286. return [true, "highlight-pink disabled", "Slot Occupied"];
  2287. }
  2288. function updateEndDate(startDate, noofdays, startingSlot, endingSlot) {
  2289. if (startDate && noofdays !== undefined) {
  2290. var start = new Date(startDate);
  2291. var startFormatted = start.toISOString().split('T')[0];
  2292. var bookingStatus = window.bookingResponse[startFormatted] || [false, false];
  2293. var morningAvailable = !bookingStatus[0]; // false means available
  2294. var eveningAvailable = !bookingStatus[1]; // false means available
  2295. var endDate;
  2296. var isValid = true; // Flag to determine if all slots are available
  2297. // Convert noofdays to a number for accurate calculations
  2298. noofdays = parseFloat(noofdays);
  2299. // Handle slot availability and combinations
  2300. if (startingSlot === "2" && endingSlot === "2") { // Evening to Evening
  2301. //console.log("Handling Evening to Evening slot.");
  2302. if (noofdays === 0.5) {
  2303. if (eveningAvailable) {
  2304. endDate = new Date(start);
  2305. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2306. endDate = endDate.toISOString().split('T')[0];
  2307. document.getElementById('endDateInput').value = endDate;
  2308. //console.log("End Date (Evening to Evening):", endDate);
  2309. } else {
  2310. Swal.fire({
  2311. title: 'Evening Slot Not Available',
  2312. text: 'The evening slot is not available for the selected date range.',
  2313. icon: 'warning',
  2314. confirmButtonText: 'OK'
  2315. });
  2316. document.getElementById('endDateInput').value = "";
  2317. //console.log("Evening slot not available for", noofdays, "days.");
  2318. }
  2319. } else if (noofdays === 1.5) {
  2320. // Special handling for 2 days
  2321. let endDateCandidate = new Date(start);
  2322. endDateCandidate.setDate(start.getDate() + 1);
  2323. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2324. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2325. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2326. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2327. if (eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
  2328. endDate = endDateCandidate.toISOString().split('T')[0];
  2329. document.getElementById('endDateInput').value = endDate;
  2330. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2331. } else {
  2332. Swal.fire({
  2333. title: 'Slot Not Available',
  2334. text: 'The Morning slots are not available for the selected date range.',
  2335. icon: 'warning',
  2336. confirmButtonText: 'OK'
  2337. });
  2338. document.getElementById('endDateInput').value = "";
  2339. //console.log("Morning or Evening slot not available for 2 days.");
  2340. }
  2341. } else {
  2342. //console.log("Unsupported duration for Evening to Evening slot.");
  2343. Swal.fire({
  2344. title: 'Invalid Selection',
  2345. text: 'The selected duration for the evening slot is not supported.',
  2346. icon: 'error',
  2347. confirmButtonText: 'OK'
  2348. });
  2349. document.getElementById('endDateInput').value = "";
  2350. }
  2351. } else if (startingSlot === "1" && endingSlot === "1") { // Morning to Morning
  2352. //console.log("Handling Morning to Morning slot.");
  2353. if (noofdays === 0.5) {
  2354. if (morningAvailable) {
  2355. endDate = new Date(start);
  2356. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2357. endDate = endDate.toISOString().split('T')[0];
  2358. document.getElementById('endDateInput').value = endDate;
  2359. //console.log("End Date (morning to morning):", endDate);
  2360. } else {
  2361. Swal.fire({
  2362. title: 'Morning Slot Not Available',
  2363. text: 'The Morning slot is not available for the selected date range.',
  2364. icon: 'warning',
  2365. confirmButtonText: 'OK'
  2366. });
  2367. document.getElementById('endDateInput').value = "";
  2368. //console.log("Evening slot not available for", noofdays, "days.");
  2369. }
  2370. } else if (noofdays === 1.5) {
  2371. // Special handling for 2 days
  2372. let endDateCandidate = new Date(start);
  2373. endDateCandidate.setDate(start.getDate() + 1);
  2374. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2375. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2376. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2377. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2378. if (morningAvailable && eveningAvailable && morningAvailableOnEndDate) {
  2379. endDate = endDateCandidate.toISOString().split('T')[0];
  2380. document.getElementById('endDateInput').value = endDate;
  2381. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2382. } else {
  2383. Swal.fire({
  2384. title: 'Slot Not Available',
  2385. text: 'The evening slots are not available for the selected date range.',
  2386. icon: 'warning',
  2387. confirmButtonText: 'OK'
  2388. });
  2389. document.getElementById('endDateInput').value = "";
  2390. //console.log("Morning or Evening slot not available for 2 days.");
  2391. }
  2392. } else {
  2393. //console.log("Unsupported duration for Morning to Morning slot.");
  2394. Swal.fire({
  2395. title: 'Invalid Selection',
  2396. text: 'The selected duration for the morning slot is not supported.',
  2397. icon: 'error',
  2398. confirmButtonText: 'OK'
  2399. });
  2400. document.getElementById('endDateInput').value = "";
  2401. }
  2402. } else if (startingSlot === "1" && endingSlot === "2") { // Morning to Evening
  2403. //console.log("Handling Morning to Evening slot.");
  2404. if (noofdays === 1) {
  2405. if (morningAvailable && eveningAvailable) {
  2406. endDate = new Date(start);
  2407. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2408. endDate = endDate.toISOString().split('T')[0];
  2409. document.getElementById('endDateInput').value = endDate;
  2410. //console.log("End Date (Morning to Evening):", endDate);
  2411. } else {
  2412. Swal.fire({
  2413. title: ' Slot Not Available',
  2414. text: 'The Selected slot is not available for the selected date range.',
  2415. icon: 'warning',
  2416. confirmButtonText: 'OK'
  2417. });
  2418. document.getElementById('endDateInput').value = "";
  2419. //console.log("Evening slot not available for", noofdays, "days.");
  2420. }
  2421. } else if (noofdays === 2) {
  2422. // Special handling for 2 days
  2423. let endDateCandidate = new Date(start);
  2424. endDateCandidate.setDate(start.getDate() + 1);
  2425. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2426. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2427. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2428. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2429. if (morningAvailable && eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
  2430. endDate = endDateCandidate.toISOString().split('T')[0];
  2431. document.getElementById('endDateInput').value = endDate;
  2432. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2433. } else {
  2434. Swal.fire({
  2435. title: 'Slot Not Available',
  2436. text: 'The morning and/or evening slots are not available for the selected date range.',
  2437. icon: 'warning',
  2438. confirmButtonText: 'OK'
  2439. });
  2440. document.getElementById('endDateInput').value = "";
  2441. //console.log("Morning or Evening slot not available for 2 days.");
  2442. }
  2443. } else {
  2444. //console.log("Unsupported duration for Morning to Evening slot.");
  2445. Swal.fire({
  2446. title: 'Invalid Selection',
  2447. text: 'The selected duration for the morning to evening slot is not supported.',
  2448. icon: 'error',
  2449. confirmButtonText: 'OK'
  2450. });
  2451. document.getElementById('endDateInput').value = "";
  2452. }
  2453. } else if (startingSlot === "2" && endingSlot === "1") { // Evening to Morning
  2454. //console.log("Handling Evening to Morning slot.");
  2455. if (noofdays === 1) {
  2456. if (eveningAvailable) { // Check if evening slot is available
  2457. let nextDay = new Date(start);
  2458. nextDay.setDate(start.getDate() + 1);
  2459. let nextDayFormatted = nextDay.toISOString().split('T')[0];
  2460. let nextDayStatus = window.bookingResponse[nextDayFormatted] || [false, false];
  2461. let nextDayMorningAvailable = !nextDayStatus[0]; // false means available
  2462. if (nextDayMorningAvailable) {
  2463. endDate = nextDay.toISOString().split('T')[0];
  2464. document.getElementById('endDateInput').value = endDate;
  2465. //console.log("End Date (Evening to Morning):", endDate);
  2466. } else {
  2467. Swal.fire({
  2468. title: 'Morning Slot Not Available',
  2469. text: 'The morning slot is not available for the next day.',
  2470. icon: 'warning',
  2471. confirmButtonText: 'OK'
  2472. });
  2473. document.getElementById('endDateInput').value = "";
  2474. //console.log("Morning slot not available for the next day.");
  2475. }
  2476. } else {
  2477. Swal.fire({
  2478. title: 'Evening Slot Not Available',
  2479. text: 'The evening slot is not available for the selected date.',
  2480. icon: 'warning',
  2481. confirmButtonText: 'OK'
  2482. });
  2483. document.getElementById('endDateInput').value = "";
  2484. //console.log("Evening slot not available for", startDate);
  2485. }
  2486. } else {
  2487. //console.log("Unsupported duration for Evening to Morning slot.");
  2488. Swal.fire({
  2489. title: 'Invalid Selection',
  2490. text: 'The selected duration for the evening to morning slot is not supported.',
  2491. icon: 'error',
  2492. confirmButtonText: 'OK'
  2493. });
  2494. document.getElementById('endDateInput').value = "";
  2495. }
  2496. } else {
  2497. //console.log("Unsupported slot combination or duration.");
  2498. Swal.fire({
  2499. title: 'Invalid Slot Combination',
  2500. text: 'The selected slot combination or duration is not supported.',
  2501. icon: 'error',
  2502. confirmButtonText: 'OK'
  2503. });
  2504. document.getElementById('endDateInput').value = "";
  2505. }
  2506. } else {
  2507. //console.log("Start Date or Number of Days not provided.");
  2508. Swal.fire({
  2509. title: 'Invalid Input',
  2510. text: 'Please provide a valid start date and number of days.',
  2511. icon: 'error',
  2512. confirmButtonText: 'OK'
  2513. });
  2514. document.getElementById('endDateInput').value = "";
  2515. }
  2516. }
  2517. function datepickerFormat(dateString) {
  2518. var dateObject = new Date(dateString);
  2519. var year = dateObject.getFullYear();
  2520. var month = (dateObject.getMonth() + 1).toString().padStart(2, "0");
  2521. var day = dateObject.getDate().toString().padStart(2, "0");
  2522. return `${year}-${month}-${day}`;
  2523. }
  2524. function printTables() {
  2525. // Get the printable content
  2526. var printableContent = document.getElementById('printableContent').innerHTML;
  2527. // Open a print window
  2528. var printWindow = window.open('', '', 'height=400,width=600');
  2529. // Write the printable content to the print window
  2530. printWindow.document.write('<html><head><title>Print</title></head><body>' + printableContent + '</body></html>');
  2531. // Close the print window after printing
  2532. printWindow.document.close();
  2533. printWindow.print();
  2534. printWindow.close();
  2535. }
  2536. function Reschedule() {
  2537. // Get mobile number and show OTP modal for verification
  2538. $.ajax({
  2539. type: "GET",
  2540. url: '/victoriahallbooking/user/api/viewAllBookingDetails',
  2541. data: { bookingId: rescheduleBookingId },
  2542. success: function (response) {
  2543. rescheduleMobileNumber = response.users.mobileNo;
  2544. // Show mobile number in OTP modal
  2545. document.getElementById("rescheduleMobileTxt").textContent = rescheduleMobileNumber;
  2546. // Clear any previous OTP errors
  2547. document.getElementById("rescheduleOtpError").textContent = "";
  2548. // Clear OTP inputs
  2549. for (let i = 1; i <= 5; i++) {
  2550. document.getElementById("rescheduleOtp" + i).value = "";
  2551. }
  2552. // Close date change modal and show OTP modal
  2553. $('#bookingRescheduleModal').modal('hide');
  2554. $('#rescheduleOtpModal').modal('show');
  2555. // Send OTP immediately
  2556. sendRescheduleOTP(rescheduleMobileNumber);
  2557. },
  2558. error: function () {
  2559. Swal.fire({
  2560. icon: 'error',
  2561. title: 'Error',
  2562. text: 'Failed to get booking details. Please try again.',
  2563. showConfirmButton: true
  2564. });
  2565. }
  2566. });
  2567. }
  2568. function sendRescheduleOTP(mobileNumber) {
  2569. $.ajax({
  2570. type: "GET",
  2571. url: "/victoriahallbooking/user/api/sendOTP",
  2572. data: {
  2573. mobileNo: mobileNumber,
  2574. purpose: "reschedule"
  2575. },
  2576. success: function (response) {
  2577. // Start countdown timer
  2578. startRescheduleCountdown();
  2579. },
  2580. error: function () {
  2581. Swal.fire({
  2582. icon: 'error',
  2583. title: 'Error',
  2584. text: 'Failed to send OTP. Please try again.',
  2585. showConfirmButton: true
  2586. });
  2587. }
  2588. });
  2589. }
  2590. function startRescheduleCountdown() {
  2591. var resendTimeout;
  2592. var resendLink = $("#rescheduleResendLink");
  2593. $("#rescheduleResendLink").html('<a href="#" id="rescheduleResendLink" class="text-info" onclick="return resendRescheduleOTP();">Resend OTP</a>');
  2594. var countdown = $("#rescheduleCountdown");
  2595. function startCountdown() {
  2596. var timeleft = 60;
  2597. countdown.text(timeleft);
  2598. resendTimeout = setInterval(function () {
  2599. timeleft--;
  2600. countdown.text(timeleft);
  2601. if (timeleft <= 0) {
  2602. clearInterval(resendTimeout);
  2603. $("#rescheduleResendLink").html('<a href="#" id="rescheduleResendLink" class="text-info" onclick="return sendRescheduleOTP(' + rescheduleMobileNumber + ');">Resend OTP</a>');
  2604. }
  2605. }, 1000);
  2606. }
  2607. startCountdown();
  2608. }
  2609. function resendRescheduleOTP() {
  2610. if (rescheduleMobileNumber) {
  2611. sendRescheduleOTP(rescheduleMobileNumber);
  2612. // Restart countdown timer after resending OTP
  2613. startRescheduleCountdown();
  2614. }
  2615. }
  2616. function verifyRescheduleOtp() {
  2617. // Get all the input fields with class `otp-input`
  2618. var otpInputs = $('.otp-input');
  2619. // Get the OTP value as a string
  2620. var otpValue = '';
  2621. otpInputs.each(function () {
  2622. otpValue += $(this).val();
  2623. });
  2624. if (otpValue.length !== 5) {
  2625. document.getElementById("rescheduleOtpError").textContent = "Please enter complete OTP";
  2626. return false;
  2627. }
  2628. // Verify OTP
  2629. $.ajax({
  2630. type: "GET",
  2631. url: "/victoriahallbooking/user/api/verifyofficialOTP",
  2632. data: {
  2633. otp: otpValue
  2634. },
  2635. dataType: 'text',
  2636. success: function (response) {
  2637. if (response.trim() === "Success") {
  2638. // OTP verified successfully, close OTP modal and proceed with reschedule
  2639. $('#rescheduleOtpModal').modal('hide');
  2640. validateDatesAndReschedule();
  2641. } else {
  2642. document.getElementById("rescheduleOtpError").textContent = "OTP is Incorrect!!!";
  2643. // Clear OTP inputs
  2644. for (let i = 1; i <= 5; i++) {
  2645. document.getElementById("rescheduleOtp" + i).value = "";
  2646. }
  2647. }
  2648. },
  2649. error: function () {
  2650. document.getElementById("rescheduleOtpError").textContent = "Error verifying OTP. Please try again.";
  2651. }
  2652. });
  2653. return false;
  2654. }
  2655. function proceedWithReschedule() {
  2656. // Debug: Log the data being sent
  2657. console.log('Reschedule data:', {
  2658. bookingId: rescheduleBookingId,
  2659. startDate: rescheduleStartDate,
  2660. endDate: rescheduleEndDate
  2661. });
  2662. $.ajax({
  2663. type: "POST",
  2664. url: "/victoriahallbooking/user/api/reschedule-dates",
  2665. data: {
  2666. bookingId: rescheduleBookingId,
  2667. startDate: rescheduleStartDate,
  2668. endDate: rescheduleEndDate
  2669. },
  2670. success: function (response) {
  2671. Swal.fire({
  2672. icon: 'success',
  2673. title: 'Success',
  2674. text: 'Booking rescheduled successfully!',
  2675. showConfirmButton: true
  2676. }).then((result) => {
  2677. if (result.isConfirmed) {
  2678. // Close modal and reload page
  2679. $('#bookingRescheduleModal').modal('hide');
  2680. location.reload();
  2681. }
  2682. });
  2683. },
  2684. error: function (xhr, status, error) {
  2685. console.error('Reschedule API Error:', {
  2686. status: xhr.status,
  2687. statusText: xhr.statusText,
  2688. responseText: xhr.responseText,
  2689. error: error
  2690. });
  2691. let errorMessage = 'Failed to reschedule booking. Please try again.';
  2692. if (xhr.responseText) {
  2693. try {
  2694. const errorData = JSON.parse(xhr.responseText);
  2695. errorMessage = errorData.message || errorData.error || errorMessage;
  2696. } catch (e) {
  2697. errorMessage = xhr.responseText || errorMessage;
  2698. }
  2699. }
  2700. Swal.fire({
  2701. icon: 'error',
  2702. title: 'Error',
  2703. text: errorMessage,
  2704. showConfirmButton: true
  2705. });
  2706. }
  2707. });
  2708. }
  2709. function validateDatesAndReschedule() {
  2710. // Retrieve values from modal inputs
  2711. var startDate = document.getElementById("startDateInput").value;
  2712. var endDate = document.getElementById("endDateInput").value;
  2713. var originalStartDate = document.getElementById("startDatetext").value;
  2714. // Debug: Log the retrieved dates
  2715. console.log('Retrieved dates:', {
  2716. startDate: startDate,
  2717. endDate: endDate,
  2718. originalStartDate: originalStartDate
  2719. });
  2720. // Check if the rescheduled start date is the same as the original booked start date
  2721. if (startDate === originalStartDate) {
  2722. Swal.fire({
  2723. icon: 'warning',
  2724. title: 'Warning',
  2725. text: 'Your Rescheduled Start Date is the same as Your booking Start Date. Please change the date.',
  2726. showConfirmButton: true
  2727. });
  2728. return;
  2729. }
  2730. if (!endDate) {
  2731. Swal.fire({
  2732. icon: 'error',
  2733. title: 'Error',
  2734. text: 'End Date is Empty! Please check your Start Date',
  2735. showConfirmButton: true
  2736. });
  2737. return;
  2738. }
  2739. // Store the validated dates
  2740. rescheduleStartDate = startDate;
  2741. rescheduleEndDate = endDate;
  2742. // Debug: Log the final dates being sent
  2743. console.log('Final reschedule dates:', {
  2744. startDate: rescheduleStartDate,
  2745. endDate: rescheduleEndDate,
  2746. bookingId: rescheduleBookingId
  2747. });
  2748. // Proceed with reschedule
  2749. proceedWithReschedule();
  2750. }
  2751. $(document).ready(function () {
  2752. // DataTables buttons configuration
  2753. var buttons = [
  2754. {
  2755. extend: 'pageLength',
  2756. className: 'btn btn-primary'
  2757. }
  2758. ];
  2759. $('#simpletable').DataTable({
  2760. dom: 'Bftip',
  2761. columnDefs: [
  2762. { targets: 'no-sort', orderable: false }
  2763. ],
  2764. lengthMenu: [
  2765. [5, 10, 20, 50, -1],
  2766. ['5 rows', '10 rows', '20 rows', '50 rows', 'Show all']
  2767. ],
  2768. scrollY: '50vh',
  2769. fixedColumns: {
  2770. left: 1,
  2771. right: 1
  2772. },
  2773. buttons: [buttons],
  2774. responsive: true,
  2775. searching: true, // Enable search
  2776. select: false,
  2777. processing: false,
  2778. });
  2779. $('#searchInput').on('keyup', function () {
  2780. dataTable.search(this.value).draw();
  2781. });
  2782. });
  2783. $(document).on('change', '.nocfile', function () {
  2784. validateFile(this);
  2785. });
  2786. function transactionHistory(userId) {
  2787. $.ajax({
  2788. type: "GET",
  2789. url: '/victoriahallbooking/user/api/getTransactionDetails',
  2790. data: { 'userId': userId },
  2791. success: function (data) {
  2792. // console.log("Full response:", data);
  2793. // console.log("Refund Details:", data.refundDetails);
  2794. const transactions = data.transactions || [];
  2795. const refundDetails = data.refundDetails || [];
  2796. populateTransactionTable(transactions);
  2797. populateRefundDetailsTable(refundDetails);
  2798. $('#transactionHistoryModal').modal('show'); // Show the modal
  2799. },
  2800. error: function (error) {
  2801. console.error("Error fetching transaction details", error);
  2802. }
  2803. });
  2804. }
  2805. function populateTransactionTable(transactions) {
  2806. const tableBody = $('#transactionTable tbody');
  2807. tableBody.empty(); // Clear any existing rows
  2808. transactions.forEach((transaction, index) => {
  2809. const paymentStatus = (transaction.statusCode === "0300" && transaction.response?.includes("success"))
  2810. ? "Success"
  2811. : "Payment Failed";
  2812. const row = `
  2813. <tr>
  2814. <td>${index + 1}</td>
  2815. <td>${transaction.bookingId}</td>
  2816. <td>${transaction.amount || '-'}</td>
  2817. <td>${transaction.date || '-'}</td>
  2818. <td>${transaction.txansactionId || '-'}</td>
  2819. <td>${paymentStatus}</td>
  2820. </tr>
  2821. `;
  2822. tableBody.append(row); // Append the row to the table body
  2823. });
  2824. }
  2825. function populateRefundDetailsTable(refundDetails) {
  2826. const refundTable = $('#refunddetails');
  2827. const tableBody = $('#refunddetailsTable tbody');
  2828. tableBody.empty(); // Clear any existing rows
  2829. if (refundDetails.length > 0) {
  2830. refundTable.show(); // Show the refund details table
  2831. refundDetails.forEach((refund, index) => {
  2832. const row = `
  2833. <tr>
  2834. <td>${index + 1}</td>
  2835. <td>${refund.bookingId}</td>
  2836. <td>${refund.amount}</td>
  2837. <td>${refund.date}</td>
  2838. <td>${refund.txansactionId}</td>
  2839. <td>${refund.refundAmount}</td>
  2840. </tr>
  2841. `;
  2842. tableBody.append(row);
  2843. });
  2844. } else {
  2845. refundTable.hide(); // Hide the refund details table
  2846. }
  2847. }
  2848. // Toggle Chat Box
  2849. function toggleChat() {
  2850. const chatBox = document.getElementById('chat-box');
  2851. chatBox.style.display = (chatBox.style.display === 'block') ? 'none' : 'block';
  2852. }
  2853. // Send Message
  2854. function sendMessage() {
  2855. const userInput = document.getElementById('userInput');
  2856. const message = userInput.value.trim();
  2857. if (message) {
  2858. // Create message element
  2859. const chatBody = document.getElementById('chat-body');
  2860. const userMessage = document.createElement('div');
  2861. userMessage.className = 'user-message';
  2862. userMessage.textContent = message;
  2863. chatBody.appendChild(userMessage);
  2864. chatBody.scrollTop = chatBody.scrollHeight; // Auto-scroll to bottom
  2865. // Send message to the server (Spring Boot API)
  2866. fetch('/victoriahallbooking/admin/api/send', {
  2867. method: 'POST',
  2868. headers: {
  2869. 'Content-Type': 'application/json',
  2870. },
  2871. body: JSON.stringify({ message }),
  2872. })
  2873. .then(response => response.json())
  2874. .then(data => {
  2875. // Add response message to chat
  2876. const responseMessage = document.createElement('div');
  2877. responseMessage.className = 'bot-message';
  2878. responseMessage.textContent = data.response;
  2879. chatBody.appendChild(responseMessage);
  2880. chatBody.scrollTop = chatBody.scrollHeight;
  2881. });
  2882. userInput.value = ''; // Clear input field
  2883. }
  2884. }
  2885. // OTP input navigation for reschedule modal
  2886. $('.otp-input').on('keyup', function (e) {
  2887. var $this = $(this);
  2888. if ($this.val().length === 1) {
  2889. $this.next('.otp-input').focus();
  2890. }
  2891. if ($this.val().length === 0) {
  2892. $this.prev('.otp-input').focus();
  2893. }
  2894. });
  2895. // Clear OTP inputs when OTP modal is shown
  2896. $('#rescheduleOtpModal').on('shown.bs.modal', function () {
  2897. $('.otp-input').val('');
  2898. $('#rescheduleOtpError').text('');
  2899. });
  2900. </script>
  2901. </div>
  2902. </div>
  2903. </div>
  2904. </body>
  2905. </html>