مجتمعات نابضة بالحياة ومزدهرة
مجتمعات نابضة بالحياة ومزدهرة
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 الوحدات
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 selectedالوحدات
Space = $(".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,
الوحدات
Space: selectedالوحدات
Space,
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 += ` ${project.description}
We could not find any item that matches your search