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

// CEK HAK AKSES DISINI

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


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

		judul_video		= '".$judul_video."',
		link 			= '".$link."'

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


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