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

// CEK HAK AKSES DISINI

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


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

		judul_unit	 		= '".$judul_unit."',
		aktif				= '".$aktif."'

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


if($update){
	echo"<script>alert('Unit berhasil diperbarui !');</script>";
	echo"<script>document.location.href='datamodul'</script>";
}else{
	echo"<script>alert('Gagal mengeksekusi perintah ini !');history.go(-1)</script>";
}
?>