<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];
$exp	= explode("-",$kode);
$kodeop	= $exp[0];
$kodest	= $exp[1];

$text	= "SELECT * FROM st_opname WHERE kode_op= '$kodeop' AND kode_st='$kodest'";
$sql 	= mysql_query($text);
$row	= mysql_num_rows($sql);

if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['kodest']	= $r[kode_st];
	$data['namast']= $r[nama_st];
	$data['tsatuan']= $r[satuan];
	$data['jmlstok']= $r[jml_stok];
	$data['jmlopn']= $r[jml_opn];
	$data['hgbeli']	= $r[hg_beli];	
	echo json_encode($data);
}
}else{
	$data['kodest']= '';
	$data['namast']= '';
	$data['tsatuan']= '';
	$data['jmlstok']= '';
	$data['jmlopn']= '';
	$data['hgbeli']	= '';	
	echo json_encode($data);	
}
?>