<?php 
header("Access-Control-Allow-Headers: Authorization, Content-Type");
header("Access-Control-Allow-Origin: *");

$npsn=addslashes(trim($_GET['npsn']));
include("confiq.php");
$koneksi=koneksi_tabungan($npsn);
$id=addslashes(mysqli_real_escape_string($koneksi,$_GET['id']));
$api=addslashes(trim($_GET['api']));

if(isset($_GET['api']))
{
    if($api=='AIzaSyARSSmIJjL5LuxZnrjkDnrD')
    {

		$query2 ="SELECT * FROM `tb_rekening` WHERE idanggota='".$id."' order by id desc limit 1";  
		$hasil = mysqli_query($koneksi,$query2);
		while($row = mysqli_fetch_assoc($hasil)) {
		$data[] = $row;
		}
		$json = json_encode($data);
		echo $json;
		
} //end api
}  //end get api      

?>