<?php   
    require "commonincludefiles.php";
	
	  $objDesignationMgmt = new DesignationMgmt();
	     
	if ($_SESSION['VedantnrCollegeId']!="" && isset($_SESSION['VedantnrCollegeId'])) {
		$objDesignationMgmt->designation_nameeng			 =	$_REQUEST['designation_nameeng'];	
	//	$objDesignationMgmt->designation_nameguj			  =	$_REQUEST['designation_nameguj'];
		$objDesignationMgmt->designation_type			  =	$_REQUEST['designation_type'];
		$objDesignationMgmt->designation_priority			  =	$_REQUEST['designation_priority'];
		
		if ($_REQUEST["designation_id"] > 0 && isset($_REQUEST["designation_id"])) {  // edit mode 	
			 {
				if ($_REQUEST["mode"] =="delete") {  // delete mode 	
					$objDesignationMgmt->deletedesignation_id =	 $_REQUEST["designation_id"];									   
					$objDesignationMgmt -> delete();
				}
				else
				{
					$objDesignationMgmt->designation_id =	 $_REQUEST["designation_id"];									   
					$objDesignationMgmt->designation_nameeng		=	$_REQUEST['designation_nameeng'];	
		//			$objDesignationMgmt->designation_nameguj		=	$_REQUEST['designation_nameguj'];
					$objDesignationMgmt->designation_type		=	$_REQUEST['designation_type'];
					$objDesignationMgmt->designation_priority    =	$_REQUEST['designation_priority'];
					$objDesignationMgmt -> edit();
				}
			  } 
			echo '{"success":"true","msg":""}';
		}	
		
		else
		{	$objDesignationMgmt->add();
			if(	$objDesignationMgmt->designation_id	>0) {
				echo '{"success":"true","msg":""}';			
			} else {
				echo '{"success":"false","msg":""}';	
				}
	
		}
   }						 
	else {
		echo '{"success":"false","msg":"session expiry"}';
	}	
 ?>