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.

235 lines
5.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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 top menu Start -->
  10. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  11. <!-- header top menu end -->
  12. <div class="page-wrap">
  13. <!--=============== Left Menu side Start ================-->
  14. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  15. <!--=============== Left side End ================-->
  16. <div class="main-content">
  17. <div class="container-fluid">
  18. <div class="page-header mb-2">
  19. <div class="row align-items-end">
  20. <div class="col-lg-8">
  21. <div class="page-header-title">
  22. <!-- <i class="far fa-calendar-plus bg-blue"></i> -->
  23. <div class="d-inline">
  24. <h5>Attendance Marking</h5>
  25. <span>Mark attendance for training sessions </span>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <div class="col-md-12">
  33. <div class="card">
  34. <div class="card-body">
  35. <div class="row">
  36. <div class="col-md-4 col-sm-12">
  37. <label class="form-label" for="selectConstituency">Select Constituency</label>
  38. <select class="form-control" id="selectConstituency" required></select>
  39. </div>
  40. <div class="col-md-4 col-sm-12">
  41. <label class="form-label" for="trainingCentre">Training Centre</label>
  42. <input type="text" class="form-control" id="trainingCentre">
  43. </div>
  44. <div class="col-md-4 col-sm-12">
  45. <label class="form-label" for="hall">Hall</label>
  46. <input type="text" class="form-control" id="hall">
  47. </div>
  48. </div>
  49. <div class="row mt-3">
  50. <div class="col-12 d-flex justify-content-center">
  51. <button type="submit" id="searchBtn"
  52. class="btn btn-primary mx-2">Search</button>
  53. <button class="btn btn-danger mx-2" id="resetBtn"
  54. name="reset">Reset</button>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="row" id="detailscard">
  62. <div class="col-md-12">
  63. <div class="card">
  64. <div class="card-body">
  65. <div class="table-responsive">
  66. <table id="AttendanceDatatable"
  67. class="table table-striped table-bordered table-hover dataTable"
  68. role="grid">
  69. <thead class="thead-dark">
  70. <tr role="row">
  71. <th class="text-center">S.No</th>
  72. <th class="text-center">Name</th>
  73. <th class="text-center">Designation</th>
  74. <th class="text-center">EPIC No</th>
  75. <th class="text-center">Contact</th>
  76. <th class="text-center">Polling Person Category</th>
  77. <th class="text-center">Status</th>
  78. <th class="text-center">Action</th>
  79. </tr>
  80. </thead>
  81. <tbody>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div id="pageLoader" 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;">
  92. <div style="position: relative; top: 50%; transform: translateY(-50%);">
  93. <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
  94. <span class="sr-only">Loading...</span>
  95. </div>
  96. <!-- Add the 'Please wait' text below the spinner -->
  97. <p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
  98. </div>
  99. </div>
  100. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  101. </div>
  102. </div>
  103. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  104. <script type="text/javascript">
  105. $(document).ready(function() {
  106. var table = $('#AttendanceDatatable').DataTable({
  107. dom: 'Bftip',
  108. columnDefs: [
  109. { width: "150px", targets: 2 }, // Name / Pay Scale column
  110. { width: "150px", targets: 6 }, // Office Address column
  111. { width: "150px", targets: 8 },
  112. { width: "150px", targets: 12 }
  113. ],
  114. lengthMenu: [
  115. [50, 100, 200, 500, -1],
  116. ['50 rows', '100 rows', '200 rows', 'Show all']
  117. ],
  118. scrollY: '50vh',
  119. scrollX: true,
  120. buttons: [
  121. {
  122. extend: 'pageLength',
  123. className: 'btn btn-warning'
  124. },
  125. {
  126. title: 'Data export',
  127. extend: 'copyHtml5',
  128. text: 'Copy',
  129. className: 'btn btn-secondary',
  130. id: 'copyBtn'
  131. },
  132. {
  133. extend: 'excelHtml5',
  134. text: 'Excel',
  135. className: 'btn btn-secondary',
  136. id: 'excelBtn'
  137. },
  138. {
  139. extend: 'csvHtml5',
  140. text: 'CSV',
  141. className: 'btn btn-secondary',
  142. id: 'csvBtn'
  143. },
  144. {
  145. extend: 'pdfHtml5',
  146. text: 'PDF',
  147. className: 'btn btn-secondary',
  148. id: 'pdfBtn'
  149. }
  150. ],
  151. fixedHeader: true,
  152. autoWidth: true,
  153. responsive: false,
  154. searching: true,
  155. select: false,
  156. processing: false
  157. });
  158. loadConstituency();
  159. });
  160. // constituency function
  161. function loadConstituency() {
  162. $("#selectConstituency")
  163. .empty()
  164. .append('<option value="">-- Select Constituency --</option>');
  165. $.ajax({
  166. url: "/election/api/trainingadmin/getAllConstituency",
  167. type: "GET",
  168. success: function (data) {
  169. console.log("Constituency List:", data);
  170. data.forEach(function (obj) {
  171. $("#selectConstituency").append(
  172. `<option value="${obj.ac_no}">${obj.ac_name}</option>`
  173. );
  174. });
  175. },
  176. error: function () {
  177. Swal.fire({
  178. icon: 'error',
  179. title: 'Error',
  180. text: 'Failed to load constituency list',
  181. confirmButtonText: 'OK'
  182. });
  183. }
  184. });
  185. }
  186. </script>
  187. </body>
  188. </html>