<?php
    include('../loginsession.php');
    error_reporting(E_ALL);
    $filename = __FILE__;  //---Nama file saat ini
    if (strlen(__FILE__) > 48) {$filename = substr(__FILE__, 48);}
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filename')");

$code=  $_GET['code'];
$array = explode("-", $code);
$id = $array[0];
$userid= $array[1];
$keterangan=  $_POST['keterangan']; 
$nilai=  $_POST['nilai'];

$save=mysqli_query($conn, "UPDATE novia_abc_cash_loan SET nilai='$nilai', keterangan='$keterangan' where id='$id'");
if($save){ echo "<script>document.location='cash-piutang.php?userid=$userid'</script>";} 
/*
if (is_numeric($harga) && $harga != 0) {
	if ( $password != 000 ) { 
		echo "<script>alert('Password Anda Salah');document.location='cash-belanja-edit.php?id=$id'</script>"; 
	}   else { $save=mysqli_query($conn, "UPDATE novia_abc_cash_shopping SET date_='$tgl_belanja', keterangan='$keterangan', harga='$harga' where id='$id'");
		if($save){ echo "<script>document.location='cash-view-daily.php?tanggal=$tgl'</script>";} 
		else { echo "<script>alert('Proses simpan gagal, coba kembali');document.location='cash-belanja-edit.php?id=$id'</script>"; }
	}
}
if (!is_numeric($harga) || $harga == 0) {
	echo "<script>alert('Harga masih kosong');document.location='cash-belanja-edit.php?id=$id'</script>"; 
}
*/
?>
