<?php

require_once "conn.php";

$stmt = $conn->prepare("SELECT id, nama_desa, nama_kecamatan, nama_kabupaten, nama_propinsi, logo, alamat_kantor FROM config;");

$stmt->execute();
$stmt->bind_result($id, $desa, $kec, $kab, $prop, $logo, $alamat);

$config = array();

while($stmt->fetch()){
    $temp = array();
    $temp['id'] = $id;
    $temp['desa'] = $desa;
    $temp['kecamatan'] = $kec;
    $temp['kabupaten'] = $kab;
    $temp['provinsi'] = $prop;
    $temp['logo'] = $logo;
    $temp['alamat'] = $alamat;

    array_push($config, $temp);
}

echo json_encode($config);