6215b4367a
Sistem WebGIS analisis sebaran penduduk miskin dan jangkauan rumah ibadah. Fitur: peta interaktif Leaflet.js, CRUD rumah ibadah & penduduk miskin, auto-kategorisasi haversine, heatmap, export PDF/CSV, dashboard analitik, manajemen pengguna (superadmin/admin), login sistem. Teknologi: PHP, MySQL, Leaflet.js, OpenStreetMap, Nominatim Geocoding, mPDF. Catatan: jalankan `composer install` di folder uas/ untuk install dependencies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 lines
625 B
PHP
10 lines
625 B
PHP
<?php
|
|
include 'koneksi.php';
|
|
$nama = mysqli_real_escape_string($conn, trim($_POST['nama'] ?? ''));
|
|
$tipe = in_array($_POST['tipe'] ?? '', ['RT','RW','Kelurahan','Kecamatan']) ? $_POST['tipe'] : 'RT';
|
|
$geojson = mysqli_real_escape_string($conn, $_POST['geojson'] ?? '');
|
|
if (!$nama || !$geojson) { echo json_encode(['status'=>'error','message'=>'Data tidak lengkap']); exit; }
|
|
$q = "INSERT INTO wilayah (nama, tipe, geojson) VALUES ('$nama', '$tipe', '$geojson')";
|
|
if (mysqli_query($conn, $q)) echo json_encode(['status' => 'success']);
|
|
else echo json_encode(['status' => 'error', 'message' => mysqli_error($conn)]);
|