$value) { if (!is_numeric($value)) { unset($selected[$key]); } } $fields = Import::getFields($id_record); $csv = Import::getFile($id_record, $records[0]['id'], [ 'headers' => empty($first_row), ]); // Interpretazione dei dati $data = []; foreach ($csv as $row) { $data_row = []; foreach ($row as $key => $value) { $field = $fields[$selected[$key]]; if (isset($selected[$key])) { $name = $field['field']; $query = $field['query']; if (!empty($query)) { $query = str_replace('|value|', prepare($value), $query); $value = $dbo->fetchArray($query)[0]['result']; } $data_row[$name] = $value; } } $data[] = $data_row; } // Richiamo delle operazioni specifiche include $imports[$id_record]['import']; $_SESSION['infos'][] = tr('Importazione completata!'); break; }