<?php
session_start();
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));
include"../../../../inc/conn.php";

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


$delete1 	= mysqli_query($connect,"delete from tb_pretest where id_pretest='$id_pretest'")or die(mysqli_error($connect));
$delete2 	= mysqli_query($connect,"delete from tb_jawaban_pretest where id_pretest='$id_pretest'")or die(mysqli_error($connect));


if($delete1){
	echo"<script>alert('Soal pretest berhasil dihapus !');</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>";
}


?>