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

$kode= $_POST['kode'];

$sql1= mysql_query("SELECT * FROM jurppi_tmp WHERE nofak= '$kode' ");
$row = mysql_num_rows($sql1);
if ($row>0){
	$input = "UPDATE jurppi_tmp SET batal='BATAL' WHERE nofak='$kode'";
	mysql_query($input);
	
	$sql= mysql_query("SELECT * FROM jurppi_tmp WHERE batal= '' ");
    $row= mysql_num_rows($sql1);
	$tbayar=0
	while($r1=mysql_fetch_array($sql1)){
		$tbayar=$tbayar+$r[dibayar];
	}
	$data['tbayar'] = $tbayar;
	echo json_encode($data);
}else{
	$data['tbayar'] = '';
	echo json_encode($data);
	echo "Maaf, data $kode tidak ada";
}
?>
