Browse Source

added session and changes in page design

master
yoganandhank 1 year ago
parent
commit
c466078c99
  1. 37
      src/main/resources/templates/modules/crslogspages/birthanddeath.html
  2. 82
      src/main/resources/templates/modules/crslogspages/loginpage.html

37
src/main/resources/templates/modules/crslogspages/birthanddeath.html

@ -10,11 +10,18 @@
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<!-- Include Bootstrap Icons CDN in <head> if not already -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<!-- <link th:href="@{/styles/birthanddeath.css}" rel="stylesheet" /> -->
</head>
<style>
.form-check {
display: flex;
align-items: center;
@ -405,7 +412,7 @@ body {
@media (min-width: 769px) {
.mobile-username,
.mobile-logout {
display: none;
display: block;
}
.header .center-text{
@ -417,7 +424,7 @@ body {
</style>
</head>
<body style="background-color: #ebf1fa;">
@ -742,24 +749,25 @@ body {
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Your custom script
<script th:src="@{/script/birthanddeath.js}"></script> -->
<script>
// Redirect after 60 seconds (1 minute) of inactivity
let timeoutDuration = 10 * 60 * 1000; // 60 seconds
@ -815,7 +823,7 @@ body {
document.addEventListener("DOMContentLoaded", function () {
const userName = localStorage.getItem("userName");
console.log("userName ",userName);
//console.log("userName ",userName);
if (userName) {
@ -837,8 +845,7 @@ body {
}
$('#logoutBtn').click(function (e) {
e.stopPropagation();
$('#logoutBtn,#logoutBtnMobile').click(function () {
Swal.fire({
title: "Are you sure?",
@ -966,7 +973,7 @@ function fetchBirthData() {
const gender = document.querySelector('input[name="gender"]:checked')?.value;
const captchaInput = document.getElementById('birth-captcha-input');
console.log("gender:", gender);
//console.log("gender:", gender);
// Validate Date of Birth
if (!dob) {
@ -999,7 +1006,7 @@ function fetchBirthData() {
}
const formattedDob = dob.split("-").reverse().join("/"); // Convert yyyy-MM-dd to dd/MM/yyyy
console.log("dob:", formattedDob);
//console.log("dob:", formattedDob);
$('#pageLoader').show();
$.ajax({
@ -1088,7 +1095,7 @@ function fetchDeathData() {
const gender = document.querySelector('input[name="deathgender"]:checked')?.value;
const captchaInput = document.getElementById('death-captcha-input');
console.log("gender:", gender);
// console.log("gender:", gender);
// Validate Date of Birth
if (!dod) {
@ -1121,7 +1128,7 @@ function fetchDeathData() {
const formattedDod = dod.split("-").reverse().join("/"); // Convert yyyy-MM-dd to dd/MM/yyyy
console.log("dod:", formattedDod);
// console.log("dod:", formattedDod);
$('#pageLoader').show();
$.ajax({
@ -1205,7 +1212,7 @@ function saveCertificateLog(regNo, eventDate, url, service){
service: service
},
success: function() {
console.log('View logged successfully');
//console.log('View logged successfully');
},
error: function(xhr, status, error) {
console.error('Logging failed:', error);
@ -1214,8 +1221,8 @@ function saveCertificateLog(regNo, eventDate, url, service){
}
</script>
</body>
</html>

82
src/main/resources/templates/modules/crslogspages/loginpage.html

@ -3,29 +3,18 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GCC - Birth & Death</title>
<title>GCC - Birth And Death</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<!-- Include Bootstrap Icons CDN in <head> if not already -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<!-- jQuery (Only load it once) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Popper.js (Required for Bootstrap 4) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<!-- SweetAlert JS (optional if you plan to use it) -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- <link th:href="@{/styles/loginpage.css}" rel="stylesheet" /> -->
<style>
/* Header Styling */
.header {
background-color: #134356;
@ -173,6 +162,7 @@
width: 150px; /* optional: set fixed width */
}
</style>
</head>
<body style="background-color: #ebf1fa;">
@ -269,7 +259,7 @@
<span class="text-danger">*</span>
<input type="text"
id="phoneNumber" class="form-control"
placeholder="Enter Mobile number"
placeholder="Enter Registered Mobile number"
oninput="validatePhoneNumber(this)">
</div>
@ -362,8 +352,24 @@
<script>
<!-- jQuery (Only load it once) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<!-- Popper.js (Required for Bootstrap 4) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<!-- SweetAlert JS (optional if you plan to use it) -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- <script th:src="@{/script/loginpage.js}"></script> -->
<script>
document.addEventListener("DOMContentLoaded", function () {
@ -429,38 +435,35 @@ $(document).ready(function () {
// phone number validation
/* function validatePhoneNumber(input) {
// Remove any non-numeric characters using regex
input.value = input.value.replace(/[^0-9]/g, '');
// Limit the input to 10 digits
if (input.value.length > 10) {
input.value = input.value.slice(0, 10);
}
} */
function validatePhoneNumber(input) {
// Remove non-numeric characters
let value = input.value.replace(/[^0-9]/g, '');
// Prevent first digit from being 0
if (value.startsWith('0')) {
value = value.substring(1);
// Prevent input if first digit is 0
if (value.length === 1 && value[0] === '0') {
value = '';
}
// Limit to 10 digits
// Enforce Indian mobile format: starts with 6-9 and has exactly 10 digits
if (value.length > 10) {
value = value.slice(0, 10);
}
// Update input value
input.value = value;
}
// Optional: check for invalid numbers starting with digits other than 6-9
if (value.length === 10 && !/^[6-9]\d{9}$/.test(value)) {
Swal.fire({
title: "Invalid Mobile Number",
text: "Please enter a valid 10-digit Indian mobile number starting with 6-9.",
icon: "error",
confirmButtonText: "OK",
allowOutsideClick: false
});
input.value = "";
}
}
$('#registersubmit').click(function (event) {
@ -635,7 +638,7 @@ $(document).ready(function () {
setTimeout(function () {
Swal.close();
console.log("OTP sent response:", response);
//console.log("OTP sent response:", response);
$('#mobilenotxt').html(mobileNumber);
$('#otpForm').modal({
@ -690,7 +693,7 @@ $(document).ready(function () {
dataType: 'json',
success: function (response) {
console.log("response...",response);
//console.log("response...",response);
if (response.userName) {
localStorage.setItem("userName", response.userName);
}
@ -701,7 +704,7 @@ $(document).ready(function () {
Swal.close();
if (response.status === "Success") {
//alert("inside line 890 " + response.userName);
console.log("Welcome, " , response.userName);
//console.log("Welcome, " , response.userName);
Swal.fire({
title: "OTP Verified!",
text: "Your OTP has been successfully verified.",
@ -832,5 +835,6 @@ $(document).ready(function () {
</script>
</body>
</html>
Loading…
Cancel
Save