<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];

$sql 	= mysql_query("SELECT * FROM stock WHERE kode_st= '$kode' ORDER BY kode_st");
$row	= mysql_num_rows($sql);
if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['namast']	= $r['nama_st'];
	$data['satuan']	= $r['satuan'];
	$data['hgpokok']= $r['hg_beli'];
	echo json_encode($data);
}
}else{
	$data['namast']	= '';
	$data['satuan']	= '';
	$data['hgpokok']= '';	
	echo json_encode($data);
}
?>