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

$kode= $_POST['kode'];

$sql = mysql_query("SELECT * FROM stock WHERE barcode= '$kode' ");
$row = mysql_num_rows($sql);

if ($row>0){
	$r=mysql_fetch_assoc($sql);
	$data['kodest'] = $r['kode_st'];
	$data['namast']	= $r['nama_st'];
	$data['foto']	= $r['foto'];
	echo json_encode($data);
}else{
	$data['kodest'] = '';
	$data['namast']	= '';
	$data['foto']	= '';
	echo json_encode($data);
}
?>