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

// CEK HAK AKSES DISINI

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

//echo $konten;

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

		konten 			= '".$konten."'

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

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