fetchNum('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));
if (!empty($documenti)){
echo '
'.tr('Ci sono _NUM_ documenti collegati', [
'_NUM_' => count($documenti),
]).'.