'; } if (!$cliente) { $ignore = $dbo->fetchArray("SELECT id FROM zz_plugins WHERE name='Impianti del cliente' OR name='Ddt del cliente'"); foreach ($ignore as $plugin) { echo ' '; } } ?>

{[ "type": "text", "label": "", "name": "ragione_sociale", "required": 1, "value": "$ragione_sociale$" ]}
{[ "type": "select", "label": "", "name": "tipo", "values": "list=\"\": \"\", \"Azienda\": \"\", \"Privato\": \"\", \"Ente pubblico\": \"\"", "value": "$tipo$" ]}
{[ "type": "text", "label": "", "maxlength": 13, "name": "piva", "class": "text-center", "value": "$piva$" ]}
{[ "type": "text", "label": "", "maxlength": 16, "name": "codice_fiscale", "class": "text-center", "value": "$codice_fiscale$" ]}
{[ "type": "text", "label": "", "name": "codice", "required": 1, "class": "text-center", "value": "$codice$" ]}
{[ "type": "text", "label": "", "name": "luogo_nascita", "value": "$luogo_nascita$" ]}
{[ "type": "date", "label": "", "maxlength": 10, "name": "data_nascita", "value": "$data_nascita$" ]}
{[ "type": "select", "label": "", "name": "sesso", "values": "list=\"\": \"Non specificato\", \"M\": \"\", \"F\": \"\"", "value": "$sesso$" ]}
{[ "type": "text", "label": "", "name": "indirizzo", "value": "$indirizzo$" ]}
{[ "type": "text", "label": "", "name": "indirizzo2", "value": "$indirizzo2$" ]}
{[ "type": "select", "label": "", "name": "id_nazione", "values": "query=SELECT id AS id, nome AS descrizione FROM an_nazioni ORDER BY nome ASC", "value": "$id_nazione$" ]}
{[ "type": "text", "label": "", "name": "cap", "maxlength": 5, "class": "text-center", "value": "$cap$" ]}
{[ "type": "text", "label": "", "name": "citta", "class": "text-center", "value": "$citta$" ]}
{[ "type": "text", "label": "", "name": "provincia", "maxlength": 2, "class": "text-center", "value": "$provincia$" ]}
{[ "type": "number", "label": "", "name": "km", "maxlength": 4, "class": "text-center", "value": "$km$" ]}

{[ "type": "text", "label": "", "name": "telefono", "class": "text-center", "value": "$telefono$", "icon-before": "" ]}
{[ "type": "text", "label": "", "name": "fax", "class": "text-center", "value": "$fax$", "icon-before": "" ]}
{[ "type": "text", "label": "", "name": "cellulare", "class": "text-center", "value": "$cellulare$", "icon-before": "" ]}
{[ "type": "text", "label": "", "name": "email", "class": "email-mask", "placeholder":"casella@dominio.ext", "value": "$email$", "icon-before": "" ]}
{[ "type": "text", "label": "", "name": "sitoweb", "placeholder":"www.dominio.ext", "value": "$sitoweb$", "icon-before": "" ]}
{[ "type": "select", "label": "", "name": "idzona", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$" ]}

{[ "type": "select", "label": "", "name": "idpagamento_acquisti", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_acquisti$" ]}
{[ "type": "select", "label": "", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$" ]}
{[ "type": "select", "label": "", "name": "idiva_acquisti", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_acquisti$" ]}
{[ "type": "select", "label": "", "name": "idpagamento_vendite", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_vendite$" ]}
{[ "type": "select", "label": "", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$" ]}
{[ "type": "select", "label": "", "name": "idiva_vendite", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_vendite$" ]}
{[ "type": "select", "label": "", "name": "idsede_fatturazione", "values": "query=SELECT id, IF(citta = '', nomesede, CONCAT_WS(', ', nomesede, citta)) AS descrizione FROM an_sedi WHERE idanagrafica='' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$" ]}
{[ "type": "select", "label": "", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$" ]}
{[ "type": "select", "label": "Agente principale", "name": "idagente", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE (descrizione='Agente' AND deleted=0)ORDER BY ragione_sociale", "value": "$idagente$" ]}

{[ "type": "text", "label": "", "name": "codiceri", "value": "$codiceri$" ]}
{[ "type": "text", "label": "('.tr('provincia/C.C.I.A.A.').')'; ?>", "name": "codicerea", "value": "$codicerea$" ]}
{[ "type": "text", "label": "", "name": "cciaa", "value": "$cciaa$" ]}
{[ "type": "text", "label": "", "name": "cciaa_citta", "value": "$cciaa_citta$" ]}
{[ "type": "text", "label": "", "name": "iscrizione_tribunale", "value": "$iscrizione_tribunale$" ]}
{[ "type": "text", "label": "", "name": "n_alboartigiani", "value": "$n_alboartigiani$" ]}
{[ "type": "text", "label": "", "name": "foro_competenza", "value": "$foro_competenza$" ]}
{[ "type": "number", "label": "", "name": "capitale_sociale", "decimals": 0, "value": "$capitale_sociale$", "icon-after":"€" ]}
{[ "type": "text", "label": "", "name": "appoggiobancario", "value": "$appoggiobancario$" ]}
{[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]}
{[ "type": "text", "label": "", "name": "codiceiban", "value": "$codiceiban$" ]}
{[ "type": "text", "label": "", "name": "bic", "value": "$bic$" ]}
{[ "type": "text", "label": "", "name": "diciturafissafattura", "value": "$diciturafissafattura$" ]}
{[ "type": "text", "label": "", "name": "settore", "value": "$settore$" ]}
{[ "type": "text", "label": "", "name": "marche", "value": "$marche$" ]}
{[ "type": "number", "label": "", "name": "dipendenti", "decimals": 0, "value": "$dipendenti$" ]}
{[ "type": "number", "label": "", "name": "macchine", "decimals": 0, "value": "$macchine$" ]}
{[ "type": "select", "multiple": "1", "label": "", "name": "idtipoanagrafica[]", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = 'Azienda' AND deleted = 0) ORDER BY descrizione", "value": "$idtipianagrafica$" ]} '.tr('Questa anagrafica appartiene alla tipologia "Azienda"').'.

'; } ?>
{[ "type": "text", "label": "", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "
" ]}
{[ "type": "select", "label": "Agenti secondari", "multiple": "1", "name": "idagenti[]", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE (descrizione='Agente' AND deleted=0 AND an_anagrafiche.idanagrafica NOT IN (SELECT idagente FROM an_anagrafiche WHERE idanagrafica = )) OR (an_anagrafiche.idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE idanagrafica = ) ) ORDER BY ragione_sociale", "value": "$idagenti$" ]}
{[ "type": "select", "label": "", "name": "idrelazione", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$" ]}
{[ "type": "textarea", "label": "", "name": "note", "value": "$note$" ]}
{[ "type": "text", "label": "'.tr('Indirizzo Google').'", "name": "gaddress", "value": "$gaddress$", "extra": "data-geo=\'formatted_address\'" ]}
{[ "type": "text", "label": "'.tr('Latitudine').'", "name": "lat", "value": "$lat$", "extra": "data-geo=\'lat\'", "class": "text-right" ]}
{[ "type": "text", "label": "'.tr('Longitudine').'", "name": "lng", "value": "$lng$", "extra": "data-geo=\'lng\'", "class": "text-right" ]}
'; // Calcola percorso if (empty($records[0]['gaddress']) || (empty($records[0]['lat']) && empty($records[0]['lng']))) { echo ' '; } echo '
'; if (!empty($records[0]['gaddress']) || (!empty($records[0]['lat']) && !empty($records[0]['lng']))) { echo '
'; } } else { echo '
'.Modules::link('Impostazioni', $dbo->fetchArray("SELECT `idimpostazione` FROM `zz_settings` WHERE sezione='Generali'")[0]['idimpostazione'], tr('Per abilitare la visualizzazione delle anagrafiche nella mappa, inserire la Google Maps API Key nella scheda Impostazioni')).'.
'; } ?>
'.tr('Elimina').' '; } ?>