big update casadoc
This commit is contained in:
@@ -25,9 +25,12 @@ $result = $stmt->get_result();
|
||||
<!-- Bootstrap 4 CSS -->
|
||||
<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/dripicons/2.0.0/webfont.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="assets/css/style.css" rel="stylesheet" type="text/css">
|
||||
@@ -102,16 +105,37 @@ $result = $stmt->get_result();
|
||||
<td><?php echo htmlspecialchars($row['country']); ?></td>
|
||||
<td>
|
||||
<!-- Pulsante per modificare i dettagli della casa -->
|
||||
<a href="manage-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-info btn-sm">
|
||||
<i class="fas fa-info-circle"></i> Dettagli
|
||||
<a href="manage-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-info btn-sm" title="Dettagli">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
</a>
|
||||
<a href="documents-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-primary btn-sm">
|
||||
<i class="fas fa-info-circle"></i> Documenti
|
||||
|
||||
<!-- Pulsante per i documenti della casa -->
|
||||
<a href="documents-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-primary btn-sm" title="Documenti">
|
||||
<i class="fas fa-folder-open"></i>
|
||||
</a>
|
||||
<a href="manage-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-danger btn-sm">
|
||||
<i class="fas fa-info-circle"></i> Elimina
|
||||
|
||||
<!-- Pulsante per condividere la casa -->
|
||||
<a href="share-home.php?idhome=<?php echo $row['idhome']; ?>" class="btn btn-warning btn-sm" title="Condividi">
|
||||
<i class="fas fa-share-alt"></i>
|
||||
</a>
|
||||
|
||||
<!-- Pulsante per passaggio proprietà -->
|
||||
<button class="btn btn-secondary btn-sm transfer-property-btn" data-id="<?php echo $row['idhome']; ?>" title="Passaggio Proprietà">
|
||||
<i class="fas fa-exchange-alt"></i>
|
||||
</button>
|
||||
|
||||
<!-- Pulsante per assegnare le persone proprietarie -->
|
||||
<button class="btn btn-success btn-sm assign-owner-btn" data-id="<?php echo $row['idhome']; ?>" title="Assegna Proprietari">
|
||||
<i class="fas fa-user-plus"></i>
|
||||
</button>
|
||||
|
||||
<!-- Pulsante per eliminare la casa -->
|
||||
<button class="btn btn-danger btn-sm delete-home-btn" data-id="<?php echo $row['idhome']; ?>" title="Elimina">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
@@ -148,6 +172,59 @@ $result = $stmt->get_result();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Inizializza DataTables con filtri di colonna
|
||||
var table = $('#homeTable').DataTable();
|
||||
|
||||
// Aggiungi ricerca personalizzata in ogni colonna
|
||||
$('#homeTable thead tr:eq(1) th').each(function(i) {
|
||||
$('input', this).on('keyup change', function() {
|
||||
if (table.column(i).search() !== this.value) {
|
||||
table.column(i).search(this.value).draw();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Gestisci l'eliminazione con SweetAlert
|
||||
$('.delete-home-btn').on('click', function() {
|
||||
var idhome = $(this).data('id'); // Ottieni l'id della casa
|
||||
Swal.fire({
|
||||
title: 'Sei sicuro?',
|
||||
text: "Questa azione eliminerà la casa e non può essere annullata.",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: 'Sì, elimina',
|
||||
cancelButtonText: 'Annulla'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
// Reindirizza al file di eliminazione
|
||||
window.location.href = "delete-home.php?idhome=" + idhome;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<?php if (isset($_GET['status']) && $_GET['status'] == 'success') { ?>
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Eliminazione completata!',
|
||||
text: 'La casa è stata eliminata con successo.'
|
||||
});
|
||||
<?php } elseif (isset($_GET['status']) && $_GET['status'] == 'error') { ?>
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Errore!',
|
||||
text: 'Si è verificato un errore durante l\'eliminazione della casa.'
|
||||
});
|
||||
<?php } ?>
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user