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.

380 lines
12 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-public :: head}"></head>
  4. <style>
  5. .card-body table {
  6. width: 100%;
  7. padding: 100px;
  8. }
  9. .card-body th,
  10. td {
  11. padding: 8px;
  12. text-align: left;
  13. }
  14. .amount-cell {
  15. text-align: right;
  16. padding-right: 1rem;
  17. /* Adjust padding as needed */
  18. }
  19. .table {
  20. width: 100% !important;
  21. }
  22. </style>
  23. <body>
  24. <!-- Page Container -->
  25. <div id="page-container"
  26. class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed page-header-dark">
  27. <!-- Side Overlay aside (right)-->
  28. <aside th:replace="~{fragments/aside-right :: aside}"></aside>
  29. <!-- END Side Overlay (right)-->
  30. <!-- Sidebar Nav-->
  31. <nav th:replace="~{fragments/nav-officer :: nav}"></nav>
  32. <!-- END Sidebar -->
  33. <!-- Header -->
  34. <header th:replace="~{fragments/header-officer :: header}"></header>
  35. <!-- END Header -->
  36. <!-- Main Container -->
  37. <main id="main-container">
  38. <!-- Page Content -->
  39. <div class="content">
  40. <div class="block-header block-header-default">
  41. <h3 class="block-title">List of Payments</h3>
  42. </div>
  43. <div class="block block-rounded">
  44. <div class="block-header block-header-default" style="display: block;">
  45. <form class="row" action="javascript:getbydate()">
  46. <div class="col-6">
  47. <h3 class="block-title"></h3>
  48. </div>
  49. <div class="col-6">
  50. <div class="row">
  51. <div class="col-4">
  52. <input type="text" th:value="${fromdate}" class="datepicker form-control"
  53. name="From Date" id="fromdate" placeholder="From Date"
  54. data-date-format="dd-mm-yyyy" required />
  55. </div>
  56. <div class="col-4">
  57. <input type="text" th:value="${todate}" class="datepicker form-control"
  58. name="To Date" id="todate" placeholder="To Date"
  59. data-date-format="dd-mm-yyyy" required />
  60. </div>
  61. <div class="col-4 p-0 text-center">
  62. <button type="submit" class="btn btn-primary" id="submit" name="submit"
  63. style="">Submit</button>
  64. <button class="btn btn-danger" onclick="resetDate()" name="reset"
  65. type="reset">Reset</button>
  66. </div>
  67. </div>
  68. </div>
  69. </form>
  70. </div>
  71. <div class="block-content p-0">
  72. <div class="p-sm-4 p-0">
  73. <div class="table-responsive">
  74. <table class="table table-bordered table-striped table-vcenter js-dataTable-responsive" id="paymentlist">
  75. <thead class="thead-light">
  76. <tr class="table-bordered">
  77. <th class="text-center no-sort">S.No</th>
  78. <th class="text-center" width="20%">Transaction Id</th>
  79. <th class="text-center">Payment Status</th>
  80. <th class="text-center">Payment Type</th>
  81. <th class="text-center">Amount Received</th>
  82. <th class="text-center">Created date</th>
  83. <th class="text-center">User Details</th>
  84. <th class="text-center">Booking Details</th>
  85. </tr>
  86. </thead>
  87. <tbody id="paymentDetailsBody">
  88. <tr th:each="list, i : ${paymentlist}" class="${paymentlist}">
  89. <td th:text="${i.count}"></td>
  90. <td th:text="${list.transactionId}"></td>
  91. <td th:text="${list.paymentStatus}"></td>
  92. <td th:text="${list.paymentType}"></td>
  93. <td th:text="${list.amountReceived}"></td>
  94. <td th:text="${list.cdate}"></td>
  95. <td class="text-center">
  96. <button type="button" class="btn btn-primary" data-bs-toggle="modal"
  97. data-bs-target="#exampleModal"
  98. th:onclick="UserDetails([[${list.bookingDetails.bookingId}]])">View</button>
  99. </td>
  100. <td class="text-center">
  101. <button type="button" class="btn btn-primary" data-bs-toggle="modal"
  102. data-bs-target="#Bookingdetails"
  103. th:onclick="BookingDetails([[${list.bookingDetails.bookingId}]])">View</button>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <!--User Details-->
  114. <div class="modal fade" id="userDetails" tabindex="-1" aria-labelledby="exampleModalLabel"
  115. aria-hidden="true">
  116. <div class="modal-dialog modal-lg">
  117. <div class="modal-content">
  118. <div class="modal-header">
  119. <h5 class="modal-title" id="exampleModalLabel">User Details</h5>
  120. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  121. </div>
  122. <div class="modal-body">
  123. <div class="row">
  124. <div class="col-sm-4">
  125. <label class="form-label" for="name">Name:<span class="text-danger"></span></label>
  126. <input type="text" class="form-control text-center" name="name" id="name"
  127. readonly />
  128. </div>
  129. <div class="col-sm-4">
  130. <label class="form-label" for="mobileno">Mobile Number:<span
  131. class="text-danger"></span></label>
  132. <input type="text" class="form-control text-center" name="mobileno" id="mobileno"
  133. readonly />
  134. </div>
  135. <div class="col-sm-4">
  136. <label class="form-label" for="email">Email:<span
  137. class="text-danger"></span></label>
  138. <input type="text" class="form-control text-center" name="email" id="email"
  139. readonly />
  140. </div>
  141. <div class="col-sm-4">
  142. <label class="form-label" for="usertype">User type:<span
  143. class="text-danger"></span></label>
  144. <input type="text" class="form-control text-center" name="usertype" id="usertype"
  145. readonly />
  146. </div>
  147. <div class="col-sm-4">
  148. <label class="form-label" for="street">Street:<span
  149. class="text-danger"></span></label>
  150. <input type="text" class="form-control text-center" name="street" id="street"
  151. readonly />
  152. </div>
  153. <div class="col-sm-4">
  154. <label class="form-label" for="area">Area:<span class="text-danger"></span></label>
  155. <input type="text" class="form-control text-center" name="area" id="area"
  156. readonly />
  157. </div>
  158. <div class="col-sm-4">
  159. <label class="form-label" for="location">Location:<span
  160. class="text-danger"></span></label>
  161. <input type="text" class="form-control text-center" name="location" id="location"
  162. readonly />
  163. </div>
  164. <div class="col-sm-4">
  165. <label class="form-label" for="pincode">Pincode:<span
  166. class="text-danger"></span></label>
  167. <input type="text" class="form-control text-center" name="pincode" id="pincode"
  168. readonly />
  169. </div>
  170. </div>
  171. </div>
  172. <div class="modal-footer">
  173. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <!--Booking Details-->
  179. <div class="modal fade" id="Bookingdetails" tabindex="-1" aria-labelledby="exampleModalLabel"
  180. aria-hidden="true">
  181. <div class="modal-dialog modal-lg">
  182. <div class="modal-content">
  183. <div class="modal-header">
  184. <h5 class="modal-title" id="exampleModalLabel">Booking Details</h5>
  185. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  186. </div>
  187. <div class="modal-body">
  188. <div class="row">
  189. <div class="col-sm-4">
  190. <label class="form-label" for="bookingid">Booking ID:<span
  191. class="text-danger"></span></label>
  192. <input type="text" class="form-control text-center" name="bookingid" id="bookingid"
  193. readonly />
  194. </div>
  195. <div class="col-sm-4">
  196. <label class="form-label" for="hallname">Hall Name:<span
  197. class="text-danger"></span></label>
  198. <input type="text" class="form-control text-center" name="hallname" id="hallname"
  199. readonly />
  200. </div>
  201. <div class="col-sm-4">
  202. <label class="form-label" for="bookingstatus">Booking Status:<span
  203. class="text-danger"></span></label>
  204. <input type="text" class="form-control text-center" name="bookingstatus"
  205. id="bookingstatus" readonly />
  206. </div>
  207. <div class="col-sm-4">
  208. <label class="form-label" for="noofdays">No of Days:<span
  209. class="text-danger"></span></label>
  210. <input type="text" class="form-control text-center" name="noofdays" id="noofdays"
  211. readonly />
  212. </div>
  213. <div class="col-sm-4">
  214. <label class="form-label" for="startdate">Start Date:<span
  215. class="text-danger"></span></label>
  216. <input type="text" class="form-control text-center" name="startdate" id="startdate"
  217. readonly />
  218. </div>
  219. <div class="col-sm-4">
  220. <label class="form-label" for="enddate">End Date:<span
  221. class="text-danger"></span></label>
  222. <input type="text" class="form-control text-center" name="enddate" id="enddate"
  223. readonly />
  224. </div>
  225. </div>
  226. </div>
  227. <div class="modal-footer">
  228. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  229. </div>
  230. </div>
  231. </div>
  232. </div> <!-- END Page Content -->
  233. </main>
  234. <!-- END Main Container -->
  235. <!-- Footer -->
  236. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  237. <!-- END Footer -->
  238. </div>
  239. <div th:replace="~{fragments/resetpassword :: div}"></div>
  240. <!-- Scripts -->
  241. <script th:replace="~{fragments/loginscript :: script}"></script>
  242. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  243. <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  244. <script type="text/javascript">
  245. $(document).ready(function () {
  246. // DataTables buttons configuration
  247. var buttons = [
  248. {
  249. extend: 'pageLength',
  250. className: 'btn btn-primary'
  251. },
  252. {
  253. title: 'Data export',
  254. extend: 'copyHtml5',
  255. text: 'Copy',
  256. className: 'btn btn-primary',
  257. id: 'copyBtn'
  258. },
  259. {
  260. extend: 'excelHtml5',
  261. text: 'Excel',
  262. className: 'btn btn-primary',
  263. id: 'excelBtn'
  264. },
  265. {
  266. extend: 'csvHtml5',
  267. text: 'CSV',
  268. className: 'btn btn-primary',
  269. id: 'csvBtn'
  270. },
  271. {
  272. extend: 'pdfHtml5',
  273. text: 'PDF',
  274. className: 'btn btn-primary',
  275. id: 'pdfBtn'
  276. }
  277. ];
  278. // Initialize DataTable for each tab on tab shown event
  279. $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  280. var targetTable = $(e.target).attr('href'); // activated tab
  281. $(targetTable).find('.dataTable').DataTable().columns.adjust();
  282. });
  283. // Initialize DataTable for Settlement Approved tab
  284. $('#paymentlist').DataTable({
  285. dom: 'Bftip',
  286. columnDefs: [
  287. {targets: 'no-sort', orderable: false}
  288. ],
  289. lengthMenu: [
  290. [50, 100, 200, 500, -1],
  291. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  292. ],
  293. buttons: buttons,
  294. responsive: true,
  295. searching: true,
  296. select: false,
  297. processing: false,
  298. // Set width to 100%
  299. "autoWidth": true
  300. });
  301. });
  302. function UserDetails(bookingId) {
  303. $.ajax({
  304. type: "GET",
  305. url: '/communityhall/api/officer/getBookingDetails',
  306. data: {
  307. 'bookingsId': bookingId
  308. },
  309. success: function (x) {
  310. //console.log(x);
  311. showUserInfo(x)
  312. }
  313. });
  314. }
  315. function BookingDetails(bookingId) {
  316. $.ajax({
  317. type: "GET",
  318. url: '/communityhall/api/officer/getBookingDetails',
  319. data: {
  320. 'bookingsId': bookingId
  321. },
  322. success: function (x) {
  323. //console.log(x);
  324. showBookingInfo(x)
  325. }
  326. });
  327. }
  328. function showUserInfo(list) {
  329. $('#userDetails').modal({
  330. backdrop: 'static',
  331. keyboard: false
  332. });
  333. $('#userDetails').modal('show');
  334. // Populate booking information
  335. $('#name').val(list.users.name);
  336. $('#mobileno').val(list.users.mobileNo);
  337. $('#email').val(list.users.email);
  338. $('#usertype').val(list.users.usertype);
  339. $('#street').val(list.users.street);
  340. $('#area').val(list.users.area);
  341. $('#location').val(list.users.location);
  342. $('#pincode').val(list.users.pinCode);
  343. }
  344. function showBookingInfo(list) {
  345. $('#Bookingdetails').modal({
  346. backdrop: 'static',
  347. keyboard: false
  348. });
  349. $('#Bookingdetails').modal('show');
  350. // Populate booking information
  351. $('#bookingid').val(list.bookingId);
  352. $('#hallname').val(list.hallDetails.hallName);
  353. $('#bookingstatus').val(list.bookingStatus);
  354. $('#noofdays').val(list.noOfDays);
  355. $('#startdate').val(list.startDate);
  356. $('#enddate').val(list.endDate);
  357. }
  358. </script>
  359. </body>
  360. </html>