<?php
	require "../commonincludefiles.php";
	$action = $_REQUEST['action'];
	$name   = $_REQUEST['name'];
	$id		= $_REQUEST['id'];
	switch($action)
	{
		case "subgroup":
			$obj = new AccountSubGroupMgmt();		
			$result = $obj->getDuplicateByName($id,$name);			
			echo "{success:true,duplicate:'".$result."'}";	
			break;
		case "group":
			$obj = new AccountGroupMgmt();
			$result = $obj->getDuplicateByName($id,$name);
			echo "{success:true,duplicate:'".$result."'}";	
			break;
		case "master":
			$obj = new AccountMasterMgmt();
			$result = $obj->getDuplicateByName($id,$name);
			echo "{success:true,duplicate:'".$result."'}";	
			break;
	}
?>