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

$kode	= $_POST['kode'];

$text	= "SELECT *	FROM stock_bb WHERE kode_st= '$kode' GROUP BY kode_st ";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);

if ($row>0){
while ($r=mysql_fetch_assoc($sql)){
	$data['namast'] = $r[nama_st];
	$data['jmlstok']= $r[jml_stok];
	$data['satuan'] = $r[satuan];
	$data['hgpokok']= $r[hg_beli];
	echo json_encode($data);
}
}else{
	$data['namast'] = '';
	$data['jmlstok']= '';
	$data['satuan'] = '';
	$data['hgpokok']= '';
	echo json_encode($data);
}
?>
