<?php 	

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


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

$leaveTypeId = $_POST['categoriesId'];

if($leaveTypeId) { 


 $sql = "DELETE FROM leave_type WHERE leaveType_id = {$leaveTypeId}";
 
 

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


 $conn->close();

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