if($ret && count($cat_ids)) {
array_walk($cat_ids,'db_escape');
$sql = "INSERT INTO ".TB_PREF."crm_contacts (person_id,type,action,entity_id)
if($ret && count($cat_ids)) {
array_walk($cat_ids,'db_escape');
$sql = "INSERT INTO ".TB_PREF."crm_contacts (person_id,type,action,entity_id)