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.
 
 
 
 
 

236 lines
5.8 KiB

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}">
<style>
</style>
</head>
<body>
<div class="wrapper">
<!-- header top menu Start -->
<header th:replace="~{fragments/modules/base/header :: header}"></header>
<!-- header top menu end -->
<div class="page-wrap">
<!--=============== Left Menu side Start ================-->
<div th:replace="~{fragments/modules/base/menu :: menu}"></div>
<!--=============== Left side End ================-->
<div class="main-content">
<div class="container-fluid">
<div class="page-header mb-2">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<!-- <i class="far fa-calendar-plus bg-blue"></i> -->
<div class="d-inline">
<h5>Attendance Marking</h5>
<span>Mark attendance for training sessions </span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-4 col-sm-12">
<label class="form-label" for="selectConstituency">Select Constituency</label>
<select class="form-control" id="selectConstituency" required></select>
</div>
<div class="col-md-4 col-sm-12">
<label class="form-label" for="trainingCentre">Training Centre</label>
<input type="text" class="form-control" id="trainingCentre">
</div>
<div class="col-md-4 col-sm-12">
<label class="form-label" for="hall">Hall</label>
<input type="text" class="form-control" id="hall">
</div>
</div>
<div class="row mt-3">
<div class="col-12 d-flex justify-content-center">
<button type="submit" id="searchBtn"
class="btn btn-primary mx-2">Search</button>
<button class="btn btn-danger mx-2" id="resetBtn"
name="reset">Reset</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row" id="detailscard">
<div class="col-md-12">
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="AttendanceDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center">S.No</th>
<th class="text-center">Name</th>
<th class="text-center">Designation</th>
<th class="text-center">EPIC No</th>
<th class="text-center">Contact</th>
<th class="text-center">Polling Person Category</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<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;">
<div style="position: relative; top: 50%; transform: translateY(-50%);">
<div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
<span class="sr-only">Loading...</span>
</div>
<!-- Add the 'Please wait' text below the spinner -->
<p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
</div>
</div>
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
</div>
</div>
<script th:replace="~{fragments/modules/base/script :: script}"></script>
<script type="text/javascript">
$(document).ready(function() {
var table = $('#AttendanceDatatable').DataTable({
dom: 'Bftip',
columnDefs: [
{ width: "150px", targets: 2 }, // Name / Pay Scale column
{ width: "150px", targets: 6 }, // Office Address column
{ width: "150px", targets: 8 },
{ width: "150px", targets: 12 }
],
lengthMenu: [
[50, 100, 200, 500, -1],
['50 rows', '100 rows', '200 rows', 'Show all']
],
scrollY: '50vh',
scrollX: true,
buttons: [
{
extend: 'pageLength',
className: 'btn btn-warning'
},
{
title: 'Data export',
extend: 'copyHtml5',
text: 'Copy',
className: 'btn btn-secondary',
id: 'copyBtn'
},
{
extend: 'excelHtml5',
text: 'Excel',
className: 'btn btn-secondary',
id: 'excelBtn'
},
{
extend: 'csvHtml5',
text: 'CSV',
className: 'btn btn-secondary',
id: 'csvBtn'
},
{
extend: 'pdfHtml5',
text: 'PDF',
className: 'btn btn-secondary',
id: 'pdfBtn'
}
],
fixedHeader: true,
autoWidth: true,
responsive: false,
searching: true,
select: false,
processing: false
});
loadConstituency();
});
// constituency function
function loadConstituency() {
$("#selectConstituency")
.empty()
.append('<option value="">-- Select Constituency --</option>');
$.ajax({
url: "/election/api/trainingadmin/getAllConstituency",
type: "GET",
success: function (data) {
console.log("Constituency List:", data);
data.forEach(function (obj) {
$("#selectConstituency").append(
`<option value="${obj.ac_no}">${obj.ac_name}</option>`
);
});
},
error: function () {
Swal.fire({
icon: 'error',
title: 'Error',
text: 'Failed to load constituency list',
confirmButtonText: 'OK'
});
}
});
}
</script>
</body>
</html>