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

$tglawal	= $_POST['tglawal'];
$tglakhir	= $_POST['tglakhir'];

mysql_query("UPDATE faktur_pj SET import='v' WHERE tanggal BETWEEN '$tglawal' AND '$tglakhir' AND batal='' AND posting='P' ");

$sql1	= mysql_query("SELECT sum(jumlah) as timport,sum(potongan) as tpotongan  FROM faktur_pj WHERE tanggal BETWEEN '$tglawal' AND '$tglakhir' AND import='v' ");
$r1		= mysql_fetch_assoc($sql1);
$timport=$r1['timport']-$r1['tpotongan'];
$prosen=100;

$data['timport']	= $timport;
$data['prosen'] 	= $prosen;
echo json_encode($data);
?>