<?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['hgbeli']= $r[hg_beli];
	$data['jmlstok']= $r[jml_stok];	
	echo json_encode($data);
}
}else{
	$data['namast']	= '';
	$data['satuan']	= '';
	$data['hgbeli']= '';
	$data['jmlstok']= '';
	echo json_encode($data);
}
?>