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

$kode	= $_POST['kode'];
$exp	= explode("-",$kode);
$kodesb	= $exp[0];
$idbon 	= $exp[1];

$sql = mysql_query("SELECT * FROM setor_bbm WHERE kode_sb= '$kodesb' AND id_bon='$idbon' ");
$row = mysql_num_rows($sql);

if ($row>0){
	$r=mysql_fetch_assoc($sql);
	$data['jmlnopol']= $r[jml_nopol];
	
	$input = "DELETE FROM setor_bbm WHERE kode_sb= '$kodesb' AND id_bon='$idbon'";
	mysql_query($input);
	echo json_encode($data);
}else{
	$data['jmlnopol']= '';
	echo json_encode($data);
	echo "Maaf, data $kodesb item $idbon tidak ada";
}
?>