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

$kode	= $_POST['kode'];
$text	= "SELECT kode_bm,jumlah FROM jurbm WHERE kode_bm= '$kode' ORDER BY kode_bm";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);

if ($row>0){
	$total=0;
	while ($r=mysql_fetch_array($sql)){
		$total=$total+$r[jumlah];
	}
	$data['total']=$total;
	echo json_encode($data);
}
else{
	$data['total']	= '';	
	echo json_encode($data);
}
?>