commit 6c0bc590dd5a53573a00afe942a2d40571a82536 Author: YaraAqmal Date: Sun Jun 7 13:42:40 2026 +0700 Initial commit - Fresh Clean Code diff --git a/LinkWebsite_JalanRusak_Marker.txt b/LinkWebsite_JalanRusak_Marker.txt new file mode 100644 index 0000000..ad54515 --- /dev/null +++ b/LinkWebsite_JalanRusak_Marker.txt @@ -0,0 +1 @@ +https://sigwebsite.free.je/JalanRusak_Marker/ \ No newline at end of file diff --git a/api_jalan_rusak.php b/api_jalan_rusak.php new file mode 100644 index 0000000..574b8d6 --- /dev/null +++ b/api_jalan_rusak.php @@ -0,0 +1,53 @@ +query("SELECT * FROM jalan_rusak ORDER BY created_at DESC"); + $data = []; + while ($row = $result->fetch_assoc()) { + $data[] = $row; + } + sendResponse(true, 'Data berhasil dimuat', $data); +} +elseif ($method === 'POST' && $action === 'create') { + $nama = $_POST['nama'] ?? ''; + $lat = $_POST['latitude'] ?? 0; + $lng = $_POST['longitude'] ?? 0; + $alamat = $_POST['alamat'] ?? ''; + $catatan = $_POST['catatan'] ?? ''; + + $foto_name = ''; + // Logika Upload File Foto + if (isset($_FILES['foto_file']) && $_FILES['foto_file']['error'] === UPLOAD_ERR_OK) { + $ext = pathinfo($_FILES['foto_file']['name'], PATHINFO_EXTENSION); + $foto_name = 'img_' . time() . '.' . $ext; + move_uploaded_file($_FILES['foto_file']['tmp_name'], $upload_dir . $foto_name); + } + + $stmt = $conn->prepare("INSERT INTO jalan_rusak (nama, latitude, longitude, alamat, catatan, foto) VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->bind_param("sddsss", $nama, $lat, $lng, $alamat, $catatan, $foto_name); + + if ($stmt->execute()) { + sendResponse(true, 'Laporan berhasil disimpan'); + } else { + sendResponse(false, 'Gagal menyimpan ke database'); + } +} +elseif ($method === 'DELETE' && $action === 'delete') { + $id = intval($_GET['id']); + // Opsional: Hapus file fisik foto di sini jika diperlukan + $stmt = $conn->prepare("DELETE FROM jalan_rusak WHERE id=?"); + $stmt->bind_param("i", $id); + $stmt->execute(); + sendResponse(true, 'Laporan dihapus'); +} +?> \ No newline at end of file diff --git a/config.php b/config.php new file mode 100644 index 0000000..d2e8a3a --- /dev/null +++ b/config.php @@ -0,0 +1,26 @@ +connect_error) { + die(json_encode(['success' => false, 'message' => 'Koneksi gagal: ' . $conn->connect_error])); +} + +$conn->set_charset("utf8"); + +function sendResponse($success, $message, $data = null) { + echo json_encode(['success' => $success, 'message' => $message, 'data' => $data]); + exit; +} +?> \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..dc5d221 --- /dev/null +++ b/index.html @@ -0,0 +1,258 @@ + + + + + Sistem Pelaporan Jalan Rusak V3 - Full Draggable + + + + + + + +
+
+
+
+ + + +
+ + Tips: Semua marker (baru maupun lama) dapat digeser untuk menyesuaikan posisi koordinat secara presisi. +
+
+ +
+ +
+
+
+ + + + + \ No newline at end of file diff --git a/uploads/img_1778518733.jpg b/uploads/img_1778518733.jpg new file mode 100644 index 0000000..a4ddb3e Binary files /dev/null and b/uploads/img_1778518733.jpg differ diff --git a/uploads/img_1778520128.jpg b/uploads/img_1778520128.jpg new file mode 100644 index 0000000..583f9ad Binary files /dev/null and b/uploads/img_1778520128.jpg differ