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

$kode= $_POST['kode'];
$sql = mysql_query("SELECT * FROM jurmbr WHERE kode_mb= '$kode' GROUP BY kode_mb");
$r   = mysql_fetch_assoc($sql);
$gdasal=$r['gd_asal'];
$gdtujuan=$r['gd_tujuan'];

if($gdasal=='1') $asal='PRODUKSI';
else $asal='MOMONG';

if($gdtujuan=='1') $tujuan='PRODUKSI';
else $tujuan='MOMONG';

$data['tanggal'] = $r['tanggal'];	
$data['petugas'] = $r['petugas'];
$data['gdasal']  = $r['gd_asal'];
$data['asal']    = $asal;
$data['gdtujuan']= $r['gd_tujuan'];
$data['tujuan']  = $tujuan;
$data['kategori']= $r['kategori'];
echo json_encode($data);
?>