'Akses Ditolak: Anda bukan Admin!'])); } // otak_spbu/api_hapus_spbu.php header("Content-Type: application/json; charset=UTF-8"); header("Access-Control-Allow-Methods: POST"); require_once '../koneksi.php'; $data = json_decode(file_get_contents("php://input")); if (!empty($data->id)) { try { $stmt = $conn->prepare("DELETE FROM spbu_markers WHERE id = :id"); $stmt->bindValue(':id', $data->id, PDO::PARAM_INT); if($stmt->execute()) { echo json_encode(["pesan" => "SPBU berhasil dihapus."]); } } catch(PDOException $e) { http_response_code(500); echo json_encode(["error" => $e->getMessage()]); } } ?>