<?php
include "../../inc/inc.koneksi.php";

$kode	= $_POST['kode'];
$text	= "SELECT kode_km,tanggal,nokas,namakas,pembayar,sum(jumlah) as total FROM jurkm WHERE kode_km= '$kode' GROUP BY kode_km";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['tgl']   = $r['tanggal'];
	$data['nokas'] = $r['nokas'];
	$data['nakas'] = $r['namakas'];
	$data['pemby'] = $r['pembayar'];
	$data['total'] = $r['total'];
	echo json_encode($data);
}
}else{
	$data['tgl']    = '';
	$data['nokas']  = '';
	$data['nakas']  = '';
	$data['pemby']  = '';
	$data['total']  = '';
	echo json_encode($data);
}
?>