<?php
error_reporting(0);
include('../koneksi.php');
if (isset($_GET['rekening']) AND isset($_GET['no_bukti'])){
$rekening = $_POST['rekening'];
}
$no_bukti     = $_POST['no_bukti'];
$username     = $_SESSION['username'];
$kode         = $_SESSION['kode'];
$rekening     = $_POST['rekening'];
$tgl          = date('Y-m-d',strtotime($_POST['tgl']));
$pokok        = str_replace(",", "", $_POST['pokok']);


$bakidebet   = str_replace(",", "", $_POST['bakidebet'])+$pokok;

$query = mysqli_query($koneksi,"DELETE FROM angsuran WHERE no_bukti='$no_bukti' AND kode='$kode' ")or die(mysqli_error($koneksi));
$query = mysqli_query($koneksi,"UPDATE pinjaman SET bakidebet='$bakidebet' where rekening='$rekening' ")or die(mysqli_error($koneksi));

$query = mysqli_query($koneksi,"DELETE FROM bukubesar WHERE no_bukti='$no_bukti' AND kode='$kode' ")or die(mysqli_error($koneksi));
echo "data sukses";

?>
