<?php 
header("Access-Control-Allow-Headers: Authorization, Content-Type");
header("Access-Control-Allow-Origin: *");
	
	include("confiq.php");
	$npsn=addslashes(trim($_GET['npsn']));

	$koneksi=koneksi_tabungan($npsn);

$cari=addslashes(mysqli_real_escape_string($koneksi,$_GET['cari']));
$api=addslashes(trim($_GET['api']));

if(isset($_GET['api']))
{
    if($api=='AIzaSyARSSmIJjL5LuxZnrjkDnrD')
    {
		 
		  $query2 ="SELECT * FROM `tb_anggota` WHERE (nama LIKE '%".$cari."%') or (idanggota LIKE '%".$cari."%') or (rfid ='".$cari."')";  
		$hasil = mysqli_query($koneksi,$query2);
		while($row = mysqli_fetch_assoc($hasil)) {
		$data[] = $row;
		}
		$json = json_encode($data);
		echo $json;
		
} //end api
}  //end get api      

?>