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

$kode	= $_POST['kode'];
$sql 	= mysql_query("SELECT tanggal,nomor_fk,kode_sup,nama_sup,kode_opb,tanggal_jt,sum(jumlah) as total,sum(potongan) as tpotong,sum(bayar) as tbayar,sum(kurang) as tkurang FROM faktur_pb WHERE kode_pb= '$kode' GROUP BY kode_pb");
$r		= mysql_fetch_assoc($sql);
$data['tgl']		= $r['tanggal'];
$data['nomorfk']	= $r['nomor_fk'];
$data['kodesup']	= $r['kode_sup'];
$data['namasup'] 	= $r['nama_sup'];
$data['kodeopb']    = $r['kode_opb'];
$data['tanggaljt']  = $r['tanggal_jt'];
$data['total']      = $r['total'];
$data['potong']     = $r['tpotong'];
$data['bayar']      = $r['tbayar'];
$data['kurang']     = $r['tkurang'];
echo json_encode($data);
?>