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

$kode	= $_POST['kode'];
$exp	= explode("-",$kode);
$kodeju	= $exp[0];
$nourut	= $exp[1];

$sql 	= mysql_query("SELECT * FROM jurnalum WHERE kode_ju='$kodeju' AND no_urut='$nourut'");
$r		= mysql_fetch_assoc($sql);

$debet=$r[debet];
$kredit=$r[kredit];

if(!($debet==0)) $jumlah=$debet;
else $jumlah=$kredit;

$data['nourut']	= $r[no_urut];
$data['noakun']	= $r[noakun];
$data['nobp']	= $r[nobp];
$data['naakun']	= $r[naakun];
$data['nofak']	= $r[nofak];
$data['kodest']	= $r[kode_st];
$data['jmlunit']= $r[jml_unit];
$data['ket']	= $r[keterangan];	
$data['debet']	= $r[debet];
$data['kredit']	= $r[kredit];
$data['jumlah']	= $jumlah;
$data['posting']= $r[posting];
echo json_encode($data);
?>