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

$kode= $_POST['kode'];
$sql = mysql_query("SELECT kode_rb,tanggal,kode_sup,nama_sup,nomor_fk,tanggal_fk,cara_by,sum(jumlah) as total FROM retur_pb WHERE kode_rb= '$kode' GROUP BY kode_rb");
$r	 = mysql_fetch_assoc($sql);
$data['tgl']		= $r['tanggal'];
$data['kodesup']	= $r['kode_sup'];
$data['namasup']	= $r['nama_sup'];
$data['nomorfk']	= $r['nomor_fk'];
$data['tanggalfk']	= $r['tanggal_fk'];
$data['caraby']		= $r['cara_by'];
$data['total']		= $r['total'];
echo json_encode($data);
?>