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.
191 lines
6.1 KiB
191 lines
6.1 KiB
<!DOCTYPE html>
|
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
<head th:replace="~{fragments/modules/base/head :: head}">
|
|
<style>
|
|
|
|
#AttendanceDatatable td {
|
|
vertical-align: middle !important;
|
|
}
|
|
|
|
|
|
#AttendanceDatatable td:last-child {
|
|
text-align: center;
|
|
}
|
|
|
|
|
|
.mark-present,
|
|
.mark-absent {
|
|
width: 90px;
|
|
}
|
|
</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="row mt-1">
|
|
<div class="col-md-12">
|
|
<div class="card mt-2">
|
|
<div class="card-header" style="font-weight: bold;">
|
|
Order Copy Data
|
|
</div>
|
|
<div class="card-body d-flex align-items-end">
|
|
|
|
|
|
<!-- SL No -->
|
|
<div class="col-sm-3">
|
|
<label for="slNoInput">Search by Unique No</label>
|
|
<input type="text" id="slNoInput" class="form-control"
|
|
placeholder="Enter Unique No">
|
|
</div>
|
|
|
|
<div class="col-md-1 col-sm-12 text-center pt-4">
|
|
<span style="font-weight: bold;">OR</span>
|
|
</div>
|
|
|
|
<!-- Mobile Number -->
|
|
<div class="col-sm-3">
|
|
<label for="mobileInput">Search by Mobile No</label>
|
|
<input type="text" id="mobileInput" class="form-control"
|
|
placeholder="Enter Mobile Number" maxlength="10">
|
|
</div>
|
|
|
|
<!-- Button (hidden initially) -->
|
|
<div class="col-sm-4 d-flex align-items-end">
|
|
<button id="searchBtn" class="btn btn-success mr-2">
|
|
Search
|
|
</button>
|
|
<button id="clearSearchBtn" class="btn btn-danger">
|
|
Clear
|
|
</button>
|
|
</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>
|
|
|
|
<div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
|
|
|
|
<footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
|
|
</div>
|
|
</div>
|
|
|
|
<script th:replace="~{fragments/modules/base/script :: script}"></script>
|
|
|
|
<script>
|
|
|
|
$('#searchBtn').click(function () {
|
|
|
|
let slNo = $('#slNoInput').val().trim();
|
|
let mobileNo = $('#mobileInput').val().trim();
|
|
|
|
|
|
if (slNo === '' && mobileNo === '') {
|
|
Swal.fire('Missing Input', 'Please enter SL No or Mobile Number', 'warning');
|
|
return;
|
|
}
|
|
|
|
if (slNo !== '' && mobileNo !== '') {
|
|
Swal.fire('Invalid Input', 'Enter either SL No OR Mobile Number, not both', 'error');
|
|
return;
|
|
}
|
|
|
|
let url = '/election/api/mobile/first-order?';
|
|
|
|
if (slNo !== '') {
|
|
url += 'slNo=' + slNo;
|
|
} else {
|
|
url += 'mobileNo=' + mobileNo;
|
|
}
|
|
|
|
$('#pageLoader').show();
|
|
|
|
fetch(url)
|
|
.then(response => {
|
|
|
|
|
|
if (response.status === 404) {
|
|
throw new Error("No data found for given input");
|
|
}
|
|
|
|
|
|
if (response.status === 400) {
|
|
throw new Error("Invalid input");
|
|
}
|
|
|
|
if (!response.ok) {
|
|
throw new Error("Something went wrong");
|
|
}
|
|
|
|
return response.blob();
|
|
})
|
|
.then(blob => {
|
|
|
|
let downloadUrl = window.URL.createObjectURL(blob);
|
|
|
|
let a = document.createElement("a");
|
|
a.href = downloadUrl;
|
|
a.download = "FirstOrder.pdf"; // you can make dynamic
|
|
document.body.appendChild(a);
|
|
a.click();
|
|
a.remove();
|
|
})
|
|
.catch(err => {
|
|
Swal.fire({
|
|
icon: 'warning',
|
|
title: 'No data',
|
|
text: err.message,
|
|
allowOutsideClick: false,
|
|
allowEscapeKey:false,
|
|
allowEnterKey:false
|
|
});
|
|
})
|
|
.finally(() => {
|
|
$('#pageLoader').hide();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
$('#clearSearchBtn').click(function () {
|
|
|
|
// Clear input fields
|
|
$('#slNoInput').val('');
|
|
$('#mobileInput').val('');
|
|
|
|
// Optional: hide loader if visible
|
|
$('#pageLoader').hide();
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|