<?php
include'config.php';
 
$query = "select * from tb_pengaduan";
$hasil  =mysqli_query($koneksi,$query);
 
 
if(mysqli_num_rows($hasil) > 0 ){
  $response = array();
  $response["tb_pengaduan"] = array();
  while($x = mysqli_fetch_array($hasil)){
    $h['id'] = $x["id_pengaduan"];
    $h['asal_pengaduan'] = $x["asal_pengaduan"];
    $h['pemohon'] = $x["identitas_p"];
    $h['termohon'] = $x["identitas_t"];
    $h['satker'] = $x["satker"];
    $h['pengaduan'] = $x["pengaduan"];
    $h['deskripsi'] = $x["deskripsi"];
    $h['bukti'] = $x["bukti"];
    array_push($response["tb_pengaduan"], $h);
  }
  echo json_encode($response);
}else {
  $response["message"]="tidak ada data";
  echo json_encode($response);
}
?>



