<?php
include "../../inc/inc.koneksi.php";
$kode	= $_POST['kode'];

$sql	= mysql_query("SELECT * FROM interface");
$r = mysql_fetch_assoc($sql);
$nobb	= $r[piutang];
$noakun 	= $nobb.$kode;

$sql = mysql_query("SELECT * FROM customer WHERE kode_pl= '$kode'");
$row	= mysql_num_rows($sql);
if ($row>0){
	$input = "DELETE FROM customer WHERE kode_pl= '$kode'";
	mysql_query($input);
	$input = "DELETE FROM akun_bp WHERE noakun= '$noakun'";
	mysql_query($input);
	echo "Data Kode pelanggan : $kode sukses dihapus";
}else{
	echo "Maaf, tidak ada";
}
?>