<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];
$text	= "SELECT * FROM setor_bbm WHERE kode_sb= '$kode' AND batal='' ORDER BY kode_sb";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
	while ($r=mysql_fetch_array($sql)){
		$data['kodesb']= $r[kode_sb];
		$data['batal']= $r[batal];
	}	
	echo json_encode($data);
}else{
	$data['kodesb']= '';
	$data['batal']= '';
	echo json_encode($data);
}
?>