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

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

if ($row>0){
while ($r=mysql_fetch_array($sql)){
	$data['nourut']= $r[no_urut];
	$data['jenisst']= $r[jenis_st];
	$data['kodest']	= $r[kode_st];
	$data['namast']= $r[nama_st];
	$data['satuan']= $r[satuan];	
	$data['hgpokok']= $r[hg_beli];
	$data['jmlstok']= $r[jml_stok];
	$data['jmlopn']= $r[jml_opn];
	$data['jmlsls']= $r[jml_sls];
	$data['nilaisls']= $r[nilai_sls];
	echo json_encode($data);
}
}else{
	$data['nourut']= '';
	$data['kodest']= '';
	$data['namast']= '';
	$data['satuan']= '';	
	$data['hgpokok']= '';	
	$data['jmlstok']= '';
	$data['jmlopn']= '';
	$data['jmlsls']= '';
	$data['nilaisls']= '';
	echo json_encode($data);	
}
?>