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

// CEK HAK AKSES DISINI

$id_unit		= str_replace("'","`",(isset($_POST['id_unit'])) ? $_POST['id_unit'] : "");
$id_materi		= str_replace("'","`",(isset($_POST['id_materi'])) ? $_POST['id_materi'] : "");
$judul_materi	= str_replace("'","`",(isset($_POST['judul_materi'])) ? $_POST['judul_materi'] : "");


$update = mysqli_query($connect,"update tb_materi set 

		judul_materi	 		= '".$judul_materi."'

	where id_materi='$id_materi'")or die(mysqli_error($connect));


if($update){
	echo"<script>alert('Judul artikel berhasil diperbarui !');</script>";
	echo"<script>document.location.href='index.php?prefix=artikel&unit=$id_unit'</script>";
}else{
	echo"<script>alert('Gagal mengeksekusi perintah ini !');history.go(-1)</script>";
}
?>