<?php 	

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


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

$itemId = $_POST['categoriesId'];

if($itemId) { 


 $sql = "DELETE FROM itemtypes WHERE itemType_id = {$itemId}";
 
 

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


 $conn->close();

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