Browse Source

Places API Changes Implementation

master
KaNi-04 2 months ago
parent
commit
74b8c7b775
  1. 341
      src/main/resources/templates/modules/callcenterqaqc/domesticwastecomplaints.html
  2. 377
      src/main/resources/templates/modules/callcenterqaqc/pgrcomplaints.html
  3. 335
      src/main/resources/templates/modules/vendors/streetVendorRequestForm.html
  4. 477
      src/main/resources/templates/modules/vendors/zonerequests.html

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

@ -1,6 +1,7 @@
<!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">
@ -13,6 +14,7 @@
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width : 767px) {
#complaintform label {
@ -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,9 +190,10 @@
#suggestions ul li:hover {
background-color: #f0f0f0;
}
} */
#reader-btn, #invertColorBtn {
#reader-btn,
#invertColorBtn {
padding: 5px 10px;
font-size: 14px;
cursor: pointer;
@ -246,13 +246,12 @@
border: 1px solid #ccc;
}
@keyframes spin { 0%
{
@keyframes spin {
0% {
transform: rotate(0deg);
}
100%
{
100% {
transform: rotate(360deg);
}
}
@ -280,7 +279,9 @@ transform:rotate(360deg);
}
@-webkit-keyframes fadein {from { bottom:0;
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
@ -290,7 +291,10 @@ to {
}
}
@keyframes fadein {from { bottom:0;
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
@ -300,7 +304,10 @@ to {
}
}
@-webkit-keyframes fadeout {from { bottom:30px;
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
@ -310,7 +317,10 @@ to {
}
}
@keyframes fadeout {from { bottom:30px;
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
@ -324,8 +334,74 @@ to {
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*/
</style>
<body>
<div id="snackbar"></div>
@ -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,11 +467,11 @@ 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">
@ -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>
@ -710,6 +809,19 @@ to {
});
});
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
function validateName() {
const $inputname = $('#name');
@ -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);
@ -1576,4 +1814,5 @@ to {
</script>
</body>
</html>

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

@ -1,6 +1,7 @@
<!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">
@ -13,6 +14,7 @@
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width : 767px) {
#complaintform label {
@ -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,9 +203,10 @@
#suggestions ul li:hover {
background-color: #f0f0f0;
}
} */
#reader-btn, #invertColorBtn {
#reader-btn,
#invertColorBtn {
padding: 5px 10px;
font-size: 14px;
cursor: pointer;
@ -246,13 +259,12 @@
border: 1px solid #ccc;
}
@keyframes spin { 0%
{
@keyframes spin {
0% {
transform: rotate(0deg);
}
100%
{
100% {
transform: rotate(360deg);
}
}
@ -280,7 +292,9 @@ transform:rotate(360deg);
}
@-webkit-keyframes fadein {from { bottom:0;
@-webkit-keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
@ -290,7 +304,10 @@ to {
}
}
@keyframes fadein {from { bottom:0;
@keyframes fadein {
from {
bottom: 0;
opacity: 0;
}
@ -300,7 +317,10 @@ to {
}
}
@-webkit-keyframes fadeout {from { bottom:30px;
@-webkit-keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
@ -310,7 +330,10 @@ to {
}
}
@keyframes fadeout {from { bottom:30px;
@keyframes fadeout {
from {
bottom: 30px;
opacity: 1;
}
@ -324,8 +347,62 @@ to {
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;
}
/*for snack bar*/
</style>
<body>
<div id="snackbar"></div>
@ -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,11 +469,11 @@ 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">
@ -403,8 +486,7 @@ to {
<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">
@ -412,16 +494,17 @@ to {
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>
@ -1171,6 +1266,19 @@ to {
}); */
});
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
@ -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);
@ -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>

335
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);
@ -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();

477
src/main/resources/templates/modules/vendors/zonerequests.html

@ -1,22 +1,25 @@
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/modules/base/head :: head}"></head>
<style>
.required {
color: red;
}
/* Mobile screens - targeting devices with a max width of 767px */
@media (max-width: 767px)
{
@media (max-width: 767px) {
#requestlistform label {
margin-top: 10px;
}
}
#viewModal .modal-body {
max-height: 70vh; /* Limit the height to 70% of the viewport */
overflow-y: auto; /* Enable vertical scrolling */
max-height: 70vh;
/* Limit the height to 70% of the viewport */
overflow-y: auto;
/* Enable vertical scrolling */
}
.custom-doc-btn {
@ -75,6 +78,7 @@ padding-bottom: 10px;
input.form-control {
padding: 10px;
}
.form-select {
padding: 10px;
height: 40px;
@ -89,7 +93,7 @@ input.form-control {
max-width: 100%;
}
#pac-input {
/* #pac-input {
position: absolute;
top: 10px;
left: 50%;
@ -113,8 +117,7 @@ input.form-control {
background-color: white;
border-radius: 4px;
padding: 0;
/* Removed extra padding to match the input width */
}
} */
#search-box {
width: 100%;
@ -128,7 +131,7 @@ input.form-control {
/* Makes sure padding is considered in width */
}
#suggestions {
/* #suggestions {
border: 1px solid #ccc;
border-radius: 4px;
max-height: 200px;
@ -137,15 +140,15 @@ input.form-control {
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 */
}
} */
.pac-container {
z-index: 2000 !important; /* higher than modal's z-index */
z-index: 2000 !important;
/* higher than modal's z-index */
}
#suggestions ul {
/* #suggestions ul {
list-style: none;
padding: 0;
margin: 0;
@ -158,8 +161,74 @@ input.form-control {
#suggestions ul li:hover {
background-color: #f0f0f0;
} */
#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>
<!--[if lt IE 8]>
@ -191,8 +260,8 @@ input.form-control {
<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">Vending Committe</li>
<li class="breadcrumb-item active" aria-current="page">Zone Requests</li>
</ol>
@ -209,11 +278,16 @@ input.form-control {
<div class="card-block">
<div class="page-header-title">
<h5 style="margin: 0;font-weight: bold;"><span th:text="${zone}" id="userzone"></span>&nbsp;-&nbsp;Zone Request List</h5><span th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span><hr>
<h5 style="margin: 0;font-weight: bold;"><span th:text="${zone}"
id="userzone"></span>&nbsp;-&nbsp;Zone Request List</h5><span
th:text="${LoginUserId}" id="userIdSpan" style="display: none;"></span>
<hr>
</div>
<div>
<table id="RequestListDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
<table id="RequestListDatatable"
class="table table-striped table-bordered table-hover dataTable"
role="grid">
<thead class="thead-dark">
<tr role="row">
<th class="text-center">S.No</th>
@ -258,7 +332,8 @@ input.form-control {
<!-- Modal -->
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-hidden="true"
data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
@ -316,23 +391,27 @@ input.form-control {
</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">
<label for="latitude_field">Latitude</label>
<input type="text" class="form-control" id="latitude_field" name="latitude_field" readonly >
<input type="text" class="form-control" id="latitude_field"
name="latitude_field" readonly>
</div>
<div class="col-md-6">
<label for="longitude_field">Longitude</label>
<input type="text" class="form-control" id="longitude_field" name="longitude_field" readonly >
<input type="text" class="form-control" id="longitude_field"
name="longitude_field" readonly>
</div>
</div>
@ -351,29 +430,41 @@ input.form-control {
<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>
<textarea class="form-control" id="landmark_tamil" name="landmark_tamil" placeholder="தமிழில் பதிவு செய்யவும்" required="required"></textarea>
<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>
</div>
<div class="row mb-3">
<div class="col-md-6">
<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">
<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">
</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">
<input type="text" class="form-control" id="vendor_district_tamil"
name="vendor_district_tamil" placeholder="தமிழில் பதிவு செய்யவும்"
required="required">
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Pincode | அஞ்சல் குறியீடு<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="vendor_pincode" name="vendor_pincode" oninput="validatePincode(this)" required="required">
<label class="form-label">Pincode | அஞ்சல் குறியீடு<span
class="text-danger">*</span></label>
<input type="text" class="form-control" id="vendor_pincode"
name="vendor_pincode" oninput="validatePincode(this)" required="required">
</div>
</div>
@ -381,12 +472,14 @@ input.form-control {
<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>
<th:block th:each="vendingCategory : ${vendingCategories}">
<option th:value="${vendingCategory.id}" th:text="${vendingCategory.vending_category_name}"></option>
<option th:value="${vendingCategory.id}"
th:text="${vendingCategory.vending_category_name}"></option>
</th:block>
</select>
@ -394,12 +487,16 @@ input.form-control {
<div class="col-md-6">
<label for="tamilbusinesstype" class="form-label"> வியாபார வகை <span class="text-danger">*</span>
<label for="tamilbusinesstype" class="form-label"> வியாபார வகை <span
class="text-danger">*</span>
</label>
<select id="tamilbusinesstype" name="tamilbusinesstype" class="form-control" required>
<select id="tamilbusinesstype" name="tamilbusinesstype" class="form-control"
required>
<option value="">-- வியாபார வகையைத் தேர்ந்தெடுக்கவும் --</option>
<th:block th:each="tamilvendingCategory : ${tamilvendingCategories}">
<option th:value="${tamilvendingCategory.id}" th:text="${tamilvendingCategory.tamil_vending_category_name}"></option>
<option th:value="${tamilvendingCategory.id}"
th:text="${tamilvendingCategory.tamil_vending_category_name}">
</option>
</th:block>
</select>
</div>
@ -407,28 +504,34 @@ input.form-control {
<div class="row mb-3">
<div class="col-md-6">
<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">
<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>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Did you get SVANIDHI loan? | ஸ்வநிதி கடன் வாங்கினீங்களா? </label><br>
<label class="form-label">Did you get SVANIDHI loan? | ஸ்வநிதி கடன்
வாங்கினீங்களா? </label><br>
<input type="radio" name="svanidhi" value="Yes"> Yes
<input type="radio" name="svanidhi" value="No" class="ms-3"> No
</div>
<div class="col-md-6">
<label class="form-label">Do you have a Bank Account? | வங்கி கணக்கு உள்ளதா? </label><br>
<label class="form-label">Do you have a Bank Account? | வங்கி கணக்கு உள்ளதா?
</label><br>
<input type="radio" name="bank_account" value="Yes"> Yes
<input type="radio" name="bank_account" value="No" class="ms-3"> No
</div>
<div class="col-md-6" id="bank_passbook_container" style="display:none;">
<label for="bank_passbook" class="form-label">Upload Bank Passbook (jpg/jpeg/pdf)<span class="text-danger">*</span>
<label for="bank_passbook" class="form-label">Upload Bank Passbook
(jpg/jpeg/pdf)<span class="text-danger">*</span>
</label>
<input type="file" class="form-control" id="bank_passbook" name="bank_passbook" accept=".jpg,.jpeg,.pdf,application/pdf" >
<input type="file" class="form-control" id="bank_passbook" name="bank_passbook"
accept=".jpg,.jpeg,.pdf,application/pdf">
<div id="bank_passbookpreview" class="mt-2" style="display: none;"></div>
</div>
@ -450,21 +553,29 @@ input.form-control {
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label"> Name <span class="required">*</span></label>
<input type="text" class="form-control" id="name" name="name" oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
<input type="text" class="form-control" id="name" name="name"
oninput="this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" required>
</div>
<div class="col-md-6">
<label class="form-label">பெயர் <span class="required">*</span></label>
<input type="text" class="form-control" id="name_tamil" name="name_tamil" placeholder="தமிழில் பதிவு செய்யவும்" required>
<input type="text" class="form-control" id="name_tamil" name="name_tamil"
placeholder="தமிழில் பதிவு செய்யவும்" required>
</div>
</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>
<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">
<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">
</div>
<div class="col-md-6">
<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">
<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">
</div>
</div>
@ -477,17 +588,21 @@ input.form-control {
<input type="radio" name="gender" value="Transgender" class="ms-3">Transgender
</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="பிற்பாலினர்" class="ms-3">பிற்பாலினர்
<input type="radio" name="gender_tamil" value="பிற்பாலினர்"
class="ms-3">பிற்பாலினர்
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Mobile Number | மொபைல் எண் <span class="required">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no" oninput="validatePhoneNumber(this)" required readonly="readonly">
<label class="form-label">Mobile Number | மொபைல் எண் <span
class="required">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no"
oninput="validatePhoneNumber(this)" required readonly="readonly">
</div>
</div>
@ -495,12 +610,15 @@ input.form-control {
<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>
<select class="form-control" id="community" name="community" required="required">
<label class="form-label">Community Category | சமூக வகை <span
class="text-danger">*</span></label>
<select class="form-control" id="community" name="community"
required="required">
<option value="">-- Select Community --</option>
<th:block th:each="com : ${communities}">
<option th:value="${com.id}" th:text="${com.category_name}"></option>
@ -511,13 +629,15 @@ input.form-control {
<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}">
@ -530,16 +650,14 @@ input.form-control {
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>
<div class="col-md-6">
<label class="form-label">Street Vendor’s educational status | தெருவணிகரின் கல்வித்தகுதி </label>
<label class="form-label">Street Vendor’s educational status | தெருவணிகரின்
கல்வித்தகுதி </label>
<select class="form-control" id="education" name="education">
<option value="">-- Select Education Status--</option>
<th:block th:each="edu : ${educationList}">
@ -552,17 +670,20 @@ input.form-control {
<div class="row mb-3">
<div class="col-md-6">
<label for="maritalstatus" class="form-label"> Marital Status | திருமண நிலை </label>
<label for="maritalstatus" class="form-label"> Marital Status | திருமண நிலை
</label>
<select class="form-control" id="maritalStatus" name="maritalStatus">
<option value="">-- Select Marital Status --</option>
<th:block th:each="status : ${maritalStatuses}">
<option th:value="${status.id}" th:text="${status.marital_status}"></option>
<option th:value="${status.id}" th:text="${status.marital_status}">
</option>
</th:block>
</select>
</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}">
@ -573,15 +694,18 @@ input.form-control {
</div>
<div class="col-md-6 mt-3">
<label for="familymembers" class="form-label">Number of Family Members | குடும்ப உறுப்பினர்கள் எண்ணிக்கை<span class="text-danger">*</span> </label>
<input type="number" class="form-control" name="familymembers" id="familymembers" max="15" required="required">
<label for="familymembers" class="form-label">Number of Family Members | குடும்ப
உறுப்பினர்கள் எண்ணிக்கை<span class="text-danger">*</span> </label>
<input type="number" class="form-control" name="familymembers"
id="familymembers" max="15" required="required">
</div>
</div>
<div id="familyMemberContainer"></div>
<div class="mb-3">
<label class="form-label">Are any of your family member involved in street vending | உங்கள் குடும்ப உறுப்பினர் வியாபாரத்தில் உள்ளவரா? </label><br>
<label class="form-label">Are any of your family member involved in street vending |
உங்கள் குடும்ப உறுப்பினர் வியாபாரத்தில் உள்ளவரா? </label><br>
<input type="radio" name="fam_vendor" value="Yes"> Yes
<input type="radio" name="fam_vendor" value="No" class="ms-3"> No
</div>
@ -596,31 +720,42 @@ input.form-control {
<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="required">
<label class="form-label">Street Name | தெரு பெயர் <span
class="text-danger">*</span> </label>
<input type="text" class="form-control" name="streetname" id="streetname"
required="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>
<input type="text" class="form-control" name="areaname" id="areaname" required="required">
<label class="form-label">Area Name | பகுதி பெயர் <span
class="text-danger">*</span></label>
<input type="text" class="form-control" name="areaname" id="areaname"
required="required">
</div>
<div class="col-md-6">
<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="required">
<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="required">
</div>
</div>
<div class="row mb-3">
<div class="col-md-6">
<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="required">
<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="required">
</div>
<div class="col-md-6">
<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="required">
<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="required">
</div>
</div>
@ -631,7 +766,8 @@ input.form-control {
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Aadhaar Front Image | ஆதார் முன்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Aadhaar Front Image | ஆதார் முன்னணி படத்தை
பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="aadharfrontimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharfrontimage">
@ -639,7 +775,8 @@ input.form-control {
</div>
<div class="col-md-6">
<label class="form-label">Aadhaar Back Image | ஆதார் பின்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Aadhaar Back Image | ஆதார் பின்னணி படத்தை பதிவேற்றவும்
(jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="aadharbackimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="aadharbackimage">
@ -648,7 +785,8 @@ input.form-control {
</div>
<div class="row mb-3">
<div class="col-md-6">
<label class="form-label">Take Ration Card Front Image | ரேஷன் கார்டு முன்னணி படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<label class="form-label">Take Ration Card Front Image | ரேஷன் கார்டு முன்னணி
படத்தை பதிவேற்றவும் (jpg/jpeg/pdf)</label>
<input type="file" class="form-control" id="ration_card_photo"
accept=".jpg,.jpeg,.pdf,application/pdf" name="ration_card_photo">
@ -657,7 +795,8 @@ input.form-control {
</div>
<!-- Submit -->
<div class="text-center mt-4">
<button type="submit" class="btn btn-primary" name="submitBtn" id="submitBtn">Update</button>
<button type="submit" class="btn btn-primary" name="submitBtn"
id="submitBtn">Update</button>
</div>
@ -669,7 +808,8 @@ input.form-control {
</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>
@ -745,41 +885,167 @@ allowTamilAndSymbols("father_name_tamil");
const infowindow = new google.maps.InfoWindow();
// 🔍 Initialize the SearchBox
let input = document.getElementById('pac-input');
let searchBox = new google.maps.places.SearchBox(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
// let input = document.getElementById('pac-input');
// let 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);
@ -1074,6 +1340,20 @@ allowTamilAndSymbols("father_name_tamil");
});
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) &&
e.target !== input
) {
suggestions.style.display = "none";
}
});
// Validation helpers
function validatePhoneNumber(input) {
input.value = input.value.replace(/[^0-9]/g, '').slice(0, 10);
@ -2102,4 +2382,5 @@ allowTamilAndSymbols("father_name_tamil");
}
</script>
</body>
</html>
Loading…
Cancel
Save