@ -108,8 +108,8 @@ label{
max-width: 100%;
max-width: 100%;
}
}
#pac-input {
position: absolute;
/* #pac-input {
position: absolute;
top: 10px;
top: 10px;
left: 50%;
left: 50%;
transform: translateX(-50%);
transform: translateX(-50%);
@ -119,9 +119,9 @@ label{
border: 1px solid #ccc;
border: 1px solid #ccc;
background-color: white;
background-color: white;
border-radius: 4px;
border-radius: 4px;
}
} */
#search-container {
/* #search-container {
position: absolute;
position: absolute;
top: 10px;
top: 10px;
left: 50%;
left: 50%;
@ -132,8 +132,8 @@ label{
background-color: white;
background-color: white;
border-radius: 4px;
border-radius: 4px;
padding: 0;
padding: 0;
/* Removed extra padding to match the input width */
}
} */
#search-box {
#search-box {
width: 100%;
width: 100%;
@ -147,7 +147,7 @@ label{
/* Makes sure padding is considered in width */
/* Makes sure padding is considered in width */
}
}
#suggestions {
/* #suggestions {
border: 1px solid #ccc;
border: 1px solid #ccc;
border-radius: 4px;
border-radius: 4px;
max-height: 200px;
max-height: 200px;
@ -156,9 +156,7 @@ label{
background-color: white;
background-color: white;
display: none;
display: none;
width: 100%;
width: 100%;
/* Matches the width of the container and input */
box-sizing: border-box;
box-sizing: border-box;
/* Ensures the width includes borders and padding */
}
}
#suggestions ul {
#suggestions ul {
@ -174,7 +172,73 @@ label{
#suggestions ul li:hover {
#suggestions ul li:hover {
background-color: #f0f0f0;
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;
}
.section-notes {
.section-notes {
padding: 20px;
padding: 20px;
@ -252,13 +316,15 @@ label{
< h5 > Business Details | வியாபார விவரங்கள்< / h5 > < / div >
< h5 > Business Details | வியாபார விவரங்கள்< / h5 > < / div >
< div id = "mapContainer" style = "position: relative; height: 500px;" >
< 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 id = "search-container" >
< input id = "pac-input" class = "controls" type = "text" placeholder = "Search location - please enter minimum of 5 characters " >
<!-- <input type="text" id="search - box" placeholder="Search for a location..."> -->
< div id = "suggestions" > < / div >
< / div >
< / div >
< div id = "search-container" >
<!-- <input type="text" id="search - box" placeholder="Search for a location..."> -->
< div id = "suggestions" > < / div >
< div id = "googleMap" style = "height: 90%; width: 100%;" > < / div >
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
@ -290,30 +356,30 @@ label{
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Landmark (maximum 255 characters)< / label >
< textarea class = "form-control" id = "landmark" name = "landmark" maxlength = "255" > < / 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > விற்பனை பகுதி< / label >
< textarea class = "form-control" id = "landmark_tamil" name = "landmark_tamil" placeholder = "தமிழில் பதிவு செய்யவும்" maxlength = "255" > < / textarea >
< label class = "form-label" > விற்பனை பகுதி< span class = "text-danger" > *< / span > < / label >
< textarea class = "form-control" id = "landmark_tamil" name = "landmark_tamil" placeholder = "தமிழில் பதிவு செய்யவும்" maxlength = "255" required = "required" > < / textarea >
< / div >
< / div >
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > District< / label >
< input type = "text" class = "form-control" id = "vendor_district" name = "vendor_district" oninput = "this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
< 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > மாவட்டம்< / label >
< input type = "text" class = "form-control" id = "vendor_district_tamil" name = "vendor_district_tamil" placeholder = "தமிழில் பதிவு செய்யவும்" >
< 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" >
< / div >
< / div >
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Pincode< / label >
< input type = "text" class = "form-control" id = "vendor_pincode" name = "vendor_pincode" oninput = "validatePincode(this)" >
< 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 >
< / div >
< / div >
@ -347,8 +413,8 @@ label{
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Business Space (Sq ft)| வியாபார இடம் < / label >
< input type = "text" class = "form-control" id = "business_space" name = "business_space" >
< 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 >
< / div >
@ -366,7 +432,7 @@ label{
< div class = "col-md-6" id = "bank_passbook_container" style = "display:none;" >
< 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)
< label for = "bank_passbook" class = "form-label" > Upload Bank Passbook (jpg/jpeg/pdf)< span class = "text-danger" > *< / span >
< / label >
< / 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 >
< / div >
@ -382,9 +448,9 @@ label{
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Profile Image (eg:Passport size photo)(jpg/jpeg/pdf)< / label >
< label class = "form-label" > Profile Image (eg:Passport size photo)(jpg/jpeg/pdf)< span class = "text-danger" > *< / span > < / label >
< input type = "file" class = "form-control" id = "profileimage"
< input type = "file" class = "form-control" id = "profileimage"
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage" >
accept=".jpg,.jpeg,.pdf,application/pdf" name="profileimage" required="required" >
< / div >
< / div >
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
@ -399,26 +465,26 @@ label{
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Father's / Husband's Name < / label >
< input type = "text" class = "form-control" id = "father_name" name = "father_name" oninput = "this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
< 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > தந்தை/கணவர் பெயர் < / label >
< input type = "text" class = "form-control" id = "father_name_tamil" name = "father_name_tamil" placeholder = "தமிழில் பதிவு செய்யவும்" >
< 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 >
< / div >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Gender | பாலினம் < / label > < br >
< label class = "form-label" > Gender | பாலினம்< span class = "text-danger" > *< / span > < / label > < br >
< input type = "radio" name = "gender" value = "Male" > Male
< input type = "radio" name = "gender" value = "Male" > Male
< input type = "radio" name = "gender" value = "Female" class = "ms-3" > Female
< input type = "radio" name = "gender" value = "Female" class = "ms-3" > Female
< input type = "radio" name = "gender" value = "Transgender" class = "ms-3" > Transgender
< input type = "radio" name = "gender" value = "Transgender" class = "ms-3" > Transgender
< / div >
< / div >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > பாலினம் < / 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 = "ஆண்" > ஆண்
< 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" > பிற்பாலினர்
< input type = "radio" name = "gender_tamil" value = "பிற்பாலினர்" class = "ms-3" > பிற்பாலினர்
@ -435,12 +501,12 @@ label{
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Date of Birth | பிறந்த தேதி < / label >
< input type = "date" id = "dob" class = "form-control" name = "dob" >
< 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Community Category | சமூக வகை < / label >
< select class = "form-control" id = "community" name = "community" >
< 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 >
< option value = "" > -- Select Community --< / option >
< th:block th:each = "com : ${communities}" >
< th:block th:each = "com : ${communities}" >
< option th:value = "${com.id}" th:text = "${com.category_name}" > < / option >
< option th:value = "${com.id}" th:text = "${com.category_name}" > < / option >
@ -451,11 +517,31 @@ label{
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Differently Abled | இயலாமை உள்ளவரா? < / 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 = "Yes" > Yes
< input type = "radio" name = "differently_abled" value = "No" class = "ms-3" > No
< input type = "radio" name = "differently_abled" value = "No" class = "ms-3" > No
< / div >
< / div >
< div class = "col-md-6" id = "diffSection" style = "display: none;" >
< 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}" >
< option th:value = "${diff.id}" th:text = "${diff.name}" > < / option >
< / th:block >
< / select >
< div id = "otherDisabilityDiv" class = "mt-2" style = "display:none;" >
< label class = "form-label" >
Specify Disability | இயலாமையை குறிப்பிடவும்
< span class = "required" > *< / span >
< / label >
< input type = "text"
class="form-control"
id="other_disability"
name="other_disability"
placeholder="Enter Disability">
< / div >
< / div >
< div class = "col-md-6" >
< div class = "col-md-6" >
@ -481,10 +567,22 @@ label{
< / select >
< / select >
< / div >
< / div >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label for = "familymembers" class = "form-label" > Number of Family Members | குடும்ப உறுப்பினர்கள் எண்ணிக்கை < / label >
< input type = "number" class = "form-control" name = "familymembers" id = "familymembers" >
< 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}" >
< option th:value = "${religion.id}" th:text = "${religion.religion}" >
< / option >
< / th:block >
< / select >
< / div >
< div class = "col-md-6 mt-2" >
< 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 >
< / div >
< div id = "familyMemberContainer" > < / div >
< div class = "mb-3" >
< 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 >
@ -504,31 +602,31 @@ label{
< input type = "text" class = "form-control" name = "doorno" id = "doorno" >
< input type = "text" class = "form-control" name = "doorno" id = "doorno" >
< / div >
< / div >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Street Name | தெரு பெயர் < / label >
< input type = "text" class = "form-control" name = "streetname" id = "streetname" >
< 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 >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Area Name | பகுதி பெயர் < / label >
< input type = "text" class = "form-control" name = "areaname" id = "areaname" >
< 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > District | மாவட்டம் < / label >
< input type = "text" class = "form-control" name = "district" id = "district" oninput = "this.value = this.value.replace(/[^a-zA-Z\s]/g, '')" >
< 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 >
< / div >
< div class = "row mb-3" >
< div class = "row mb-3" >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Pincode | அஞ்சல் குறியீடு < / label >
< input type = "text" class = "form-control" name = "pincode" id = "pincode" oninput = "validatePincode(this)" >
< 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 >
< div class = "col-md-6" >
< div class = "col-md-6" >
< label class = "form-label" > Aadhaar Number | ஆதார் எண் < / label >
< input type = "text" class = "form-control" id = "aadhar_number" name = "aadhar_number" maxlength = "12" oninput = "validateAadhar(this)" >
< 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 >
< / div >
< / div >
@ -629,6 +727,7 @@ label{
< / script >
< / script >
< script >
< script >
var relationshipOptions = "";
function allowTamilAndSymbols(id) {
function allowTamilAndSymbols(id) {
const el = document.getElementById(id);
const el = document.getElementById(id);
@ -671,6 +770,8 @@ document.addEventListener("DOMContentLoaded", function () {
});
});
< / script >
< / script >
< script >
< script >
document.getElementById("backBtn").addEventListener("click", function () {
document.getElementById("backBtn").addEventListener("click", function () {
window.location.href = "/streetvendorlicense/home";
window.location.href = "/streetvendorlicense/home";
});
});
@ -689,7 +790,7 @@ function myMap() {
let streetsList = []; // Define globally inside myMap
let streetsList = []; // Define globally inside myMap
const infowindow = new google.maps.InfoWindow();
const infowindow = new google.maps.InfoWindow();
// Initialize the SearchBox
/* / / Initialize the SearchBox
const input = document.getElementById('pac-input');
const input = document.getElementById('pac-input');
const searchBox = new google.maps.places.SearchBox(input);
const searchBox = new google.maps.places.SearchBox(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
//map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
@ -723,6 +824,145 @@ function myMap() {
infowindow.open(map, marker);
infowindow.open(map, marker);
fetchStreets(lat, lng);
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);
});
function showPredictions(predictions, status) {
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.open(map, marker);
fetchStreets(lat, lng);
});
}
document.addEventListener("click", function (e) {
if (
!suggestions.contains(e.target) & &
e.target !== input
) {
suggestions.style.display = "none";
}
});
});
map.addListener("click", function (event) {
map.addListener("click", function (event) {
@ -793,9 +1033,110 @@ function myMap() {
});
});
}
}
}
}
//Load Relationship Dropdown
function loadRelationshipDropdown(selectElement) {
$.ajax({
url: "/gcc/api/streetvendor/getrelationship",
type: "GET",
success: function(response) {
$(selectElement).empty();
$(selectElement).append('< option value = "" > -- Select Relationship --< / option > ');
$.each(response, function(index, item) {
$(selectElement).append(
'< option value = "' + item.id + '" > ' + item.name + '< / option > '
);
});
}
});
}
$("#familymembers").on("input", function () {
var count = parseInt($(this).val()) || 0;
if (count > 15) {
count = 15;
$(this).val(15);
Swal.fire("Warning", "Maximum 15 family members allowed.", "info");
}
$("#familyMemberContainer").empty();
for (var i = 1; i < = count; i++) {
var row = `
< div class = "row familyRow mb-3" >
< div class = "col-md-4" >
< label > Person Name ${i}< span class = "text-danger" > *< / span > < / label >
< input type = "text"
class="form-control family_name"
placeholder="Enter Name">
< / div >
< div class = "col-md-3" >
< label > Age< span class = "text-danger" > *< / span > < / label >
< input type = "number"
class="form-control family_age"
placeholder="Enter Age">
< / div >
< div class = "col-md-5" >
< label > Relationship< span class = "text-danger" > *< / span > < / label >
< select class = "form-control relationship" >
${relationshipOptions}
< / select >
< / div >
< / div >
`;
$("#familyMemberContainer").append(row);
}
});
$(document).on("input", ".family_name", function () {
this.value = this.value.replace(/[^A-Za-z. ]/g, '');
});
$(document).on("input", ".family_age", function () {
this.value = this.value.replace(/\D/g, '').slice(0, 3);
});
$(document).on("input", "#familymembers", function () {
this.value = this.value.replace(/\D/g, '').slice(0, 2);
});
$(document).ready(function () {
$(document).ready(function () {
$.ajax({
url: "/streetvendorlicense/api/getrelationship",
type: "GET",
success: function (response) {
relationshipOptions = '< option value = "" > -- Select Relationship --< / option > ';
$.each(response, function (i, item) {
relationshipOptions +=
'< option value = "' + item.id + '" > ' +
item.name +
'< / option > ';
});
},
error: function () {
alert("Failed to load relationships.");
}
});
$("input[name='bank_account']").change(function () {
$("input[name='bank_account']").change(function () {
if ($(this).val() === "Yes") {
if ($(this).val() === "Yes") {
$("#bank_passbook_container").show();
$("#bank_passbook_container").show();
@ -815,6 +1156,29 @@ $(document).ready(function () {
}
}
});
});
$("#diff_type").change(function () {
var selectedText = $("#diff_type option:selected").text().trim();
if (selectedText.toLowerCase() === "others" || selectedText.includes("மற்றவை")) {
$("#otherDisabilityDiv").show();
} else {
$("#otherDisabilityDiv").hide();
$("#other_disability").val("");
}
});
$("input[name='differently_abled']").change(function () {
if ($(this).val() === "Yes") {
$("#diffSection").show();
} else {
$("#diffSection").hide();
$("#diff_type").val("");
$("#otherDisabilityDiv").hide();
$("#other_disability").val("");
}
});
// Maximum file size (20 MB)
// Maximum file size (20 MB)
const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB in bytes
const MAX_FILE_SIZE = 20 * 1024 * 1024; // 20MB in bytes
@ -866,6 +1230,20 @@ $(document).ready(function () {
return;
return;
}
}
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){
Swal.fire("Missing Gender", "Please Select Gender in Tamil", "info");
$('#submitBtn').prop('disabled', false).text('Submit');
return;
}
$('#pageLoader').show();
$('#pageLoader').show();
$.ajax({
$.ajax({
url: '/streetvendorlicense/api/check-mobile',
url: '/streetvendorlicense/api/check-mobile',
@ -934,6 +1312,47 @@ function proceedSubmission(mobileNumber,formData){
let diffVal = $("input[name='differently_abled']:checked").val();
let diffVal = $("input[name='differently_abled']:checked").val();
setIfPresent(formData, "diff_abled", diffVal === undefined ? "" : diffVal === "Yes");
setIfPresent(formData, "diff_abled", diffVal === undefined ? "" : diffVal === "Yes");
// Differently Abled Validation
var differentlyAbled = $("input[name='differently_abled']:checked").val();
if (!differentlyAbled) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning", "Please select Differently Abled (Yes/No).", "warning");
return false;
}
if (differentlyAbled === "Yes") {
if ($("#diff_type").val() == "") {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning", "Please select the Type of Disability.", "warning");
return false;
}
var selectedText = $("#diff_type option:selected").text().trim().toLowerCase();
if (selectedText.toLowerCase() === "others" || selectedText.includes("மற்றவை")) {
if ($("#other_disability").val().trim() == "") {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning", "Please specify the disability.", "warning");
return false;
}
}
}
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);
// are_any_fam_mem_invol_str
// are_any_fam_mem_invol_str
let famVal = $("input[name='fam_vendor']:checked").val();
let famVal = $("input[name='fam_vendor']:checked").val();
setIfPresent(formData, "are_any_fam_mem_invol_str", famVal === undefined ? "" : famVal === "Yes");
setIfPresent(formData, "are_any_fam_mem_invol_str", famVal === undefined ? "" : famVal === "Yes");
@ -951,8 +1370,112 @@ function proceedSubmission(mobileNumber,formData){
if (isBankYes){
if (isBankYes){
setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0]);
setFileIfPresent(formData, "bank_passbook", $('#bank_passbook')[0]);
}
}
const religion =$("#religion").val();
if(!religion){
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning", "Please select Religion.", "warning");
return false;
}
setIfPresent(formData, "religion", religion);
var familyCount = parseInt($("#familymembers").val()) || 0;
var familyDetails = [];
if (familyCount > 0) {
var isValid = true;
$("#familyMemberContainer .familyRow").each(function (index) {
var name = $(this).find(".family_name").val().trim();
var age = $(this).find(".family_age").val().trim();
var relationship = $(this).find(".relationship").val();
if (name === "") {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning",
"Please enter Person Name for Family Member " + (index + 1),
"warning");
isValid = false;
return false;
}
if (age === "") {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning",
"Please enter Age for Family Member " + (index + 1),
"warning");
isValid = false;
return false;
}
if (relationship === "") {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Warning",
"Please select Relationship for Family Member " + (index + 1),
"warning");
isValid = false;
return false;
}
// Push only after successful validation
familyDetails.push({
name: name,
age: age,
relationship: relationship
});
});
if (!isValid) {
return false;
}
}
console.log(familyDetails);
setIfPresent(formData, "familyDetails", JSON.stringify(familyDetails));
var familyCount = parseInt($("#familymembers").val()) || 0;
var rowCount = $("#familyMemberContainer .familyRow").length;
// If family members is 0, there should be no rows
if (familyCount === 0) {
if (rowCount !== 0) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire(
"Warning",
"Family member details should be empty when Number of Family Members is 0.",
"warning"
);
return false;
}
} else {
// Count should match
if (familyCount !== rowCount) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire(
"Warning",
"Number of Family Members (" + familyCount +
") does not match the entered Family Member Details (" + rowCount + ").",
"warning"
);
return false;
}
}
// Lat/Lng
// Lat/Lng
const latitude = $('#latitude_field').val().trim();
const latitude = $('#latitude_field').val().trim();
const longitude = $('#longitude_field').val().trim();
const longitude = $('#longitude_field').val().trim();
@ -1019,19 +1542,28 @@ function proceedSubmission(mobileNumber,formData){
setIfPresent(formData, "f_h_name", $('#father_name').val());
setIfPresent(formData, "f_h_name", $('#father_name').val());
const dobValue = new Date($('#dob').val());
const dobValue = new Date($('#dob').val());
const today = new Date();
const age14Date = new Date(
today.getFullYear() - 14,
today.getMonth(),
today.getDate()
);
const today = new Date();
const age14Date = new Date(
today.getFullYear() - 14,
today.getMonth(),
today.getDate()
);
if (dobValue > age14Date) {
$('#pageLoader').hide();
$('#submitBtn').prop('disabled', false).text('Submit');
Swal.fire("Invalid Age", "Applicant must be at least 14 years old.", "error");
return;
}
if (dobValue > age14Date) {
Swal.fire("Invalid Age", "Applicant must be at least 14 years old.", "error");
return;
}
setIfPresent(formData, "dob", $('#dob').val());
const dob = $('#dob').val();
if (dob) {
const [year, month, day] = dob.split("-");
const formattedDob = `${day}-${month}-${year}`;
setIfPresent(formData, "dob", formattedDob);
}
let genderVal = $("input[name='gender']:checked").val();
let genderVal = $("input[name='gender']:checked").val();