Aggiornamento nazioni

This commit is contained in:
Thomas Zilio 2018-07-05 10:07:39 +02:00
parent 0103608070
commit 7bd7ae6ba1
2 changed files with 533 additions and 4 deletions

526
update/2_4_2.php Normal file
View File

@ -0,0 +1,526 @@
<?php
// Aggiornamento nazioni con codice ISO 3166-1 alpha-2 e nome in inglese
$it = [
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'UM' => 'Altre isole americane del Pacifico',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antartide',
'AG' => 'Antigua e Barbuda',
'SA' => 'Arabia Saudita',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaigian',
'BS' => 'Bahamas',
'BH' => 'Bahrein',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BE' => 'Belgio',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BY' => 'Bielorussia',
'BO' => 'Bolivia',
'BA' => 'Bosnia ed Erzegovina',
'BW' => 'Botswana',
'BR' => 'Brasile',
'BN' => 'Brunei',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambogia',
'CM' => 'Camerun',
'CA' => 'Canada',
'CV' => 'Capo Verde',
'BQ' => 'Caraibi olandesi',
'CZ' => 'Cèchia',
'EA' => 'Ceuta e Melilla',
'TD' => 'Ciad',
'CL' => 'Cile',
'CN' => 'Cina',
'CY' => 'Cipro',
'VA' => 'Città del Vaticano',
'CO' => 'Colombia',
'KM' => 'Comore',
'CD' => 'Congo - Kinshasa',
'CG' => 'Congo-Brazzaville',
'KP' => 'Corea del Nord',
'KR' => 'Corea del Sud',
'CI' => 'Costa dAvorio',
'CR' => 'Costa Rica',
'HR' => 'Croazia',
'CU' => 'Cuba',
'CW' => 'Curaçao',
'DK' => 'Danimarca',
'DG' => 'Diego Garcia',
'DM' => 'Dominica',
'EC' => 'Ecuador',
'EG' => 'Egitto',
'SV' => 'El Salvador',
'AE' => 'Emirati Arabi Uniti',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Etiopia',
'EZ' => 'Eurozone',
'FJ' => 'Figi',
'PH' => 'Filippine',
'FI' => 'Finlandia',
'FR' => 'Francia',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'GS' => 'Georgia del Sud e Sandwich australi',
'DE' => 'Germania',
'GH' => 'Ghana',
'JM' => 'Giamaica',
'JP' => 'Giappone',
'GI' => 'Gibilterra',
'DJ' => 'Gibuti',
'JO' => 'Giordania',
'GR' => 'Grecia',
'GD' => 'Grenada',
'GL' => 'Groenlandia',
'GP' => 'Guadalupa',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GQ' => 'Guinea Equatoriale',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'GF' => 'Guyana francese',
'HT' => 'Haiti',
'HN' => 'Honduras',
'IN' => 'India',
'ID' => 'Indonesia',
'IR' => 'Iran',
'IQ' => 'Iraq',
'IE' => 'Irlanda',
'IS' => 'Islanda',
'AC' => 'Isola Ascensione',
'CX' => 'Isola Christmas',
'IM' => 'Isola di Man',
'NF' => 'Isola Norfolk',
'AX' => 'Isole Åland',
'IC' => 'Isole Canarie',
'KY' => 'Isole Cayman',
'CC' => 'Isole Cocos (Keeling)',
'CK' => 'Isole Cook',
'FO' => 'Isole Fær Øer',
'FK' => 'Isole Falkland',
'MP' => 'Isole Marianne settentrionali',
'MH' => 'Isole Marshall',
'PN' => 'Isole Pitcairn',
'SB' => 'Isole Salomone',
'TC' => 'Isole Turks e Caicos',
'VI' => 'Isole Vergini Americane',
'VG' => 'Isole Vergini Britanniche',
'IL' => 'Israele',
'IT' => 'Italia',
'JE' => 'Jersey',
'KZ' => 'Kazakistan',
'KE' => 'Kenya',
'KG' => 'Kirghizistan',
'KI' => 'Kiribati',
'XK' => 'Kosovo',
'KW' => 'Kuwait',
'LA' => 'Laos',
'LS' => 'Lesotho',
'LV' => 'Lettonia',
'LB' => 'Libano',
'LR' => 'Liberia',
'LY' => 'Libia',
'LI' => 'Liechtenstein',
'LT' => 'Lituania',
'LU' => 'Lussemburgo',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldive',
'ML' => 'Mali',
'MT' => 'Malta',
'MA' => 'Marocco',
'MQ' => 'Martinica',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Messico',
'FM' => 'Micronesia',
'MD' => 'Moldavia',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MZ' => 'Mozambico',
'MM' => 'Myanmar (Birmania)',
'NA' => 'Namibia',
'NR' => 'Nauru',
'UN' => 'nazioni unite',
'NP' => 'Nepal',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NO' => 'Norvegia',
'NC' => 'Nuova Caledonia',
'NZ' => 'Nuova Zelanda',
'OM' => 'Oman',
'NL' => 'Paesi Bassi',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PA' => 'Panamá',
'PG' => 'Papua Nuova Guinea',
'PY' => 'Paraguay',
'PE' => 'Perù',
'PF' => 'Polinesia francese',
'PL' => 'Polonia',
'PT' => 'Portogallo',
'PR' => 'Portorico',
'QA' => 'Qatar',
'HK' => 'RAS di Hong Kong',
'MO' => 'RAS di Macao',
'GB' => 'Regno Unito',
'CF' => 'Repubblica Centrafricana',
'MK' => 'Repubblica di Macedonia',
'DO' => 'Repubblica Dominicana',
'RE' => 'Riunione',
'RO' => 'Romania',
'RW' => 'Ruanda',
'RU' => 'Russia',
'EH' => 'Sahara occidentale',
'KN' => 'Saint Kitts e Nevis',
'LC' => 'Saint Lucia',
'MF' => 'Saint Martin',
'PM' => 'Saint Pierre e Miquelon',
'VC' => 'Saint Vincent e Grenadines',
'BL' => 'Saint-Barthélemy',
'WS' => 'Samoa',
'AS' => 'Samoa americane',
'SM' => 'San Marino',
'SH' => 'SantElena',
'ST' => 'São Tomé e Príncipe',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SX' => 'Sint Maarten',
'SY' => 'Siria',
'SK' => 'Slovacchia',
'SI' => 'Slovenia',
'SO' => 'Somalia',
'ES' => 'Spagna',
'LK' => 'Sri Lanka',
'US' => 'Stati Uniti',
'SS' => 'Sud Sudan',
'ZA' => 'Sudafrica',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard e Jan Mayen',
'SE' => 'Svezia',
'CH' => 'Svizzera',
'SZ' => 'Swaziland',
'TJ' => 'Tagikistan',
'TW' => 'Taiwan',
'TZ' => 'Tanzania',
'TF' => 'Terre australi francesi',
'PS' => 'Territori palestinesi',
'IO' => 'Territorio britannico dellOceano Indiano',
'TH' => 'Thailandia',
'TL' => 'Timor Est',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad e Tobago',
'TA' => 'Tristan da Cunha',
'TN' => 'Tunisia',
'TR' => 'Turchia',
'TM' => 'Turkmenistan',
'TV' => 'Tuvalu',
'UA' => 'Ucraina',
'UG' => 'Uganda',
'HU' => 'Ungheria',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'WF' => 'Wallis e Futuna',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
];
$en = [
'AF' => 'Afghanistan',
'AX' => 'Åland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua & Barbuda',
'AR' => 'Argentina',
'AM' => 'Armenia',
'AW' => 'Aruba',
'AC' => 'Ascension Island',
'AU' => 'Australia',
'AT' => 'Austria',
'AZ' => 'Azerbaijan',
'BS' => 'Bahamas',
'BH' => 'Bahrain',
'BD' => 'Bangladesh',
'BB' => 'Barbados',
'BY' => 'Belarus',
'BE' => 'Belgium',
'BZ' => 'Belize',
'BJ' => 'Benin',
'BM' => 'Bermuda',
'BT' => 'Bhutan',
'BO' => 'Bolivia',
'BA' => 'Bosnia & Herzegovina',
'BW' => 'Botswana',
'BR' => 'Brazil',
'IO' => 'British Indian Ocean Territory',
'VG' => 'British Virgin Islands',
'BN' => 'Brunei',
'BG' => 'Bulgaria',
'BF' => 'Burkina Faso',
'BI' => 'Burundi',
'KH' => 'Cambodia',
'CM' => 'Cameroon',
'CA' => 'Canada',
'IC' => 'Canary Islands',
'CV' => 'Cape Verde',
'BQ' => 'Caribbean Netherlands',
'KY' => 'Cayman Islands',
'CF' => 'Central African Republic',
'EA' => 'Ceuta & Melilla',
'TD' => 'Chad',
'CL' => 'Chile',
'CN' => 'China',
'CX' => 'Christmas Island',
'CC' => 'Cocos (Keeling) Islands',
'CO' => 'Colombia',
'KM' => 'Comoros',
'CG' => 'Congo - Brazzaville',
'CD' => 'Congo - Kinshasa',
'CK' => 'Cook Islands',
'CR' => 'Costa Rica',
'CI' => 'Côte dIvoire',
'HR' => 'Croatia',
'CU' => 'Cuba',
'CW' => 'Curaçao',
'CY' => 'Cyprus',
'CZ' => 'Czechia',
'DK' => 'Denmark',
'DG' => 'Diego Garcia',
'DJ' => 'Djibouti',
'DM' => 'Dominica',
'DO' => 'Dominican Republic',
'EC' => 'Ecuador',
'EG' => 'Egypt',
'SV' => 'El Salvador',
'GQ' => 'Equatorial Guinea',
'ER' => 'Eritrea',
'EE' => 'Estonia',
'ET' => 'Ethiopia',
'EZ' => 'Eurozone',
'FK' => 'Falkland Islands',
'FO' => 'Faroe Islands',
'FJ' => 'Fiji',
'FI' => 'Finland',
'FR' => 'France',
'GF' => 'French Guiana',
'PF' => 'French Polynesia',
'TF' => 'French Southern Territories',
'GA' => 'Gabon',
'GM' => 'Gambia',
'GE' => 'Georgia',
'DE' => 'Germany',
'GH' => 'Ghana',
'GI' => 'Gibraltar',
'GR' => 'Greece',
'GL' => 'Greenland',
'GD' => 'Grenada',
'GP' => 'Guadeloupe',
'GU' => 'Guam',
'GT' => 'Guatemala',
'GG' => 'Guernsey',
'GN' => 'Guinea',
'GW' => 'Guinea-Bissau',
'GY' => 'Guyana',
'HT' => 'Haiti',
'HN' => 'Honduras',
'HK' => 'Hong Kong SAR China',
'HU' => 'Hungary',
'IS' => 'Iceland',
'IN' => 'India',
'ID' => 'Indonesia',
'IR' => 'Iran',
'IQ' => 'Iraq',
'IE' => 'Ireland',
'IM' => 'Isle of Man',
'IL' => 'Israel',
'IT' => 'Italy',
'JM' => 'Jamaica',
'JP' => 'Japan',
'JE' => 'Jersey',
'JO' => 'Jordan',
'KZ' => 'Kazakhstan',
'KE' => 'Kenya',
'KI' => 'Kiribati',
'XK' => 'Kosovo',
'KW' => 'Kuwait',
'KG' => 'Kyrgyzstan',
'LA' => 'Laos',
'LV' => 'Latvia',
'LB' => 'Lebanon',
'LS' => 'Lesotho',
'LR' => 'Liberia',
'LY' => 'Libya',
'LI' => 'Liechtenstein',
'LT' => 'Lithuania',
'LU' => 'Luxembourg',
'MO' => 'Macau SAR China',
'MK' => 'Macedonia',
'MG' => 'Madagascar',
'MW' => 'Malawi',
'MY' => 'Malaysia',
'MV' => 'Maldives',
'ML' => 'Mali',
'MT' => 'Malta',
'MH' => 'Marshall Islands',
'MQ' => 'Martinique',
'MR' => 'Mauritania',
'MU' => 'Mauritius',
'YT' => 'Mayotte',
'MX' => 'Mexico',
'FM' => 'Micronesia',
'MD' => 'Moldova',
'MC' => 'Monaco',
'MN' => 'Mongolia',
'ME' => 'Montenegro',
'MS' => 'Montserrat',
'MA' => 'Morocco',
'MZ' => 'Mozambique',
'MM' => 'Myanmar (Burma)',
'NA' => 'Namibia',
'NR' => 'Nauru',
'NP' => 'Nepal',
'NL' => 'Netherlands',
'NC' => 'New Caledonia',
'NZ' => 'New Zealand',
'NI' => 'Nicaragua',
'NE' => 'Niger',
'NG' => 'Nigeria',
'NU' => 'Niue',
'NF' => 'Norfolk Island',
'KP' => 'North Korea',
'MP' => 'Northern Mariana Islands',
'NO' => 'Norway',
'OM' => 'Oman',
'PK' => 'Pakistan',
'PW' => 'Palau',
'PS' => 'Palestinian Territories',
'PA' => 'Panama',
'PG' => 'Papua New Guinea',
'PY' => 'Paraguay',
'PE' => 'Peru',
'PH' => 'Philippines',
'PN' => 'Pitcairn Islands',
'PL' => 'Poland',
'PT' => 'Portugal',
'PR' => 'Puerto Rico',
'QA' => 'Qatar',
'RE' => 'Réunion',
'RO' => 'Romania',
'RU' => 'Russia',
'RW' => 'Rwanda',
'WS' => 'Samoa',
'SM' => 'San Marino',
'ST' => 'São Tomé & Príncipe',
'SA' => 'Saudi Arabia',
'SN' => 'Senegal',
'RS' => 'Serbia',
'SC' => 'Seychelles',
'SL' => 'Sierra Leone',
'SG' => 'Singapore',
'SX' => 'Sint Maarten',
'SK' => 'Slovakia',
'SI' => 'Slovenia',
'SB' => 'Solomon Islands',
'SO' => 'Somalia',
'ZA' => 'South Africa',
'GS' => 'South Georgia & South Sandwich Islands',
'KR' => 'South Korea',
'SS' => 'South Sudan',
'ES' => 'Spain',
'LK' => 'Sri Lanka',
'BL' => 'St. Barthélemy',
'SH' => 'St. Helena',
'KN' => 'St. Kitts & Nevis',
'LC' => 'St. Lucia',
'MF' => 'St. Martin',
'PM' => 'St. Pierre & Miquelon',
'VC' => 'St. Vincent & Grenadines',
'SD' => 'Sudan',
'SR' => 'Suriname',
'SJ' => 'Svalbard & Jan Mayen',
'SZ' => 'Swaziland',
'SE' => 'Sweden',
'CH' => 'Switzerland',
'SY' => 'Syria',
'TW' => 'Taiwan',
'TJ' => 'Tajikistan',
'TZ' => 'Tanzania',
'TH' => 'Thailand',
'TL' => 'Timor-Leste',
'TG' => 'Togo',
'TK' => 'Tokelau',
'TO' => 'Tonga',
'TT' => 'Trinidad & Tobago',
'TA' => 'Tristan da Cunha',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TM' => 'Turkmenistan',
'TC' => 'Turks & Caicos Islands',
'TV' => 'Tuvalu',
'UM' => 'U.S. Outlying Islands',
'VI' => 'U.S. Virgin Islands',
'UG' => 'Uganda',
'UA' => 'Ukraine',
'AE' => 'United Arab Emirates',
'GB' => 'United Kingdom',
'UN' => 'United Nations',
'US' => 'United States',
'UY' => 'Uruguay',
'UZ' => 'Uzbekistan',
'VU' => 'Vanuatu',
'VA' => 'Vatican City',
'VE' => 'Venezuela',
'VN' => 'Vietnam',
'WF' => 'Wallis & Futuna',
'EH' => 'Western Sahara',
'YE' => 'Yemen',
'ZM' => 'Zambia',
'ZW' => 'Zimbabwe',
];
foreach ($it as $key => $value) {
$database->update('an_nazioni', [
'iso2' => $key,
'name' => $en[$key],
], ['nome' => $value]);
}

View File

@ -4,7 +4,7 @@
`descrizione` varchar(255) NOT NULL, `descrizione` varchar(255) NOT NULL,
`deleted` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `zz_documenti` ( CREATE TABLE IF NOT EXISTS `zz_documenti` (
@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS `zz_documenti` (
`nome` varchar(255) NOT NULL, `nome` varchar(255) NOT NULL,
`data` date DEFAULT NULL, `data` date DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ) ENGINE=InnoDB;
INSERT INTO `zz_documenti_categorie` (`id`, `descrizione`, `deleted`) VALUES INSERT INTO `zz_documenti_categorie` (`id`, `descrizione`, `deleted`) VALUES
@ -25,3 +25,6 @@ INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `option
-- Innesto modulo categorie documenti -- Innesto modulo categorie documenti
INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES (NULL, 'Categorie documenti', 'Categorie documenti', 'categorie_documenti', '{ "main_query": [ { "type": "table", "fields": "Descrizione", "query": "SELECT zz_documenti_categorie.`descrizione`as Descrizione, zz_documenti_categorie.`id`as id FROM zz_documenti_categorie WHERE deleted = 0 HAVING 1=1"} ]}', '', 'fa fa-file-text-o', '2.4', '2.4', '1', (SELECT `id` FROM `zz_modules` m WHERE `name` = 'Gestione documentale'), '1', '1'); INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES (NULL, 'Categorie documenti', 'Categorie documenti', 'categorie_documenti', '{ "main_query": [ { "type": "table", "fields": "Descrizione", "query": "SELECT zz_documenti_categorie.`descrizione`as Descrizione, zz_documenti_categorie.`id`as id FROM zz_documenti_categorie WHERE deleted = 0 HAVING 1=1"} ]}', '', 'fa fa-file-text-o', '2.4', '2.4', '1', (SELECT `id` FROM `zz_modules` m WHERE `name` = 'Gestione documentale'), '1', '1');
-- Fatturazione elettronica
ALTER TABLE `an_nazioni` ADD `name` VARCHAR(255);