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.

574 lines
20 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/head-officer :: 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. <!-- Sidebar Nav-->
  28. <nav th:replace="~{fragments/nav-officer :: nav}"></nav>
  29. <!-- END Sidebar -->
  30. <!-- Header -->
  31. <header th:replace="~{fragments/header-officer :: header}"></header>
  32. <!-- END Header -->
  33. <!-- Main Container -->
  34. <main id="main-container">
  35. <div class="content">
  36. <div class="block block-rounded">
  37. <div class="block-header block-header-default">
  38. <h3 class="block-title">List of Bookings Rejected</h3>
  39. </div>
  40. <div class="block-content p-0">
  41. <div class="p-sm-4 p-0">
  42. <div class="table-responsive">
  43. <table class="table table-bordered table-striped table-vcenter js-dataTable-responsive" id="bookingrejectedtable">
  44. <thead class="thead-light">
  45. <tr>
  46. <th class="text-center no-sort">S.No</th>
  47. <th class="text-center">Booking Id</th>
  48. <th class="text-center">zone</th>
  49. <th class="text-center">Division</th>
  50. <th class="text-center" width="20%">Hall Name</th>
  51. <th class="text-center">User Name</th>
  52. <th class="text-center">User type</th>
  53. <th class="text-center" width="20%">Booking Date</th>
  54. <th class="text-center">Number of days</th>
  55. <th class="text-center">Reason for Booking</th>
  56. <th class="text-center">Caretaker Name/MobileNumber</th>
  57. <th class="text-center">Action</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <!--<tbody th:each="registration, i : ${registrations}">-->
  62. <!--<tr>-->
  63. <tr th:each="booking, rowStat : ${rejectedBookings}">
  64. <td class="text-center" th:text="${rowStat.index + 1}"></td>
  65. <td class="text-center" th:text="${booking.bookingId}"></td>
  66. <td class="text-center" th:text="${booking.hallDetails.zone}"></td>
  67. <td class="text-center" th:text="${booking.hallDetails.division}"></td>
  68. <td class="text-center" th:text="${booking.hallDetails.hallName}"></td>
  69. <td class="text-center" th:text="${booking.users.name}"></td>
  70. <td class="text-center" th:text="${booking.users.usertype}"></td>
  71. <td class="text-center" th:text="${booking.bookingDate}"></td>
  72. <td class="text-center" th:text="${booking.noOfDays}"></td>
  73. <td class="text-center" th:text="${booking.reason}"></td>
  74. <td class="text-center"
  75. th:text="${booking.hallDetails.hallInchargeName} + ' / ' + ${booking.hallDetails.hallInchargeMobno}">
  76. </td>
  77. <td>
  78. <p>
  79. <span class="badge bg-warning" style="cursor: pointer;"
  80. th:onclick="pendingbooking([[${booking.bookingId}]])">REJECTED</span>
  81. </p>
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </main>
  92. <!-- END Main Container -->
  93. <!--modal for pening-->
  94. <div class="modal fade backdrop" id="pendingBookingForm" data-backdrop="static" tabindex="-1" role="dialog"
  95. aria-labelledby="staticBackdropLabel" aria-hidden="true">
  96. <div class="modal-dialog modal-lg" role="document">
  97. <div class="modal-content">
  98. <form id="ownform" onsubmit="return rejectsubmit();">
  99. <div class="block block-rounded block-themed block-transparent mb-0">
  100. <div class="block-header bg-primary-dark">
  101. <h3 class="block-title" id="2mtitle">Booking Information</h3>
  102. <div class="block-options">
  103. <button type="button" class="btn-block-option" data-bs-dismiss="modal"
  104. aria-label="Close">
  105. <i class="fa fa-fw fa-times"></i>
  106. </button>
  107. </div>
  108. </div>
  109. <div class="block-content row">
  110. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  111. <input type="hidden" class="form-control text-center" name="bookingid"
  112. id="bookingid" disabled />
  113. <div class="card-body">
  114. <table>
  115. <tr>
  116. <th colspan="10" style="background-color: #f2f2f2;">User Details</th>
  117. </tr>
  118. <tr>
  119. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Name:
  120. </th>
  121. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  122. id="td_userName"></td>
  123. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Mobile Number:
  124. </th>
  125. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  126. id="td_mobileNumber"></td>
  127. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Type:
  128. </th>
  129. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  130. id="td_usertype"></td>
  131. </tr>
  132. <tr>
  133. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">User Address:
  134. </th>
  135. <td colspan="5" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  136. id="td_useraddress"></td>
  137. </tr>
  138. </table>
  139. </div>
  140. </div>
  141. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  142. <input type="hidden" class="form-control text-center" name="bookingid"
  143. id="bookingid" disabled />
  144. <div class="card-body">
  145. <table>
  146. <tr>
  147. <th colspan="10" style="background-color: #f2f2f2;">Hall Details</th>
  148. </tr>
  149. <tr>
  150. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Hall Name:
  151. </th>
  152. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  153. id="td_hallName"></td>
  154. </tr>
  155. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Hall Address:</th>
  156. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  157. id="td_halladdress"></td>
  158. </tr>
  159. <tr>
  160. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Caretaker
  161. Name:</th>
  162. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  163. id="td_caretakername"></td>
  164. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Caretaker
  165. Mobile Number:</th>
  166. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  167. id="td_caretakermobileNumber"></td>
  168. </tr>
  169. </table>
  170. </div>
  171. </div>
  172. <div class="col-md-12 col-lg-12 col-sm-12">
  173. <input type="hidden" class="form-control text-center" name="settlementid"
  174. id="settlementid" disabled />
  175. <div class="card-body">
  176. <table>
  177. <tr>
  178. <th colspan="4" style="background-color: #f2f2f2;">Booking
  179. Details (Booking Id:-<span id="booking_id"
  180. style="color:blue"></span>)</th>
  181. </tr>
  182. <tr>
  183. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Booking Date:
  184. </th>
  185. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  186. id="td_bookingDate"></td>
  187. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Booking Status:
  188. </th>
  189. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  190. id="td_bookingStatus"></td>
  191. </tr>
  192. <tr>
  193. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Start Date:
  194. </th>
  195. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  196. id="td_startDate"></td>
  197. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Deposit
  198. Amount:</th>
  199. <td class="fw-semibold amount-cell " style="padding: 0.45rem 0.45rem;"
  200. id="td_depositeAmount"></td>
  201. </tr>
  202. <tr>
  203. <th style="padding: 0.45rem 0.45rem;font-weight: normal">END
  204. Date:</th>
  205. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  206. id="td_endDate"></td>
  207. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Hall Amount:
  208. </th>
  209. <td class="fw-semibold amount-cell " style="padding: 0.45rem 0.45rem;"
  210. id="td_hallAmount"></td>
  211. </tr>
  212. <tr>
  213. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Starting Slot:
  214. </th>
  215. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  216. id="td_startingSlot"></td>
  217. <th style="padding: 0.45rem 0.45rem;font-weight: normal">GST @18%:</th>
  218. <td class="fw-semibold amount-cell " style="padding: 0.45rem 0.45rem;"
  219. id="td_gst"></td>
  220. </tr>
  221. <tr>
  222. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Ending Slot:
  223. </th>
  224. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  225. id="td_endingSlot"></td>
  226. <th style="padding: 0.45rem 0.45rem;font-weight: normal">Total Amount:
  227. </th>
  228. <td class="fw-semibold amount-cell" style="padding: 0.45rem 0.45rem;"
  229. id="td_totalAmount"></td>
  230. </tr>
  231. </table>
  232. </div>
  233. </div>
  234. <div class="col-sm-12">
  235. <!--<label class="form-label">Documents:<span class="text-danger"></span></label>-->
  236. <div class="documents" id="documents"></div>
  237. </div>
  238. <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
  239. <input type="hidden" class="form-control text-center" name="bookingid"
  240. id="bookingid" disabled />
  241. <div class="card-body">
  242. <table>
  243. <tr>
  244. <th colspan="10" style="background-color: #f2f2f2;">Booking Payment
  245. Details</th>
  246. </tr>
  247. <tr>
  248. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Transaction
  249. ID:</th>
  250. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  251. id="td_transactionId"></td>
  252. </tr>
  253. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Amount Received:
  254. </th>
  255. <td colspan="10" class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  256. id="td_payamountReceived"></td>
  257. </tr>
  258. <tr>
  259. <th style="padding: 0.45rem 0.45rem;font-weight: normal;">Transaction
  260. Status:</th>
  261. <td class="fw-semibold" style="padding: 0.45rem 0.45rem;"
  262. id="td_paymentStatus"></td>
  263. </tr>
  264. </table>
  265. </div>
  266. </div>
  267. </div>
  268. </div>
  269. <div class="block-content block-content-full text-end bg-body" id="mbutton2">
  270. <button type="button" class="btn btn-sm btn-alt-secondary"
  271. data-bs-dismiss="modal">Close</button>
  272. </div>
  273. </form>
  274. </div>
  275. </div>
  276. </div>
  277. <!-- End Modal User -->
  278. <!-- Footer -->
  279. <div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel"
  280. aria-hidden="true">
  281. <div class="modal-dialog modal-lg" role="document">
  282. <div class="modal-content">
  283. <div class="modal-header">
  284. <h5 class="modal-title" id="fileModalLabel">File Preview</h5>
  285. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  286. <span aria-hidden="true">&times;</span>
  287. </button>
  288. </div>
  289. <div class="modal-body">
  290. <embed id="filePreview" src="" width="100%" height="600px">
  291. </div>
  292. <div class="modal-footer">
  293. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <footer th:replace="~{fragments/footer2 :: footer}"></footer>
  299. <!-- END Footer -->
  300. </div>
  301. <!-- Scripts -->
  302. <div th:replace="~{fragments/resetpassword :: div}"></div>
  303. <script th:replace="~{fragments/loginscript :: script}"></script>
  304. <script>
  305. //script to open pending form
  306. function pendingbooking(bookingId) {
  307. $.ajax({
  308. type: "GET",
  309. url: '/communityhall/api/officer/getBookingDetails',
  310. data: {
  311. 'bookingsId': bookingId
  312. },
  313. success: function (x) {
  314. //console.log(x);
  315. showBookingInfo(x);
  316. }
  317. });
  318. }
  319. function showBookingInfo(list) {
  320. $('#pendingBookingForm').modal({
  321. backdrop: 'static',
  322. keyboard: false
  323. });
  324. $('#pendingBookingForm').modal('show');
  325. document.getElementById("td_userName").innerHTML = list.users.name;
  326. document.getElementById("td_mobileNumber").innerHTML = list.users.mobileNo;
  327. document.getElementById("td_usertype").innerHTML = list.users.usertype;
  328. document.getElementById("bookingid").value = list.bookingId;
  329. var userDetails = list.users;
  330. var userDetailsString =
  331. userDetails.doorNo + ", " +
  332. userDetails.street + ", " +
  333. userDetails.area + ", " +
  334. userDetails.location + "- " +
  335. userDetails.pinCode;
  336. document.getElementById("td_useraddress").innerHTML = userDetailsString;
  337. document.getElementById("td_hallName").innerHTML = list.hallDetails.hallName;
  338. var hallDetails = list.hallDetails;
  339. var hallDetailsString =
  340. hallDetails.doorNo + ", " +
  341. hallDetails.street + ", " +
  342. hallDetails.area + ", " +
  343. hallDetails.city + "- " +
  344. hallDetails.pinCode;
  345. document.getElementById("td_halladdress").innerHTML = hallDetailsString;
  346. document.getElementById("td_caretakername").innerHTML = list.hallDetails.hallInchargeName;
  347. document.getElementById("td_caretakermobileNumber").innerHTML = list.hallDetails.hallInchargeMobno;
  348. document.getElementById("td_bookingDate").innerHTML = list.bookingDate;
  349. document.getElementById("td_depositeAmount").innerHTML = '₹ ' + parseFloat(list.depositAmount).toFixed(2);
  350. document.getElementById("td_hallAmount").innerHTML = '₹ ' + parseFloat(list.hallAmount).toFixed(2);
  351. document.getElementById("td_totalAmount").innerHTML = '₹ ' + parseFloat(list.amountReceived).toFixed(2);
  352. var gstcl = (list.hallAmount * (list.hallDetails.gst/100));
  353. var formattedGst = gstcl.toFixed(2);
  354. document.getElementById("td_gst").innerHTML = '₹ ' + formattedGst;
  355. document.getElementById("td_startDate").innerHTML = list.startDate;
  356. document.getElementById("td_endDate").innerHTML = list.endDate;
  357. document.getElementById("booking_id").innerHTML = list.bookingId;
  358. function getTimeSlot(slotValue) {
  359. //console.log("Slot Value in getTimeSlot function:", slotValue);
  360. var timeSlot;
  361. var trimmedSlotValue = String(slotValue).trim(); // Convert to string and then trim
  362. if (trimmedSlotValue === '1') {
  363. timeSlot = 'Morning';
  364. } else if (trimmedSlotValue === '2') {
  365. timeSlot = 'Evening';
  366. } else {
  367. timeSlot = 'Unknown';
  368. }
  369. //console.log("Time Slot:", timeSlot);
  370. return timeSlot;
  371. }
  372. document.getElementById("td_startingSlot").innerHTML = getTimeSlot(list.startingSlot);
  373. document.getElementById("td_endingSlot").innerHTML = getTimeSlot(list.endingSlot);
  374. document.getElementById("td_bookingStatus").innerHTML = list.bookingStatus;
  375. document.getElementById("td_transactionId").innerHTML = list.payments.transactionId;
  376. document.getElementById("td_payamountReceived").innerHTML = '₹ ' + list.payments.amountReceived;
  377. document.getElementById("td_paymentStatus").innerHTML = list.payments.paymentStatus;
  378. showReasonDocuments(list);
  379. }
  380. function showReasonDocuments(list) {
  381. $.ajax({
  382. type: "GET",
  383. url: '/communityhall/api/officer/getReasonByName',
  384. data: {
  385. 'reasonName': list.reason
  386. },
  387. success: function (x) {
  388. //console.log(x);
  389. showReasonWithDocument(x, list);
  390. }
  391. });
  392. }
  393. // Display booking documents
  394. function showReasonWithDocument(reasonData, list) {
  395. var reasonDocumentData = reasonData.reasonDocumentMasterList;
  396. var bookingDocumentsList = list.bookingDocumentsList;
  397. const reasonFieldsContainer = $('#documents');
  398. reasonFieldsContainer.empty();
  399. // Create a responsive table container
  400. var tableResponsiveDiv = $('<div>').addClass('table-responsive');
  401. // Create the table with Bootstrap classes and custom styles
  402. var table = $('<table>').addClass('table table-bordered table-striped table-vcenter js-dataTable-responsive').css({
  403. 'width': '100%',
  404. 'height': 'auto',
  405. 'border': '1px solid black'
  406. });
  407. // Create the table header (thead)
  408. var thead = $('<thead>').appendTo(table);
  409. var headerRow = $('<tr>').appendTo(thead);
  410. $('<th>').attr('colspan', '3').text('Document Details').css({
  411. 'color': 'black',
  412. 'font-weight': 'bold',
  413. 'background-color': '#f2f2f2',
  414. 'padding': '0.45rem 0.45rem'
  415. }).appendTo(headerRow);
  416. // Create header row for columns
  417. var columnHeadersRow = $('<tr>').appendTo(thead);
  418. $('<th>').text('S.No').appendTo(columnHeadersRow);
  419. $('<th>').text('Required Info').appendTo(columnHeadersRow);
  420. $('<th>').text('Required Documents').appendTo(columnHeadersRow);
  421. // Create the table body (tbody)
  422. var tbody = $('<tbody>').appendTo(table);
  423. // Iterate through the documents list and populate rows
  424. for (var i = 0; i < bookingDocumentsList.length; i++) {
  425. (function (index) {
  426. var row = $('<tr>').appendTo(tbody);
  427. $('<td>').text(index + 1).appendTo(row);
  428. // Determine the text content for the second cell
  429. var name = bookingDocumentsList[index].name ? bookingDocumentsList[index].name : ''; // Empty string if name is null or undefined
  430. var fieldText = reasonDocumentData[index].fieldName;
  431. var fullText = name ? fieldText + ': ' + name : fieldText; // Include colon only if name is not empty
  432. $('<td>').text(fullText).appendTo(row);
  433. // Create a link to view document image
  434. var viewLink = $('<a>').attr('href', 'javascript:void(0)').text(reasonDocumentData[index].docFieldName).on('click', function () {
  435. showDocumentImage(bookingDocumentsList[index].bookingDocUrl);
  436. });
  437. $('<td>').append(viewLink).appendTo(row);
  438. })(i);
  439. }
  440. // Append table to the responsive container
  441. tableResponsiveDiv.append(table);
  442. // Append table to the container in the DOM
  443. reasonFieldsContainer.append(tableResponsiveDiv);
  444. }
  445. function showDocumentImage(fileURL) {
  446. //console.log(fileURL);
  447. openFileModal(fileURL);
  448. }
  449. // Event delegation for dynamically added elements
  450. $(document).on('click', '.view-document', function () {
  451. const fileURL = $(this).data('url');
  452. openFileModal(fileURL);
  453. });
  454. function openFileModal(fileURL) {
  455. $('#filePreview').attr('src', fileURL);
  456. $('#fileModal').modal('show');
  457. }
  458. $(document).ready(
  459. function () {
  460. var buttons = [{
  461. extend: 'pageLength',
  462. className: 'btn btn-primary'
  463. }, {
  464. title: 'Data export',
  465. extend: 'copyHtml5',
  466. text: 'Copy',
  467. className: 'btn btn-primary',
  468. id: 'copyBtn'
  469. }, {
  470. extend: 'excelHtml5',
  471. text: 'Excel',
  472. className: 'btn btn-primary',
  473. id: 'excelBtn'
  474. }, {
  475. extend: 'csvHtml5',
  476. text: 'CSV',
  477. className: 'btn btn-primary',
  478. id: 'csvBtn'
  479. }, {
  480. extend: 'pdfHtml5',
  481. text: 'PDF',
  482. className: 'btn btn-primary',
  483. id: 'pdfBtn'
  484. },
  485. ];
  486. $('#bookingrejectedtable').DataTable(
  487. {
  488. dom: 'Bftip',
  489. columnDefs: [{
  490. targets: 'no-sort',
  491. orderable: false
  492. }],
  493. lengthMenu: [
  494. [50, 100, 200, 500, -1],
  495. ['50 rows', '100 rows', '200 rows',
  496. '500 rows', 'Show all']],
  497. scrollY: '50vh',
  498. fixedColumns: {
  499. left: 1,
  500. right: 1
  501. },
  502. buttons: [buttons],
  503. responsive: true,
  504. searching: true, // Enable search
  505. select: false,
  506. processing: false,
  507. });
  508. });
  509. </script>
  510. </body>
  511. </html>