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

$kode	= $_POST['kode'];

$sql 	= mysql_query("SELECT kode_pb,tanggal,nomor_fk,kode_sup,nama_sup,sum(jumlah) as total,sum(potongan) as jpotong,sum(bayar) as jbayar,sum(kurang) as jkurang 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['total']		= $r['total'];
$data['potong']	    = $r['jpotong'];
$data['bayar']		= $r['jbayar'];
$data['kurang'] 	= $r['jkurang'];
echo json_encode($data);
?>