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

$kode	= $_POST['kode'];
							$text	= "SELECT kode_ju,debet,kredit FROM jurnalum WHERE kode_ju= '$kode' ORDER BY kode_ju";
$sql 	= mysql_query($text);
$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);
}
?>