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

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

				// add into order_item
				$procRequestItemSql = "INSERT INTO sections (dept_id,sect_name) 
				VALUES ('$dept_id','".$_POST['section_name'][$x]."')";

				$conn->query($procRequestItemSql);		

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

		
	} // /for quantity

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