<?php   
require "commonincludefiles.php"; 
if ($_SESSION['cCompany_id']!="" && isset($_SESSION['cCompany_id'])) {

	 $objDistMgmt = new DistMgmt();
	 
	 $objDistMgmt->dist_code			  =	$_REQUEST['distcode'];		
	 $objDistMgmt->dist_nameeng			  =	$_REQUEST['distnameeng'];
	 $objDistMgmt->dist_id				  = $_REQUEST["ID"];
	
	if ($_REQUEST["ID"] > 0 && isset($_REQUEST["ID"])) {  // edit mode 							
		$objDistMgmt -> edit();							  
		echo '{"success":"true","msg":""}';
	}	
	else
	{	
		$objDistMgmt->add();			
		
		if(	$objDistMgmt->dist_id>0) {
			echo '{"success":"true","msg":""}';			
		} else {
			echo '{"success":"false","msg":""}';	
		}
	}
}						 
else {
	echo '{"success":"false","msg":"session expiry"}';
}	
?>