Victoria Hall Booking for Events
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

384 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-counter :: head}">
  4. <title>Refund Initialisation</title>
  5. </head>
  6. <body>
  7. <div id="page-container"
  8. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  9. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  10. <nav th:replace="~{fragments/nav-counter :: nav}"></nav>
  11. <header th:replace="~{fragments/header-counter :: header}"></header>
  12. <main id="main-container">
  13. <div class="content">
  14. <div class="block block-rounded">
  15. <div class="block-header block-header-default">
  16. <h3 class="block-title"> Refund Initialisation</h3>
  17. </div>
  18. <div class="block-content p-0">
  19. <div class="p-sm-4 p-0">
  20. <div class="table-responsive">
  21. <table id="refunddocsList"
  22. class="table table-bordered table-striped table-vcenter js-dataTable-responsive">
  23. <thead class="thead-light">
  24. <tr class="table-bordered">
  25. <th class="text-center no-sort">S.No</th>
  26. <th class="text-center" width="20%">Letter</th>
  27. <th class="text-center" width="20%">Booking Details</th>
  28. <th class="text-center" width="20%">User Details</th>
  29. <th class="text-center">Status</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <tr th:each="list, i : ${counterRefundLists}" class="${counterRefundLists}"
  34. id="hallRow">
  35. <td th:text="${i.count}">0</td>
  36. <td class="text-center">
  37. <button type="button" class="btn btn-primary" data-bs-toggle="modal"
  38. data-bs-target="#exampleModal"
  39. th:onclick="viewLetter([[${list.letterdocument}]])">View</button>
  40. </td>
  41. <td class="text-center">
  42. <button type="button" class="btn btn-primary" data-bs-toggle="modal"
  43. data-bs-target="#exampleModal"
  44. th:onclick="BookingDetails([[${list.counterDetails}]])">View</button>
  45. </td>
  46. <td class="text-center">
  47. <button type="button" class="btn btn-primary" data-bs-toggle="modal"
  48. data-bs-target="#exampleModal"
  49. th:onclick="UserDetails([[${list.counterDetails}]])">View</button>
  50. </td>
  51. <td>
  52. <span class="badge bg-primary"
  53. th:text="${list.initialisationStatus}"></span>
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </main>
  64. </div>
  65. <div class="modal fade" id="userDetails" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  66. <div class="modal-dialog modal-lg">
  67. <div class="modal-content">
  68. <div class="modal-header">
  69. <h5 class="modal-title" id="exampleModalLabel">User Details</h5>
  70. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  71. </div>
  72. <div class="modal-body">
  73. <div class="row">
  74. <div class="col-sm-4">
  75. <label class="form-label" for="name">Name:<span class="text-danger"></span></label>
  76. <input type="text" class="form-control text-center" name="name" id="name" readonly />
  77. </div>
  78. <div class="col-sm-4">
  79. <label class="form-label" for="mobileno">Mobile Number:<span
  80. class="text-danger"></span></label>
  81. <input type="text" class="form-control text-center" name="mobileno" id="mobileno"
  82. readonly />
  83. </div>
  84. <div class="col-sm-4">
  85. <label class="form-label" for="email">Email:<span class="text-danger"></span></label>
  86. <input type="text" class="form-control text-center" name="email" id="email" readonly />
  87. </div>
  88. <div class="col-sm-4">
  89. <label class="form-label" for="usertype">User type:<span class="text-danger"></span></label>
  90. <input type="text" class="form-control text-center" name="usertype" id="usertype"
  91. readonly />
  92. </div>
  93. <div class="col-sm-4">
  94. <label class="form-label" for="street">Street:<span class="text-danger"></span></label>
  95. <input type="text" class="form-control text-center" name="street" id="street" readonly />
  96. </div>
  97. <div class="col-sm-4">
  98. <label class="form-label" for="area">Area:<span class="text-danger"></span></label>
  99. <input type="text" class="form-control text-center" name="area" id="area" readonly />
  100. </div>
  101. <div class="col-sm-4">
  102. <label class="form-label" for="location">Location:<span class="text-danger"></span></label>
  103. <input type="text" class="form-control text-center" name="location" id="location"
  104. readonly />
  105. </div>
  106. <div class="col-sm-4">
  107. <label class="form-label" for="pincode">Pincode:<span class="text-danger"></span></label>
  108. <input type="text" class="form-control text-center" name="pincode" id="pincode" readonly />
  109. </div>
  110. </div>
  111. </div>
  112. <div class="modal-footer">
  113. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="modal fade" id="bookingDetails" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  119. <div class="modal-dialog modal-lg">
  120. <div class="modal-content">
  121. <div class="modal-header">
  122. <h5 class="modal-title" id="exampleModalLabel">Booking Details</h5>
  123. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  124. </div>
  125. <div class="modal-body">
  126. <div class="row">
  127. <div class="col-sm-4">
  128. <label class="form-label" for="noofdays">No of Days:<span
  129. class="text-danger"></span></label>
  130. <input type="text" class="form-control text-center" name="noofdays" id="noofdays"
  131. readonly />
  132. </div>
  133. <div class="col-sm-4">
  134. <label class="form-label" for="startdate">Start Date:<span
  135. class="text-danger"></span></label>
  136. <input type="text" class="form-control text-center" name="startdate" id="startdate"
  137. readonly />
  138. </div>
  139. <div class="col-sm-4">
  140. <label class="form-label" for="enddate">End Date:<span class="text-danger"></span></label>
  141. <input type="text" class="form-control text-center" name="enddate" id="enddate" readonly />
  142. </div>
  143. <div class="col-sm-4">
  144. <label class="form-label" for="startingslot">Starting Slot<span
  145. class="text-danger"></span></label>
  146. <input type="text" class="form-control text-center" name="startingslot" id="startingslot"
  147. readonly />
  148. </div>
  149. <div class="col-sm-4">
  150. <label class="form-label" for="endingslot">Ending Slot<span
  151. class="text-danger"></span></label>
  152. <input type="text" class="form-control text-center" name="endingslot" id="endingslot"
  153. readonly />
  154. </div>
  155. <div class="col-sm-4">
  156. <label class="form-label" for="bookingdate">Booking Date<span
  157. class="text-danger"></span></label>
  158. <input type="text" class="form-control text-center" name="bookingdate" id="bookingdate"
  159. readonly />
  160. </div>
  161. <div class="col-sm-4">
  162. <label class="form-label" for="bookingstatus">Booking Status<span
  163. class="text-danger"></span></label>
  164. <input type="text" class="form-control text-center" name="bookingstatus" id="bookingstatus"
  165. readonly />
  166. </div>
  167. <div class="col-sm-4">
  168. <label class="form-label" for="bankname">Bank Name<span class="text-danger"></span></label>
  169. <input type="text" class="form-control text-center" name="bankname" id="bankname"
  170. readonly />
  171. </div>
  172. <div class="col-sm-4">
  173. <label class="form-label" for="bankaccno">Bank Account No<span
  174. class="text-danger"></span></label>
  175. <input type="text" class="form-control text-center" name="bankaccno" id="bankaccno"
  176. readonly />
  177. </div>
  178. <div class="col-sm-4">
  179. <label class="form-label" for="amountreceived">Amount Received<span
  180. class="text-danger"></span></label>
  181. <input type="text" class="form-control text-center" name="amountreceived"
  182. id="amountreceived" readonly />
  183. </div>
  184. <div class="col-sm-4">
  185. <label class="form-label" for="ddnumber">DD Number<span class="text-danger"></span></label>
  186. <input type="text" class="form-control text-center" name="ddnumber" id="ddnumber"
  187. readonly />
  188. </div>
  189. </div>
  190. </div>
  191. <div class="modal-footer">
  192. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel"
  198. aria-hidden="true">
  199. <div class="modal-dialog modal-lg" role="document">
  200. <div class="modal-content">
  201. <div class="modal-header">
  202. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  203. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  204. <span aria-hidden="true">&times;</span>
  205. </button>
  206. </div>
  207. <div class="modal-body">
  208. <embed id="filePreview" src="" width="100%" height="600px">
  209. </div>
  210. <div class="modal-footer">
  211. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  217. <script th:replace="~{fragments/loginscript :: script}"></script>
  218. <script type="text/javascript">
  219. $(document).ready(function () {
  220. const maxFileSize = 1 * 1024 * 1024; // 1MB in bytes
  221. function validateFileSize(input) {
  222. const file = input.files[0];
  223. if (file && file.size > maxFileSize) {
  224. $(input).siblings('.text-danger.file-size-message').text('File size exceeds the limit of 1 MB.');
  225. $(input).val(''); // Clear the file input
  226. } else {
  227. $(input).siblings('.text-danger.file-size-message').text('');
  228. }
  229. }
  230. });
  231. function UserDetails(counterDetails) {
  232. // console.log("Initial Counter Details:", counterDetails);
  233. var counterId = counterDetails.counterId;
  234. $.ajax({
  235. url: '/victoriahallbooking/user/api/counterdetails',
  236. type: 'GET',
  237. data: {counterId: counterId},
  238. success: function (response) {
  239. // console.log("Fetched User Details:", response);
  240. // Assuming the response is an array and we need the first element
  241. if (response.length > 0) {
  242. var userDetails = response[0].users;
  243. // Populate booking information
  244. $('#name').val(userDetails.name);
  245. $('#mobileno').val(userDetails.mobileNo);
  246. $('#email').val(userDetails.email);
  247. $('#usertype').val(userDetails.usertype);
  248. $('#street').val(userDetails.street);
  249. $('#area').val(userDetails.area);
  250. $('#location').val(userDetails.location);
  251. $('#pincode').val(userDetails.pinCode);
  252. // Show the modal
  253. $('#userDetails').modal('show');
  254. } else {
  255. console.error('No user details found for the given counter ID');
  256. }
  257. },
  258. error: function (xhr, status, error) {
  259. console.error('Failed to fetch user details:', error);
  260. }
  261. });
  262. }
  263. function BookingDetails(counterDetails) {
  264. var counterId = counterDetails.counterId;
  265. $.ajax({
  266. url: '/victoriahallbooking/user/api/counterdetails',
  267. type: 'GET',
  268. data: {counterId: counterId},
  269. success: function (response) {
  270. // console.log("Fetched Booking Details:", response);
  271. if (response.length > 0) {
  272. var bookingDetails = response[0];
  273. $('#noofdays').val(bookingDetails.noOfDays);
  274. $('#startdate').val(bookingDetails.startDate);
  275. $('#enddate').val(bookingDetails.endDate);
  276. $('#startingslot').val(bookingDetails.startingSlot);
  277. $('#endingslot').val(bookingDetails.endingSlot);
  278. $('#bookingdate').val(bookingDetails.bookingDate);
  279. $('#bookingstatus').val(bookingDetails.bookingStatus);
  280. $('#bankname').val(bookingDetails.counterDetails.bankName);
  281. $('#bankaccno').val(bookingDetails.counterDetails.bankAccNo);
  282. $('#amountreceived').val(bookingDetails.counterDetails.amountReceived);
  283. $('#ddnumber').val(bookingDetails.counterDetails.ddNumber);
  284. $('#bookingDetails').modal('show');
  285. } else {
  286. console.error('No booking details found for the given counter ID');
  287. }
  288. },
  289. error: function (xhr, status, error) {
  290. console.error('Failed to fetch booking details:', error);
  291. }
  292. });
  293. }
  294. function viewLetter(letterdocument) {
  295. document.getElementById('filePreview').src = letterdocument;
  296. $('#fileModal').modal('show');
  297. }
  298. $(document).ready(
  299. function () {
  300. var buttons = [{
  301. extend: 'pageLength',
  302. className: 'btn btn-primary'
  303. }, {
  304. title: 'Data export',
  305. extend: 'copyHtml5',
  306. text: 'Copy',
  307. className: 'btn btn-primary',
  308. id: 'copyBtn'
  309. }, {
  310. extend: 'excelHtml5',
  311. text: 'Excel',
  312. className: 'btn btn-primary',
  313. id: 'excelBtn'
  314. }, {
  315. extend: 'csvHtml5',
  316. text: 'CSV',
  317. className: 'btn btn-primary',
  318. id: 'csvBtn'
  319. }, {
  320. extend: 'pdfHtml5',
  321. text: 'PDF',
  322. className: 'btn btn-primary',
  323. id: 'pdfBtn'
  324. },
  325. ];
  326. $('#refunddocsList').DataTable(
  327. {
  328. dom: 'Bftip',
  329. columnDefs: [{
  330. targets: 'no-sort',
  331. orderable: false
  332. }],
  333. lengthMenu: [
  334. [50, 100, 200, 500, -1],
  335. ['50 rows', '100 rows', '200 rows',
  336. '500 rows', 'Show all']],
  337. scrollY: '50vh',
  338. fixedColumns: {
  339. left: 1,
  340. right: 1
  341. },
  342. buttons: [buttons],
  343. responsive: true,
  344. searching: true, // Enable search
  345. select: false,
  346. processing: false,
  347. });
  348. // Link the search input to DataTable
  349. $('#searchInput').on('keyup', function () {
  350. dataTable.search(this.value).draw();
  351. });
  352. });
  353. </script>
  354. </body>
  355. </html>