<?php 	

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

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

if($_POST) {	

	$editDesignation = $_POST['editDesignation'];
	
	
	$editShortName = $_POST['editShortName'];
	
	
    $desId = $_POST['editCategoriesId'];

	$sql = "UPDATE designation SET des_name = '$editDesignation',des_short_name='$editShortName' WHERE des_id = '$desId'";

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

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