Files
UAS_SIG_A/02/hapus_pengaduan.php
T
2026-06-10 20:12:23 +07:00

18 lines
468 B
PHP

<?php
include 'koneksi.php';
if (isset($_GET['id'])) {
$id = mysqli_real_escape_string($conn, $_GET['id']);
$query = "DELETE FROM pengaduan_warga WHERE id = '$id'";
if (mysqli_query($conn, $query)) {
echo "<script>
alert('Laporan pengaduan berhasil dihapus!');
window.location.href='index.php';
</script>";
} else {
echo "Gagal menghapus data: " . mysqli_error($conn);
}
}
?>