fetchArray($q2); echo '

'._('Articolo').': '.$rs2[0]['codice'].' - '.$rs2[0]['descrizione'].'

'; $serials = []; $array = array_column($rs2, 'serial'); foreach ($array as $value) { if (!empty($value)) { $serials[] = $value; } } if ($dir == 'entrata') { echo '
{[ "type": "select", "label": "'._('Serial').'", "name": "serial[]", "multiple": 1, "value": "'.implode(',', $serials).'", "values": "query=SELECT serial AS id, serial AS descrizione FROM vw_serials WHERE dir=\'uscita\' AND serial NOT IN (SELECT serial FROM vw_serials WHERE dir=\'entrata\' AND record != \'fat-'.$id_record.'\')", "extra": "data-maximum=\"'.count($rs2).'\"" ]}
'; } else { echo '

'._('Inserisci i numeri seriali degli articoli aggiunti:').'

'; foreach ($array as $key => $serial) { if ($key % 3 == 0) { echo '
'; } $res = $dbo->fetchArray("SELECT record FROM vw_serials WHERE dir='entrata' AND serial = ".prepare($serial)); echo '
{[ "type": "text", "name": "serial[]", "value": "'.$serial.'"'.(!empty($res) ? ', "readonly": 1' : '').' ]}'; if (!empty($res)) { $pieces = explode('-', $res[0]['record']); switch ($pieces[0]) { case 'int': $modulo = 'Interventi'; break; case 'ddt': $modulo = 'Ddt di vendita'; break; case 'fat': $modulo = 'Fatture di vendita'; break; case 'ord': $modulo = 'Ordini cliente'; break; } echo ' '.Modules::link($modulo, $pieces[1], _('Visualizza vendita').' ', null); } echo '
'; if (($key + 1) % 3 == 0) { echo '

'; } } if (($key + 1) % 3 != 0) { echo ' '; } } echo '
'; echo ' ';