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

$kode	= $_POST[kode];
$sql 	= mysql_query("SELECT tanggal,kode_sp,nama_sp,kode_dv,nama_dv,nopol,sum(jml_unit) as tunit,sum(jumlah) as tjumlah FROM faktur_sj WHERE kode_pj= '$kode' GROUP BY kode_pj");
$r		= mysql_fetch_assoc($sql);
$data[tgl]      = $r[tanggal];
$data[kodesp]   = $r[kode_sp];
$data[namasp]   = $r[nama_sp];
$data[kodedv]   = $r[kode_dv];
$data[namadv]   = $r[nama_dv];
$data[nopol]    = $r[nopol];
$data[tunit]    = $r[tunit];
$data[total]    = $r[tjumlah];
echo json_encode($data);
?>