<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];
$exp	= explode(".",$kode);
$kodepb= $exp[0];
$kodest= $exp[1];

$text	= "SELECT * FROM faktur_pb WHERE kode_pb='$kodepb' AND kode_st= '$kodest' ORDER BY kode_pb AND kode_st";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['kodest']		= $r[kode_st];
	$data['namast']	= $r[nama_st];
	$data['tsatuan']	= $r[satuan];
	$data['jmlkirim']	= $r[jml_unit];
	$data['hgbeli']		= $r[hg_beli];
	echo json_encode($data);
}
}else{
	$data['kodest']		= '';
	$data['namast']	= '';
	$data['tsatuan']	= '';
	$data['jmlkirim']	= '';
	$data['hgbeli']		= '';
	echo json_encode($data);
}
?>