Browse Source

Places API Changes Implementation

master
KaNi-04 2 months ago
parent
commit
74b8c7b775
  1. 549
      src/main/resources/templates/modules/callcenterqaqc/domesticwastecomplaints.html
  2. 563
      src/main/resources/templates/modules/callcenterqaqc/pgrcomplaints.html
  3. 359
      src/main/resources/templates/modules/vendors/streetVendorRequestForm.html
  4. 663
      src/main/resources/templates/modules/vendors/zonerequests.html

549
src/main/resources/templates/modules/callcenterqaqc/domesticwastecomplaints.html

@ -1,93 +1,95 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
</head>
<style>
.required {
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media ( max-width : 767px) {
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width : 767px) {
#complaintform label {
margin-top: 10px;
}
}
}
.form-row {
.form-row {
margin-bottom: 20px;
}
}
.form-step {
.form-step {
display: none;
}
}
.form-step.active {
.form-step.active {
display: block;
}
}
.container {
.container {
max-width: 100%;
}
}
/*css for step 3*/
.complaint-icons {
/*css for step 3*/
.complaint-icons {
display: flex;
justify-content: space-around;
margin-bottom: 20px;
}
}
.complaint-icon {
.complaint-icon {
text-align: center;
cursor: pointer;
}
}
.complaint-icon img {
.complaint-icon img {
width: 50px;
height: 50px;
}
}
.complaint-fields {
.complaint-fields {
display: none;
}
}
.complaint-fields.active {
.complaint-fields.active {
display: block;
}
}
/*for radio button style*/
.radio-group {
/*for radio button style*/
.radio-group {
display: flex;
align-items: center;
/* Ensures all items are aligned to the center */
}
}
.radio-item {
.radio-item {
display: flex;
align-items: center;
margin-right: 20px;
/* Adds space between each radio item */
}
}
.radio-item input[type="radio"] {
.radio-item input[type="radio"] {
margin-right: 10px;
/* Adds space between the radio button and its label */
vertical-align: middle;
/* Ensures vertical alignment */
}
}
.radio-item label {
.radio-item label {
margin: 0;
/* Removes any default margins that might affect alignment */
}
}
.back-button {
.back-button {
background: none;
border: none;
color: #000;
@ -96,17 +98,17 @@
padding: 0;
margin-right: auto;
/* Align the button to the left */
}
}
.title {
.title {
text-align: center;
flex-grow: 1;
font-size: 24px;
font-weight: bold;
margin: 0;
}
}
/*css for map in step2*/
/*css for map in step2*/
#googleMap {
height: 300px;
@ -116,7 +118,7 @@
max-width: 100%;
}
#pac-input {
/* #pac-input {
position: absolute;
top: 10px;
left: 50%;
@ -127,7 +129,7 @@
border: 1px solid #ccc;
background-color: white;
border-radius: 4px;
}
} */
/* Media query for mobile devices */
@ -138,7 +140,7 @@
}
}
#search-container {
/* #search-container {
position: absolute;
top: 10px;
left: 50%;
@ -149,8 +151,7 @@
background-color: white;
border-radius: 4px;
padding: 0;
/* Removed extra padding to match the input width */
}
}*/
#search-box {
width: 100%;
@ -164,7 +165,7 @@
/* Makes sure padding is considered in width */
}
#suggestions {
/* #suggestions {
border: 1px solid #ccc;
border-radius: 4px;
max-height: 200px;
@ -173,9 +174,7 @@
background-color: white;
display: none;
width: 100%;
/* Matches the width of the container and input */
box-sizing: border-box;
/* Ensures the width includes borders and padding */
}
#suggestions ul {
@ -191,15 +190,16 @@
#suggestions ul li:hover {
background-color: #f0f0f0;
}
} */
#reader-btn, #invertColorBtn {
#reader-btn,
#invertColorBtn {
padding: 5px 10px;
font-size: 14px;
cursor: pointer;
}
}
.loader {
.loader {
border: 16px solid #f3f3f3;
/* Light grey */
border-top: 16px solid #3498db;
@ -217,7 +217,7 @@
/* Ensure it's on top of everything */
display: none;
/* Initially hidden */
}
}
.row {
display: flex;
@ -246,18 +246,17 @@
border: 1px solid #ccc;
}
@keyframes spin { 0%
{
@keyframes spin {
0% {
transform: rotate(0deg);
}
}
100%
{
transform:rotate(360deg);
}
}
100% {
transform: rotate(360deg);
}
}
#snackbar {
#snackbar {
visibility: hidden;
min-width: 250px;
background-color: #333;
@ -280,54 +279,131 @@ transform:rotate(360deg);
}
@-webkit-keyframes fadein {from { bottom:0;
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
}
to {
to {
bottom: 30px;
opacity: 1;
}
}
}
@keyframes fadein {from { bottom:0;
}
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
}
to {
to {
bottom: 30px;
opacity: 1;
}
}
}
}
@-webkit-keyframes fadeout {from { bottom:30px;
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
}
to {
to {
bottom: 0;
opacity: 0;
}
}
}
}
@keyframes fadeout {from { bottom:30px;
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
}
to {
to {
bottom: 0;
opacity: 0;
}
}
}
}
.input-error {
.input-error {
border: 1px solid red !important;
}
}
#pac-input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 15px;
box-sizing: border-box;
}
#suggestions {
width: 100%;
display: none;
background: #fff;
border: 1px solid #ccc;
border-top: none;
max-height: 220px;
overflow-y: auto;
box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
#suggestions ul {
margin: 0;
padding: 0;
list-style: none;
}
#suggestions li {
padding: 10px 12px;
cursor: pointer;
border-bottom: 1px solid #eee;
}
#suggestions li:hover {
background: #f5f5f5;
}
#search-container {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 420px;
z-index: 1000;
}
/*for snack bar*/
/*for snack bar*/
</style>
<body>
<div id="snackbar"></div>
<div id="snackbar"></div>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@ -358,7 +434,8 @@ to {
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Sofa Bed Collection</li>
<li class="breadcrumb-item active" aria-current="page">Register Complaint</li>
</ol>
@ -372,8 +449,12 @@ to {
<div class="col-md-12"><span th:text="${userId}" style="display:none;" id="userIdSpan"></span>
<div class="card" style="margin-top: 0px;">
<div class="card-header"><span th:text="${userId}" style="display:none;" id="userIdSpan"></span>
<h3 class="mb-0" style="font-weight: bold;font-size: large;"><span th:text="${agent[0]['agent_name']}" style="font-weight: bold;font-size: large;"></span>'s Sofa Bed Collection Registration</h3>
<div class="card-header"><span th:text="${userId}" style="display:none;"
id="userIdSpan"></span>
<h3 class="mb-0" style="font-weight: bold;font-size: large;"><span
th:text="${agent[0]['agent_name']}"
style="font-weight: bold;font-size: large;"></span>'s Sofa Bed Collection
Registration</h3>
</div>
<div class="card-body">
@ -386,24 +467,24 @@ to {
<h5 class="card-title">1. Personal Details:</h5>
<div class="form-row">
<div class="col-md-4">
<label for="mobile">Mobile Number:<span class="required">*</span></label>
<label for="mobile">Mobile Number:<span
class="required">*</span></label>
<input type="text" id="mobileNo" name="mobileNo"
class="form-control mb-1"
placeholder="Enter Mobile Number" maxlength="10"
required>
class="form-control mb-1" placeholder="Enter Mobile Number"
maxlength="10" required>
</div>
</div>
<div class="form-row">
<div class="col-md-4 mb-2">
<label for="name">Name:<span class="required">*</span></label>
<input type="text" class="form-control" id="name"
placeholder="Enter your name" required >
placeholder="Enter your name" required>
</div>
<div class="col-md-8 mb-2">
<label for="address">Address:<span class="required">*</span></label>
<input type="text" class="form-control" id="address"
placeholder="Enter your Address" required >
placeholder="Enter your Address" required>
</div>
@ -427,14 +508,20 @@ to {
<div class="col-md-12">
<!-- <div id="map"></div> -->
<div id="mapContainer" style="position: relative; height: 500px;" class="mb-4 mt-2">
<input id="pac-input" class="controls" type="text" placeholder="Search location">
<div id="googleMap" style="height: 100%; width: 100%;border:2px solid black;"></div>
</div>
<div id="mapContainer" style="position: relative; height: 500px;"
class="mb-4 mt-2">
<div id="search-container">
<!-- <input type="text" id="search-box" placeholder="Search for a location..."> -->
<input id="pac-input" class="controls" type="text"
placeholder="Search location - please enter minimum of 5 characters">
<div id="suggestions"></div>
</div>
<div id="googleMap"
style="height: 100%; width: 100%;border:2px solid black;"></div>
</div>
<!-- <input type="text" id="search-box" placeholder="Search for a location..."> -->
<div class="row">
<div class="col-md-6 mb-2">
<!-- <label for="street">Street:</label>
@ -449,13 +536,15 @@ to {
<!-- <label for="longitude_field">Longtitude</label>
<input type="text" class="form-control" id="longitude_field" name="longtitude"> -->
<label for="longitude_field">Longtitude</label>
<input type="text" class="form-control" id="longitude_field" readonly>
<input type="text" class="form-control" id="longitude_field"
readonly>
</div>
<div class="col-md-6 mb-2">
<!-- <label for="latitude_field">Latitide</label>
<input type="text" class="form-control" id="latitude_field"> -->
<label for="latitude_field">Latitude</label>
<input type="text" class="form-control" id="latitude_field" readonly>
<input type="text" class="form-control" id="latitude_field"
readonly>
</div>
<div class="col-md-6 mb-2">
<!-- <label for="street_id">Street Id</label>
@ -498,12 +587,18 @@ to {
<div class="complaint-fields active mt-2" id="specific-fields">
<div class="form-row">
<div class="col-md-5">
<label for="specificComplaintType">Select Item Type:<span class="text-danger">*</span></label>
<label for="specificComplaintType">Select Item Type:<span
class="text-danger">*</span></label>
<div class="dropdown">
<button class="btn btn-light border rounded w-100 text-start" type="button" id="complaintDropdownBtn" data-bs-toggle="dropdown" aria-expanded="false">
<button
class="btn btn-light border rounded w-100 text-start"
type="button" id="complaintDropdownBtn"
data-bs-toggle="dropdown" aria-expanded="false">
Click to Select Item Type
</button>
<ul class="dropdown-menu p-3" aria-labelledby="complaintDropdownBtn" style="max-height: 200px; overflow-y: auto; width: 100%;">
<ul class="dropdown-menu p-3"
aria-labelledby="complaintDropdownBtn"
style="max-height: 200px; overflow-y: auto; width: 100%;">
<div id="complaintCheckboxContainer">
<!-- Checkboxes will be loaded here -->
</div>
@ -520,8 +615,10 @@ to {
<div class="row mt-2">
<div class="col-md-12">
<label for="remarks" class="form-label fw-bold">Description:</label>
<textarea id="remarks" class="form-control" rows="4" placeholder="Enter your description here"></textarea>
<label for="remarks"
class="form-label fw-bold">Description:</label>
<textarea id="remarks" class="form-control" rows="4"
placeholder="Enter your description here"></textarea>
</div>
</div>
@ -626,7 +723,8 @@ to {
onclick="prevStep('prevStep4')">Previous</button>
<button id="submitButton" class="btn btn-success float-right">Submit</button>
<button id="submitButton"
class="btn btn-success float-right">Submit</button>
</div>
</div>
@ -648,7 +746,8 @@ to {
</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 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>
@ -689,7 +788,7 @@ to {
var snackbar = document.getElementById("snackbar");
snackbar.innerHTML = message;
snackbar.className = "show";
setTimeout(function () {snackbar.className = snackbar.className.replace("show", "");}, 3000);
setTimeout(function () { snackbar.className = snackbar.className.replace("show", ""); }, 3000);
}
$(document).ready(function () {
@ -710,7 +809,20 @@ to {
});
});
function validateName(){
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
function validateName() {
const $inputname = $('#name');
const namefield = $('#name').val().trim();
@ -824,11 +936,11 @@ to {
const name = $('#name').val().trim();
const address=$('#address').val().trim();
const address = $('#address').val().trim();
console.log("mobileNo"+mobileNo);
console.log("name="+name);
console.log("address="+address);
console.log("mobileNo" + mobileNo);
console.log("name=" + name);
console.log("address=" + address);
// Validate mobile number
@ -866,19 +978,19 @@ to {
return false;
}
if(!address){
if (!address) {
showSnackbar("Please enter your address.");
return false;
}
} else if (step === 2) {
const streets = $('#streetName option:selected').val();
console.log("streets="+streets);
console.log("streets=" + streets);
const longitude = $('#longitude_field').val();
const latitude = $('#latitude_field').val();
const streetId = $('#streetId').val();
const landmark = $('#landmark').val();
const stepzone= $('#zone').val();
const stepzone = $('#zone').val();
const stepward = $('#ward').val();
@ -928,7 +1040,7 @@ to {
}
}
else if (step === 3){
else if (step === 3) {
// Get all checked checkboxes
const checkedBoxes = $(".compCheckbox:checked");
@ -981,7 +1093,7 @@ to {
const name = $('#name').val();
const street = $('#streetName option:selected').text();
const mobileNo = $('#mobileNo').val();
const compaddress=$('#address').val().trim();
const compaddress = $('#address').val().trim();
const complaintDetails = $('#remarks').val(); // Others complaint details
//$('#summaryComplaintTitle').text(complaintTitle);
@ -1006,7 +1118,7 @@ to {
$('#summaryLongitude').text(longtitude);
const summaryzone= $('#zone').val();
const summaryzone = $('#zone').val();
const summaryward = $('#ward').val();
$('#summaryZone').text(summaryzone);
$('#summaryWard').text(summaryward);
@ -1082,41 +1194,167 @@ to {
const infowindow = new google.maps.InfoWindow();
// 🔍 Initialize the SearchBox
const input = document.getElementById('pac-input');
const searchBox = new google.maps.places.SearchBox(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// const input = document.getElementById('pac-input');
// const searchBox = new google.maps.places.SearchBox(input);
// //map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// map.addListener('bounds_changed', function () {
// searchBox.setBounds(map.getBounds());
// });
// searchBox.addListener('places_changed', function () {
// const places = searchBox.getPlaces();
// if (places.length === 0) return;
// if (marker) marker.setMap(null);
// const place = places[0];
// if (!place.geometry) return;
// marker = new google.maps.Marker({
// map: map,
// position: place.geometry.location
// });
// const lat = place.geometry.location.lat().toFixed(6);
// const lng = place.geometry.location.lng().toFixed(6);
// document.getElementById("latitude_field").value = lat;
// document.getElementById("longitude_field").value = lng;
// map.setCenter(place.geometry.location);
// map.setZoom(15);
// infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
// infowindow.open(map, marker);
// fetchStreets(lat, lng);
// });
const input = document.getElementById("pac-input");
const suggestions = document.getElementById("suggestions");
const autocompleteService = new google.maps.places.AutocompleteService();
const placesService = new google.maps.places.PlacesService(map);
let debounceTimer = null;
input.addEventListener("input", function () {
clearTimeout(debounceTimer);
const query = this.value.trim();
// Hide suggestions
if (query.length < 5) {
suggestions.style.display = "none";
suggestions.innerHTML = "";
return;
}
debounceTimer = setTimeout(function () {
autocompleteService.getPlacePredictions({
input: query,
bounds: map.getBounds()
}, showPredictions);
}, 500);
map.addListener('bounds_changed', function () {
searchBox.setBounds(map.getBounds());
});
searchBox.addListener('places_changed', function () {
const places = searchBox.getPlaces();
if (places.length === 0) return;
function showPredictions(predictions, status) {
if (marker) marker.setMap(null);
const place = places[0];
if (!place.geometry) return;
suggestions.innerHTML = "";
if (
status !== google.maps.places.PlacesServiceStatus.OK ||
!predictions ||
predictions.length === 0
) {
suggestions.style.display = "none";
return;
}
const ul = document.createElement("ul");
predictions.forEach(function (prediction) {
const li = document.createElement("li");
li.innerHTML = prediction.description;
li.onclick = function () {
input.value = prediction.description;
suggestions.style.display = "none";
loadPlace(prediction.place_id);
};
ul.appendChild(li);
});
suggestions.appendChild(ul);
suggestions.style.display = "block";
}
function loadPlace(placeId) {
placesService.getDetails({
placeId: placeId,
fields: [
"geometry",
"formatted_address",
"name"
]
}, function (place, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK)
return;
if (marker)
marker.setMap(null);
marker = new google.maps.Marker({
map: map,
position: place.geometry.location
});
const lat = place.geometry.location.lat().toFixed(6);
const lng = place.geometry.location.lng().toFixed(6);
document.getElementById("latitude_field").value = lat;
document.getElementById("longitude_field").value = lng;
map.setCenter(place.geometry.location);
map.setZoom(15);
infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
infowindow.setContent(
"Latitude : " + lat +
"<br>Longitude : " + lng
);
infowindow.open(map, marker);
fetchStreets(lat, lng);
});
}
map.addListener("click", function (event) {
const clickedLatLng = event.latLng;
if (marker) marker.setMap(null);
@ -1204,7 +1442,7 @@ to {
if (selectedIndex !== "") {
const selectedStreet = streetsList[selectedIndex];
console.log("selectedStreet.new_zone==="+selectedStreet.new_zone);
console.log("selectedStreet.new_zone===" + selectedStreet.new_zone);
document.getElementById("streetId").value = selectedStreet.road_id;
document.getElementById("landmark").value = selectedStreet.type;
@ -1219,7 +1457,7 @@ to {
document.getElementById("ward").value = "";
}
});
}
}
function fetchSuggestions(query) {
// ArcGIS API URL to fetch suggestions based on the input query
const arcgisSuggestionUrl = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/Hosted/Road_API/FeatureServer/0/query?where=UPPER(road_name)%20LIKE%20'%25${query.toUpperCase()}%25'&outFields=road_name,zone,ward,road_id&returnGeometry=true&f=geojson`;
@ -1281,7 +1519,7 @@ to {
//document.getElementById("street_id").value = roadId;
document.getElementById("streetId").value = roadId;
document.getElementById("landmark").value = roadName;
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
} else {
document.getElementById("street").value = "No road data found for this location";
document.getElementById("latitude_field").value = "No latitude data found for this location";
@ -1290,12 +1528,12 @@ to {
document.getElementById("streetId").value = "No street id data found for this location";
document.getElementById("landmark").value = "No landmark data found for this location";
info = `No road data found for this location`
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
}
})
.catch(error => {
console.error('Error fetching road data:', error);
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, { permanent: false, direction: 'top' }).openTooltip();
});
}
@ -1323,7 +1561,7 @@ to {
//document.getElementById("street_id").value = roadId;
document.getElementById("streetId").value = roadId;
document.getElementById("landmark").value = roadName;
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
} else {
document.getElementById("street").value = suggestedRoadName;
document.getElementById("latitude_field").value = lat;
@ -1332,12 +1570,12 @@ to {
document.getElementById("streetId").value = suggestedRoadId;
document.getElementById("landmark").value = suggestedRoadName;
info = `Road Name: ${suggestedRoadName}<br>Zone: ${suggestedZone}<br>Ward: ${suggestedWard}<br>Latitude: ${lat}<br>Longitude: ${lng}`
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
}
})
.catch(error => {
console.error('Error fetching road data:', error);
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, { permanent: false, direction: 'top' }).openTooltip();
});
}
@ -1351,15 +1589,15 @@ to {
var complainantName = $('#summaryName').text().trim();
var complainantStreet = $('#summaryStreet').text().trim();
var mobileNo = $('#summaryMobile').text().trim();
var useraddress=$('#summaryAddress').text().trim();
var useraddress = $('#summaryAddress').text().trim();
var complaintDetails = $('#summaryDescription').text().trim();
var streetId = $('#summaryStreetId').text().trim();
var landmark = $('#summaryLandmark').text().trim();
var latitude = $('#summaryLatitude').text().trim();
var longtitude = $('#summaryLongitude').text().trim(); // Note the misspelling
var zone=$('#summaryZone').text().trim();
var ward=$('#summaryWard').text().trim();
var zone = $('#summaryZone').text().trim();
var ward = $('#summaryWard').text().trim();
var userId = document.getElementById('userIdSpan').textContent;
@ -1414,13 +1652,13 @@ to {
mobile: mobileNo,
remarks: complaintDetails,
street_id: streetId,
street_name:complainantStreet,
street_name: complainantStreet,
latitude: latitude,
longtitude: longtitude,
itemsJson:itemsJson,
userId:userId,
zone:zone,
ward:ward
itemsJson: itemsJson,
userId: userId,
zone: zone,
ward: ward
});
// AJAX call to your backend controller
@ -1433,13 +1671,13 @@ to {
mobile: mobileNo,
remarks: complaintDetails,
street_id: streetId,
street_name:complainantStreet,
street_name: complainantStreet,
latitude: latitude,
longitude: longtitude,
items: itemsJson,
userId:userId,
zone:zone,
ward:ward
userId: userId,
zone: zone,
ward: ward
},
success: function (response) {
$('#submitButton').prop('disabled', false).text('Submit');
@ -1576,4 +1814,5 @@ to {
</script>
</body>
</html>

563
src/main/resources/templates/modules/callcenterqaqc/pgrcomplaints.html

@ -1,93 +1,95 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}">
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
</head>
<style>
.required {
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media ( max-width : 767px) {
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width : 767px) {
#complaintform label {
margin-top: 10px;
}
}
}
.form-row {
.form-row {
margin-bottom: 20px;
}
}
.form-step {
.form-step {
display: none;
}
}
.form-step.active {
.form-step.active {
display: block;
}
}
.container {
.container {
max-width: 100%;
}
}
/*css for step 3*/
.complaint-icons {
/*css for step 3*/
.complaint-icons {
display: flex;
justify-content: space-around;
margin-bottom: 20px;
}
}
.complaint-icon {
.complaint-icon {
text-align: center;
cursor: pointer;
}
}
.complaint-icon img {
.complaint-icon img {
width: 50px;
height: 50px;
}
}
.complaint-fields {
.complaint-fields {
display: none;
}
}
.complaint-fields.active {
.complaint-fields.active {
display: block;
}
}
/*for radio button style*/
.radio-group {
/*for radio button style*/
.radio-group {
display: flex;
align-items: center;
/* Ensures all items are aligned to the center */
}
}
.radio-item {
.radio-item {
display: flex;
align-items: center;
margin-right: 20px;
/* Adds space between each radio item */
}
}
.radio-item input[type="radio"] {
.radio-item input[type="radio"] {
margin-right: 10px;
/* Adds space between the radio button and its label */
vertical-align: middle;
/* Ensures vertical alignment */
}
}
.radio-item label {
.radio-item label {
margin: 0;
/* Removes any default margins that might affect alignment */
}
}
.back-button {
.back-button {
background: none;
border: none;
color: #000;
@ -96,17 +98,17 @@
padding: 0;
margin-right: auto;
/* Align the button to the left */
}
}
.title {
.title {
text-align: center;
flex-grow: 1;
font-size: 24px;
font-weight: bold;
margin: 0;
}
}
/*css for map in step2*/
/*css for map in step2*/
#googleMap {
height: 300px;
@ -116,7 +118,7 @@
max-width: 100%;
}
#pac-input {
/* #pac-input {
position: absolute;
top: 10px;
left: 50%;
@ -127,7 +129,7 @@
border: 1px solid #ccc;
background-color: white;
border-radius: 4px;
}
} */
/* Media query for mobile devices */
@ -138,7 +140,7 @@
}
}
#search-container {
/* #search-container {
position: absolute;
top: 10px;
left: 50%;
@ -149,7 +151,18 @@
background-color: white;
border-radius: 4px;
padding: 0;
/* Removed extra padding to match the input width */
} */
#search-container {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 420px;
z-index: 1000;
}
#search-box {
@ -164,18 +177,17 @@
/* Makes sure padding is considered in width */
}
#suggestions {
/* #suggestions {
border: 1px solid #ccc;
border-radius: 4px;
max-height: 200px;
overflow-y: auto;
margin-top: 5px;
background-color: white;
display: none;
width: 100%;
/* Matches the width of the container and input */
box-sizing: border-box;
/* Ensures the width includes borders and padding */
}
#suggestions ul {
@ -191,15 +203,16 @@
#suggestions ul li:hover {
background-color: #f0f0f0;
}
} */
#reader-btn, #invertColorBtn {
#reader-btn,
#invertColorBtn {
padding: 5px 10px;
font-size: 14px;
cursor: pointer;
}
}
.loader {
.loader {
border: 16px solid #f3f3f3;
/* Light grey */
border-top: 16px solid #3498db;
@ -217,7 +230,7 @@
/* Ensure it's on top of everything */
display: none;
/* Initially hidden */
}
}
.row {
display: flex;
@ -246,18 +259,17 @@
border: 1px solid #ccc;
}
@keyframes spin { 0%
{
@keyframes spin {
0% {
transform: rotate(0deg);
}
}
100%
{
transform:rotate(360deg);
}
}
100% {
transform: rotate(360deg);
}
}
#snackbar {
#snackbar {
visibility: hidden;
min-width: 250px;
background-color: #333;
@ -280,54 +292,119 @@ transform:rotate(360deg);
}
@-webkit-keyframes fadein {from { bottom:0;
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
}
to {
to {
bottom: 30px;
opacity: 1;
}
}
}
}
@keyframes fadein {from { bottom:0;
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
}
to {
to {
bottom: 30px;
opacity: 1;
}
}
}
}
@-webkit-keyframes fadeout {from { bottom:30px;
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
}
to {
to {
bottom: 0;
opacity: 0;
}
}
}
@keyframes fadeout {from { bottom:30px;
}
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
}
to {
to {
bottom: 0;
opacity: 0;
}
}
}
}
.input-error {
.input-error {
border: 1px solid red !important;
}
}
#pac-input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 15px;
box-sizing: border-box;
}
#suggestions {
width: 100%;
display: none;
background: #fff;
border: 1px solid #ccc;
border-top: none;
max-height: 220px;
overflow-y: auto;
box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
#suggestions ul {
margin: 0;
padding: 0;
list-style: none;
}
#suggestions li {
padding: 10px 12px;
cursor: pointer;
/*for snack bar*/
border-bottom: 1px solid #eee;
}
#suggestions li:hover {
background: #f5f5f5;
}
/*for snack bar*/
</style>
<body>
<div id="snackbar"></div>
<div id="snackbar"></div>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
@ -358,9 +435,11 @@ to {
<div class="col-lg-4">
<nav class="breadcrumb-container" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
<li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a>
</li>
<li class="breadcrumb-item" aria-current="page">Register Complaint</li>
<li class="breadcrumb-item active" aria-current="page">Complaint Registration</li>
<li class="breadcrumb-item active" aria-current="page">Complaint Registration
</li>
</ol>
</nav>
</div>
@ -372,8 +451,12 @@ to {
<div class="col-md-12"><span th:text="${userId}" style="display:none;" id="userIdSpan"></span>
<div class="card" style="margin-top: 0px;">
<div class="card-header"><span th:text="${userId}" style="display:none;" id="userIdSpan"></span>
<h3 class="mb-0" style="font-weight: bold;font-size: large;"><span th:text="${agent[0]['agent_name']}" style="font-weight: bold;font-size: large;"></span>'s Complaints Registration</h3>
<div class="card-header"><span th:text="${userId}" style="display:none;"
id="userIdSpan"></span>
<h3 class="mb-0" style="font-weight: bold;font-size: large;"><span
th:text="${agent[0]['agent_name']}"
style="font-weight: bold;font-size: large;"></span>'s Complaints
Registration</h3>
</div>
<div class="card-body">
@ -386,42 +469,42 @@ to {
<h5 class="card-title">1. Complaining Person's Details:</h5>
<div class="form-row">
<div class="col-md-4">
<label for="mobile">Mobile Number:<span class="required">*</span></label>
<label for="mobile">Mobile Number:<span
class="required">*</span></label>
<input type="text" id="mobileNo" name="mobileNo"
class="form-control mb-1"
placeholder="Enter Mobile Number" maxlength="10"
required>
class="form-control mb-1" placeholder="Enter Mobile Number"
maxlength="10" required>
</div>
</div>
<div class="form-row">
<div class="col-md-4 mb-2">
<label for="name">Name:<span class="required">*</span></label>
<input type="text" class="form-control" id="name"
placeholder="Enter your name" required >
placeholder="Enter your name" required>
</div>
<div class="col-md-4 mb-2">
<label for="email">Email:</label> <input type="email"
class="form-control" id="email"
placeholder="Enter your email">
class="form-control" id="email" placeholder="Enter your email">
</div>
<div class="col-md-4 mb-2">
<label for="gender" >Gender/பாலினம்:<span
<label for="gender">Gender/பாலினம்:<span
class="required">*</span></label>
<div class="radio-group mt-2 ">
<div class="radio-item">
<input type="radio" id="male" name="gender" value="male"
> <label for="male">Male</label>
<input type="radio" id="male" name="gender" value="male"> <label
for="male">Male</label>
</div>
<div class="radio-item">
<input type="radio" id="female" name="gender"
value="female"> <label for="female">Female</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label>
</div>
<div class="radio-item">
<input type="radio" id="transgender" name="gender"
value="transgender"> <label for="transgender">Transgender</label>
value="transgender"> <label
for="transgender">Transgender</label>
</div>
</div>
</div>
@ -445,14 +528,17 @@ to {
<div class="col-md-12">
<!-- <div id="map"></div> -->
<div id="mapContainer" style="position: relative; height: 500px;" class="mb-4 mt-2">
<input id="pac-input" class="controls" type="text" placeholder="Search location">
<div id="googleMap" style="height: 100%; width: 100%;border:2px solid black;"></div>
</div>
<div id="mapContainer" style="position: relative; height: 500px;"
class="mb-4 mt-2">
<div id="search-container">
<!-- <input type="text" id="search-box" placeholder="Search for a location..."> -->
<input id="pac-input" class="controls" type="text"
placeholder="Search location - please enter minimum of 5 characters">
<div id="suggestions"></div>
</div>
<div id="googleMap"
style="height: 100%; width: 100%;border:2px solid black;">
</div>
</div>
<div class="row">
<div class="col-md-6 mb-2">
<!-- <label for="street">Street:</label>
@ -467,13 +553,15 @@ to {
<!-- <label for="longitude_field">Longtitude</label>
<input type="text" class="form-control" id="longitude_field" name="longtitude"> -->
<label for="longitude_field">Longtitude</label>
<input type="text" class="form-control" id="longitude_field" readonly>
<input type="text" class="form-control" id="longitude_field"
readonly>
</div>
<div class="col-md-6 mb-2">
<!-- <label for="latitude_field">Latitide</label>
<input type="text" class="form-control" id="latitude_field"> -->
<label for="latitude_field">Latitude</label>
<input type="text" class="form-control" id="latitude_field" readonly>
<input type="text" class="form-control" id="latitude_field"
readonly>
</div>
<div class="col-md-6 mb-2">
<!-- <label for="street_id">Street Id</label>
@ -508,7 +596,8 @@ to {
<!-- Step 3 -->
<div class=" form-step active readable" id="step-3">
<div class="card-body">
<h5 class="card-title">3. Complaint Type:&nbsp;<span>(Please Select Complaint Type from Below...)</span></h5>
<h5 class="card-title">3. Complaint Type:&nbsp;<span>(Please Select
Complaint Type from Below...)</span></h5>
<!-- Icons -->
<!-- <div class="complaint-icons">
@ -614,23 +703,29 @@ to {
</select>
</div>
<div class="col-md-6">
<label for="specificComplaintSubType">Complaint Sub-Type:</label>
<select class="form-control" id="specificComplaintSubType" disabled>
<label for="specificComplaintSubType">Complaint
Sub-Type:</label>
<select class="form-control" id="specificComplaintSubType"
disabled>
<option value="">-- Select Complaint Sub-Type --</option>
</select>
</div>
</div>
<div class="form-row">
<div class="col-md-6">
<label for="specificComplaintDetails">Details of Complaint:</label>
<textarea class="form-control" id="specificComplaintDetails" rows="3"
placeholder="Enter complaint details" maxlength="400"></textarea>
<label for="specificComplaintDetails">Details of
Complaint:</label>
<textarea class="form-control" id="specificComplaintDetails"
rows="3" placeholder="Enter complaint details"
maxlength="400"></textarea>
</div>
<div class="col-md-6">
<label for="specificComplaintImage">Upload Photo:
<p style="color: orange;">Note: Upload Photo Less Than 1MB.</p>
<p style="color: orange;">Note: Upload Photo Less Than 1MB.
</p>
</label>
<input type="file" class="form-control" id="specificComplaintImage" name="Comp_Image"
<input type="file" class="form-control"
id="specificComplaintImage" name="Comp_Image"
accept="image/*">
</div>
</div>
@ -640,8 +735,8 @@ to {
<div class="complaint-fields" id="others-fields">
<div class="form-row">
<div class="col-md-4">
<label for="type">Type:</label> <select
class="form-control" id="type">
<label for="type">Type:</label> <select class="form-control"
id="type">
<option value="">Please Select</option>
</select>
</div>
@ -663,9 +758,9 @@ to {
<div class="col-md-6">
<label for="othercomplaintdetailsss">Details of
Complaint:</label>
<textarea class="form-control"
id="othercomplaintdetailsss" rows="3"
placeholder="Enter complaint details" maxlength="400"></textarea>
<textarea class="form-control" id="othercomplaintdetailsss"
rows="3" placeholder="Enter complaint details"
maxlength="400"></textarea>
</div>
</div>
</div>
@ -674,7 +769,6 @@ to {
<button id="prevStep3" class="btn btn-secondary"
onclick="prevStep('prevStep3')">Previous</button>
<button id="nextStep3" class="btn btn-primary float-right"
style="background-color: #414f69;">Next</button>
</div>
</div>
@ -723,9 +817,8 @@ to {
</tr>
<tr>
<td><strong>Image / Video</strong></td>
<td>: <img id="summaryImage" src="#"
alt="Uploaded Image/Video" width="100"
style="display: none;">
<td>: <img id="summaryImage" src="#" alt="Uploaded Image/Video"
width="100" style="display: none;">
</td>
</tr>
</tbody>
@ -737,7 +830,8 @@ to {
onclick="prevStep('prevStep4')">Previous</button>
<button id="submitButton" class="btn btn-success float-right">Submit</button>
<button id="submitButton"
class="btn btn-success float-right">Submit</button>
</div>
</div>
@ -759,7 +853,8 @@ to {
</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 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>
@ -797,7 +892,7 @@ to {
var snackbar = document.getElementById("snackbar");
snackbar.innerHTML = message;
snackbar.className = "show";
setTimeout(function () {snackbar.className = snackbar.className.replace("show", "");}, 3000);
setTimeout(function () { snackbar.className = snackbar.className.replace("show", ""); }, 3000);
}
$(document).ready(function () {
@ -818,7 +913,7 @@ to {
});
});
function validateName(){
function validateName() {
const $inputname = $('#name');
const namefield = $('#name').val().trim();
@ -933,10 +1028,10 @@ to {
const name = $('#name').val().trim();
let email = $('#email').val().trim();
console.log("mobileNo"+mobileNo);
console.log("gender="+gender);
console.log("name="+name);
console.log("email="+email);
console.log("mobileNo" + mobileNo);
console.log("gender=" + gender);
console.log("name=" + name);
console.log("email=" + email);
// Validate mobile number
if (mobileNo === '' || !/^\d{10}$/.test(mobileNo)) {
@ -989,7 +1084,7 @@ to {
}
} else if (step === 2) {
const streets = $('#streetName option:selected').val();
console.log("streets="+streets);
console.log("streets=" + streets);
const longitude = $('#longitude_field').val();
const latitude = $('#latitude_field').val();
const streetId = $('#streetId').val();
@ -1100,7 +1195,7 @@ to {
// If there's a separate image input for the specific form, handle it similarly:
// Check if specific fields section is active
// if ($('#specific-fields').hasClass('active')) {
// if ($('#specific-fields').hasClass('active')) {
const specificFileInput = $('#specificComplaintImage')[0]; // Example ID for specific form
if (specificFileInput.files && specificFileInput.files[0]) {
const reader = new FileReader();
@ -1111,7 +1206,7 @@ to {
} else {
$('#summaryImage').hide(); // Hide the image if no file is selected
}
// }
// }
// Check if "Others" section is active
if ($('#others-fields').hasClass('active')) {
const fileInput = $('#uploadothers')[0]; // Assuming this is for the "Others" section
@ -1171,13 +1266,26 @@ to {
}); */
});
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
//for complaint group and complainttype wise options dropdown api
/* $(document).ready(function () {
/* $(document).ready(function () {
const $type = $('#type');
const $subType = $('#sub-type');
@ -1301,41 +1409,167 @@ to {
const infowindow = new google.maps.InfoWindow();
// 🔍 Initialize the SearchBox
const input = document.getElementById('pac-input');
const searchBox = new google.maps.places.SearchBox(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// const input = document.getElementById('pac-input');
// const searchBox = new google.maps.places.SearchBox(input);
// //map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// map.addListener('bounds_changed', function () {
// searchBox.setBounds(map.getBounds());
// });
// searchBox.addListener('places_changed', function () {
// const places = searchBox.getPlaces();
// if (places.length === 0) return;
// if (marker) marker.setMap(null);
// const place = places[0];
// if (!place.geometry) return;
// marker = new google.maps.Marker({
// map: map,
// position: place.geometry.location
// });
// const lat = place.geometry.location.lat().toFixed(6);
// const lng = place.geometry.location.lng().toFixed(6);
// document.getElementById("latitude_field").value = lat;
// document.getElementById("longitude_field").value = lng;
// map.setCenter(place.geometry.location);
// map.setZoom(15);
// infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
// infowindow.open(map, marker);
// fetchStreets(lat, lng);
// });
const input = document.getElementById("pac-input");
const suggestions = document.getElementById("suggestions");
const autocompleteService = new google.maps.places.AutocompleteService();
const placesService = new google.maps.places.PlacesService(map);
let debounceTimer = null;
input.addEventListener("input", function () {
clearTimeout(debounceTimer);
const query = this.value.trim();
// Hide suggestions
if (query.length < 5) {
suggestions.style.display = "none";
suggestions.innerHTML = "";
return;
}
debounceTimer = setTimeout(function () {
autocompleteService.getPlacePredictions({
input: query,
bounds: map.getBounds()
}, showPredictions);
}, 500);
map.addListener('bounds_changed', function () {
searchBox.setBounds(map.getBounds());
});
searchBox.addListener('places_changed', function () {
const places = searchBox.getPlaces();
if (places.length === 0) return;
function showPredictions(predictions, status) {
if (marker) marker.setMap(null);
const place = places[0];
if (!place.geometry) return;
suggestions.innerHTML = "";
if (
status !== google.maps.places.PlacesServiceStatus.OK ||
!predictions ||
predictions.length === 0
) {
suggestions.style.display = "none";
return;
}
const ul = document.createElement("ul");
predictions.forEach(function (prediction) {
const li = document.createElement("li");
li.innerHTML = prediction.description;
li.onclick = function () {
input.value = prediction.description;
suggestions.style.display = "none";
loadPlace(prediction.place_id);
};
ul.appendChild(li);
});
suggestions.appendChild(ul);
suggestions.style.display = "block";
}
function loadPlace(placeId) {
placesService.getDetails({
placeId: placeId,
fields: [
"geometry",
"formatted_address",
"name"
]
}, function (place, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK)
return;
if (marker)
marker.setMap(null);
marker = new google.maps.Marker({
map: map,
position: place.geometry.location
});
const lat = place.geometry.location.lat().toFixed(6);
const lng = place.geometry.location.lng().toFixed(6);
document.getElementById("latitude_field").value = lat;
document.getElementById("longitude_field").value = lng;
map.setCenter(place.geometry.location);
map.setZoom(15);
infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
infowindow.setContent(
"Latitude : " + lat +
"<br>Longitude : " + lng
);
infowindow.open(map, marker);
fetchStreets(lat, lng);
});
}
map.addListener("click", function (event) {
const clickedLatLng = event.latLng;
if (marker) marker.setMap(null);
@ -1434,7 +1668,7 @@ to {
// document.getElementById("ward").value = "";
}
});
}
}
function fetchSuggestions(query) {
// ArcGIS API URL to fetch suggestions based on the input query
const arcgisSuggestionUrl = `https://gisgcc.chennaicorporation.gov.in/server/rest/services/Hosted/Road_API/FeatureServer/0/query?where=UPPER(road_name)%20LIKE%20'%25${query.toUpperCase()}%25'&outFields=road_name,zone,ward,road_id&returnGeometry=true&f=geojson`;
@ -1496,7 +1730,7 @@ to {
//document.getElementById("street_id").value = roadId;
document.getElementById("streetId").value = roadId;
document.getElementById("landmark").value = roadName;
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
} else {
document.getElementById("street").value = "No road data found for this location";
document.getElementById("latitude_field").value = "No latitude data found for this location";
@ -1505,12 +1739,12 @@ to {
document.getElementById("streetId").value = "No street id data found for this location";
document.getElementById("landmark").value = "No landmark data found for this location";
info = `No road data found for this location`
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
}
})
.catch(error => {
console.error('Error fetching road data:', error);
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, { permanent: false, direction: 'top' }).openTooltip();
});
}
@ -1536,7 +1770,7 @@ to {
//document.getElementById("street_id").value = roadId;
document.getElementById("streetId").value = roadId;
document.getElementById("landmark").value = roadName;
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
} else {
document.getElementById("street").value = suggestedRoadName;
document.getElementById("latitude_field").value = lat;
@ -1545,12 +1779,12 @@ to {
document.getElementById("streetId").value = suggestedRoadId;
document.getElementById("landmark").value = suggestedRoadName;
info = `Road Name: ${suggestedRoadName}<br>Zone: ${suggestedZone}<br>Ward: ${suggestedWard}<br>Latitude: ${lat}<br>Longitude: ${lng}`
marker.bindTooltip(info, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(info, { permanent: false, direction: 'top' }).openTooltip();
}
})
.catch(error => {
console.error('Error fetching road data:', error);
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, {permanent: false, direction: 'top'}).openTooltip();
marker.bindTooltip(`Error fetching road data.<br>Latitude: ${lat}<br>Longitude: ${lng}`, { permanent: false, direction: 'top' }).openTooltip();
});
}
@ -1590,7 +1824,7 @@ to {
longtitude: longtitude,
Landmark: landmark,
gender: gender,
userId:userId
userId: userId
});
// AJAX call to your backend controller
@ -1611,7 +1845,7 @@ to {
longtitude: longtitude,
Landmark: landmark,
gender: gender,
userId:userId
userId: userId
},
success: function (response) {
$('#submitButton').prop('disabled', false).text('Submit');
@ -2021,7 +2255,7 @@ to {
let complaintTitle = '';
const selectedGroupId1 = $(specificComplaintType).val();
const selectedSubGroupId1=$(specificComplaintSubType).val();
const selectedSubGroupId1 = $(specificComplaintSubType).val();
if (!selectedGroupId1) {
Swal.fire({
@ -2048,7 +2282,7 @@ to {
const mobileNo = $('#mobileNo').val().trim();
const streetName = $('#streetName option:selected').text().trim().toLowerCase();
/* if (shareMobile === 'no' || mobileNo === '') {
/* if (shareMobile === 'no' || mobileNo === '') {
nextStep(); // Skip duplicate check if mobile not shared
return;
} */
@ -2142,4 +2376,5 @@ to {
/* html: `Your complaint has been submitted successfully. Your Complaint Number is <strong>${complaintNumber}</strong>. It will be sent to your mobile number.`, */
</script>
</body>
</html>

359
src/main/resources/templates/modules/vendors/streetVendorRequestForm.html

@ -150,7 +150,7 @@
max-width: 100%;
}
#pac-input {
/* #pac-input {
position: absolute;
top: 10px;
left: 50%;
@ -161,9 +161,9 @@
border: 1px solid #ccc;
background-color: white;
border-radius: 4px;
}
} */
#search-container {
/* #search-container {
position: absolute;
top: 10px;
left: 50%;
@ -174,8 +174,7 @@
background-color: white;
border-radius: 4px;
padding: 0;
/* Removed extra padding to match the input width */
}
} */
#search-box {
width: 100%;
@ -189,7 +188,7 @@
/* Makes sure padding is considered in width */
}
#suggestions {
/* #suggestions {
border: 1px solid #ccc;
border-radius: 4px;
max-height: 200px;
@ -198,9 +197,7 @@
background-color: white;
display: none;
width: 100%;
/* Matches the width of the container and input */
box-sizing: border-box;
/* Ensures the width includes borders and padding */
}
#suggestions ul {
@ -216,7 +213,7 @@
#suggestions ul li:hover {
background-color: #f0f0f0;
}
} */
.section-notes {
padding: 20px;
@ -241,6 +238,71 @@
font-size: 13px;
line-height: 1.4;
}
#pac-input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 15px;
box-sizing: border-box;
}
#suggestions {
width: 100%;
display: none;
background: #fff;
border: 1px solid #ccc;
border-top: none;
max-height: 220px;
overflow-y: auto;
box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
#suggestions ul {
margin: 0;
padding: 0;
list-style: none;
}
#suggestions li {
padding: 10px 12px;
cursor: pointer;
border-bottom: 1px solid #eee;
}
#suggestions li:hover {
background: #f5f5f5;
}
#search-container {
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 420px;
z-index: 1000;
}
</style>
<body>
@ -293,13 +355,15 @@
<h5>Business Details | வியாபார விவரங்கள்</h5>
</div>
<div id="mapContainer" style="position: relative; height: 500px;">
<input id="pac-input" class="controls" type="text" placeholder="Search location">
<div id="googleMap" style="height: 90%; width: 100%;"></div>
</div>
<div id="search-container">
<!-- <input type="text" id="search-box" placeholder="Search for a location..."> -->
<input id="pac-input" class="controls" type="text"
placeholder="Search location - please enter minimum of 5 characters">
<div id="suggestions"></div>
</div>
<div id="googleMap" style="height: 90%; width: 100%;"></div>
</div>
<div class="row mb-3">
<div class="col-md-6">
@ -360,12 +424,14 @@
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Landmark (maximum 255 characters)<span class="text-danger">*</span></label>
<textarea class="form-control" id="landmark" name="landmark"
maxlength="255" required="required"></textarea>
<label class="form-label">Landmark (maximum 255 characters)<span
class="text-danger">*</span></label>
<textarea class="form-control" id="landmark" name="landmark" maxlength="255"
required="required"></textarea>
</div>
<div class="col-md-6">
<label class="form-label">விற்பனை பகுதி<span class="text-danger">*</span></label>
<label class="form-label">விற்பனை பகுதி<span
class="text-danger">*</span></label>
<textarea class="form-control" id="landmark_tamil" name="landmark_tamil"
placeholder="தமிழில் பதிவு செய்யவும்" required="required"></textarea>
</div>
@ -375,12 +441,14 @@
<label class="form-label">District<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="vendor_district"
name="vendor_district"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required="required">
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')"
required="required">
</div>
<div class="col-md-6">
<label class="form-label"> மாவட்டம்<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="vendor_district_tamil"
name="vendor_district_tamil" placeholder="தமிழில் பதிவு செய்யவும்" required="required">
name="vendor_district_tamil" placeholder="தமிழில் பதிவு செய்யவும்"
required="required">
</div>
</div>
@ -397,7 +465,8 @@
<div class="row mb-3">
<div class="col-md-6">
<label for="businesstype" class="form-label">Type of Business <span class="text-danger">*</span>
<label for="businesstype" class="form-label">Type of Business <span
class="text-danger">*</span>
</label>
<select id="businesstype" name="businesstype" class="form-control" required>
<option value="">-- Select Business Type --</option>
@ -428,7 +497,8 @@
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Business Space (Sq ft)| வியாபார இடம்<span class="text-danger">*</span> </label>
<label class="form-label">Business Space (Sq ft)| வியாபார இடம்<span
class="text-danger">*</span> </label>
<input type="text" class="form-control" id="business_space"
name="business_space" required="required">
</div>
@ -466,9 +536,11 @@
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Profile Image (jpg/jpeg/pdf)<span class="text-danger">*</span></label>
<label class="form-label">Profile Image (jpg/jpeg/pdf)<span
class="text-danger">*</span></label>
<input type="file" class="form-control" id="profileimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage" required="required">
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage"
required="required">
</div>
</div>
<div class="row mb-3">
@ -485,14 +557,18 @@
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Father's / Husband's Name<span class="text-danger">*</span> </label>
<label class="form-label">Father's / Husband's Name<span
class="text-danger">*</span> </label>
<input type="text" class="form-control" id="father_name" name="father_name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required="required">
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')"
required="required">
</div>
<div class="col-md-6">
<label class="form-label"> தந்தை/கணவர் பெயர்<span class="text-danger">*</span> </label>
<label class="form-label"> தந்தை/கணவர் பெயர்<span class="text-danger">*</span>
</label>
<input type="text" class="form-control" id="father_name_tamil"
name="father_name_tamil" placeholder="தமிழில் பதிவு செய்யவும்" required="required">
name="father_name_tamil" placeholder="தமிழில் பதிவு செய்யவும்"
required="required">
</div>
</div>
@ -506,7 +582,8 @@
</div>
<div class="col-md-6">
<label class="form-label"> பாலினம் <span class="text-danger">*</span></label><br>
<label class="form-label"> பாலினம் <span
class="text-danger">*</span></label><br>
<input type="radio" name="gender_tamil" value="ஆண்"> ஆண்
<input type="radio" name="gender_tamil" value="பெண்" class="ms-3"> பெண்
<input type="radio" name="gender_tamil" value="பிற்பாலினர்"
@ -526,11 +603,13 @@
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Date of Birth | பிறந்த தேதி<span class="text-danger">*</span> </label>
<label class="form-label">Date of Birth | பிறந்த தேதி<span
class="text-danger">*</span> </label>
<input type="date" id="dob" class="form-control" name="dob" required="required">
</div>
<div class="col-md-6">
<label class="form-label">Community Category | சமூக வகை <span class="text-danger">*</span></label>
<label class="form-label">Community Category | சமூக வகை <span
class="text-danger">*</span></label>
<select class="form-control" id="community" name="community" required>
<option value="">-- Select Community --</option>
<th:block th:each="com : ${communities}">
@ -542,13 +621,15 @@
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Differently Abled | இயலாமை உள்ளவரா?<span class="required">*</span> </label><br>
<label class="form-label">Differently Abled | இயலாமை உள்ளவரா?<span
class="required">*</span> </label><br>
<input type="radio" name="differently_abled" value="Yes"> Yes
<input type="radio" name="differently_abled" value="No" class="ms-3"> No
</div>
<div class="col-md-6" id="diffSection" style="display: none;">
<label class="form-label">Type of Disability | இயலாமையின் வகை <span class="required">*</span> </label>
<label class="form-label">Type of Disability | இயலாமையின் வகை <span
class="required">*</span> </label>
<select class="form-control" id="diff_type" name="diff_type">
<option value="">-- Select Disability --</option>
<th:block th:each="diff : ${DiffAbledList}">
@ -561,11 +642,8 @@
Specify Disability | இயலாமையை குறிப்பிடவும்
<span class="required">*</span>
</label>
<input type="text"
class="form-control"
id="other_disability"
name="other_disability"
placeholder="Enter Disability">
<input type="text" class="form-control" id="other_disability"
name="other_disability" placeholder="Enter Disability">
</div>
</div>
@ -597,7 +675,8 @@
</div>
<div class="col-md-6">
<label for="religion" class="form-label"> Religion | மதம்<span class="text-danger">*</span></label>
<label for="religion" class="form-label"> Religion | மதம்<span
class="text-danger">*</span></label>
<select class="form-control" id="religion" name="religion" required="required">
<option value="">-- Select Religion --</option>
<th:block th:each="religion : ${religionList}">
@ -636,17 +715,21 @@
<input type="text" class="form-control" name="doorno" id="doorno">
</div>
<div class="col-md-6">
<label class="form-label">Street Name | தெரு பெயர் <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="streetname" id="streetname" required>
<label class="form-label">Street Name | தெரு பெயர் <span
class="text-danger">*</span></label>
<input type="text" class="form-control" name="streetname" id="streetname"
required>
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Area Name | பகுதி பெயர்<span class="text-danger">*</span> </label>
<label class="form-label">Area Name | பகுதி பெயர்<span
class="text-danger">*</span> </label>
<input type="text" class="form-control" name="areaname" id="areaname" required>
</div>
<div class="col-md-6">
<label class="form-label">District | மாவட்டம் <span class="text-danger">*</span></label>
<label class="form-label">District | மாவட்டம் <span
class="text-danger">*</span></label>
<input type="text" class="form-control" name="district" id="district"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
</div>
@ -654,14 +737,16 @@
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Pincode | அஞ்சல் குறியீடு<span class="text-danger">*</span> </label>
<label class="form-label">Pincode | அஞ்சல் குறியீடு<span
class="text-danger">*</span> </label>
<input type="text" class="form-control" name="pincode" id="pincode"
oninput="validatePincode(this)" required>
</div>
<div class="col-md-6">
<label class="form-label">Aadhaar Number | ஆதார் எண்<span class="text-danger">*</span> </label>
<label class="form-label">Aadhaar Number | ஆதார் எண்<span
class="text-danger">*</span> </label>
<input type="text" class="form-control" id="aadhar_number" name="aadhar_number"
maxlength="12" oninput="validateAadhar(this)" required>
</div>
@ -845,41 +930,167 @@
const infowindow = new google.maps.InfoWindow();
// 🔍 Initialize the SearchBox
const input = document.getElementById('pac-input');
const searchBox = new google.maps.places.SearchBox(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// const input = document.getElementById('pac-input');
// const searchBox = new google.maps.places.SearchBox(input);
// //map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// map.addListener('bounds_changed', function () {
// searchBox.setBounds(map.getBounds());
// });
// searchBox.addListener('places_changed', function () {
// const places = searchBox.getPlaces();
// if (places.length === 0) return;
// if (marker) marker.setMap(null);
// const place = places[0];
// if (!place.geometry) return;
// marker = new google.maps.Marker({
// map: map,
// position: place.geometry.location
// });
// const lat = place.geometry.location.lat().toFixed(6);
// const lng = place.geometry.location.lng().toFixed(6);
// document.getElementById("latitude_field").value = lat;
// document.getElementById("longitude_field").value = lng;
// map.setCenter(place.geometry.location);
// map.setZoom(15);
// infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
// infowindow.open(map, marker);
// fetchStreets(lat, lng);
// });
const input = document.getElementById("pac-input");
const suggestions = document.getElementById("suggestions");
const autocompleteService = new google.maps.places.AutocompleteService();
const placesService = new google.maps.places.PlacesService(map);
let debounceTimer = null;
input.addEventListener("input", function () {
clearTimeout(debounceTimer);
const query = this.value.trim();
// Hide suggestions
if (query.length < 5) {
suggestions.style.display = "none";
suggestions.innerHTML = "";
return;
}
debounceTimer = setTimeout(function () {
autocompleteService.getPlacePredictions({
input: query,
bounds: map.getBounds()
}, showPredictions);
}, 500);
map.addListener('bounds_changed', function () {
searchBox.setBounds(map.getBounds());
});
searchBox.addListener('places_changed', function () {
const places = searchBox.getPlaces();
if (places.length === 0) return;
function showPredictions(predictions, status) {
if (marker) marker.setMap(null);
const place = places[0];
if (!place.geometry) return;
suggestions.innerHTML = "";
if (
status !== google.maps.places.PlacesServiceStatus.OK ||
!predictions ||
predictions.length === 0
) {
suggestions.style.display = "none";
return;
}
const ul = document.createElement("ul");
predictions.forEach(function (prediction) {
const li = document.createElement("li");
li.innerHTML = prediction.description;
li.onclick = function () {
input.value = prediction.description;
suggestions.style.display = "none";
loadPlace(prediction.place_id);
};
ul.appendChild(li);
});
suggestions.appendChild(ul);
suggestions.style.display = "block";
}
function loadPlace(placeId) {
placesService.getDetails({
placeId: placeId,
fields: [
"geometry",
"formatted_address",
"name"
]
}, function (place, status) {
if (status !== google.maps.places.PlacesServiceStatus.OK)
return;
if (marker)
marker.setMap(null);
marker = new google.maps.Marker({
map: map,
position: place.geometry.location
});
const lat = place.geometry.location.lat().toFixed(6);
const lng = place.geometry.location.lng().toFixed(6);
document.getElementById("latitude_field").value = lat;
document.getElementById("longitude_field").value = lng;
map.setCenter(place.geometry.location);
map.setZoom(15);
infowindow.setContent(`Latitude: ${lat}<br>Longitude: ${lng}`);
infowindow.setContent(
"Latitude : " + lat +
"<br>Longitude : " + lng
);
infowindow.open(map, marker);
fetchStreets(lat, lng);
});
}
map.addListener("click", function (event) {
const clickedLatLng = event.latLng;
if (marker) marker.setMap(null);
@ -958,12 +1169,12 @@
$.ajax({
url: "/gcc/api/streetvendor/getrelationship",
type: "GET",
success: function(response) {
success: function (response) {
$(selectElement).empty();
$(selectElement).append('<option value="">-- Select Relationship --</option>');
$.each(response, function(index, item) {
$.each(response, function (index, item) {
$(selectElement).append(
'<option value="' + item.id + '">' + item.name + '</option>'
@ -1119,27 +1330,27 @@
}
const czone = $('#zone').val().trim();
if (czone==="") {
if (czone === "") {
Swal.fire("Missing Zone", "Please Click on Map", "info");
$('#submitBtn').prop('disabled', false).text('Submit');
return;
}
const cward = $('#ward').val().trim();
if (cward==="") {
if (cward === "") {
Swal.fire("Missing Ward", "Please Click on Map", "info");
$('#submitBtn').prop('disabled', false).text('Submit');
return;
}
const gen=$('input[name="gender"]:checked').val();
if(!gen){
const gen = $('input[name="gender"]:checked').val();
if (!gen) {
Swal.fire("Missing Gender", "Please Select Gender", "info");
$('#submitBtn').prop('disabled', false).text('Submit');
return;
}
const tamgen=$('input[name="gender_tamil"]:checked').val();
if(!tamgen){
const tamgen = $('input[name="gender_tamil"]:checked').val();
if (!tamgen) {
Swal.fire("Missing Gender", "Please Select Gender in Tamil", "info");
$('#submitBtn').prop('disabled', false).text('Submit');
return;
@ -1185,6 +1396,18 @@
});
});
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
function proceedSubmission(mobileNumber, formData) {
$('#pageLoader').show();
@ -1233,8 +1456,8 @@
setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0]);
}
const religion =$("#religion").val();
if(!religion){
const religion = $("#religion").val();
if (!religion) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning", "Please select Religion.", "warning");
@ -1287,8 +1510,8 @@
const diff_type =$("#diff_type").val();
const other_disability =$("#other_disability").val().trim();
const diff_type = $("#diff_type").val();
const other_disability = $("#other_disability").val().trim();
setIfPresent(formData, "diff_type", diff_type);
setIfPresent(formData, "other_disability", other_disability);

663
src/main/resources/templates/modules/vendors/zonerequests.html
File diff suppressed because it is too large
View File

Loading…
Cancel
Save