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

$kode= $_POST['kode'];

$sql= mysql_query("SELECT kode_pj,tanggal,kode_sop,kode_plg,nama_plg,tanggal_jt,sum(jumlah) as total,sum(potongan) as tpotong,sum(bayar) as tbayar,sum(kurang) as tkurang,sum(hpp) as thpp FROM faktur_pjg WHERE kode_pj='$kode' GROUP BY kode_pj");
$r	= mysql_fetch_assoc($sql);
$data['tgl']		= $r['tanggal'];
$data['kodesop']	= $r['kode_sop'];
$data['kodeplg']	= $r['kode_plg'];
$data['namaplg']	= $r['nama_plg'];
$data['tanggaljt']	= $r['tanggal_jt'];
$data['total']		= $r['total'];
$data['potong'] 	= $r['tpotong'];
$data['bayar']		= $r['tbayar'];
$data['kurang']		= $r['tkurang'];
$data['thpp']		= $r['thpp'];
echo json_encode($data);
?>