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.

2847 lines
155 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
  3. <head th:replace="~{fragments/head :: head}">
  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. </style>
  436. <body>
  437. <!-- Pre-loader start -->
  438. <div class="theme-loader">
  439. <div class="ball-scale">
  440. <div class='contain'>
  441. <div class="ring">
  442. <div class="frame"></div>
  443. </div>
  444. <div class="ring">
  445. <div class="frame"></div>
  446. </div>
  447. <div class="ring">
  448. <div class="frame"></div>
  449. </div>
  450. <div class="ring">
  451. <div class="frame"></div>
  452. </div>
  453. <div class="ring">
  454. <div class="frame"></div>
  455. </div>
  456. <div class="ring">
  457. <div class="frame"></div>
  458. </div>
  459. <div class="ring">
  460. <div class="frame"></div>
  461. </div>
  462. <div class="ring">
  463. <div class="frame"></div>
  464. </div>
  465. <div class="ring">
  466. <div class="frame"></div>
  467. </div>
  468. <div class="ring">
  469. <div class="frame"></div>
  470. </div>
  471. </div>
  472. </div>
  473. </div>
  474. <!-- Pre-loader end -->
  475. <div id="pcoded" class="pcoded">
  476. <div class="pcoded-container">
  477. <!-- Menu header start -->
  478. <nav th:replace="~{fragments/nav-user :: nav}"></nav>
  479. <!-- Menu header end -->
  480. <div class="pcoded-main-container">
  481. <nav th:replace="~{fragments/nav-usermenu :: nav}"></nav>
  482. <div class="pcoded-wrapper">
  483. <div class="pcoded-content">
  484. <div class="pcoded-inner-content">
  485. <!-- Main-body start -->
  486. <div class="main-body" style="background-color: white">
  487. <div class="page-wrapper" style="padding: 0;">
  488. <!-- Page-header start -->
  489. <div class="page-header m-t-50">
  490. </div>
  491. <div id="futureEventsContainer" class="page-body" style="display: none;"></div>
  492. <div class="card">
  493. <div class="card-header">
  494. <h5>Hall Booking Details</h5>
  495. <button type="button" class="btn btn-primary btn-square-md"
  496. th:if="${userBookingspast.size() > 0}"
  497. th:onclick="'transactionHistory(' + ${userBookingspast[0].users_user_id} + ')'">
  498. Transaction History
  499. </button>
  500. </div>
  501. <div class="card-block">
  502. <div class="table-responsive">
  503. <table
  504. class="table table-bordered table-striped table-vcenter js-dataTable-responsive"
  505. id="detailstable" style="width: 100%">
  506. <thead class="thead-light">
  507. <tr>
  508. <th class="text-center no-sort" width="10%">S.No</th>
  509. <th>Booking Id</th>
  510. <th>Booking date</th>
  511. <th>Hall Name</th>
  512. <th>Starting Date</th>
  513. <th>Ending Date</th>
  514. <th>Starting Period</th>
  515. <th>Ending Period</th>
  516. <th>Reason for booking</th>
  517. <th>Booking Status</th>
  518. <th>Payment Status</th>
  519. <th>Event Status</th>
  520. <th class="text-center no-sort" width="10%">Action</th>
  521. <th>View</th>
  522. </tr>
  523. </thead>
  524. <tbody>
  525. <tr th:each="booking, i : ${userBookingspast}"
  526. class="${userBookingspast}">
  527. <td th:text="${i.count}"></td>
  528. <td th:text="${booking.booking_id}"></td>
  529. <td th:text="${booking.booking_date}"></td>
  530. <td th:text="${booking.hall_name}"></td>
  531. <td th:text="${booking.start_date}"></td>
  532. <td th:text="${booking.end_date}"></td>
  533. <td
  534. th:text="${booking.starting_slot == 1 ? 'morning' : (booking.starting_slot == 2 ? 'evening' : '')}">
  535. </td>
  536. <td
  537. th:text="${booking.ending_slot == 1 ? 'morning' : (booking.ending_slot == 2 ? 'evening' : '')}">
  538. </td>
  539. <td th:text="${booking.reason}"></td>
  540. <td
  541. th:text="${#strings.replace(booking.booking_status, '_', ' ')}">
  542. </td>
  543. <td
  544. th:text="${booking.payment_status != null ? booking.payment_status : 'NA'}">
  545. </td>
  546. <td>
  547. <span th:if="${booking.booking_status == 'APPROVED'}">
  548. <span th:switch="${booking.event_category}">
  549. <span th:case="'Current'">Current Event</span>
  550. <span th:case="'Past'">Completed Event</span>
  551. <span th:case="'Future'">Upcoming Event</span>
  552. <span th:case="'Reschedule'">Upcoming
  553. Event</span>
  554. <span th:case="'noaction'">Govt Event</span>
  555. </span>
  556. </span>
  557. <span th:if="${booking.booking_status == 'COMPLETED'}">
  558. <span>Refund Completed Event</span>
  559. </span>
  560. <span th:if="${booking.booking_status == 'CANCELED'}">
  561. <span>User Canceled Event</span>
  562. </span>
  563. <span th:if="${booking.booking_status == 'REJECTED'}">
  564. <span>GCC Rejected Event</span>
  565. </span>
  566. <span
  567. th:if="${booking.booking_status == 'GCC_BLOCKED'}">
  568. <span>GCC Blocked Event</span>
  569. </span>
  570. <span
  571. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  572. <span>Waiting For NOC Document</span>
  573. </span>
  574. <span
  575. th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL'}">
  576. <span>Waiting For Admin Approval</span>
  577. </span>
  578. </td>
  579. <td th:switch="${booking.event_category}">
  580. <p th:case="'Future'">
  581. <a class="view-button"
  582. th:if="${booking.booking_status == 'APPROVED'}">
  583. <span class="badge bg-danger"
  584. style="cursor: pointer;"
  585. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  586. Booking</span>
  587. </a>
  588. </p>
  589. <p th:case="'waitingfornoc'">
  590. <a class="view-button"
  591. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  592. <span class="badge bg-danger"
  593. style="cursor: pointer;"
  594. data-bs-toggle="modal"
  595. data-bs-target="#uploadNocModal"
  596. th:attr="data-booking-id=${booking.booking_id}">Upload
  597. NOC</span>
  598. </a>
  599. <a class="view-button"
  600. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  601. <span class="badge bg-danger"
  602. style="cursor: pointer;"
  603. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  604. Booking</span>
  605. </a>
  606. <!--<a class="reschedule-button"
  607. th:if="${booking.booking_status == 'WAITING_FOR_NOC' and booking.schedule_count < 1}">
  608. &lt;!&ndash;th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">&ndash;&gt;
  609. <span class="badge bg-danger"
  610. style="cursor: pointer;"
  611. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  612. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  613. Booking</span>
  614. </a>-->
  615. </p>
  616. <p th:case="'waitingfornocapproval'">
  617. <a class="view-button"
  618. th:if="${booking.booking_status == 'WAITING_FOR_NOC_APPROVAL'}">
  619. <span class="badge bg-danger"
  620. style="cursor: pointer;"
  621. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  622. Booking</span>
  623. </a>
  624. </p>
  625. <!--<p th:case="'noaction'">
  626. <a class="view-button">
  627. <span>&#45;&#45;No Action&#45;&#45;</span>
  628. </a>
  629. </p>-->
  630. <p th:case="'noaction'">
  631. <a class="view-button">
  632. <a class="view-button"
  633. th:if="${booking.booking_status == 'APPROVED'}">
  634. <span class="badge bg-danger"
  635. style="cursor: pointer;"
  636. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  637. Booking</span>
  638. </a>
  639. </a>
  640. </p>
  641. <p th:case="'noaction'">
  642. <a class="view-button">
  643. <span>--No Action--</span>
  644. </a>
  645. </p>
  646. <p th:case="'Reschedule'">
  647. <a class="view-button"
  648. th:if="${booking.booking_status == 'APPROVED'}">
  649. <span class="badge bg-danger"
  650. style="cursor: pointer;"
  651. th:onclick="cancelBooking([[${booking.booking_id}]], [[${booking.mobile_no}]], [[${booking.booking_type}]])">Cancel
  652. Booking</span>
  653. </a>
  654. <a class="reschedule-button"
  655. th:if="${booking.booking_status == 'APPROVED'}">
  656. <span class="badge bg-danger"
  657. style="cursor: pointer;"
  658. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  659. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  660. Booking</span>
  661. </a>
  662. <a class="reschedule-button"
  663. th:if="${booking.booking_status == 'WAITING_FOR_NOC'}">
  664. <span class="badge bg-danger"
  665. style="cursor: pointer;"
  666. th:onclick="openRescheduleModal([[${booking.booking_id}]], [[${booking.start_date}]], [[${booking.end_date}]],[[${booking.no_of_days}]],
  667. [[${booking.hall_details_hall_id}]],[[${booking.starting_slot}]],[[${booking.ending_slot}]],[[${booking.reason}]])">Reschedule
  668. Booking</span>
  669. </a>
  670. </p>
  671. </td>
  672. <td>
  673. <a class="view-button">
  674. <span class="badge bg-primary"
  675. style="cursor: pointer;"
  676. th:onclick="showBookingDetails([[${booking.booking_id}]])">View</span>
  677. </a>
  678. <!--<a class="view-button">
  679. <span class="badge bg-primary"
  680. style="cursor: pointer;"
  681. th:onclick="trackBooking([[${booking.booking_id}]])">Track</span>
  682. </a>-->
  683. </td>
  684. </tr>
  685. </tbody>
  686. </table>
  687. </div>
  688. </div>
  689. </div>
  690. <input type="hidden" id="serverDate" th:value=${serverDate}>
  691. <div class="modal fade backdrop" id="showBookingDetails" data-backdrop="static"
  692. tabindex="-1" role="dialog" aria-labelledby="staticBackdropLabel"
  693. aria-hidden="true">
  694. <div class="modal-dialog modal-lg" role="document">
  695. <div class="modal-content" id="printableContent">
  696. <form id="regform" onsubmit="return rejectsubmit();">
  697. <div
  698. class="block block-rounded block-themed block-transparent mb-0">
  699. <div class="block-header bg-primary-dark">
  700. <h3 class="block-title" id="2mtitle">Booking
  701. Information</h3>
  702. <div class="block-options">
  703. <button type="button" class="btn-block-option"
  704. data-bs-dismiss="modal" aria-label="Close">
  705. <i class="fa fa-fw fa-times"></i>
  706. </button>
  707. </div>
  708. </div>
  709. <div class="block-content row"
  710. style="margin-right:0px;margin:0;padding:0;">
  711. <div class="col-md-12 col-lg-12 col-sm-12">
  712. <div class="card-body">
  713. <table>
  714. <tr>
  715. <th colspan="10"
  716. style="background-color: lightgrey;">
  717. User Details
  718. </th>
  719. </tr>
  720. <tr>
  721. <th
  722. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  723. User Name:
  724. </th>
  725. <td class="fw-semibold"
  726. style="padding: 0.45rem 0.45rem;"
  727. id="td_userName"></td>
  728. <th
  729. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  730. Mobile Number:
  731. </th>
  732. <td class="fw-semibold"
  733. style="padding: 0.45rem 0.45rem;"
  734. id="td_mobileNumber"></td>
  735. <th
  736. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  737. User Type:
  738. </th>
  739. <td class="fw-semibold"
  740. style="padding: 0.45rem 0.45rem;"
  741. id="td_usertype"></td>
  742. </tr>
  743. <tr>
  744. <th
  745. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  746. User Address:
  747. </th>
  748. <td colspan="5" class="fw-semibold"
  749. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  750. id="td_useraddress"></td>
  751. </tr>
  752. <input type="hidden"
  753. class="form-control text-center"
  754. name="bookingid" id="bookingid" disabled/>
  755. <tr>
  756. <th colspan="10"
  757. style="background-color: lightgrey;">
  758. Hall Details
  759. </th>
  760. </tr>
  761. <tr>
  762. <th
  763. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  764. Hall Name:
  765. </th>
  766. <td colspan="10" class="fw-semibold"
  767. style="padding: 0.45rem 0.45rem;text-wrap:pretty;"
  768. id="td_hallName"></td>
  769. </tr>
  770. <th
  771. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  772. Hall Address:
  773. </th>
  774. <td colspan="10" class="fw-semibold"
  775. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  776. id="td_halladdress"></td>
  777. </tr>
  778. <tr>
  779. <th
  780. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  781. Caretaker Name:
  782. </th>
  783. <td colspan="2" class="fw-semibold"
  784. style="padding: 0.45rem 0.45rem;"
  785. id="td_caretakername"></td>
  786. <th
  787. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  788. Caretaker Mobile Number:
  789. </th>
  790. <td colspan="2" class="fw-semibold"
  791. style="padding: 0.45rem 0.45rem;"
  792. id="td_caretakermobileNumber"></td>
  793. </tr>
  794. <tr>
  795. <th colspan="10"
  796. style="background-color: lightgrey;">
  797. Booking
  798. Details (Booking Id:-<span
  799. id="booking_id"
  800. style="color:blue"></span>)
  801. </th>
  802. </tr>
  803. <tr>
  804. <th
  805. style="padding: 0.45rem 0.45rem;font-weight: normal">
  806. Booking Date:
  807. </th>
  808. <td colspan="2" class="fw-semibold"
  809. style="padding: 0.45rem 0.45rem;"
  810. id="td_bookingDate"></td>
  811. <th
  812. style="padding: 0.45rem 0.45rem;font-weight: normal">
  813. Deposit Amount (in Rs):
  814. </th>
  815. <td colspan="2"
  816. class="fw-semibold amount-cell"
  817. style="padding: 0.45rem 0.45rem;"
  818. id="td_depositeAmount"></td>
  819. </tr>
  820. <tr>
  821. <th
  822. style="padding: 0.45rem 0.45rem;font-weight: normal">
  823. Start Date:
  824. </th>
  825. <td colspan="2" class="fw-semibold"
  826. style="padding: 0.45rem 0.45rem;"
  827. id="td_startDate"></td>
  828. <th
  829. style="padding: 0.45rem 0.45rem;font-weight: normal">
  830. Hall Amount (in Rs):
  831. </th>
  832. <td colspan="2"
  833. class="fw-semibold amount-cell"
  834. style="padding: 0.45rem 0.45rem;"
  835. id="td_hallAmount"></td>
  836. </tr>
  837. <tr>
  838. <th
  839. style="padding: 0.45rem 0.45rem;font-weight: normal">
  840. END Date:
  841. </th>
  842. <td colspan="2" class="fw-semibold"
  843. style="padding: 0.45rem 0.45rem;"
  844. id="td_endDate"></td>
  845. <th
  846. style="padding: 0.45rem 0.45rem;font-weight: normal">
  847. GST @18% (in Rs):
  848. </th>
  849. <td colspan="2"
  850. class="fw-semibold amount-cell"
  851. style="padding: 0.45rem 0.45rem;"
  852. id="td_gst"></td>
  853. </tr>
  854. <tr>
  855. <th
  856. style="padding: 0.45rem 0.45rem;font-weight: normal">
  857. Starting Slot:
  858. </th>
  859. <td colspan="2" class="fw-semibold"
  860. style="padding: 0.45rem 0.45rem;"
  861. id="td_startingSlot"></td>
  862. <th
  863. style="padding: 0.45rem 0.45rem;font-weight: normal">
  864. Total Amount (in Rs):
  865. </th>
  866. <td colspan="2"
  867. class="fw-semibold amount-cell"
  868. style="padding: 0.45rem 0.45rem;"
  869. id="td_totalAmount"></td>
  870. </tr>
  871. <tr>
  872. <th
  873. style="padding: 0.45rem 0.45rem;font-weight: normal">
  874. Ending Slot:
  875. </th>
  876. <td colspan="2" class="fw-semibold"
  877. style="padding: 0.45rem 0.45rem;"
  878. id="td_endingSlot"></td>
  879. <!--<th style="display:none;padding: 0.45rem 0.45rem;border:none"
  880. id="rejectionreasondiv">Rejection
  881. Reason:</th>
  882. <td class="fw-semibold"
  883. style="padding: 0.45rem 0.45rem;"
  884. id="reasonforrejection"></td>-->
  885. <th
  886. style="padding: 0.45rem 0.45rem;border:none">
  887. Booking Status:
  888. </th>
  889. <td colspan="2" class="fw-semibold"
  890. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  891. id="bookingstatus_td"></td>
  892. </tr>
  893. <tr>
  894. <th style="display:none;padding: 0.45rem 0.45rem;border:none"
  895. id="rejectionreasondiv">Rejection
  896. Reason:
  897. </th>
  898. <td class="fw-semibold"
  899. style="padding: 0.45rem 0.45rem;text-wrap: pretty;"
  900. id="reasonforrejection"></td>
  901. </tr>
  902. </table>
  903. </div>
  904. </div>
  905. <div class="row col-md-12 col-lg-12 col-sm-12"
  906. style="margin-left:6px;margin-top:-21px">
  907. <div class="documents" id="documents"></div>
  908. </div>
  909. <div class="col-md-12 col-lg-12 col-sm-12 mb-2"
  910. id="paymentsdetails"
  911. style="display:none; margin-top: -26px;">
  912. <div class="card-body">
  913. <table>
  914. <tr>
  915. <th colspan="10"
  916. style="background-color: lightgrey;">
  917. Booking Payment Details
  918. </th>
  919. </tr>
  920. <tr>
  921. <th
  922. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  923. Transaction ID:
  924. </th>
  925. <td colspan="10" class="fw-semibold"
  926. style="padding: 0.45rem 0.45rem;"
  927. id="td_transactionId"></td>
  928. </tr>
  929. <th
  930. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  931. Amount Received (in Rs):
  932. </th>
  933. <td colspan="10" class="fw-semibold"
  934. style="padding: 0.45rem 0.45rem;"
  935. id="td_payamountReceived"></td>
  936. </tr>
  937. <tr>
  938. <th
  939. style="padding: 0.45rem 0.45rem;font-weight: normal;">
  940. Transaction Status:
  941. </th>
  942. <td class="fw-semibold"
  943. style="padding: 0.45rem 0.45rem;"
  944. id="td_paymentStatus"></td>
  945. </tr>
  946. </table>
  947. </div>
  948. </div>
  949. <div class="row col-md-12 col-lg-12 col-sm-12"
  950. id="ebdetails"
  951. style="display:none;margin-left: 0px;margin-top: -49px">
  952. <div class="card-body">
  953. <table>
  954. <tr>
  955. <th colspan="4"
  956. style="background-color: lightgrey;">EB
  957. Details
  958. </th>
  959. </tr>
  960. <tr>
  961. <th
  962. style="padding: 0.45rem 0.45rem;font-weight: normal">
  963. Consumer Number:
  964. </th>
  965. <td class="fw-semibold"
  966. style="padding: 0.45rem 0.45rem;"
  967. id="td_EBNumber"></td>
  968. <th
  969. style="padding: 0.45rem 0.45rem;font-weight: normal">
  970. EB Amount Per Unit (in Rs):
  971. </th>
  972. <td class="fw-semibold"
  973. style="padding: 0.45rem 0.45rem;"
  974. id="td_ebamountperunit"></td>
  975. </tr>
  976. <tr>
  977. <th
  978. style="padding: 0.45rem 0.45rem;font-weight: normal">
  979. Start Reading:
  980. </th>
  981. <td class="fw-semibold"
  982. style="padding: 0.45rem 0.45rem;"
  983. id="td_startingReading"></td>
  984. <th
  985. style="padding: 0.45rem 0.45rem;font-weight: normal">
  986. Unit Consumed:
  987. </th>
  988. <td class="fw-semibold"
  989. style="padding: 0.45rem 0.45rem;"
  990. id="td_usedunit"></td>
  991. </tr>
  992. <tr>
  993. <th
  994. style="padding: 0.45rem 0.45rem;font-weight: normal">
  995. END Reading:
  996. </th>
  997. <td class="fw-semibold"
  998. style="padding: 0.45rem 0.45rem;"
  999. id="td_endingReading"></td>
  1000. <th
  1001. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1002. EB Amount (in Rs):
  1003. </th>
  1004. <td class="fw-semibold"
  1005. style="padding: 0.45rem 0.45rem;"
  1006. id="td_electricityamount"></td>
  1007. </tr>
  1008. </tbody>
  1009. </table>
  1010. </div>
  1011. </div>
  1012. <div class="row col-md-12 col-lg-12 col-sm-12"
  1013. id="damagelist" style="disaply:none">
  1014. <div id="damageDetails"></div>
  1015. </div>
  1016. <div class="col-md-12 col-lg-12 col-sm-12"
  1017. id="refunddetails" style="margin-top:-41px">
  1018. <div class="card-body">
  1019. <table>
  1020. <tr>
  1021. <th colspan="2"
  1022. style="background-color: lightgrey;">
  1023. Amount to be Refunded (in Rs)
  1024. </th>
  1025. </tr>
  1026. <tr>
  1027. <th
  1028. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1029. Deposit Amount:
  1030. </th>
  1031. <td class="fw-semibold amount-cell"
  1032. style="padding: 0.45rem 0.45rem;"
  1033. id="td_depositeamountforrefund">0
  1034. </td>
  1035. </tr>
  1036. <tr>
  1037. <th
  1038. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1039. EB Amount:
  1040. </th>
  1041. <td class="fw-semibold amount-cell"
  1042. style="padding: 0.45rem 0.45rem;"
  1043. id="td_ebAmount"></td>
  1044. </tr>
  1045. <tr>
  1046. <th
  1047. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1048. Damage Amount:
  1049. </th>
  1050. <td class="fw-semibold amount-cell"
  1051. style="padding: 0.45rem 0.45rem;"
  1052. id="td_damage"></td>
  1053. </tr>
  1054. <tr id="pendingcolumn">
  1055. <th id="th_settel_label"
  1056. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1057. Collection Pending Amount:
  1058. </th>
  1059. <td class="fw-semibold amount-cell"
  1060. style="padding: 0.45rem 0.45rem; color: green;"
  1061. id="td_pending_amt">0
  1062. </td>
  1063. </tr>
  1064. <tr id="collectionstatuscolumn">
  1065. <th id="label"
  1066. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1067. Collection Pending Status
  1068. :
  1069. </th>
  1070. <td class="fw-semibold amount-cell"
  1071. style="padding: 0.45rem 0.45rem; color: green;"
  1072. id="td_collection_status">
  1073. </td>
  1074. </tr>
  1075. <tr>
  1076. <th
  1077. style="padding: 0.45rem 0.45rem; background-color: #f2f2f2;font-weight: normal">
  1078. Actual refundable Amount:
  1079. </th>
  1080. <td class="fw-semibold amount-cell"
  1081. style="padding: 0.45rem 0.45rem; color: green;"
  1082. id="td_settel_amt">0
  1083. </td>
  1084. </tr>
  1085. </table>
  1086. </div>
  1087. </div>
  1088. <div class="row col-md-12 col-lg-12 col-sm-12"
  1089. id="refundamountDetails"
  1090. style="display:none;margin-left: 0px;margin-top: -49px">
  1091. <div class="card-body">
  1092. <table>
  1093. <tr>
  1094. <th colspan="4"
  1095. style="background-color: lightgrey;">
  1096. Refund Details
  1097. </th>
  1098. </tr>
  1099. <tr>
  1100. <th
  1101. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1102. Booking Status:
  1103. </th>
  1104. <td class="fw-semibold"
  1105. style="padding: 0.45rem 0.45rem;"
  1106. id="td_bookingStatus"></td>
  1107. <th
  1108. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1109. Refund Status:
  1110. </th>
  1111. <td class="fw-semibold"
  1112. style="padding: 0.45rem 0.45rem;"
  1113. id="td_refundStatus"></td>
  1114. </tr>
  1115. <tr>
  1116. <th
  1117. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  1118. Refund amount:
  1119. </th>
  1120. <td class="fw-semibold" colspan="5"
  1121. style="padding: 0.45rem 0.45rem;"
  1122. id="td_refundamount"></td>
  1123. </tr>
  1124. </tbody>
  1125. </table>
  1126. </div>
  1127. </div>
  1128. <div id="refundMessage" style="display: none;">
  1129. <h1 id="refundText"
  1130. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1131. </h1>
  1132. </div>
  1133. <div id="rejectrefundMessage" style="display: none;">
  1134. <h1 id="rejectrefundText"
  1135. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1136. </h1>
  1137. </div>
  1138. <div id="blockedrefundMessage" style="display: none;">
  1139. <h1 id="blockedrefundText"
  1140. style="font-size: 17px;margin-left: 20px;color: darkgreen;">
  1141. </h1>
  1142. </div>
  1143. <!--Newly added for Reschedule Details-->
  1144. <!--<div class="row col-md-12 col-lg-12 col-sm-12"
  1145. id="rescheduleDetails"
  1146. style="display:none;margin-left: 0px;margin-top: -49px">
  1147. <div class="card-body">
  1148. <table>
  1149. <tr>
  1150. <th colspan="4"
  1151. style="background-color: lightgrey;">
  1152. Reschedule Details
  1153. </th>
  1154. </tr>
  1155. <tr>
  1156. <th
  1157. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1158. Event Start Date:
  1159. </th>
  1160. <td class="fw-semibold"
  1161. style="padding: 0.45rem 0.45rem;"
  1162. id="td_res_start_date"></td>
  1163. <th
  1164. style="padding: 0.45rem 0.45rem;font-weight: normal">
  1165. Event End Date:
  1166. </th>
  1167. <td class="fw-semibold"
  1168. style="padding: 0.45rem 0.45rem;"
  1169. id="td_res_end_date"></td>
  1170. </tr>
  1171. <tr>
  1172. <th
  1173. style="padding: 0.45rem 0.45rem;font-weight: normal;text-wrap: pretty;">
  1174. Rescheduled Date:</th>
  1175. <td class="fw-semibold" colspan="5"
  1176. style="padding: 0.45rem 0.45rem;"
  1177. id="td_res_date"></td>
  1178. </tr>
  1179. </tbody>
  1180. </table>
  1181. </div>
  1182. </div>-->
  1183. </div>
  1184. </div>
  1185. <div class="block-content block-content-full text-end bg-body"
  1186. id="mbutton">
  1187. <button class="btn btn-success"
  1188. onclick="downloadAcknowledgment(event)"
  1189. style="background: #FB6340;">View
  1190. Acknowledgement
  1191. </button>
  1192. <button type="button"
  1193. style="background-color: rgb(21,69,93);color: white;"
  1194. class="btn btn-sm btn-alt-secondary"
  1195. data-bs-dismiss="modal">Close
  1196. </button>
  1197. </div>
  1198. </form>
  1199. </div>
  1200. </div>
  1201. </div>
  1202. </div>
  1203. <br>
  1204. </div>
  1205. </div>
  1206. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog"
  1207. aria-labelledby="fileModalLabel" aria-hidden="true">
  1208. <div class="modal-dialog modal-lg" role="document">
  1209. <div class="modal-content">
  1210. <div class="modal-header">
  1211. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  1212. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"
  1213. style="border: 1px solid black; padding: 5px;
  1214. display: inline-flex; align-items: center; justify-content: center;
  1215. background-color: transparent; color: black; font-size: 20px;">
  1216. <span aria-hidden="true">&times;</span>
  1217. </button>
  1218. </div>
  1219. <div class="modal-body">
  1220. <embed id="filePreview" src="" width="100%" height="600px">
  1221. </div>
  1222. <div class="modal-footer">
  1223. <button type="button" class="btn btn-secondary"
  1224. data-bs-dismiss="modal">Close
  1225. </button>
  1226. </div>
  1227. </div>
  1228. </div>
  1229. </div>
  1230. </div>
  1231. <div class="modal fade" id="bookingRescheduleModal" tabindex="-1"
  1232. aria-labelledby="bookingModalLabel" aria-hidden="true">
  1233. <div class="modal-dialog modal-dialog-centered modal-lg">
  1234. <div class="modal-content">
  1235. <!-- Modal Header -->
  1236. <div class="modal-header" style="color:black">
  1237. <h5 class="modal-title" id="bookingModalLabel" style="color:black">Booking
  1238. Reschedule</h5>
  1239. <br>
  1240. <br>
  1241. <div style="margin-bottom: -59px; margin-left: -185px;">
  1242. <!-- Adding margin-top for separation -->
  1243. <p style="font-size: 14px; color: #6c757d;">Note: Only the Start Date can be
  1244. changed.</p>
  1245. </div>
  1246. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1247. aria-label="Close"></button>
  1248. </div>
  1249. <!-- Modal Body -->
  1250. <div class="modal-body">
  1251. <div class="container-fluid">
  1252. <div class="row">
  1253. <!-- Datepicker and Availability Buttons Column -->
  1254. <div id="datepicker-container" class="fixedcontainer"></div>
  1255. <!-- Start Date, End Date, Number of Days Inputs Column -->
  1256. <div class="col">
  1257. <input type="hidden" class="form-control" id="bookingId"
  1258. name="bookingId" required>
  1259. <label for="startDateInput" class="form-label">Start Date:</label>
  1260. <input type="text" class="form-control" id="startDateInput"
  1261. name="startDateInput" required readonly>
  1262. <input type="hidden" class="form-control" id="startDatetext"
  1263. name="startDatetext" required>
  1264. </div>
  1265. <div class="col">
  1266. <label for="endDateInput" class="form-label">End Date:</label>
  1267. <input type="date" class="form-control" id="endDateInput"
  1268. name="endDateInput" readonly>
  1269. </div>
  1270. <div class="col">
  1271. <label for="noOfDaysInput" class="form-label">Number of Days:</label>
  1272. <input type="number" class="form-control" id="noOfDaysInput"
  1273. name="noOfDaysInput" readonly>
  1274. </div>
  1275. </div>
  1276. <div class="row">
  1277. <div class="col">
  1278. <input type="hidden" id="daysDiff">
  1279. <label for="startingSlot" class="form-label">Starting Slot:</label>
  1280. <input type="text" class="form-control" id="startingSlotText"
  1281. name="startingSlot" readonly>
  1282. <input type="hidden" class="form-control" id="startingSlot"
  1283. name="startingSlot" required>
  1284. </div>
  1285. <div class="col">
  1286. <label for="endingSlot" class="form-label">Ending Slot:</label>
  1287. <input type="text" class="form-control" id="endingSlotText"
  1288. name="endDateInput" readonly>
  1289. <input type="hidden" class="form-control" id="endingSlot"
  1290. name="endDateInput" readonly>
  1291. </div>
  1292. </div>
  1293. <div class="row" style="margin-top: 39px;">
  1294. <div class="col col-lg-2 col-sm-2 col-md-2">
  1295. <button type="button" class="btn btn-primary btn-square-md"
  1296. style="background-color:#008000;"></button>
  1297. <p style="margin-left: 14px;">Day<br>(Available)</p>
  1298. </div>
  1299. <div class="col col-lg-2 col-sm-2 col-md-2">
  1300. <button type="button" class="btn btn-primary btn-square-md"
  1301. style="background-color: #ac2bac;"></button>
  1302. <p style="margin-left: 14px;">Morning<br>(Available)</p>
  1303. </div>
  1304. <div class="col col-lg-2 col-sm-2 col-md-2">
  1305. <button type="button" class="btn btn-primary btn-square-md"
  1306. style="background-color:#FFEA00;"></button>
  1307. <p style="margin-left: 14px;">Evening<br>(Available)</p>
  1308. </div>
  1309. <div class="col col-lg-2 col-sm-2 col-md-2">
  1310. <button type="button" class="btn btn-primary btn-square-md"
  1311. style="background-color: red;"></button>
  1312. <p style="margin-left: 14px;">Not Available</p>
  1313. </div>
  1314. <div class="col col-lg-2 col-sm-2 col-md-2">
  1315. <button type="button" class="btn btn-primary btn-square-md"
  1316. style="background-color: blue;"></button>
  1317. <p style="margin-left: 14px;">GCC Blocked</p>
  1318. </div>
  1319. <!--<div class="col col-lg-2 col-sm-2 col-md-2">
  1320. <button type="button" class="btn btn-primary btn-square-md"
  1321. style="background-color: lightpink;"></button>
  1322. <p style="margin-left: 14px;">Temporary Blocked</p>
  1323. </div>-->
  1324. </div>
  1325. </div>
  1326. </div>
  1327. <!-- Modal Footer -->
  1328. <div class="modal-footer">
  1329. <button type="button" class="btn btn-secondary"
  1330. data-bs-dismiss="modal">Close
  1331. </button>
  1332. <button type="button" class="btn btn-primary" onclick="Reschedule()">Save
  1333. Changes
  1334. </button>
  1335. </div>
  1336. </div>
  1337. </div>
  1338. </div>
  1339. <!-- Tracking Log Modal -->
  1340. <!-- Tracking Modal -->
  1341. <div class="modal fade" id="trackingModal" tabindex="-1" aria-labelledby="trackingModalLabel"
  1342. aria-hidden="true">
  1343. <div class="modal-dialog modal-lg">
  1344. <div class="modal-content">
  1345. <div class="modal-header">
  1346. <h4 class="modal-title">Booking Tracking</h4>
  1347. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1348. aria-label="Close"></button>
  1349. </div>
  1350. <div class="modal-body">
  1351. <div class="tracking-container">
  1352. <ul id="trackingList" class="tracking-steps list-unstyled">
  1353. <!-- Steps will be dynamically appended here -->
  1354. </ul>
  1355. </div>
  1356. </div>
  1357. </div>
  1358. </div>
  1359. </div>
  1360. <!-- Modal -->
  1361. <div class="modal fade" id="uploadNocModal" tabindex="-1" aria-labelledby="uploadNocModalLabel"
  1362. aria-hidden="true">
  1363. <div class="modal-dialog">
  1364. <div class="modal-content">
  1365. <div class="modal-header">
  1366. <h5 class="modal-title" id="uploadNocModalLabel">Upload NOC</h5>
  1367. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1368. aria-label="Close"></button>
  1369. </div>
  1370. <div class="modal-body">
  1371. <div class="mb-3">
  1372. <label for="nocFile" class="form-label">Select NOC File</label>
  1373. <input type="file" class="form-control nocfile" id="nocFile" name="nocFile"
  1374. required>
  1375. <input type="hidden" id="bookingssId" name="bookingssId">
  1376. </div>
  1377. </div>
  1378. <div class="modal-footer">
  1379. <button type="button" class="btn btn-secondary"
  1380. data-bs-dismiss="modal">Close
  1381. </button>
  1382. <button type="button" class="btn btn-primary" id="submitNocButton">Submit</button>
  1383. </div>
  1384. </div>
  1385. </div>
  1386. </div>
  1387. <!-- Modal -->
  1388. <div class="modal fade" id="transactionHistoryModal" tabindex="-1"
  1389. aria-labelledby="transactionHistoryModalLabel" aria-hidden="true">
  1390. <div class="modal-dialog modal-lg" id="transactionmodel"> <!-- modal-lg makes it larger -->
  1391. <div class="modal-content">
  1392. <div class="modal-header">
  1393. <h5 class="modal-title" id="transactionHistoryModalLabel">Transaction History</h5>
  1394. <button type="button" class="btn-close" data-bs-dismiss="modal"
  1395. aria-label="Close"></button>
  1396. </div>
  1397. <div class="modal-body">
  1398. <!-- Scrollable Table -->
  1399. <div class="table-responsive"> <!-- Make the table scrollable if too large -->
  1400. <table class="table table-bordered" id="transactionTable">
  1401. <thead>
  1402. <tr>
  1403. <th>S.NO</th>
  1404. <th>Booking ID</th>
  1405. <th>Amount</th>
  1406. <th>Date</th>
  1407. <th>Transaction ID</th>
  1408. <th>Status</th>
  1409. </tr>
  1410. </thead>
  1411. <tbody>
  1412. <!-- Data will be populated dynamically here -->
  1413. </tbody>
  1414. </table>
  1415. </div>
  1416. <div class="table-responsive" id="refunddetails" style="display: none;">
  1417. <h2>Refund Details</h2>
  1418. <table class="table table-bordered" id="refunddetailsTable">
  1419. <thead>
  1420. <tr>
  1421. <th>S.NO</th>
  1422. <th>Booking ID</th>
  1423. <th>Amount</th>
  1424. <th>Date</th>
  1425. <th>Transaction ID</th>
  1426. <th>Refund Amount</th>
  1427. </tr>
  1428. </thead>
  1429. <tbody>
  1430. <!-- Data will be populated dynamically here -->
  1431. </tbody>
  1432. </table>
  1433. </div>
  1434. </div>
  1435. <div class="modal-footer">
  1436. <button type="button" class="btn btn-secondary"
  1437. data-bs-dismiss="modal">Close
  1438. </button>
  1439. </div>
  1440. </div>
  1441. </div>
  1442. </div>
  1443. <footer th:replace="~{fragments/footer :: footer}"></footer>
  1444. </div>
  1445. </div>
  1446. </div>
  1447. <!--otp form-->
  1448. <div th:replace="~{fragments/loginreg :: div}"></div>
  1449. <!--otp form-->
  1450. <script src="js/html2pdf.bundle.min.js"></script>
  1451. <script th:replace="~{fragments/script :: script}"></script>
  1452. <script th:replace="~{fragments/logRegiOtpScript :: script}"></script>
  1453. <script type="text/javascript" src="https://www.paynimo.com/paynimocheckout/server/lib/checkout.js"></script>
  1454. <script src="https://cdn.datatables.net/1.13.4/js/jquery.dataTables.min.js"></script>
  1455. <script src="https://cdn.datatables.net/buttons/2.4.1/js/dataTables.buttons.min.js"></script>
  1456. <script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
  1457. <script type="text/javascript">
  1458. $(document).ready(function () {
  1459. $('#detailstable').DataTable({
  1460. responsive: true,
  1461. pageLength: 10,
  1462. ordering: true,
  1463. columnDefs: [{
  1464. targets: 'no-sort',
  1465. orderable: false
  1466. }],
  1467. dom: 'Bfrtip',
  1468. buttons: [
  1469. {
  1470. extend: 'excelHtml5',
  1471. text: 'Export to Excel',
  1472. className: 'btn btn-primary'
  1473. }
  1474. ]
  1475. });
  1476. });
  1477. $(document).ready(function () {
  1478. $('#submitNocButton').on('click', function (e) {
  1479. e.preventDefault();
  1480. // Get the form data
  1481. var formData = new FormData();
  1482. var fileInput = $('#nocFile')[0].files[0]; // Get the selected file
  1483. var bookingssId = $('#bookingssId').val(); // Get the bookingId
  1484. // Check if a file is selected
  1485. if (!fileInput) {
  1486. Swal.fire({
  1487. icon: 'warning',
  1488. title: 'No File Selected',
  1489. text: 'Please select a file to upload.',
  1490. });
  1491. return;
  1492. }
  1493. // Append file and bookingId to formData
  1494. formData.append('nocFile', fileInput);
  1495. formData.append('bookingssId', bookingssId);
  1496. // Perform Ajax request
  1497. $.ajax({
  1498. url: '/communityhall/user/api/uploaddocs', // API endpoint
  1499. type: 'POST',
  1500. data: formData,
  1501. contentType: false,
  1502. processData: false,
  1503. success: function (response) {
  1504. // Show success message and refresh the page
  1505. Swal.fire({
  1506. icon: 'success',
  1507. title: 'Success',
  1508. text: 'NOC uploaded successfully!',
  1509. }).then(() => {
  1510. $('#uploadNocModal').modal('hide'); // Close the modal
  1511. location.reload(); // Refresh the page
  1512. });
  1513. },
  1514. error: function (xhr, status, error) {
  1515. // Show error message
  1516. Swal.fire({
  1517. icon: 'error',
  1518. title: 'Upload Failed',
  1519. text: 'Failed to upload NOC: ' + error,
  1520. });
  1521. }
  1522. });
  1523. });
  1524. // Populate bookingId when opening the modal
  1525. $('#uploadNocModal').on('show.bs.modal', function (event) {
  1526. var button = $(event.relatedTarget); // Button that triggered the modal
  1527. var bookingId = button.data('booking-id'); // Extract bookingId from the button
  1528. $('#bookingssId').val(bookingId); // Set the bookingId in the hidden input field
  1529. });
  1530. });
  1531. // Function to track booking
  1532. function trackBooking(bookingId) {
  1533. $.ajax({
  1534. url: '/communityhall/user/api/trackBooking',
  1535. method: 'GET',
  1536. data: {bookingId: bookingId}, // Send booking ID to the server
  1537. success: function (data) {
  1538. // console.log("Received tracking data:", data);
  1539. // Clear the list initially before appending steps
  1540. $('#trackingList').empty();
  1541. if (Array.isArray(data) && data.length > 0) {
  1542. // Show the modal first
  1543. $('#trackingModal').modal('show');
  1544. // Create a Set to track seen statuses
  1545. const seenStatuses = new Set();
  1546. // Append steps one by one
  1547. data.forEach((event) => {
  1548. // Append each step if it hasn't been seen before
  1549. if (!seenStatuses.has(event.status)) {
  1550. seenStatuses.add(event.status); // Add status to Set
  1551. appendStep(event); // Call to append the event step
  1552. }
  1553. });
  1554. } else {
  1555. // Show a message when no tracking events are available
  1556. $('#trackingList').append('<li class="no-events">No tracking events available.</li>');
  1557. }
  1558. },
  1559. error: function (xhr, status, error) {
  1560. console.error("Failed to fetch booking details:", status, error);
  1561. alert('Failed to fetch booking details. Please try again later.');
  1562. }
  1563. });
  1564. }
  1565. function appendStep(event) {
  1566. const formattedDate = moment(event.dateTime).isValid()
  1567. ? moment(event.dateTime).format('MMM DD, YYYY, h:mm A') // Format date using Moment.js
  1568. : 'Invalid date';
  1569. const statusClass = getStatusClass(event.status); // Get CSS class for the status
  1570. const statusIcon = getStatusIcon(event.status); // Get icon for the status
  1571. // Create and append a step element for each event
  1572. const stepElement = `
  1573. <li class="tracking-step ${statusClass}">
  1574. <div class="step-icon">
  1575. <i class="fas ${statusIcon}"></i> <!-- Add the icon -->
  1576. </div>
  1577. <div class="step-content">
  1578. <h5>${event.description || 'No Description Available'}</h5> <!-- Event description -->
  1579. <p class="step-date">${formattedDate}</p> <!-- Formatted date -->
  1580. </div>
  1581. </li>
  1582. `;
  1583. // Append the element to the list
  1584. $('#trackingList').append(stepElement);
  1585. }
  1586. function getStatusClass(status) {
  1587. switch (status) {
  1588. case 'PAYMENT_SUCCESS':
  1589. case 'APPROVED':
  1590. case 'EVENT_COMPLETED':
  1591. case 'COMPLETED':
  1592. return 'completed'; // Returns 'completed' class for these statuses
  1593. case 'SETTLEMENT_RAISING':
  1594. return 'waiting';
  1595. case 'CANCELED':
  1596. return 'cancelled';
  1597. case 'REJECTED':
  1598. return 'rejected';
  1599. case 'GCC_BLOCKED':
  1600. return 'gcc-blocked';
  1601. default:
  1602. return 'pending'; // Default class if status is unknown
  1603. }
  1604. }
  1605. function getStatusIcon(status) {
  1606. switch (status) {
  1607. case 'PAYMENT_SUCCESS':
  1608. return 'fa-check-circle'; // Icon for payment success
  1609. case 'APPROVED':
  1610. return 'fa-thumbs-up';
  1611. case 'EVENT_COMPLETED':
  1612. return 'fa-calendar-check';
  1613. case 'CANCELED':
  1614. return 'fa-ban';
  1615. case 'REJECTED':
  1616. return 'fa-times-circle';
  1617. case 'GCC_BLOCKED':
  1618. return 'fa-lock';
  1619. default:
  1620. return 'fa-clock'; // Default icon for pending steps
  1621. }
  1622. }
  1623. function showFutureEvents() {
  1624. document.getElementById('futureEventsContainer').style.display = 'block';
  1625. }
  1626. function downloadAcknowledgment(event) {
  1627. event.preventDefault();
  1628. var bookingId = document.getElementById("booking_id").innerHTML;
  1629. // Redirect to the acknowledgment URL in the same tab
  1630. window.location.href = '/communityhall/user/acknowledgement?bookingId=' + encodeURIComponent(bookingId);
  1631. }
  1632. function getTimeSlot(slotValue) {
  1633. var timeSlot;
  1634. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  1635. if (trimmedSlotValue === '1') {
  1636. timeSlot = 'Morning';
  1637. } else if (trimmedSlotValue === '2') {
  1638. timeSlot = 'Evening';
  1639. } else {
  1640. timeSlot = 'Unknown';
  1641. }
  1642. return timeSlot;
  1643. }
  1644. function showBookingDetails(bookingId) {
  1645. $.ajax({
  1646. url: '/communityhall/user/api/viewAllBookingDetails',
  1647. method: 'GET',
  1648. data: {bookingId: bookingId},
  1649. success: function (response) {
  1650. document.getElementById("td_userName").innerHTML = response.users.name;
  1651. document.getElementById("td_mobileNumber").innerHTML = response.users.mobileNo;
  1652. document.getElementById("td_usertype").innerHTML = response.users.usertype;
  1653. var userDetails = response.users;
  1654. var userDetailsString =
  1655. userDetails.doorNo + ", " +
  1656. userDetails.street + ", " +
  1657. userDetails.area + ", " +
  1658. userDetails.location + " ,Chennai- " +
  1659. userDetails.pinCode;
  1660. document.getElementById("td_useraddress").innerHTML = userDetailsString;
  1661. document.getElementById("td_hallName").innerHTML = response.hallDetails.hallName;
  1662. var hallDetails = response.hallDetails;
  1663. var hallDetailsString =
  1664. hallDetails.doorNo + ", " +
  1665. hallDetails.street + ", " +
  1666. hallDetails.area + ", " +
  1667. hallDetails.city + "- " +
  1668. hallDetails.pinCode;
  1669. document.getElementById("td_halladdress").innerHTML = hallDetailsString;
  1670. document.getElementById("td_caretakername").innerHTML = response.hallDetails.hallInchargeName;
  1671. document.getElementById("td_caretakermobileNumber").innerHTML = response.hallDetails.hallInchargeMobno;
  1672. document.getElementById("td_bookingDate").innerHTML = response.bookingDate;
  1673. document.getElementById("td_depositeAmount").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1674. document.getElementById("td_hallAmount").innerHTML = parseFloat(response.hallAmount).toFixed(2);
  1675. // Calculate GST and total amount
  1676. var gstAmount = (parseFloat(response.hallAmount) * (response.hallDetails.gst / 100)).toFixed(2);
  1677. var totalAmount = parseFloat(response.amountReceived).toFixed(2);
  1678. document.getElementById("td_gst").innerHTML = gstAmount;
  1679. document.getElementById("td_totalAmount").innerHTML = totalAmount;
  1680. document.getElementById("td_startDate").innerHTML = response.startDate;
  1681. document.getElementById("td_endDate").innerHTML = response.endDate;
  1682. document.getElementById("booking_id").innerHTML = response.bookingId;
  1683. function getTimeSlot(slotValue) {
  1684. var timeSlot;
  1685. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  1686. if (trimmedSlotValue === '1') {
  1687. timeSlot = 'Morning';
  1688. } else if (trimmedSlotValue === '2') {
  1689. timeSlot = 'Evening';
  1690. } else {
  1691. timeSlot = 'Unknown';
  1692. }
  1693. return timeSlot;
  1694. }
  1695. document.getElementById("td_startingSlot").innerHTML = getTimeSlot(response.startingSlot);
  1696. document.getElementById("td_endingSlot").innerHTML = getTimeSlot(response.endingSlot);
  1697. document.getElementById("bookingstatus_td").innerHTML = response.bookingStatus;
  1698. console.log("before comments user view history...");
  1699. console.log("Comments..."+response.comments);
  1700. if (response.bookingStatus === 'REJECTED' && response.comments) {
  1701. document.getElementById("rejectionreasondiv").style.display = "block";
  1702. const rejectionCell = document.getElementById("reasonforrejection");
  1703. rejectionCell.innerHTML = response.comments;
  1704. } else {
  1705. document.getElementById("rejectionreasondiv").style.display = "none";
  1706. document.getElementById("reasonforrejection").style.display = "none";
  1707. }
  1708. showReasonDocuments(response);
  1709. if (response.payments) {
  1710. document.getElementById("paymentsdetails").style.display = "block";
  1711. document.getElementById("td_transactionId").innerHTML = response.payments.transactionId;
  1712. document.getElementById("td_payamountReceived").innerHTML = response.payments.amountReceived;
  1713. document.getElementById("td_paymentStatus").innerHTML = response.payments.paymentStatus;
  1714. } else {
  1715. document.getElementById("paymentsdetails").style.display = "none";
  1716. }
  1717. if (response.ebDetails) {
  1718. document.getElementById("ebdetails").style.display = "block";
  1719. document.getElementById("td_EBNumber").innerHTML = response.hallDetails.ebNumber;
  1720. document.getElementById("td_startingReading").innerHTML = response.ebDetails.startingReading;
  1721. document.getElementById("td_endingReading").innerHTML = response.ebDetails.endingReading;
  1722. document.getElementById("td_usedunit").innerHTML = response.ebDetails.usedUnit;
  1723. document.getElementById("td_ebamountperunit").innerHTML = parseFloat(response.hallDetails.ebCostPerUnit).toFixed(2);
  1724. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1725. } else {
  1726. document.getElementById("ebdetails").style.display = "none";
  1727. }
  1728. if (response.damageList && response.damageList.length > 0) {
  1729. document.getElementById("damagelist").style.display = "block";
  1730. } else {
  1731. document.getElementById("damagelist").style.display = "none";
  1732. }
  1733. if (response.settlement) {
  1734. document.getElementById("refunddetails").style.display = "block";
  1735. document.getElementById("td_depositeamountforrefund").innerHTML = parseFloat(response.depositAmount).toFixed(2);
  1736. document.getElementById("td_electricityamount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1737. document.getElementById("td_ebAmount").innerHTML = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1738. document.getElementById("td_damage").innerHTML = parseFloat(response.settlement.damageAmount).toFixed(2);
  1739. var eb_amt = parseFloat(response.ebDetails.ebAmount).toFixed(2);
  1740. var deposit_amt = parseFloat(response.depositAmount).toFixed(2);
  1741. var tem_total = (deposit_amt - eb_amt).toFixed(2);
  1742. $("#td_settel_amt").html(tem_total);
  1743. } else {
  1744. document.getElementById("refunddetails").style.display = "none";
  1745. }
  1746. showDamageDetails(response);
  1747. if (response.bookingStatus === 'CANCELED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1748. 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`;
  1749. document.getElementById("refundamountDetails").style.display = "block";
  1750. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1751. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1752. } else if (response.bookingStatus === 'CANCELED' && response.refundStatus === 'COMPLETED') {
  1753. document.getElementById("td_refundamount").innerHTML = `Deposit amount of ₹ ${parseFloat(response.depositAmount).toFixed(2)} refunded successfully`;
  1754. document.getElementById("refundamountDetails").style.display = "block";
  1755. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1756. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1757. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus) && response.amountReceived == 0) {
  1758. document.getElementById("refundamountDetails").style.display = "none";
  1759. } else if (response.bookingStatus === 'REJECTED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1760. document.getElementById("td_refundamount").innerHTML = `Your booking has been Rejected by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1761. document.getElementById("refundamountDetails").style.display = "block";
  1762. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1763. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1764. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'COMPLETED') {
  1765. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1766. document.getElementById("refundamountDetails").style.display = "block";
  1767. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1768. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1769. } else if (response.bookingStatus === 'REJECTED' && response.refundStatus === 'NA') {
  1770. document.getElementById("td_refundamount").innerHTML = `Your Booking has been rejected by GCC`;
  1771. document.getElementById("refundamountDetails").style.display = "block";
  1772. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1773. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1774. } else if (response.bookingStatus === 'GCC_BLOCKED' && ['WAITING', 'APPROVED', 'INITIATED'].includes(response.refundStatus)) {
  1775. document.getElementById("td_refundamount").innerHTML = `Your booking has been Blocked by GCC. Full amount of ₹ ${parseFloat(response.amountReceived).toFixed(2)} will be refunded shortly`;
  1776. document.getElementById("refundamountDetails").style.display = "block";
  1777. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1778. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1779. } else if (response.bookingStatus === 'GCC_BLOCKED' && response.refundStatus === 'COMPLETED') {
  1780. document.getElementById("td_refundamount").innerHTML = `Full amount of ₹${parseFloat(response.amountReceived).toFixed(2)} refunded successfully`;
  1781. document.getElementById("refundamountDetails").style.display = "block";
  1782. document.getElementById("td_bookingStatus").innerHTML = response.bookingStatus;
  1783. document.getElementById("td_refundStatus").innerHTML = response.refundStatus;
  1784. } /*else if(response.scheduleCount === 1){
  1785. document.getElementById("rescheduleDetails").style.display = "block";
  1786. document.getElementById("td_res_start_date").innerHTML = response.startDate;
  1787. document.getElementById("td_res_end_date").innerHTML = response.endDate;
  1788. document.getElementById("td_res_date").innerHTML = response.updatedDate;
  1789. }*/ else {
  1790. document.getElementById("refundamountDetails").style.display = "none";
  1791. }
  1792. // Show the modal
  1793. $('#showBookingDetails').modal('show');
  1794. },
  1795. error: function () {
  1796. console.error("An error occurred while fetching booking details.");
  1797. }
  1798. });
  1799. }
  1800. function showDamageDetails(data) {
  1801. var damageFieldContainer = $('#damageDetails');
  1802. damageFieldContainer.empty();
  1803. // Create a div for table responsiveness
  1804. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({
  1805. 'margin-top': '-19px',
  1806. 'margin-left': '19px'
  1807. });
  1808. ;
  1809. // Create table with similar classes and styles to the modal table
  1810. var table = $('<table>').addClass('table table-bordered table-striped').css({
  1811. 'width': '97%',
  1812. 'border-color': 'black',
  1813. 'border-top-color': 'white',
  1814. 'width': ' 730px'
  1815. });
  1816. var thead = $('<thead>').addClass('thead-light');
  1817. var tbody = $('<tbody>');
  1818. // Create Damage Details header row
  1819. var headerRow = $('<tr>').appendTo(thead);
  1820. $('<th>').attr('colspan', '6').text('Damage Details (if any)').css({
  1821. 'padding': '0.45rem 0.45rem',
  1822. 'background-color': 'lightgrey',
  1823. 'font-weight': 'bold',
  1824. 'color': 'black',
  1825. }).appendTo(headerRow);
  1826. // Create table header row
  1827. var columnHeadersRow = $('<tr>').css('background-color', 'white').appendTo(thead);
  1828. $('<th>').text('S.No').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1829. $('<th>').text('Asset Name').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1830. $('<th>').text('Damage Img').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1831. $('<th>').text('Cost').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1832. $('<th>').text('Qty').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1833. $('<th>').text('Amount').css('padding', '0.45rem 0.45rem').appendTo(columnHeadersRow);
  1834. var totalAmount = 0;
  1835. $.each(data.damageList, function (index, detail) {
  1836. var row = $('<tr>').appendTo(tbody);
  1837. $('<td>').text(index + 1).css('padding', '0.45rem 0.45rem').appendTo(row);
  1838. $('<td>').text(detail.assetName).css('padding', '0.45rem 0.45rem').appendTo(row);
  1839. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text('View').on('click', function () {
  1840. showDamageImage(detail.damageImageUrl);
  1841. });
  1842. var assetamt = (detail.assetAmount / detail.quantity).toFixed(2);
  1843. $('<td>').css('padding', '0.45rem 0.45rem').append(viewLink).appendTo(row);
  1844. $('<td>').text(assetamt).css('padding', '0.45rem 0.45rem').appendTo(row);
  1845. $('<td>').text(detail.quantity).css('padding', '0.45rem 0.45rem').appendTo(row);
  1846. var amount = detail.assetAmount;
  1847. totalAmount += amount;
  1848. $('<td>').text(amount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(row);
  1849. $("#td_dam_amt").html(totalAmount.toFixed(2));
  1850. });
  1851. // Add row for total amount
  1852. var totalRow = $('<tr>').appendTo(tbody);
  1853. $('<td>').attr('colspan', '5').text('Total Amount').css('padding', '0.45rem 0.45rem; font-weight: bold; background-color: #f2f2f2').appendTo(totalRow);
  1854. $('<td>').text(totalAmount.toFixed(2)).css('padding', '0.45rem 0.45rem').appendTo(totalRow);
  1855. // Append the table elements to the container div
  1856. table.append(thead, tbody);
  1857. tableResponsiveDiv.append(table);
  1858. damageFieldContainer.append(tableResponsiveDiv);
  1859. var temp_total = parseFloat($("#td_settel_amt").html());
  1860. var settleAmount = temp_total - totalAmount;
  1861. if (settleAmount < 0) {
  1862. var pendingstatus = data.settlement.collectionStatus
  1863. $("#td_settel_amt").html(0.00);
  1864. $("#pendingcolumn").show();
  1865. $("#collectionstatuscolumn").show();
  1866. $('#td_collection_status').html(pendingstatus);
  1867. $("#td_pending_amt").html(Math.abs(settleAmount).toFixed(2));
  1868. $("#td_pending_amt").css("color", "red");
  1869. } else {
  1870. $("#td_settel_amt").html(settleAmount.toFixed(2));
  1871. $("#pendingcolumn").hide();
  1872. $("#collectionstatuscolumn").hide();
  1873. $("#td_settel_amt").css("color", "green"); // Set color to green for positive amounts
  1874. }
  1875. }
  1876. function showDamageImage(damageImageUrl) {
  1877. document.getElementById('filePreview').src = damageImageUrl;
  1878. $('#fileModal').modal('show');
  1879. }
  1880. function showchallonimage(challanImgLink) {
  1881. document.getElementById('filePreview').src = challanImgLink;
  1882. $('#fileModal').modal('show');
  1883. }
  1884. function showReasonDocuments(list) {
  1885. $.ajax({
  1886. type: "GET",
  1887. url: '/communityhall/api/officer/getReasonByName',
  1888. data: {
  1889. 'reasonName': list.reason
  1890. },
  1891. success: function (x) {
  1892. showReasonWithDocument(x, list);
  1893. }
  1894. });
  1895. }
  1896. // Display booking documents
  1897. function showReasonWithDocument(reasonData, list) {
  1898. var reasonDocumentData = reasonData.reasonDocumentMasterList;
  1899. var bookingDocumentsList = list.bookingDocumentsList;
  1900. const reasonFieldsContainer = $('#documents');
  1901. reasonFieldsContainer.empty();
  1902. // Create a responsive table container
  1903. var tableResponsiveDiv = $('<div>').addClass('table-responsive').css({
  1904. 'width': '729px',
  1905. 'border': '1px solid black'
  1906. });
  1907. // Create the table with Bootstrap classes and custom styles
  1908. var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
  1909. 'width': '100%',
  1910. 'height': 'auto',
  1911. 'border': '1px solid black'
  1912. });
  1913. // Create the table header (thead)
  1914. var thead = $('<thead>').appendTo(table);
  1915. var headerRow = $('<tr>').appendTo(thead);
  1916. $('<th>').attr('colspan', '3').text('Document Details').css({
  1917. 'color': 'black',
  1918. 'background-color': 'lightgrey',
  1919. 'padding': '0.45rem 0.45rem'
  1920. }).appendTo(headerRow);
  1921. // Create header row for columns
  1922. var columnHeadersRow = $('<tr>').appendTo(thead);
  1923. $('<th>').text('S.No').appendTo(columnHeadersRow);
  1924. $('<th>').text('Required Info').appendTo(columnHeadersRow);
  1925. $('<th>').text('Required Documents').appendTo(columnHeadersRow);
  1926. // Create the table body (tbody)
  1927. var tbody = $('<tbody>').appendTo(table);
  1928. // Iterate through the documents list and populate rows
  1929. for (var i = 0; i < bookingDocumentsList.length; i++) {
  1930. (function (index) {
  1931. var row = $('<tr>').appendTo(tbody);
  1932. $('<td>').text(index + 1).appendTo(row);
  1933. // Determine the text content for the second cell
  1934. var name = bookingDocumentsList[index].name ? bookingDocumentsList[index].name : ''; // Empty string if name is null or undefined
  1935. var fieldText = reasonDocumentData[index].fieldName;
  1936. var fullText = name ? fieldText + ': ' + name : fieldText; // Include colon only if name is not empty
  1937. $('<td>').text(fullText).appendTo(row);
  1938. // Create a link to view document image
  1939. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text(reasonDocumentData[index].docFieldName).on('click', function () {
  1940. showDocumentImage(bookingDocumentsList[index].bookingDocUrl);
  1941. });
  1942. $('<td>').append(viewLink).appendTo(row);
  1943. })(i);
  1944. }
  1945. // Append table to the responsive container
  1946. tableResponsiveDiv.append(table);
  1947. // Append table to the container in the DOM
  1948. reasonFieldsContainer.append(tableResponsiveDiv);
  1949. }
  1950. function showDocumentImage(fileURL) {
  1951. openFileModal(fileURL);
  1952. }
  1953. // Event delegation for dynamically added elements
  1954. $(document).on('click', '.view-document', function () {
  1955. const fileURL = $(this).data('url');
  1956. openFileModal(fileURL);
  1957. });
  1958. function openFileModal(fileURL) {
  1959. $('#filePreview').attr('src', fileURL);
  1960. $('#fileModal').modal('show');
  1961. }
  1962. // For OTP input box
  1963. $('.otp-input').on('keyup', function (e) {
  1964. var $this = $(this);
  1965. if ($this.val().length === 1) {
  1966. $this.next('.otp-input').focus();
  1967. }
  1968. if ($this.val().length === 0) {
  1969. $this.prev('.otp-input').focus();
  1970. }
  1971. });
  1972. function cancelBooking(bookingId, mobileNo, bookingType) {
  1973. var mobileNum = mobileNo;
  1974. var bookingId = bookingId;
  1975. // Check if the booking type is OFFLINE
  1976. if (bookingType === "OFFLINE") {
  1977. Swal.fire({
  1978. title: 'Cancellation Not Available',
  1979. text: 'Cancellation is not available for offline bookings.',
  1980. icon: 'error'
  1981. });
  1982. } else {
  1983. Swal.fire({
  1984. title: 'Are you sure?',
  1985. text: 'Once canceled, this action can\'t be undo. Only the deposit Amount will be refunded within 3 to 15 days.',
  1986. icon: 'warning',
  1987. showCancelButton: true,
  1988. confirmButtonColor: '#3085d6',
  1989. cancelButtonColor: '#d33',
  1990. confirmButtonText: 'Yes, cancel it!',
  1991. cancelButtonText: 'Close',
  1992. }).then((result) => {
  1993. if (result.isConfirmed) {
  1994. // If user confirms, show OTP form
  1995. mobileNumberForCancel = mobileNum;
  1996. cancelBookingId = bookingId;
  1997. cancelBookingLogin = true;
  1998. sendOTP(mobileNum);
  1999. }
  2000. });
  2001. }
  2002. }
  2003. function openRescheduleModal(bookingId, startDate, endDate, noOfDays, hallId, startingSlot, endingSlot, reason) {
  2004. // Function to map slot values to their text representation
  2005. function getSlotText(slot) {
  2006. return slot === 1 ? 'Morning' : 'Evening';
  2007. }
  2008. // Populate modal inputs
  2009. const start = new Date(startDate);
  2010. const end = new Date(endDate);
  2011. const timeDiff = end - start;
  2012. // Convert time difference from milliseconds to days
  2013. const daysDiff = Math.ceil(timeDiff / (1000 * 3600 * 24)) + 1;
  2014. // Set values for inputs
  2015. document.getElementById("bookingId").value = bookingId;
  2016. document.getElementById("startDateInput").value = startDate;
  2017. document.getElementById("endDateInput").value = endDate;
  2018. document.getElementById("noOfDaysInput").value = noOfDays;
  2019. document.getElementById("startingSlot").value = startingSlot;
  2020. document.getElementById("endingSlot").value = endingSlot;
  2021. document.getElementById("daysDiff").value = daysDiff;
  2022. // Display slot text in the modal
  2023. document.getElementById("startDatetext").value = startDate;
  2024. document.getElementById("startingSlotText").value = getSlotText(startingSlot);
  2025. document.getElementById("endingSlotText").value = getSlotText(endingSlot);
  2026. // Optionally, fetch and update calendar or availability based on hallId
  2027. getBookingCalendar(hallId, reason);
  2028. // Show the modal
  2029. $('#bookingRescheduleModal').modal('show');
  2030. }
  2031. function getBookingCalendar(hall_id, reason) {
  2032. // Make an AJAX call to fetch booking data
  2033. $.ajax({
  2034. type: 'GET',
  2035. url: '/communityhall/user/api/getPastData',
  2036. data: {
  2037. hall_id: hall_id
  2038. },
  2039. success: function (response) {
  2040. window.bookingResponse = {};
  2041. if (response && Array.isArray(response)) {
  2042. $("#startDateInput").datepicker("destroy");
  2043. for (var i = 0; i < response.length; i++) {
  2044. var dateString = datepickerFormat(response[i].bdate);
  2045. window.bookingResponse[dateString] = [response[i].morningSlot, response[i].eveningSlot];
  2046. }
  2047. initializeDatepickerWithColors(hall_id, reason);
  2048. if (response.length == 0) {
  2049. initializeDatepickerWithColors(hall_id, reason);
  2050. }
  2051. } else {
  2052. console.error('Invalid or empty response data.');
  2053. }
  2054. },
  2055. error: function (xhr, status, error) {
  2056. console.error('Error fetching hall details:', error);
  2057. }
  2058. });
  2059. }
  2060. function initializeDatepickerWithColors(hallId, reason) { // Confirm hallId is passed here
  2061. $("#datepicker-container").datepicker("destroy");
  2062. const serverDate = new Date($("#serverDate").val() + "T00:00:00")
  2063. // console.log(" view history Date:", serverDate);
  2064. const maxDate = new Date(serverDate);
  2065. maxDate.setMonth(maxDate.getMonth() + 6);
  2066. // console.log("View History: "+maxDate);
  2067. $("#startDateInput,#datepicker-container").datepicker({
  2068. dateFormat: "yy-mm-dd",
  2069. minDate: serverDate,
  2070. maxDate: maxDate,
  2071. beforeShowDay: function (eDate) {
  2072. const dateString = $.datepicker.formatDate("yy-mm-dd", eDate);
  2073. const bookingStatus = window.bookingResponse[dateString] || {};
  2074. // const currentDate = new Date();
  2075. serverDate.setHours(0, 0, 0, 0); // Normalize current date to midnight
  2076. eDate.setHours(0, 0, 0, 0); // Normalize selected date to midnight
  2077. // Logic for other dates
  2078. if (eDate < serverDate) {
  2079. return [false, "highlight-disabled", "Slot not Available"];
  2080. }
  2081. const isToday = eDate.getTime() === serverDate.getTime();
  2082. const currentHour = new Date().getHours();
  2083. const isBefore6AM = currentHour < 6;
  2084. const isAfter2PM = currentHour >= 14;
  2085. // Block 3-day logic for specific event types
  2086. // const today = new Date();
  2087. const blockedDate = new Date(serverDate);
  2088. blockedDate.setDate(serverDate.getDate() + 2);
  2089. const isThreeDayBlock = ["Commercial", "State Govt Event", "Central Govt Event"].includes(reason);
  2090. if (eDate <= blockedDate && isThreeDayBlock) {
  2091. return [false, "highlight-disabled", "Blocked due to event type"];
  2092. }
  2093. // Logic for currentdate
  2094. if (isToday) {
  2095. if (isBefore6AM) {
  2096. // Before 6 AM: Allow full-day booking or adjust based on booking status
  2097. return handleBookingStatus(bookingStatus, "Full Day Available");
  2098. } else if (isAfter2PM) {
  2099. // After 2 PM: Block all bookings
  2100. return handleAfter2PM(bookingStatus);
  2101. } else {
  2102. // Between 6 AM and 2 PM: Check status and disable morning slots
  2103. return handleMorningSlots(bookingStatus);
  2104. }
  2105. }
  2106. return handleBookingStatus(bookingStatus, "Slot Available");
  2107. },
  2108. });
  2109. $("#startDateInput").on("change", function () {
  2110. var selectedDate = $(this).val();
  2111. var noOfDays = document.getElementById('noOfDaysInput').value;
  2112. var startingSlot = document.getElementById("startingSlot").value;
  2113. var endingSlot = document.getElementById("endingSlot").value;
  2114. var noofdays = document.getElementById("noOfDaysInput").value;
  2115. updateEndDate(selectedDate, noofdays, startingSlot, endingSlot);
  2116. });
  2117. }
  2118. function handleBookingStatus(bookingStatus, defaultMessage) {
  2119. if (bookingStatus[2]) {
  2120. return [true, "highlight-blue disabled", "GCC Blocked"];
  2121. } /*else if (bookingStatus[3]) {
  2122. return [true, "highlight-lightpink disabled", "Temporary Blocked"];
  2123. }*/ else if (bookingStatus[0] && bookingStatus[1]) {
  2124. return [true, "highlight-pink disabled", "Slot Occupied"];
  2125. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2126. return [true, "highlight-yellow", "Evening Slot Available"];
  2127. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2128. return [true, "highlight-violet", "Only Morning Slot Available"];
  2129. }
  2130. return [true, "highlight-greens", defaultMessage];
  2131. }
  2132. // Helper function: Handles logic after 2 PM
  2133. function handleAfter2PM(bookingStatus) {
  2134. if (bookingStatus[2]) {
  2135. return [true, "highlight-blue disabled", "GCC Blocked"];
  2136. } else if (bookingStatus[0] || bookingStatus[1]) {
  2137. return [true, "highlight-pink disabled", "Slot Occupied"];
  2138. }
  2139. return [false, "highlight-disabled", "Not Allowed to Book"];
  2140. }
  2141. // Helper function: Handles morning slots between 6 AM and 2 PM
  2142. function handleMorningSlots(bookingStatus) {
  2143. if (bookingStatus[2]) {
  2144. return [true, "highlight-blue disabled", "GCC Blocked"];
  2145. } else if (bookingStatus[0] && bookingStatus[1]) {
  2146. return [true, "highlight-pink disabled", "Slot Occupied"];
  2147. } else if (bookingStatus[0] && !bookingStatus[1]) {
  2148. return [true, "highlight-yellow", "Evening Slot Available"];
  2149. } else if (!bookingStatus[0] && bookingStatus[1]) {
  2150. return [false, "highlight-disabled", "Slot Occupied"];
  2151. }
  2152. return [true, "highlight-yellow", "Evening Slot Available"];
  2153. }
  2154. function updateEndDate(startDate, noofdays, startingSlot, endingSlot) {
  2155. if (startDate && noofdays !== undefined) {
  2156. var start = new Date(startDate);
  2157. var startFormatted = start.toISOString().split('T')[0];
  2158. var bookingStatus = window.bookingResponse[startFormatted] || [false, false];
  2159. var morningAvailable = !bookingStatus[0]; // false means available
  2160. var eveningAvailable = !bookingStatus[1]; // false means available
  2161. var endDate;
  2162. var isValid = true; // Flag to determine if all slots are available
  2163. // Convert noofdays to a number for accurate calculations
  2164. noofdays = parseFloat(noofdays);
  2165. // Handle slot availability and combinations
  2166. if (startingSlot === "2" && endingSlot === "2") { // Evening to Evening
  2167. //console.log("Handling Evening to Evening slot.");
  2168. if (noofdays === 0.5) {
  2169. if (eveningAvailable) {
  2170. endDate = new Date(start);
  2171. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2172. endDate = endDate.toISOString().split('T')[0];
  2173. document.getElementById('endDateInput').value = endDate;
  2174. //console.log("End Date (Evening to Evening):", endDate);
  2175. } else {
  2176. Swal.fire({
  2177. title: 'Evening Slot Not Available',
  2178. text: 'The evening slot is not available for the selected date range.',
  2179. icon: 'warning',
  2180. confirmButtonText: 'OK'
  2181. });
  2182. document.getElementById('endDateInput').value = "";
  2183. //console.log("Evening slot not available for", noofdays, "days.");
  2184. }
  2185. } else if (noofdays === 1.5) {
  2186. // Special handling for 2 days
  2187. let endDateCandidate = new Date(start);
  2188. endDateCandidate.setDate(start.getDate() + 1);
  2189. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2190. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2191. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2192. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2193. if (eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
  2194. endDate = endDateCandidate.toISOString().split('T')[0];
  2195. document.getElementById('endDateInput').value = endDate;
  2196. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2197. } else {
  2198. Swal.fire({
  2199. title: 'Slot Not Available',
  2200. text: 'The Morning slots are not available for the selected date range.',
  2201. icon: 'warning',
  2202. confirmButtonText: 'OK'
  2203. });
  2204. document.getElementById('endDateInput').value = "";
  2205. //console.log("Morning or Evening slot not available for 2 days.");
  2206. }
  2207. } else {
  2208. //console.log("Unsupported duration for Evening to Evening slot.");
  2209. Swal.fire({
  2210. title: 'Invalid Selection',
  2211. text: 'The selected duration for the evening slot is not supported.',
  2212. icon: 'error',
  2213. confirmButtonText: 'OK'
  2214. });
  2215. document.getElementById('endDateInput').value = "";
  2216. }
  2217. } else if (startingSlot === "1" && endingSlot === "1") { // Morning to Morning
  2218. //console.log("Handling Morning to Morning slot.");
  2219. if (noofdays === 0.5) {
  2220. if (morningAvailable) {
  2221. endDate = new Date(start);
  2222. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2223. endDate = endDate.toISOString().split('T')[0];
  2224. document.getElementById('endDateInput').value = endDate;
  2225. //console.log("End Date (morning to morning):", endDate);
  2226. } else {
  2227. Swal.fire({
  2228. title: 'Morning Slot Not Available',
  2229. text: 'The Morning slot is not available for the selected date range.',
  2230. icon: 'warning',
  2231. confirmButtonText: 'OK'
  2232. });
  2233. document.getElementById('endDateInput').value = "";
  2234. //console.log("Evening slot not available for", noofdays, "days.");
  2235. }
  2236. } else if (noofdays === 1.5) {
  2237. // Special handling for 2 days
  2238. let endDateCandidate = new Date(start);
  2239. endDateCandidate.setDate(start.getDate() + 1);
  2240. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2241. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2242. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2243. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2244. if (morningAvailable && eveningAvailable && morningAvailableOnEndDate) {
  2245. endDate = endDateCandidate.toISOString().split('T')[0];
  2246. document.getElementById('endDateInput').value = endDate;
  2247. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2248. } else {
  2249. Swal.fire({
  2250. title: 'Slot Not Available',
  2251. text: 'The evening slots are not available for the selected date range.',
  2252. icon: 'warning',
  2253. confirmButtonText: 'OK'
  2254. });
  2255. document.getElementById('endDateInput').value = "";
  2256. //console.log("Morning or Evening slot not available for 2 days.");
  2257. }
  2258. } else {
  2259. //console.log("Unsupported duration for Morning to Morning slot.");
  2260. Swal.fire({
  2261. title: 'Invalid Selection',
  2262. text: 'The selected duration for the morning slot is not supported.',
  2263. icon: 'error',
  2264. confirmButtonText: 'OK'
  2265. });
  2266. document.getElementById('endDateInput').value = "";
  2267. }
  2268. } else if (startingSlot === "1" && endingSlot === "2") { // Morning to Evening
  2269. //console.log("Handling Morning to Evening slot.");
  2270. if (noofdays === 1) {
  2271. if (morningAvailable && eveningAvailable) {
  2272. endDate = new Date(start);
  2273. endDate.setDate(start.getDate() + Math.ceil(noofdays) - 1);
  2274. endDate = endDate.toISOString().split('T')[0];
  2275. document.getElementById('endDateInput').value = endDate;
  2276. //console.log("End Date (Morning to Evening):", endDate);
  2277. } else {
  2278. Swal.fire({
  2279. title: ' Slot Not Available',
  2280. text: 'The Selected slot is not available for the selected date range.',
  2281. icon: 'warning',
  2282. confirmButtonText: 'OK'
  2283. });
  2284. document.getElementById('endDateInput').value = "";
  2285. //console.log("Evening slot not available for", noofdays, "days.");
  2286. }
  2287. } else if (noofdays === 2) {
  2288. // Special handling for 2 days
  2289. let endDateCandidate = new Date(start);
  2290. endDateCandidate.setDate(start.getDate() + 1);
  2291. let endDateFormattedCandidate = endDateCandidate.toISOString().split('T')[0];
  2292. let endDateStatusCandidate = window.bookingResponse[endDateFormattedCandidate] || [false, false];
  2293. let morningAvailableOnEndDate = !endDateStatusCandidate[0]; // false means available
  2294. let eveningAvailableOnEndDate = !endDateStatusCandidate[1]; // false means available
  2295. if (morningAvailable && eveningAvailable && morningAvailableOnEndDate && eveningAvailableOnEndDate) {
  2296. endDate = endDateCandidate.toISOString().split('T')[0];
  2297. document.getElementById('endDateInput').value = endDate;
  2298. //console.log("End Date (Morning to Evening with 2 days):", endDate);
  2299. } else {
  2300. Swal.fire({
  2301. title: 'Slot Not Available',
  2302. text: 'The morning and/or evening slots are not available for the selected date range.',
  2303. icon: 'warning',
  2304. confirmButtonText: 'OK'
  2305. });
  2306. document.getElementById('endDateInput').value = "";
  2307. //console.log("Morning or Evening slot not available for 2 days.");
  2308. }
  2309. } else {
  2310. //console.log("Unsupported duration for Morning to Evening slot.");
  2311. Swal.fire({
  2312. title: 'Invalid Selection',
  2313. text: 'The selected duration for the morning to evening slot is not supported.',
  2314. icon: 'error',
  2315. confirmButtonText: 'OK'
  2316. });
  2317. document.getElementById('endDateInput').value = "";
  2318. }
  2319. } else if (startingSlot === "2" && endingSlot === "1") { // Evening to Morning
  2320. //console.log("Handling Evening to Morning slot.");
  2321. if (noofdays === 1) {
  2322. if (eveningAvailable) { // Check if evening slot is available
  2323. let nextDay = new Date(start);
  2324. nextDay.setDate(start.getDate() + 1);
  2325. let nextDayFormatted = nextDay.toISOString().split('T')[0];
  2326. let nextDayStatus = window.bookingResponse[nextDayFormatted] || [false, false];
  2327. let nextDayMorningAvailable = !nextDayStatus[0]; // false means available
  2328. if (nextDayMorningAvailable) {
  2329. endDate = nextDay.toISOString().split('T')[0];
  2330. document.getElementById('endDateInput').value = endDate;
  2331. //console.log("End Date (Evening to Morning):", endDate);
  2332. } else {
  2333. Swal.fire({
  2334. title: 'Morning Slot Not Available',
  2335. text: 'The morning slot is not available for the next day.',
  2336. icon: 'warning',
  2337. confirmButtonText: 'OK'
  2338. });
  2339. document.getElementById('endDateInput').value = "";
  2340. //console.log("Morning slot not available for the next day.");
  2341. }
  2342. } else {
  2343. Swal.fire({
  2344. title: 'Evening Slot Not Available',
  2345. text: 'The evening slot is not available for the selected date.',
  2346. icon: 'warning',
  2347. confirmButtonText: 'OK'
  2348. });
  2349. document.getElementById('endDateInput').value = "";
  2350. //console.log("Evening slot not available for", startDate);
  2351. }
  2352. } else {
  2353. //console.log("Unsupported duration for Evening to Morning slot.");
  2354. Swal.fire({
  2355. title: 'Invalid Selection',
  2356. text: 'The selected duration for the evening to morning slot is not supported.',
  2357. icon: 'error',
  2358. confirmButtonText: 'OK'
  2359. });
  2360. document.getElementById('endDateInput').value = "";
  2361. }
  2362. } else {
  2363. //console.log("Unsupported slot combination or duration.");
  2364. Swal.fire({
  2365. title: 'Invalid Slot Combination',
  2366. text: 'The selected slot combination or duration is not supported.',
  2367. icon: 'error',
  2368. confirmButtonText: 'OK'
  2369. });
  2370. document.getElementById('endDateInput').value = "";
  2371. }
  2372. } else {
  2373. //console.log("Start Date or Number of Days not provided.");
  2374. Swal.fire({
  2375. title: 'Invalid Input',
  2376. text: 'Please provide a valid start date and number of days.',
  2377. icon: 'error',
  2378. confirmButtonText: 'OK'
  2379. });
  2380. document.getElementById('endDateInput').value = "";
  2381. }
  2382. }
  2383. function datepickerFormat(dateString) {
  2384. var dateObject = new Date(dateString);
  2385. var year = dateObject.getFullYear();
  2386. var month = (dateObject.getMonth() + 1).toString().padStart(2, "0");
  2387. var day = dateObject.getDate().toString().padStart(2, "0");
  2388. return `${year}-${month}-${day}`;
  2389. }
  2390. function printTables() {
  2391. // Get the printable content
  2392. var printableContent = document.getElementById('printableContent').innerHTML;
  2393. // Open a print window
  2394. var printWindow = window.open('', '', 'height=400,width=600');
  2395. // Write the printable content to the print window
  2396. printWindow.document.write('<html><head><title>Print</title></head><body>' + printableContent + '</body></html>');
  2397. // Close the print window after printing
  2398. printWindow.document.close();
  2399. printWindow.print();
  2400. printWindow.close();
  2401. }
  2402. function Reschedule() {
  2403. // Retrieve values from modal inputs
  2404. var bookingId = document.getElementById("bookingId").value;
  2405. var startDate = document.getElementById("startDateInput").value;
  2406. var endDate = document.getElementById("endDateInput").value;
  2407. var originalStartDate = document.getElementById("startDatetext").value;
  2408. // Check if the rescheduled start date is the same as the original booked start date
  2409. if (startDate === originalStartDate) {
  2410. Swal.fire({
  2411. icon: 'warning',
  2412. title: 'Warning',
  2413. text: 'Your Rescheduled Start Date is the same as Your booking Start Date. Please change the date.',
  2414. showConfirmButton: true
  2415. });
  2416. return;
  2417. }
  2418. if (!endDate) {
  2419. Swal.fire({
  2420. icon: 'error',
  2421. title: 'Error',
  2422. text: 'End Date is Empty! Please check your Start Date', // Error message from backend
  2423. showConfirmButton: true
  2424. });
  2425. return;
  2426. }
  2427. // Ajax POST request
  2428. $.ajax({
  2429. type: "POST",
  2430. url: "/communityhall/user/api/reschedule-dates",
  2431. data: {
  2432. bookingId: bookingId,
  2433. startDate: startDate,
  2434. endDate: endDate
  2435. },
  2436. success: function (response) {
  2437. // Handle success response
  2438. Swal.fire({
  2439. icon: 'success',
  2440. title: 'Success',
  2441. text: response, // Success message from backend
  2442. showConfirmButton: false,
  2443. timer: 1500
  2444. }).then(function () {
  2445. // Optionally reload page or update UI
  2446. location.reload(); // Example: reload the page
  2447. });
  2448. },
  2449. error: function (xhr, status, error) {
  2450. if (xhr.responseText.includes("Dates are already occupied")) {
  2451. Swal.fire({
  2452. icon: 'error',
  2453. title: 'Error',
  2454. text: 'Dates are already occupied. Please select another date.', // Error message from backend
  2455. showConfirmButton: true
  2456. });
  2457. } else {
  2458. Swal.fire({
  2459. icon: 'error',
  2460. title: 'Error',
  2461. text: 'An error occurred while rescheduling your booking. Please try again.', // General error message
  2462. showConfirmButton: true
  2463. });
  2464. }
  2465. }
  2466. });
  2467. }
  2468. $(document).ready(function () {
  2469. // DataTables buttons configuration
  2470. var buttons = [
  2471. {
  2472. extend: 'pageLength',
  2473. className: 'btn btn-primary'
  2474. }
  2475. ];
  2476. $('#simpletable').DataTable({
  2477. dom: 'Bftip',
  2478. columnDefs: [
  2479. {targets: 'no-sort', orderable: false}
  2480. ],
  2481. lengthMenu: [
  2482. [5, 10, 20, 50, -1],
  2483. ['5 rows', '10 rows', '20 rows', '50 rows', 'Show all']
  2484. ],
  2485. scrollY: '50vh',
  2486. fixedColumns: {
  2487. left: 1,
  2488. right: 1
  2489. },
  2490. buttons: [buttons],
  2491. responsive: true,
  2492. searching: true, // Enable search
  2493. select: false,
  2494. processing: false,
  2495. });
  2496. $('#searchInput').on('keyup', function () {
  2497. dataTable.search(this.value).draw();
  2498. });
  2499. });
  2500. $(document).on('change', '.nocfile', function () {
  2501. validateFile(this);
  2502. });
  2503. function transactionHistory(userId) {
  2504. $.ajax({
  2505. type: "GET",
  2506. url: '/communityhall/user/api/getTransactionDetails',
  2507. data: {'userId': userId},
  2508. success: function (data) {
  2509. // console.log("Full response:", data);
  2510. // console.log("Refund Details:", data.refundDetails);
  2511. const transactions = data.transactions || [];
  2512. const refundDetails = data.refundDetails || [];
  2513. populateTransactionTable(transactions);
  2514. populateRefundDetailsTable(refundDetails);
  2515. $('#transactionHistoryModal').modal('show'); // Show the modal
  2516. },
  2517. error: function (error) {
  2518. console.error("Error fetching transaction details", error);
  2519. }
  2520. });
  2521. }
  2522. function populateTransactionTable(transactions) {
  2523. const tableBody = $('#transactionTable tbody');
  2524. tableBody.empty(); // Clear any existing rows
  2525. transactions.forEach((transaction, index) => {
  2526. const paymentStatus = (transaction.statusCode === "0300" && transaction.response?.includes("success"))
  2527. ? "Success"
  2528. : "Payment Failed";
  2529. const row = `
  2530. <tr>
  2531. <td>${index + 1}</td>
  2532. <td>${transaction.bookingId}</td>
  2533. <td>${transaction.amount || '-'}</td>
  2534. <td>${transaction.date || '-'}</td>
  2535. <td>${transaction.txansactionId || '-'}</td>
  2536. <td>${paymentStatus}</td>
  2537. </tr>
  2538. `;
  2539. tableBody.append(row); // Append the row to the table body
  2540. });
  2541. }
  2542. function populateRefundDetailsTable(refundDetails) {
  2543. const refundTable = $('#refunddetails');
  2544. const tableBody = $('#refunddetailsTable tbody');
  2545. tableBody.empty(); // Clear any existing rows
  2546. if (refundDetails.length > 0) {
  2547. refundTable.show(); // Show the refund details table
  2548. refundDetails.forEach((refund, index) => {
  2549. const row = `
  2550. <tr>
  2551. <td>${index + 1}</td>
  2552. <td>${refund.bookingId}</td>
  2553. <td>${refund.amount}</td>
  2554. <td>${refund.date}</td>
  2555. <td>${refund.txansactionId}</td>
  2556. <td>${refund.refundAmount}</td>
  2557. </tr>
  2558. `;
  2559. tableBody.append(row);
  2560. });
  2561. } else {
  2562. refundTable.hide(); // Hide the refund details table
  2563. }
  2564. }
  2565. // Toggle Chat Box
  2566. function toggleChat() {
  2567. const chatBox = document.getElementById('chat-box');
  2568. chatBox.style.display = (chatBox.style.display === 'block') ? 'none' : 'block';
  2569. }
  2570. // Send Message
  2571. function sendMessage() {
  2572. const userInput = document.getElementById('userInput');
  2573. const message = userInput.value.trim();
  2574. if (message) {
  2575. // Create message element
  2576. const chatBody = document.getElementById('chat-body');
  2577. const userMessage = document.createElement('div');
  2578. userMessage.className = 'user-message';
  2579. userMessage.textContent = message;
  2580. chatBody.appendChild(userMessage);
  2581. chatBody.scrollTop = chatBody.scrollHeight; // Auto-scroll to bottom
  2582. // Send message to the server (Spring Boot API)
  2583. fetch('/communityhall/admin/api/send', {
  2584. method: 'POST',
  2585. headers: {
  2586. 'Content-Type': 'application/json',
  2587. },
  2588. body: JSON.stringify({message}),
  2589. })
  2590. .then(response => response.json())
  2591. .then(data => {
  2592. // Add response message to chat
  2593. const responseMessage = document.createElement('div');
  2594. responseMessage.className = 'bot-message';
  2595. responseMessage.textContent = data.response;
  2596. chatBody.appendChild(responseMessage);
  2597. chatBody.scrollTop = chatBody.scrollHeight;
  2598. });
  2599. userInput.value = ''; // Clear input field
  2600. }
  2601. }
  2602. </script>
  2603. </div>
  2604. </div>
  2605. </div>
  2606. </body>
  2607. </html>