fixing
This commit is contained in:
@@ -484,7 +484,7 @@ $result = $stmt->get_result();
|
||||
|
||||
<div class="card-body text-center">
|
||||
<h5 class="card-title"><?php echo htmlspecialchars($row['name']); ?></h5>
|
||||
<p class="card-text"><?php echo htmlspecialchars($row['address']); ?></p>
|
||||
<p class="card-text"><?php echo htmlspecialchars($row['address']); ?> - <?php echo htmlspecialchars($row['city']); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -591,7 +591,11 @@ $result = $stmt->get_result();
|
||||
<script>
|
||||
// Gestisci l'eliminazione con SweetAlert
|
||||
$('.delete-home-btn').on('click', function() {
|
||||
var idhome = $(this).data('id'); // Ottieni l'id della casa
|
||||
console.log("Bottone eliminazione cliccato!"); // Debugging
|
||||
|
||||
var idhome = $(this).data('id');
|
||||
console.log("ID Casa:", idhome); // Debugging
|
||||
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro?',
|
||||
text: "Questa azione eliminerà la casa e non può essere annullata.",
|
||||
@@ -603,16 +607,7 @@ $result = $stmt->get_result();
|
||||
cancelButtonText: 'Annulla'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// Chiude il dropdown prima di eseguire l'azione
|
||||
let dropdownMenu = $(this).closest('.dropdown-menu');
|
||||
let dropdownButton = dropdownMenu.prev('.dropdown-toggle');
|
||||
let dropdownInstance = bootstrap.Dropdown.getInstance(dropdownButton[0]);
|
||||
|
||||
if (dropdownInstance) {
|
||||
dropdownInstance.hide();
|
||||
}
|
||||
|
||||
// Reindirizza al file di eliminazione
|
||||
console.log("Utente ha confermato l'eliminazione."); // Debugging
|
||||
window.location.href = "delete-home.php?idhome=" + idhome;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user