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

// CEK HAK AKSES DISINI

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

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


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

		kunci			= '".$kunci."'
		
	where id_pretest='$id_pretest'")or die(mysqli_error($connect));


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