An integrated and vibrant lifestyle offering a multitude of social and
recreational activities, enhancing residents' lives
through a comprehensive array of services and facilities. This includes green
spaces, children's parks, a library, fitness centers,
cafés, and a variety of other amenities.
function getNeighborhoods(cityId) {
$.ajax({
url: "https://rayatalmaidan.com/get-neighborhoods" + "/" + cityId,
type: 'GET',
success: function (data) {
let neighborhoods = data.data.data;
console.log(neighborhoods)
console.log(data)
let options = '';
neighborhoods.forEach(function (neighborhood) {
options += '';
});
$('.neighborhoodsOP').html(options);
filterProjects();
}
});
}
// filter projects by category and city and neighborhood and units space and number of rooms and price range
function filterProjects() {
let selectedCategories = [];
$("input[name='categories[]']:checked").each(function () {
selectedCategories.push($(this).val());
});
let selectedCities = $(".js-select2[name='cities[]']").val();
let selectedNeighborhoods = $(".js-select2[name='neighborhoods[]']").val();
let selectedUnitsSpace = $(".js-range-slider").val();
let selectedNumberOfRooms = $("input[name='my_range']").val();
let SearchInput = $("#searchInput").val();
console.log(SearchInput)
// Modify this based on your input element
// You can also get price range values in a similar way
let urlAction = "filter-projects.html"
$.ajax({
url: urlAction, // Replace with your backend API endpoint
type: 'POST',
data: {
categories: selectedCategories,
cities: selectedCities,
neighborhoods: selectedNeighborhoods,
unitsSpace: selectedUnitsSpace,
numberOfRooms: selectedNumberOfRooms,
search: SearchInput,
'_token': '4gVtGjqFMagIGf6z14kXz2pge9og0lMYdYIwuXR5'
},
success: function (data) {
let html = '';
data.data.data.forEach(function (project) {
console.log(project)
let baseUrl = " ../index.html";
html += `