<?php 	

require_once '../../Server/connection.php';


$valid['success'] = array('success' => false, 'messages' => array());

$deptId = $_POST['categoriesId'];

if($deptId) { 


 $sql = "DELETE FROM departments WHERE dept_id = {$deptId}";
 
 

 if($conn->query($sql) === TRUE) {
 	$valid['success'] = true;
	$valid['messages'] = "Department is Successfully Deleted";		
 } else {
 	$valid['success'] = false;
 	$valid['messages'] = "Error while removing Department";
 }
			
			
		   


 $conn->close();

 echo json_encode($valid);
 
} // /if $_POST