fetchArray('SELECT id FROM dt_ddt WHERE idporto='.prepare($id_record).'
UNION SELECT id FROM co_documenti WHERE idporto='.prepare($id_record).'
UNION SELECT id FROM co_preventivi WHERE idporto='.prepare($id_record));
echo '
'.str_replace('_NUM_', count($documenti), _('Ci sono _NUM_ documenti collegati')).'.