fetchArray($query); $id_cliente = $records[0]['idanagrafica']; $id_sede = $records[0]['idsede']; // Leggo il nome del referente se selezionato da menu a tendina if (!empty($records[0]['idreferente'])) { $rs2 = $dbo->fetchArray('SELECT * FROM an_referenti WHERE id='.prepare($records[0]['idreferente'])); $referente = $rs2[0]['nome']; } else { $referente = $records[0]['referente'].' '.$records[0]['telefono_referente']; } // Sostituzioni specifiche // Imposta numerointervento-data-numerocommessa su intestazione $replaces = [ 'intervento_numero' => $records[0]['codice'], 'intervento_data' => Translator::dateToLocale($records[0]['data_richiesta']), 'commessa_numero' => !empty($records[0]['numero_preventivo']) ? $records[0]['codice'] : ' ', ];