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.

229 lines
9.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}">
  4. <style>
  5. </style>
  6. </head>
  7. <body>
  8. <div class="wrapper">
  9. <!-- Header -->
  10. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  11. <div class="page-wrap">
  12. <!-- Left Menu -->
  13. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  14. <div class="main-content">
  15. <div class="container-fluid">
  16. <div class="page-header">
  17. <div class="row align-items-end">
  18. <div class="col-lg-8">
  19. <div class="page-header-title">
  20. <i class="fa fa-list-alt bg-blue"></i>
  21. <div class="d-inline">
  22. <h5>1913 Attendance Reports</h5>
  23. <span>List of 1913 Agents Attendance</span>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="col-lg-4">
  28. <nav class="breadcrumb-container" aria-label="breadcrumb">
  29. <ol class="breadcrumb">
  30. <li class="breadcrumb-item">
  31. <a href="/index"><i class="ik ik-home"></i></a>
  32. </li>
  33. <li class="breadcrumb-item" aria-current="page">1913 Attendance</li>
  34. <li class="breadcrumb-item active" aria-current="page">Attendance Report</li>
  35. </ol>
  36. </nav>
  37. </div>
  38. </div>
  39. </div>
  40. <hr>
  41. <div id="pageLoader"
  42. style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
  43. <div style="position: relative; top: 50%; transform: translateY(-50%);">
  44. <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
  45. <span class="sr-only">Loading...</span>
  46. </div>
  47. <p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
  48. </div>
  49. </div>
  50. <div class ="card-body">
  51. <form th:action="@{/gcc/callcenter/attendancereport}" method="get" onsubmit="showLoader()">
  52. <div class="row">
  53. <div class="col-sm-6 mb-3">
  54. <label for="fromDate"
  55. style="font-size: medium;; margin-bottom: 0px;">From
  56. Date:</label> <input type="date" id="fromDate" name="fromDate"
  57. th:value="${fromDate}" class="form-control" required>
  58. </div>
  59. <div class="col-sm-6 mb-3">
  60. <label for="toDate"
  61. style="font-size: medium; margin-bottom: 0px;">To
  62. Date:</label> <input type="date" id="toDate" name="toDate"
  63. th:value="${toDate}" class="form-control" required>
  64. </div>
  65. </div>
  66. <div class="row">
  67. <div class="col-12 d-flex justify-content-center">
  68. <button type="submit" id="filterButton"
  69. class="btn btn-primary mx-2">Filter</button>
  70. <button class="btn btn-danger mx-2" onclick="resetDate()"
  71. name="reset">Reset</button>
  72. </div>
  73. </div>
  74. </form>
  75. </div>
  76. <!-- Agents Attendance report -->
  77. <div class="row">
  78. <div class="col-md-12">
  79. <div class="card">
  80. <div class="card-block">
  81. <div class="page-header-title" >
  82. <h5 style="margin: 0;font-weight: bold;">Attendance Reports</h5><hr>
  83. </div>
  84. <div>
  85. <table id="AttendanceDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid" width="100%" height="100%">
  86. <thead class="thead-dark">
  87. <tr role="row">
  88. <th class="text-center">S.No</th>
  89. <!-- <th class="text-center">Zone</th>
  90. <th class="text-center">Division</th> -->
  91. <th class="text-center">Employee Id</th>
  92. <th class="text-center">Employee Name</th>
  93. <!-- <th class="text-center">Department Name</th> -->
  94. <th class="text-center">Designation</th>
  95. <th class="text-center">Device Location</th>
  96. <th class="text-center">Punch Date</th>
  97. <th class="text-center">Punch In</th>
  98. <th class="text-center">Punch Out</th>
  99. <th class="text-center">Total Working hours</th>
  100. </tr>
  101. </thead>
  102. <tbody>
  103. <tr th:each="row,sno : ${attendanceData}">
  104. <td th:text="${sno.index + 1}" class="text-center"></td>
  105. <!-- <td th:text="${row.zone}" class="text-center"></td>
  106. <td th:text="${row.division}" class="text-center"></td> -->
  107. <td th:text="${row.user_id}" class="text-center"></td>
  108. <td th:text="${row.user_name}" class="text-center"></td>
  109. <!-- <td th:text="${row.departmentname}" class="text-center"></td> -->
  110. <td th:text="${row.designation}" class="text-center"></td>
  111. <td th:text="${row.device_name}" class="text-center"></td>
  112. <td th:text="${row.punch_date}" class="text-center"></td>
  113. <td th:text="${row.PUNCHIN}" class="text-center"></td>
  114. <td th:text="${row.PUNCHOUT}" class="text-center"></td>
  115. <td th:text="${row.total_working_hours}" class="text-center"></td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  127. </div>
  128. </div>
  129. <!-- Include jQuery and Bootstrap JavaScript -->
  130. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  131. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  132. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  133. <!-- sweet alert -->
  134. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  135. <script type="text/javascript">
  136. // Initialize DataTables with export buttons
  137. $(document).ready(function () {
  138. var buttons = [
  139. { extend: 'pageLength', className: 'btn btn-warning' },
  140. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  141. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  142. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  143. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' },
  144. ];
  145. $('#AttendanceDatatable').DataTable({
  146. dom: 'Bftip',
  147. columnDefs: [
  148. { targets: 'no-sort', orderable: false }
  149. ],
  150. lengthMenu: [
  151. [50, 100, 200, 500, -1],
  152. ['50 rows', '100 rows', '200 rows', '500 rows', 'Show all']
  153. ],
  154. scrollY: '50vh',
  155. fixedColumns: { left: 1, right: 1 },
  156. buttons: buttons,
  157. fixedHeader: true,
  158. autoWidth: true,
  159. responsive: true,
  160. searching: true,
  161. select: false,
  162. processing: false,
  163. });
  164. });
  165. $("#fromDate").on("change", function() {
  166. const startDate = $(this).val(); // Get the selected start date
  167. // Set the min value for To Date to be the selected From Date
  168. $("#toDate").attr("min", startDate);
  169. });
  170. // Event listener for To Date selection
  171. $("#toDate").on("change", function() {
  172. const endDate = $(this).val(); // Get the selected end date
  173. // Set the max value for From Date to be the selected To Date
  174. $("#fromDate").attr("max", endDate);
  175. });
  176. //Function to reset the date fields and reload the page with cleared data
  177. function resetDate() {
  178. // Clear the date inputs
  179. document.getElementById("fromDate").value = "";
  180. document.getElementById("toDate").value = "";
  181. // Redirect to the endpoint without parameters to reset the page
  182. window.location.href = "/gcc/callcenter/attendancereport";
  183. }
  184. //Function to show the loader when the form is submitted
  185. function showLoader() {
  186. document.getElementById('pageLoader').style.display = 'block';
  187. }
  188. // Function to hide the loader after the page has loaded
  189. window.onload = function () {
  190. document.getElementById('pageLoader').style.display = 'none';
  191. };
  192. </script>
  193. </body>
  194. </html>