$arrContact = getAllcontactsByEmailId($strCK_user_id, $_REQUEST['contactemailaddress'], $objDataHelper); if (count($arrContact) > 0) { echo "3"; exit; } // for new group name and existing group name start if (trim($_REQUEST["newcontactgroupname"]) != "") { $_REQUEST["contactgroup"] = trim($_REQUEST["newcontactgroupname"]); } // for new group name and existing group name end $insertParams = getInsertQueryString($_REQUEST, $formMaps); if ($insertParams == -1) { echo "2"; exit; } $result = change_user_profile($insertParams, $objDataHelper, $strCK_user_id, "add"); echo "1"; break; case "update": $_REQUEST['updatedon'] = date('Y-m-d H:i:s'); $formMaps = profile_form_table_map_contacts(); // for new group name and existing group name start if (trim($_REQUEST["newcontactgroupname"]) != "") { $_REQUEST["contactgroup"] = trim($_REQUEST["newcontactgroupname"]); } // for new group name and existing group name end $updateparams = getUpdateQueryString($_REQUEST, $formMaps); $result = updateContactProfile($updateparams, $_REQUEST["contactid"], $objDataHelper, $strCK_user_id, $_REQUEST["action"]); echo $result; break; case "getcontact":
$arrContact = getAllcontactsByEmailId($strSetClient_ID, $_REQUEST['contactemailaddress'], $objDataHelper); if (count($arrContact) > 0) { echo "3"; exit; } // for new group name and existing group name start if (trim($_REQUEST["newcontactgroupname"]) != "") { $_REQUEST["contactgroup"] = trim($_REQUEST["newcontactgroupname"]); } // for new group name and existing group name end $insertParams = getInsertQueryString($_REQUEST, $formMaps); if ($insertParams == -1) { echo "2"; exit; } $result = change_user_profile($insertParams, $objDataHelper, $strSetClient_ID, "add"); echo "1"; break; case "update": $_REQUEST['updatedon'] = date('Y-m-d H:i:s'); $formMaps = profile_form_table_map_contacts(); // for new group name and existing group name start if (trim($_REQUEST["newcontactgroupname"]) != "") { $_REQUEST["contactgroup"] = trim($_REQUEST["newcontactgroupname"]); } // for new group name and existing group name end $updateparams = getUpdateQueryString($_REQUEST, $formMaps); $result = updateContactProfile($updateparams, $_REQUEST["contactid"], $objDataHelper, $strSetClient_ID, $_REQUEST["action"]); echo $result; break; case "getcontact":