<?php 	

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

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

if($_POST) {	

	$editPosName = $_POST['editPositionName'];
  $posId = $_POST['editCategoriesId'];

	$sql = "UPDATE positions SET name = '$editPosName' WHERE pos_id = '$posId'";

	if($connect12->query($sql) === TRUE) {
	 	$valid['success'] = true;
		$valid['messages'] = "Successfully Updated";	
	} else {
	 	$valid['success'] = false;
	 	$valid['messages'] = "Error while updating the Positions";
	}
	 
	$connect12->close();

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