Initial Commit: Tugas Semua Pertemuan

This commit is contained in:
2026-06-08 22:49:54 +07:00
commit 51ea70b6ce
51 changed files with 6841 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
include 'koneksi.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$id = intval($_POST['id']);
$foto = mysqli_real_escape_string($conn, $_POST['foto']);
// Hapus file foto
$targetDir = "uploads/";
if (!empty($foto) && file_exists($targetDir . $foto)) {
unlink($targetDir . $foto);
}
$query = "DELETE FROM jalan_rusak WHERE id=$id";
if (mysqli_query($conn, $query)) {
echo "success";
} else {
echo "db_error: " . mysqli_error($conn);
}
} else {
echo "invalid_request";
}
?>