mohon bntuanya sdikit para master php
$id= $_GET['id'];
//get today's date
$pecah = explode("-",$tgl_pinjam);
$next_7_hari = mktime(0,0,0,$pecah[1],$pecah[0]+7,$pecah[2]);
$hari_next = date("Y-m-d", $next_7_hari);
//write a query to update that the book is returned
$sql = "UPDATE peminjaman SET tgl_kembali='$hari_next' WHERE id_peminjaman='$id'";
$result = mysqli_query($connection, $sql);
if($result){
echo"<script type='text/javascript'>
onload =function(){
alert('Data berhasil diperpanjang!');
document.location='daftar-peminjaman.php';
}
</script>";
}else{
echo "<script>alert('Data gagal diperpanjang. Silahkan cek kembali.');</script>";
}