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

$kodeaw	= $_POST[kodeaw];
$kodeak	= $_POST[kodeak];

$sql	= mysql_query("SELECT * FROM jurnalum WHERE kode_ju BETWEEN '$kodeaw' AND '$kodeak' ORDER BY kode_ju");
$row	= mysql_num_rows($sql);
if ($row>0){
	$tdebet=0;
	$tkredit=0;
	while($r=mysql_fetch_array($sql)){
		$tdebet=$tdebet+$r[debet];
		$tkredit=$tkredit+$r[kredit];
	}
	$data['tdebet']=$tdebet;
	$data['tkredit']=$tkredit;
	echo json_encode($data);
else
	$data['tdebet']='';
	$data['tkredit']='';
	echo json_encode($data);
}
?>