<?php
session_start();
include_once('../../config/#Config.php');
if(!$_SESSION['UserName']){
die('<script>window.location.href=\''.$config['site']['url'].'index.php\';</script>');
} else {
$get_AD = mysqli_query($conn, "Select * From config_admin WHERE Account = '".$_SESSION['UserName']."'");
if(!mysqli_num_rows($get_AD)){
	die('Không đủ quyền.');
}

			//Select TOP ID
			$get_ID = mysqli_fetch_array(mysqli_query($conn,"Select * from box_mocnap WHERE BoxID = '".$_POST['BoxID']."'"),MYSQLI_ASSOC);
				if($get_ID['BoxID']){
					mysqli_query($conn, "DELETE FROM box_mocnap WHERE BoxID = '".$_POST['BoxID']."'");
					mysqli_query($conn, "DELETE FROM box_mocnap_item WHERE BoxID = '".$_POST['BoxID']."'");
					mysqli_query($conn, "DELETE FROM box_mocnap_logs WHERE BOXID = '".$_POST['BoxID']."'");
die("0");
				} else {
die("Mốc này không tồn tại.");				
				}

		echo json_encode($return);
		exit();	
}
?>