|
|
@ -1392,7 +1392,7 @@ |
|
|
var streetId = $('#summaryStreetId').text().trim(); |
|
|
var streetId = $('#summaryStreetId').text().trim(); |
|
|
var landmark = $('#summaryLandmark').text().trim(); |
|
|
var landmark = $('#summaryLandmark').text().trim(); |
|
|
var latitude = $('#summaryLatitude').text().trim(); |
|
|
var latitude = $('#summaryLatitude').text().trim(); |
|
|
var longtitude = $('#summaryLongitude').text().trim(); // Note the misspelling: it should match the controller parameter |
|
|
|
|
|
|
|
|
var longtitude = $('#summaryLongitude').text().trim(); // Note the misspelling |
|
|
var gender = $('#summaryGender').text().trim(); |
|
|
var gender = $('#summaryGender').text().trim(); |
|
|
var imageSrc = $('#summaryImage').attr('src'); |
|
|
var imageSrc = $('#summaryImage').attr('src'); |
|
|
|
|
|
|
|
|
@ -1427,15 +1427,23 @@ |
|
|
StreetId: streetId, |
|
|
StreetId: streetId, |
|
|
Comp_Image: imageSrc, |
|
|
Comp_Image: imageSrc, |
|
|
latitude: latitude, |
|
|
latitude: latitude, |
|
|
longtitude: longtitude, // Ensure this matches the controller parameter name |
|
|
|
|
|
|
|
|
longtitude: longtitude, |
|
|
Landmark: landmark, |
|
|
Landmark: landmark, |
|
|
gender: gender |
|
|
gender: gender |
|
|
}, |
|
|
}, |
|
|
success: function (response) { |
|
|
success: function (response) { |
|
|
// Handle success response |
|
|
|
|
|
console.log('Success:', response); |
|
|
|
|
|
alert('Complaint registered successfully!'); |
|
|
|
|
|
// You can also redirect or reset the form here |
|
|
|
|
|
|
|
|
// SweetAlert upon success |
|
|
|
|
|
Swal.fire({ |
|
|
|
|
|
title: 'Success!', |
|
|
|
|
|
text: 'Your complaint has been submitted.', |
|
|
|
|
|
icon: 'success', |
|
|
|
|
|
confirmButtonText: 'OK' |
|
|
|
|
|
}).then((result) => { |
|
|
|
|
|
if (result.isConfirmed) { |
|
|
|
|
|
// Redirect to home.html after clicking 'OK' |
|
|
|
|
|
window.location.href = 'home'; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
error: function (xhr, status, error) { |
|
|
error: function (xhr, status, error) { |
|
|
// Improved error handling |
|
|
// Improved error handling |
|
|
@ -1444,7 +1452,7 @@ |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|