<?php 	
require_once '../../Server/connection.php';
if($_POST) {	

	$procRequestItemStatus = false;
	
	for($x = 0; $x < count($_POST['item_type']); $x++) {			
		

				// add into order_item
				$procRequestItemSql = "INSERT INTO itemtypes (name) 
				VALUES ('".$_POST['item_type'][$x]."')";

				$conn->query($procRequestItemSql);		

				if($x == count($_POST['item_type'])) {
					$procRequestItemStatus = true;
					
					
				}	

		
	} // /for quantity

	$valid['success'] = true;
	$valid['messages'] = "Item Type is Successfully Added";		
	
	$conn->close();
     
	 
	echo json_encode($valid);
 
} // /if $_POST
// echo json_encode($valid);