<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];

$sql 	= mysql_query("SELECT sum(jml_unit) as tunit,sum(jumlah) as tjumlah FROM surat_jln WHERE kode_sj= '$kode' GROUP BY kode_sj");
$row	= mysql_num_rows($sql);

if ($row>0){
	$r=mysql_fetch_assoc($sql);
	$data['tunit']	= $r[tunit];
	$data['total']	= $r[tjumlah];
	echo json_encode($data);
}else{
	$data['tunit']	= 0;
	$data['total']	= 0;
	echo json_encode($data);
}
?>