Browse Source

changes in register page

master
yoganandhan 10 months ago
parent
commit
2b5293f9a4
  1. 2
      src/main/java/com/gcc/crslogs/controller/ApiController.java
  2. 111
      src/main/java/com/gcc/crslogs/service/BirthAndDeathDetailsService.java
  3. 247
      src/main/resources/templates/modules/crslogspages/birthloginpage.html
  4. 9
      src/main/resources/templates/modules/crslogspages/death.html
  5. 247
      src/main/resources/templates/modules/crslogspages/deathloginpage.html

2
src/main/java/com/gcc/crslogs/controller/ApiController.java

@ -258,7 +258,7 @@ public ResponseEntity<?> fetchDeathCertificateSecurely(@RequestBody Map<String,
if (dod == null || dod.isEmpty() || sex == null || sex.isEmpty()) {
Map<String, Object> error = new HashMap<>();
error.put("status", false);
error.put("message", "DOB and Sex are mandatory.");
error.put("message", "dod and Sex are mandatory.");
return ResponseEntity.badRequest().body(error);
}

111
src/main/java/com/gcc/crslogs/service/BirthAndDeathDetailsService.java

@ -31,12 +31,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
@Service
public class BirthAndDeathDetailsService {
@Autowired
private final RestTemplate restTemplate;
@Autowired
private JdbcTemplate jdbcTemplate;
@ -44,11 +41,10 @@ public class BirthAndDeathDetailsService {
this.restTemplate = builder.build();
}
// using for live
//using for live
public Map<String, Object> fetchBirthCertificate(String dob, String sex, String regno, String childName, String fatherName, String motherName) throws Exception {
public Map<String, Object> fetchBirthCertificate(String dob, String sex, String regno, String childName,
String fatherName, String motherName) throws Exception {
Map<String, String> params = new LinkedHashMap(); // keep order
params.put("regno", regno != null ? regno : "");
params.put("sex", sex);
@ -61,10 +57,11 @@ public class BirthAndDeathDetailsService {
String serviceInput = mapper.writeValueAsString(params);
// Final raw URL — NOT encoded
String BirthCertificateapiUrl = "https://chennaicorporation.gov.in/gcc/Api/BirthCertificate_json.jsp?serviceinput=" + serviceInput;
String BirthCertificateapiUrl = "https://chennaicorporation.gov.in/gcc/Api/BirthCertificate_json.jsp?serviceinput="
+ serviceInput;
//System.out.println("⏩ Raw JSON: " + serviceInput);
//System.out.println("🌐 FINAL RAW URL: " + BirthCertificateapiUrl);
// System.out.println("⏩ Raw JSON: " + serviceInput);
// System.out.println("🌐 FINAL RAW URL: " + BirthCertificateapiUrl);
HttpHeaders headers = new HttpHeaders();
headers.set("User-Agent", "Mozilla/5.0");
@ -72,26 +69,28 @@ public class BirthAndDeathDetailsService {
HttpEntity<String> entity = new HttpEntity<>(headers);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.exchange(BirthCertificateapiUrl, HttpMethod.GET, entity, String.class);
ResponseEntity<String> response = restTemplate.exchange(BirthCertificateapiUrl, HttpMethod.GET, entity,
String.class);
String rawJson = response.getBody();
String cleanJson = sanitizeJsonResponse(rawJson);
// System.out.println("✅ API Raw Response: " + cleanJson);
//System.out.println("✅ API Raw Response: " + cleanJson);
return mapper.readValue(cleanJson, new TypeReference<Map<String, Object>>() {});
return mapper.readValue(cleanJson, new TypeReference<Map<String, Object>>() {
});
}
// to created our external api from restservices
// to created our external api from restservices
public Map<String, Object> fetchLocalBirthCertificate(
String dob, String fatherName, String motherName, String childName, String sex) throws Exception {
String apiUrl = "https://gccservices.chennaicorporation.gov.in/gccrestservices/api/birth-certificate/by-detailsnewforWeb";
// String apiUrl =
// "http://localhost:8077/gccrestservices/api/birth-certificate/by-detailsnewforWeb";
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("incident_date", dob); // yyyy-MM-dd
params.add("gender", sex);
@ -116,7 +115,8 @@ public class BirthAndDeathDetailsService {
String rawJson = response.getBody();
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {});
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {
});
// ✅ Only keep records that actually have a PDF link
if (result.containsKey("certificate_details")) {
@ -130,21 +130,18 @@ public class BirthAndDeathDetailsService {
}
return result;
}
}
// to created our external api from restservices
// to created our external api from restservices
public Map<String, Object> fetchLocalDeathCertificate(
String dod, String fatherName, String motherName, String personName, String sex) throws Exception {
String apiUrl = "https://gccservices.chennaicorporation.gov.in/gccrestservices/api/death-certificate/by-detailsnewforWeb";
// String apiUrl =
// "http://localhost:8077/gccrestservices/api/death-certificate/by-detailsnewforWeb";
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("incident_date", dod); // yyyy-MM-dd
params.add("gender", sex);
@ -169,8 +166,9 @@ public class BirthAndDeathDetailsService {
String rawJson = response.getBody();
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {});
//✅ Only keep records that actually have a PDF link
Map<String, Object> result = mapper.readValue(rawJson, new TypeReference<Map<String, Object>>() {
});
// ✅ Only keep records that actually have a PDF link
if (result.containsKey("certificate_details")) {
List<Map<String, Object>> details = (List<Map<String, Object>>) result.get("certificate_details");
@ -182,16 +180,12 @@ public class BirthAndDeathDetailsService {
}
return result;
}
}
//using in live
// using in live
public Map<String, Object> fetchDeathCertificate(String dod, String sex, String regno, String personName, String fatherName, String motherName) throws Exception {
public Map<String, Object> fetchDeathCertificate(String dod, String sex, String regno, String personName,
String fatherName, String motherName) throws Exception {
@SuppressWarnings("rawtypes")
Map<String, String> params = new LinkedHashMap(); // keep order
params.put("regno", regno != null ? regno : "");
@ -205,10 +199,11 @@ public class BirthAndDeathDetailsService {
String serviceInput = mapper.writeValueAsString(params);
// Final raw URL — NOT encoded
String DeathCertificateapiUrl = "https://chennaicorporation.gov.in/gcc/Api/DeathCertificate_json.jsp?serviceinput=" + serviceInput;
String DeathCertificateapiUrl = "https://chennaicorporation.gov.in/gcc/Api/DeathCertificate_json.jsp?serviceinput="
+ serviceInput;
//System.out.println("⏩ Raw JSON: " + serviceInput);
//System.out.println("🌐 FINAL RAW URL: " + DeathCertificateapiUrl);
// System.out.println("⏩ Raw JSON: " + serviceInput);
// System.out.println("🌐 FINAL RAW URL: " + DeathCertificateapiUrl);
HttpHeaders headers = new HttpHeaders();
headers.set("User-Agent", "Mozilla/5.0");
@ -216,26 +211,26 @@ public class BirthAndDeathDetailsService {
HttpEntity<String> entity = new HttpEntity<>(headers);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> response = restTemplate.exchange(DeathCertificateapiUrl, HttpMethod.GET, entity, String.class);
ResponseEntity<String> response = restTemplate.exchange(DeathCertificateapiUrl, HttpMethod.GET, entity,
String.class);
//System.out.println("✅ API Raw Response: " + response.getBody());
// System.out.println("✅ API Raw Response: " + response.getBody());
String rawJson = response.getBody();
String cleanJson = sanitizeJsonResponse(rawJson);
return mapper.readValue(cleanJson, new TypeReference<Map<String, Object>>() {});
return mapper.readValue(cleanJson, new TypeReference<Map<String, Object>>() {
});
}
private String sanitizeJsonResponse(String rawJson) {
if (rawJson == null) return "";
if (rawJson == null)
return "";
// Remove quote before parenthesis (fixes: "NAME" : "ABC "(LATE)")
String fixed = rawJson.replaceAll("\"\\s*\\(([^)]*)\\)\"", " ($1)\"");
// Remove parenthesis and content outside of quotes (fixes: ... "ABC" (LATE) ... → ... "ABC" ...)
// Remove parenthesis and content outside of quotes (fixes: ... "ABC" (LATE) ...
// → ... "ABC" ...)
fixed = fixed.replaceAll("\"\\s*\\([^)]*\\)", "\"");
return fixed
@ -251,11 +246,7 @@ public class BirthAndDeathDetailsService {
.replaceAll("\"\"\"", "\"\"") // fix triple quotes
.replaceAll("\"{3,}", "\"") // collapse 3+ quotes to 1
.replaceAll(":(\\s*)\"{2,}\"", ":\"\""); // handle `:"""` to `:""`
}
}
@Transactional
public ResponseEntity<?> saveNewUser(String user_name, String user_address, String user_mobile) {
@ -274,28 +265,22 @@ public class BirthAndDeathDetailsService {
}
}
public boolean isUserRegistered(String mobile) {
String sql = "SELECT COUNT(*) FROM users WHERE user_mobile = ?";
Integer count = jdbcTemplate.queryForObject(sql, new Object[]{mobile}, Integer.class);
Integer count = jdbcTemplate.queryForObject(sql, new Object[] { mobile }, Integer.class);
return count != null && count > 0;
}
public ResponseEntity<?> saveCertificateLogs(String regNo, String eventDate, String url, String service, int userid) {
public ResponseEntity<?> saveCertificateLogs(String regNo, String eventDate, String url, String service,
int userid) {
String sql = "Insert into certificate_logs (regno, event_date, english_url, service, user_id) VALUES (?, ?, ?, ?, ?)";
Integer count = jdbcTemplate.update(sql, regNo, eventDate, url, service, userid);
return count != null && count > 0 ? ResponseEntity.ok(count) : ResponseEntity.notFound().build();
}
public Map<String,Object> getUserDetails(String mobNo) {
public Map<String, Object> getUserDetails(String mobNo) {
String sql = "Select * from users where user_mobile = ?";
return jdbcTemplate.queryForMap(sql, mobNo);
}
}

247
src/main/resources/templates/modules/crslogspages/birthloginpage.html

@ -1,50 +1,50 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GCC - Birth And Death</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<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">
<!-- 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/loginpage.css}" rel="stylesheet" /> -->
<style>
/* Header Styling */
.header {
<!-- <link th:href="@{/styles/loginpage.css}" rel="stylesheet" /> -->
<style>
/* Header Styling */
.header {
background-color: #134356;
padding: 10px 20px;
color: rgb(255, 255, 255);
font-family: Arial, sans-serif;
}
}
.header .logo img {
.header .logo img {
height: 60px;
}
}
.header .center-text {
.header .center-text {
text-align: center;
font-size: 24px;
}
}
.header .menu-btn {
.header .menu-btn {
background-color: transparent;
border: none;
font-size: 24px;
color: white;
}
}
.header .menu-btn:hover {
.header .menu-btn:hover {
color: #ccc;
}
}
/* Menu Dropdown */
.menu-dropdown {
/* Menu Dropdown */
.menu-dropdown {
position: absolute;
top: 80px;
right: 20px;
@ -52,29 +52,30 @@
padding: 10px;
display: none;
flex-direction: column;
z-index: 1000; /* Add z-index to bring the menu above other elements */
}
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
.menu-dropdown a {
.menu-dropdown a {
color: white;
margin-bottom: 5px;
text-decoration: none;
}
}
.menu-dropdown a:hover {
.menu-dropdown a:hover {
text-decoration: underline;
}
}
/* otp*/
.otp-input-box {
/* otp*/
.otp-input-box {
display: flex;
justify-content: center;
gap: 10px;
/* Adjust spacing between the inputs */
}
}
.otp-input {
.otp-input {
width: 50px;
/* Width for a square input */
height: 50px;
@ -90,36 +91,37 @@
outline: none;
/* Remove default focus outline */
transition: border-color 0.3s ease;
}
}
.otp-input:focus {
.otp-input:focus {
border-color: #007bff;
/* Change border color on focus */
}
}
/* otp*/
/* otp*/
/*send otp styles*/
.input-group .form-control {
/*send otp styles*/
.input-group .form-control {
border-right: 0;
/* Remove right border of the input to blend with the button */
}
}
.input-group-append .btn {
.input-group-append .btn {
border-left: 0;
/* Remove left border of the button */
}
}
.bottom-container {
margin-bottom: 50px; /* Adjust as needed */
}
.bottom-container {
margin-bottom: 50px;
/* Adjust as needed */
}
/* Mobile Specific Styling */
@media (max-width: 768px) {
/* Mobile Specific Styling */
@media (max-width: 768px) {
.header {
display: flex;
justify-content: space-between;
@ -136,43 +138,46 @@
.menu-dropdown {
right: 0;
left: 0;
z-index: 1000; /* Add z-index to bring the menu above other elements */
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
}
}
.button-wrapper {
.button-wrapper {
display: flex;
justify-content: center;
margin-top: 20px; /* adds space from the top */
}
margin-top: 20px;
/* adds space from the top */
}
#registersubmit {
#registersubmit {
background-color: #0c4f63;
border: none;
width: 150px; /* optional: set fixed width */
}
width: 150px;
/* optional: set fixed width */
}
#submitBtn {
#submitBtn {
background-color: #0c4f63;
border: none;
width: 150px; /* optional: set fixed width */
}
</style>
width: 150px;
/* optional: set fixed width */
}
</style>
</head>
<body style="background-color: #ebf1fa;">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Left: Logo -->
<div class="logo">
<a href="https://chennaicorporation.gov.in/gcc/" >
<a href="https://chennaicorporation.gov.in/gcc/">
<img src="https://gccservices.in/gcc/assets/images/logo.png" alt="Logo">
</a>
@ -186,42 +191,46 @@
<div class="center">
<a href="https://chennaicorporation.gov.in/gcc/" >
<div class="center">
<a href="https://chennaicorporation.gov.in/gcc/">
<i class="bi bi-house-fill" style="font-size: 40px; color:#93adc8"></i>
</a>
</div>
</div>
</div>
</div>
</header>
<!-- Header End-->
</header>
<!-- Header End-->
<main class="container mt-4">
<main class="container mt-4">
<!-- First Card -->
<!-- Register Card -->
<!-- Register Card -->
<div class="card register-card mx-auto mt-5" style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; display:none;">
<!-- Register Card -->
<div class="card register-card mx-auto mt-5"
style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; display:none;">
<div class="card-body ">
<h4 class="text-center mb-4" style="color: #004865;"><strong>Registration of Birth Certificate Download</strong></h4>
<h4 class="text-center mb-4" style="color: #004865;"><strong>Registration of Birth Certificate
Download</strong></h4>
<hr>
<!-- Name -->
<div class="form-group">
<label for="name">Name</label><span class="text-danger">*</span>
<input type="text" class="form-control " id="name" placeholder="Enter your name" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
<input type="text" class="form-control " id="name" placeholder="Enter your name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
</div>
<!-- Phone -->
<div class="form-group">
<label for="phone">Mobile No</label><span class="text-danger">*</span>
<input type="text" class="form-control" id="phone" placeholder="Enter Mobile number" oninput="validatePhoneNumber(this)">
<input type="text" class="form-control" id="phone" placeholder="Enter Mobile number"
oninput="validatePhoneNumber(this)">
</div>
<!-- Address -->
<!-- <div class="form-group">
<!-- <div class="form-group">
<label for="address">Address</label><span class="text-danger">*</span>
<textarea class="form-control" id="address" rows="2" placeholder="Enter your Address"></textarea>
</div> -->
@ -234,14 +243,14 @@
<div class="text-center mt-3 mb-2">
<div class="text-center mt-3 mb-2">
<label>
If you already have an account,
<a href="#" id="showLoginCardBtn">click here to login</a>.
</label>
</div>
</div>
</div>
@ -249,18 +258,17 @@
<div class="card login-card mx-auto mt-5" style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; " >
<div class="card login-card mx-auto mt-5"
style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; ">
<div class="card-body ">
<h4 class="text-center mb-4" style="color: #004865;"><strong>Birth Certificate Download</strong></h4>
<hr>
<hr>
<!-- Phone -->
<div class="form-group">
<label for="phone">Mobile No</label>
<span class="text-danger">*</span>
<input type="text"
id="phoneNumber" class="form-control"
placeholder="Enter Registered Mobile number"
oninput="validatePhoneNumber(this)">
<input type="text" id="phoneNumber" class="form-control"
placeholder="Enter Registered Mobile number" oninput="validatePhoneNumber(this)">
</div>
@ -270,7 +278,7 @@
</div>
<div class="text-center mt-3 mb-2">
<div class="text-center mt-3 mb-2">
<label>
If you don't have an account,
<a href="#" id="showRegisterCardBtn">click here to Register</a>.
@ -280,22 +288,20 @@
</div>
</div>
</main>
</main>
<!-- OTP Modal -->
<!-- OTP Modal -->
<div class="modal fade" id="otpForm" tabindex="-1" role="dialog"
aria-labelledby="otpFormLabel" aria-hidden="true">
<div class="modal fade" id="otpForm" tabindex="-1" role="dialog" aria-labelledby="otpFormLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="" onsubmit="return verifyOtp(1); "> <!--1 mentioned for existing user login -->
<div class="modal-header">
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">OTP
Login</h6>
<button type="button" class="close" data-bs-dismiss="modal"
aria-label="Close"
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"
style="color: black; border: white; background-color: white;">
<span aria-hidden="true">&times;</span>
</button>
@ -303,8 +309,7 @@
<div class="modal-body">
<div class="row ">
<div class="mb-3" style="text-align: center;">
<img src="https://gccservices.in/gcc/files/c_d/otp.png"
width="50%" alt="Mobileotp">
<img src="https://gccservices.in/gcc/files/c_d/otp.png" width="50%" alt="Mobileotp">
</div>
</div>
@ -320,13 +325,11 @@
<div class="row d-flex justify-content-center align-items-center">
<div class="mb-3 ">
<div class="otp-input-box">
<input type="text" maxlength="1" class="otp-input" id="otp1"
required /> <input type="text" maxlength="1"
class="otp-input" id="otp2" required /> <input type="text"
maxlength="1" class="otp-input" id="otp3" required /> <input
<input type="text" maxlength="1" class="otp-input" id="otp1" required /> <input
type="text" maxlength="1" class="otp-input" id="otp2" required /> <input
type="text" maxlength="1" class="otp-input" id="otp3" required /> <input
type="text" maxlength="1" class="otp-input" id="otp4" required />
<input type="text" maxlength="1" class="otp-input" id="otp5"
required />
<input type="text" maxlength="1" class="otp-input" id="otp5" required />
</div>
</div>
</div>
@ -340,39 +343,38 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="but">Verify
OTP</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- jQuery (Only load it once) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></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>
<!-- 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>
<!-- 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>
<!-- 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 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 th:src="@{/script/loginpage.js}"></script> -->
<script>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
const registerCard = document.querySelector(".register-card");
const loginCard = document.querySelector(".login-card");
@ -399,11 +401,11 @@ document.addEventListener("DOMContentLoaded", function () {
registerCard.style.display = "none";
loginCard.style.display = "block";
});
});
});
$(document).ready(function () {
$(document).ready(function () {
// Show Login Card when "Login" is clicked from Register Card
$('#showLoginCardBtn').on('click', function (e) {
e.preventDefault();
@ -431,7 +433,7 @@ $(document).ready(function () {
startCountdown();
});
});
});
@ -504,7 +506,7 @@ $(document).ready(function () {
// Step 3: Wait for user to manually click Verify inside OTP modal,
// and if successful, call verifyOtp with a callback
$('#but').off('click').on('click', function () {
verifyOtp(2,function () { // 2 is mentioned for new user registration
verifyOtp(2, function () { // 2 is mentioned for new user registration
// Step 4: Save new user only after OTP success
$.ajax({
url: '/crs/api/saveNewUser',
@ -523,7 +525,7 @@ $(document).ready(function () {
$('#name').val('');
$('#phone').val('');
// $('#address').val('');
window.location.href = "/crs/loginpage";
window.location.href = "/crs/birth";
});
},
error: function (xhr) {
@ -689,7 +691,7 @@ $(document).ready(function () {
$.ajax({
type: "GET",
url: '/crs/api/verifyOTP',
data: {'otp': otpValue, 'mobNo': mobileNumber, 'flag': flag},
data: { 'otp': otpValue, 'mobNo': mobileNumber, 'flag': flag },
dataType: 'json',
success: function (response) {
@ -833,8 +835,9 @@ $(document).ready(function () {
</script>
</script>
</body>
</html>

9
src/main/resources/templates/modules/crslogspages/death.html

@ -704,7 +704,7 @@ $(document).ready(function () {
document.addEventListener("DOMContentLoaded", function () {
const today = new Date().toISOString().split("T")[0]; // yyyy-mm-dd format
document.getElementById("dateofbirth").setAttribute("max", today);
//document.getElementById("dateofbirth").setAttribute("max", today);
document.getElementById("dateofdeath").setAttribute("max", today);
});
@ -848,7 +848,7 @@ function validateCaptcha(type) {
document.addEventListener("DOMContentLoaded", function () {
generateCaptcha("birth");
// generateCaptcha("birth");
generateCaptcha("death");
});
@ -1010,7 +1010,7 @@ if (!validateCaptcha('death')) {
const formattedDod = dod.split("-").reverse().join("/"); // Convert yyyy-MM-dd to dd/MM/yyyy
// console.log("dod:", formattedDod);
//console.log("dod:", formattedDod);
$('#pageLoader').show();
const payload = {
@ -1029,10 +1029,11 @@ $.ajax({
contentType: 'application/json',
data: JSON.stringify(payload),
success: function (response) {
$('#pageLoader').hide();
if (response && response.certificate_details && response.certificate_details.length > 0) {
let html = '<table id="deathDataTable" class="table table-bordered"><thead><tr>' +
let html = '<table id="deathDataTable" class="table table-bordered table-striped"><thead><tr>' +
'<th>S.No</th><th>Reg No</th><th>Person Name</th>' +
'<th>Father Name</th><th>Mother Name</th><th>DOD</th><th>Certificate Link</th></tr></thead><tbody>';

247
src/main/resources/templates/modules/crslogspages/deathloginpage.html

@ -1,50 +1,50 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GCC - Death</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GCC - 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">
<!-- 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/loginpage.css}" rel="stylesheet" /> -->
<style>
/* Header Styling */
.header {
<!-- <link th:href="@{/styles/loginpage.css}" rel="stylesheet" /> -->
<style>
/* Header Styling */
.header {
background-color: #134356;
padding: 10px 20px;
color: rgb(255, 255, 255);
font-family: Arial, sans-serif;
}
}
.header .logo img {
.header .logo img {
height: 60px;
}
}
.header .center-text {
.header .center-text {
text-align: center;
font-size: 24px;
}
}
.header .menu-btn {
.header .menu-btn {
background-color: transparent;
border: none;
font-size: 24px;
color: white;
}
}
.header .menu-btn:hover {
.header .menu-btn:hover {
color: #ccc;
}
}
/* Menu Dropdown */
.menu-dropdown {
/* Menu Dropdown */
.menu-dropdown {
position: absolute;
top: 80px;
right: 20px;
@ -52,29 +52,30 @@
padding: 10px;
display: none;
flex-direction: column;
z-index: 1000; /* Add z-index to bring the menu above other elements */
}
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
.menu-dropdown a {
.menu-dropdown a {
color: white;
margin-bottom: 5px;
text-decoration: none;
}
}
.menu-dropdown a:hover {
.menu-dropdown a:hover {
text-decoration: underline;
}
}
/* otp*/
.otp-input-box {
/* otp*/
.otp-input-box {
display: flex;
justify-content: center;
gap: 10px;
/* Adjust spacing between the inputs */
}
}
.otp-input {
.otp-input {
width: 50px;
/* Width for a square input */
height: 50px;
@ -90,36 +91,37 @@
outline: none;
/* Remove default focus outline */
transition: border-color 0.3s ease;
}
}
.otp-input:focus {
.otp-input:focus {
border-color: #007bff;
/* Change border color on focus */
}
}
/* otp*/
/* otp*/
/*send otp styles*/
.input-group .form-control {
/*send otp styles*/
.input-group .form-control {
border-right: 0;
/* Remove right border of the input to blend with the button */
}
}
.input-group-append .btn {
.input-group-append .btn {
border-left: 0;
/* Remove left border of the button */
}
}
.bottom-container {
margin-bottom: 50px; /* Adjust as needed */
}
.bottom-container {
margin-bottom: 50px;
/* Adjust as needed */
}
/* Mobile Specific Styling */
@media (max-width: 768px) {
/* Mobile Specific Styling */
@media (max-width: 768px) {
.header {
display: flex;
justify-content: space-between;
@ -136,43 +138,46 @@
.menu-dropdown {
right: 0;
left: 0;
z-index: 1000; /* Add z-index to bring the menu above other elements */
z-index: 1000;
/* Add z-index to bring the menu above other elements */
}
}
}
.button-wrapper {
.button-wrapper {
display: flex;
justify-content: center;
margin-top: 20px; /* adds space from the top */
}
margin-top: 20px;
/* adds space from the top */
}
#registersubmit {
#registersubmit {
background-color: #0c4f63;
border: none;
width: 150px; /* optional: set fixed width */
}
width: 150px;
/* optional: set fixed width */
}
#submitBtn {
#submitBtn {
background-color: #0c4f63;
border: none;
width: 150px; /* optional: set fixed width */
}
</style>
width: 150px;
/* optional: set fixed width */
}
</style>
</head>
<body style="background-color: #ebf1fa;">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Header Start-->
<header>
<div class="header d-flex justify-content-between align-items-center">
<!-- Left: Logo -->
<div class="logo">
<a href="https://chennaicorporation.gov.in/gcc/" >
<a href="https://chennaicorporation.gov.in/gcc/">
<img src="https://gccservices.in/gcc/assets/images/logo.png" alt="Logo">
</a>
@ -186,42 +191,46 @@
<div class="center">
<a href="https://chennaicorporation.gov.in/gcc/" >
<div class="center">
<a href="https://chennaicorporation.gov.in/gcc/">
<i class="bi bi-house-fill" style="font-size: 40px; color:#93adc8"></i>
</a>
</div>
</div>
</div>
</div>
</header>
<!-- Header End-->
</header>
<!-- Header End-->
<main class="container mt-4">
<main class="container mt-4">
<!-- First Card -->
<!-- Register Card -->
<!-- Register Card -->
<div class="card register-card mx-auto mt-5" style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; display:none;">
<!-- Register Card -->
<div class="card register-card mx-auto mt-5"
style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; display:none;">
<div class="card-body ">
<h4 class="text-center mb-4" style="color: #004865;"><strong>Registration of Death Certificate Download</strong></h4>
<h4 class="text-center mb-4" style="color: #004865;"><strong>Registration of Death Certificate
Download</strong></h4>
<hr>
<!-- Name -->
<div class="form-group">
<label for="name">Name</label><span class="text-danger">*</span>
<input type="text" class="form-control " id="name" placeholder="Enter your name" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
<input type="text" class="form-control " id="name" placeholder="Enter your name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')">
</div>
<!-- Phone -->
<div class="form-group">
<label for="phone">Mobile No</label><span class="text-danger">*</span>
<input type="text" class="form-control" id="phone" placeholder="Enter Mobile number" oninput="validatePhoneNumber(this)">
<input type="text" class="form-control" id="phone" placeholder="Enter Mobile number"
oninput="validatePhoneNumber(this)">
</div>
<!-- Address -->
<!-- <div class="form-group">
<!-- <div class="form-group">
<label for="address">Address</label><span class="text-danger">*</span>
<textarea class="form-control" id="address" rows="2" placeholder="Enter your Address"></textarea>
</div> -->
@ -234,14 +243,14 @@
<div class="text-center mt-3 mb-2">
<div class="text-center mt-3 mb-2">
<label>
If you already have an account,
<a href="#" id="showLoginCardBtn">click here to login</a>.
</label>
</div>
</div>
</div>
@ -249,18 +258,17 @@
<div class="card login-card mx-auto mt-5" style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; " >
<div class="card login-card mx-auto mt-5"
style="max-width: 400px; background-color: rgba(44, 84, 103, 0.1); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid #ffffff40; ">
<div class="card-body ">
<h4 class="text-center mb-4" style="color: #004865;"><strong>Death Certificate Download</strong></h4>
<hr>
<hr>
<!-- Phone -->
<div class="form-group">
<label for="phone">Mobile No</label>
<span class="text-danger">*</span>
<input type="text"
id="phoneNumber" class="form-control"
placeholder="Enter Registered Mobile number"
oninput="validatePhoneNumber(this)">
<input type="text" id="phoneNumber" class="form-control"
placeholder="Enter Registered Mobile number" oninput="validatePhoneNumber(this)">
</div>
@ -270,7 +278,7 @@
</div>
<div class="text-center mt-3 mb-2">
<div class="text-center mt-3 mb-2">
<label>
If you don't have an account,
<a href="#" id="showRegisterCardBtn">click here to Register</a>.
@ -280,22 +288,20 @@
</div>
</div>
</main>
</main>
<!-- OTP Modal -->
<!-- OTP Modal -->
<div class="modal fade" id="otpForm" tabindex="-1" role="dialog"
aria-labelledby="otpFormLabel" aria-hidden="true">
<div class="modal fade" id="otpForm" tabindex="-1" role="dialog" aria-labelledby="otpFormLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="" onsubmit="return verifyOtp(1); "> <!--1 mentioned for existing user login -->
<div class="modal-header">
<h6 class="modal-title m-0" id="exampleModalDefaultLabel">OTP
Login</h6>
<button type="button" class="close" data-bs-dismiss="modal"
aria-label="Close"
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"
style="color: black; border: white; background-color: white;">
<span aria-hidden="true">&times;</span>
</button>
@ -303,8 +309,7 @@
<div class="modal-body">
<div class="row ">
<div class="mb-3" style="text-align: center;">
<img src="https://gccservices.in/gcc/files/c_d/otp.png"
width="50%" alt="Mobileotp">
<img src="https://gccservices.in/gcc/files/c_d/otp.png" width="50%" alt="Mobileotp">
</div>
</div>
@ -320,13 +325,11 @@
<div class="row d-flex justify-content-center align-items-center">
<div class="mb-3 ">
<div class="otp-input-box">
<input type="text" maxlength="1" class="otp-input" id="otp1"
required /> <input type="text" maxlength="1"
class="otp-input" id="otp2" required /> <input type="text"
maxlength="1" class="otp-input" id="otp3" required /> <input
<input type="text" maxlength="1" class="otp-input" id="otp1" required /> <input
type="text" maxlength="1" class="otp-input" id="otp2" required /> <input
type="text" maxlength="1" class="otp-input" id="otp3" required /> <input
type="text" maxlength="1" class="otp-input" id="otp4" required />
<input type="text" maxlength="1" class="otp-input" id="otp5"
required />
<input type="text" maxlength="1" class="otp-input" id="otp5" required />
</div>
</div>
</div>
@ -340,39 +343,38 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="but">Verify
OTP</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- jQuery (Only load it once) -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></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>
<!-- 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>
<!-- 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>
<!-- 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 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 th:src="@{/script/loginpage.js}"></script> -->
<script>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
const registerCard = document.querySelector(".register-card");
const loginCard = document.querySelector(".login-card");
@ -399,11 +401,11 @@ document.addEventListener("DOMContentLoaded", function () {
registerCard.style.display = "none";
loginCard.style.display = "block";
});
});
});
$(document).ready(function () {
$(document).ready(function () {
// Show Login Card when "Login" is clicked from Register Card
$('#showLoginCardBtn').on('click', function (e) {
e.preventDefault();
@ -431,7 +433,7 @@ $(document).ready(function () {
startCountdown();
});
});
});
@ -504,7 +506,7 @@ $(document).ready(function () {
// Step 3: Wait for user to manually click Verify inside OTP modal,
// and if successful, call verifyOtp with a callback
$('#but').off('click').on('click', function () {
verifyOtp(2,function () { // 2 is mentioned for new user registration
verifyOtp(2, function () { // 2 is mentioned for new user registration
// Step 4: Save new user only after OTP success
$.ajax({
url: '/crs/api/saveNewUser',
@ -523,7 +525,7 @@ $(document).ready(function () {
$('#name').val('');
$('#phone').val('');
// $('#address').val('');
window.location.href = "/crs/loginpage";
window.location.href = "/crs/death";
});
},
error: function (xhr) {
@ -689,7 +691,7 @@ $(document).ready(function () {
$.ajax({
type: "GET",
url: '/crs/api/verifyOTP',
data: {'otp': otpValue, 'mobNo': mobileNumber, 'flag': flag},
data: { 'otp': otpValue, 'mobNo': mobileNumber, 'flag': flag },
dataType: 'json',
success: function (response) {
@ -833,8 +835,9 @@ $(document).ready(function () {
</script>
</script>
</body>
</html>
Loading…
Cancel
Save