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

$kode	= $_POST['kode'];

$sql 	= mysql_query("SELECT sum(jumlah) as tjumlah FROM sopb WHERE kode_opb= '$kode'");
$row	= mysql_num_rows($sql);

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

echo json_encode($data);
?>