Initial commit: Setup Landing Page dan file pertemuan

This commit is contained in:
Romeo3
2026-06-09 13:50:00 +07:00
commit c94bc418ef
35 changed files with 8807 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
<?php
include 'koneksi.php';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$id = isset($_POST['id']) ? intval($_POST['id']) : 0;
$tabel = isset($_POST['tabel']) ? trim($_POST['tabel']) : '';
$stmt = null;
if ($id <= 0) {
http_response_code(400);
echo "ID tidak valid!";
exit;
}
if ($tabel == 'jalan') {
$nama = isset($_POST['nama_jalan']) ? trim($_POST['nama_jalan']) : '';
$status = isset($_POST['status']) ? trim($_POST['status']) : '';
if (empty($nama)) {
http_response_code(400);
echo "Nama jalan tidak boleh kosong!";
exit;
}
$stmt = $conn->prepare("UPDATE jalan SET nama_jalan=?, status=? WHERE id=?");
$stmt->bind_param("ssi", $nama, $status, $id);
} else if ($tabel == 'parsil') {
$nama = isset($_POST['nama_pemilik']) ? trim($_POST['nama_pemilik']) : '';
$status = isset($_POST['status']) ? trim($_POST['status']) : '';
if (empty($nama)) {
http_response_code(400);
echo "Nama pemilik tidak boleh kosong!";
exit;
}
$stmt = $conn->prepare("UPDATE parsil SET nama_pemilik=?, status=? WHERE id=?");
$stmt->bind_param("ssi", $nama, $status, $id);
} else {
http_response_code(400);
echo "Tabel tidak valid!";
exit;
}
if ($stmt) {
if ($stmt->execute()) {
echo "Data berhasil diperbarui!";
} else {
http_response_code(500);
echo "Gagal memperbarui: " . $conn->error;
}
$stmt->close();
}
$conn->close();
} else {
http_response_code(405);
echo "Metode tidak diizinkan";
}
?>