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

$kode= $_POST['kode'];

$sql = mysql_query("SELECT kode_pj,tanggal,kode_cab,kode_pl,nama_pl,sum(jumlah) as tjumlah,sum(hpp) as thpp,sum(potongan) as tpotong,jenis_by,nobank,sum(charge_edc) as tcharge,sum(bayar) as tbayar,sum(kembali) as tkembali,user FROM faktur_pj WHERE kode_pj= '$kode' GROUP BY kode_pj");
$r	 = mysql_fetch_assoc($sql);

$data['tgl']	= $r['tanggal'];
$data['kodecab']= $r['kode_cab'];
$data['kodepl']	= $r['kode_pl'];
$data['namapl']	= $r['nama_pl'];
$data['total'] 	= $r['tjumlah'];
$data['jenisby']= $r['jenis_by'];
$data['nobank']	= $r['nobank'];
$data['charge']	= $r['tcharge'];
$data['tbayar']	= $r['tbayar'];
$data['tkembali']= $r['tkembali'];
$data['tpotong'] = $r['tpotong'];
$data['thpp']	 = $r['thpp'];
$data['user']	 = $r['user'];
echo json_encode($data);
?>