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

$kode	= $_POST[kode];
$text	= "SELECT kode_ju,tanggal,sum(debet) as tdebet,sum(kredit) as tkredit FROM jurnalum WHERE kode_ju= '$kode' GROUP BY kode_ju";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['tgl']		= $r[tanggal];	
	$data['tdebet'] = $r[tdebet];
	$data['tkredit'] = $r[tkredit];
	echo json_encode($data);
}
}else{
	$data['tgl']		= '';	
	$data['tdebet']= '';
	$data['tkredit']= '';
	echo json_encode($data);
}
?>