<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];
$text	= "SELECT * FROM stock WHERE kode_st= '$kode' ORDER BY kode_st";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);
if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['namast']	= $r[nama_st];
	$data['tsatuan']	= $r[satuan];	
	$data['hgbeli']		= $r[hg_beli];
	$data['jmlstok']	= $r[jml_stok];
	echo json_encode($data);
}
}else{
	$data['namast']	= '';
	$data['tsatuan']	= '';
	$data['hgbeli']		= '';
	$data['jmlstok']	= '';
	echo json_encode($data);
}
?>