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

// CEK HAK AKSES DISINI


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


$simpan = mysqli_query($connect,"insert into tb_video set 

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

")or die(mysqli_error($connect));


if($simpan){
	echo"<script>alert('Video pembelajaran berhasil disimpan !');</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>";
}
?>