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

$kode= $_POST['kode'];

$sql= mysql_query("SELECT kode_pj,tanggal,kode_pl,nama_pl,sum(jumlah) as tjumlah,sum(potongan) as tpotong,jenis_by,jenis_kt,nokartu,sum(charge_edc) as tcharge,sum(bayar) as tbayar,sum(kembali) as tkembali FROM faktur_pj WHERE kode_pj= '$kode' GROUP BY kode_pj");
$r	= mysql_fetch_assoc($sql);
$data['tanggal']= $r['tanggal'];
$data['kodepl']	= $r['kode_pl'];
$data['namapl']	= $r['nama_pl'];
$data['total']	= $r['tjumlah'];
$data['potong']	= $r['tpotong'];
$data['jenisby']= $r['jenis_by'];
$data['jeniskt']= $r['jenis_kt'];
$data['nokartu']= $r['nokartu'];
$data['charge'] = $r['tcharge'];
$data['bayar']	= $r['tbayar'];
$data['kembali']= $r['tkembali'];
echo json_encode($data);
?>