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

$sql 	= mysql_query("SELECT * FROM faktur_pj WHERE kode_pj= '$kodepj' AND no_urut='$nourut'");
$r		= mysql_fetch_assoc($sql);
$jmlunit= $r['jml_unit'];

$data['nourut']	= $r['no_urut'];
$data['kodest']	= $r['kode_st'];
$data['namast']	= $r['nama_st'];
$data['barcode']= $r['barcode'];
$data['satuan'] = $r['satuan'];
$data['jmlunit']= $r['jml_unit'];
$data['hgjual']	= $r['hg_jual'];

if(!$jmlunit==0)
    $data['hgbeli']	= $r['hpp']/$r['jml_unit'];
else
    $data['hgbeli']	= $r['hpp'];

$data['jumlah'] = $r['jumlah'];
echo json_encode($data);
?>