Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 771 | Rev 1124 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 771 Rev 773
1
<?php
1
<?php
2
// /opt/lampp/bin/php cli.php chorodep -a chargerVersions
2
// /opt/lampp/bin/php cli.php chorodep -a chargerVersions
3
class Chorodep extends EfloreScript {
3
class Chorodep extends EfloreScript {
4
	protected $nbre_dep = 0;
4
	protected $nbre_dep = 0;
5
	private $type_donnee = '';
5
	private $type_donnee = '';
6
	protected $aso_num_nomenc = array();
6
	protected $aso_num_nomenc = array();
7
	protected $nbre_ligne = 0;
7
	protected $nbre_ligne = 0;
8
	protected $nbre_plte_presente = 0;
8
	protected $nbre_plte_presente = 0;
9
	protected $nbre_plte_a_confirmer = 0;
9
	protected $nbre_plte_a_confirmer = 0;
10
	protected $nbre_plte_douteux = 0;
10
	protected $nbre_plte_douteux = 0;
11
	protected $nbre_plte_erreur = 0;
11
	protected $nbre_plte_erreur = 0;
12
	protected $nbre_plte_disparue = 0;
12
	protected $nbre_plte_disparue = 0;
13
	protected $nbre_plte_erreur_a_confirmer = 0;
13
	protected $nbre_plte_erreur_a_confirmer = 0;
14
	protected $nc_autres_valeur_champ = 0;
14
	protected $nc_autres_valeur_champ = 0;
15
	protected $nc_nbre_plte_presente = 0;
15
	protected $nc_nbre_plte_presente = 0;
16
	protected $nc_nbre_plte_a_confirmer = 0;
16
	protected $nc_nbre_plte_a_confirmer = 0;
17
	protected $nc_nbre_plte_douteux = 0;
17
	protected $nc_nbre_plte_douteux = 0;
18
	protected $nc_nbre_plte_disparue = 0;
18
	protected $nc_nbre_plte_disparue = 0;
19
	protected $nc_nbre_plte_erreur = 0;
19
	protected $nc_nbre_plte_erreur = 0;
20
	protected $nc_nbre_plte_erreur_a_confirmer = 0;
20
	protected $nc_nbre_plte_erreur_a_confirmer = 0;
21
 
21
 
22
	protected $aso_totaux_dep = array();
22
	protected $aso_totaux_dep = array();
23
	private $fichier_verif = './chorodep_verif.html';
23
	private $fichier_verif = './chorodep_verif.html';
24
 
24
 
25
	public function executer() {
25
	public function executer() {
26
		try {
26
		try {
27
			$this->initialiserProjet('chorodep');
27
			$this->initialiserProjet('chorodep');
28
 
28
 
29
			// Lancement de l'action demandée
29
			// Lancement de l'action demandée
30
			$cmd = $this->getParametre('a');
30
			$cmd = $this->getParametre('a');
31
			switch ($cmd) {
31
			switch ($cmd) {
32
 
32
 
33
				case 'chargerTous' :
33
				case 'chargerTous' :
34
					$this->chargerStructureSql();
34
					$this->chargerStructureSql();
35
					$this->chargerVersions();
35
					$this->chargerVersions();
36
					$this->chargerChorodepContributeurs();
36
					$this->chargerChorodepContributeurs();
37
					$this->chargerChorodepSources();
37
					$this->chargerChorodepSources();
38
					$this->chargerChorodepOntologies();
38
					$this->chargerChorodepOntologies();
39
					break;
39
					break;
40
				case 'chargerStructureSql' :
40
				case 'chargerStructureSql' :
41
					$this->chargerStructureSql();
41
					$this->chargerStructureSql();
42
					break;
42
					break;
43
				case 'chargerVersions' :
43
				case 'chargerVersions' :
44
					$this->chargerVersions();
44
					$this->chargerVersions();
45
					break;
45
					break;
46
				case 'chargerChorodep' :
46
				case 'chargerChorodep' :
47
					$this->chargerChorodepContributeurs();
47
					$this->chargerChorodepContributeurs();
48
					$this->chargerChorodepSources();
48
					$this->chargerChorodepSources();
49
					$this->chargerChorodepOntologies();
49
					$this->chargerChorodepOntologies();
50
					break;
50
					break;
51
				case 'verifierDonnees' :
51
				case 'verifierDonnees' :
52
					$this->initialiserTraitement();
52
					$this->initialiserTraitement();
53
					$this->verifierDonnees();
53
					$this->verifierDonnees();
54
					break;
54
					break;
55
				case 'supprimerTous' :
55
				case 'supprimerTous' :
56
					$this->supprimerTous();
56
					$this->supprimerTous();
57
					break;
57
					break;
58
				default :
58
				default :
59
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
59
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
60
			}
60
			}
61
		} catch (Exception $e) {
61
		} catch (Exception $e) {
62
			$this->traiterErreur($e->getMessage());
62
			$this->traiterErreur($e->getMessage());
63
		}
63
		}
64
	}
64
	}
65
 
65
 
66
	private function chargerChorodepContributeurs() {
66
	private function chargerChorodepContributeurs() {
67
		$chemin = Config::get('chemins.chorodepContributeurs');
67
		$chemin = Config::get('chemins.chorodepContributeurs');
68
		$table = Config::get('tables.chorodepContributeurs');
68
		$table = Config::get('tables.chorodepContributeurs');
69
		$requete = "LOAD DATA INFILE '$chemin' ".
69
		$requete = "LOAD DATA INFILE '$chemin' ".
70
						"REPLACE INTO TABLE $table ".
70
						"REPLACE INTO TABLE $table ".
71
						'CHARACTER SET utf8 '.
71
						'CHARACTER SET utf8 '.
72
						'FIELDS '.
72
						'FIELDS '.
73
						"	TERMINATED BY '\t' ".
73
						"	TERMINATED BY '\t' ".
74
						"	ENCLOSED BY '' ".
74
						"	ENCLOSED BY '' ".
75
						"	ESCAPED BY '\\\' ".
75
						"	ESCAPED BY '\\\' ".
76
						'IGNORE 2 LINES';
76
						'IGNORE 2 LINES';
77
		$this->getBdd()->requeter($requete);
77
		$this->getBdd()->requeter($requete);
78
	}
78
	}
79
 
79
 
80
	private function chargerChorodepSources() {
80
	private function chargerChorodepSources() {
81
		$chemin = Config::get('chemins.chorodepSources');
81
		$chemin = Config::get('chemins.chorodepSources');
82
		$table = Config::get('tables.chorodepSources');
82
		$table = Config::get('tables.chorodepSources');
83
		$requete = "LOAD DATA INFILE '$chemin' ".
83
		$requete = "LOAD DATA INFILE '$chemin' ".
84
							"REPLACE INTO TABLE $table ".
84
							"REPLACE INTO TABLE $table ".
85
							'CHARACTER SET utf8 '.
85
							'CHARACTER SET utf8 '.
86
							'FIELDS '.
86
							'FIELDS '.
87
							"	TERMINATED BY '\t' ".
87
							"	TERMINATED BY '\t' ".
88
							"	ENCLOSED BY '' ".
88
							"	ENCLOSED BY '' ".
89
							"	ESCAPED BY '\\\' ".
89
							"	ESCAPED BY '\\\' ".
90
							'IGNORE 2 LINES';
90
							'IGNORE 2 LINES';
91
		$this->getBdd()->requeter($requete);
91
		$this->getBdd()->requeter($requete);
92
	}
92
	}
93
 
93
 
94
	private function chargerChorodepOntologies() {
94
	private function chargerChorodepOntologies() {
95
		$chemin = Config::get('chemins.chorodepOntologies');
95
		$chemin = Config::get('chemins.chorodepOntologies');
96
		$table = Config::get('tables.chorodepOntologies');
96
		$table = Config::get('tables.chorodepOntologies');
97
		$requete = "LOAD DATA INFILE '$chemin' ".
97
		$requete = "LOAD DATA INFILE '$chemin' ".
98
								"REPLACE INTO TABLE $table ".
98
								"REPLACE INTO TABLE $table ".
99
								'CHARACTER SET utf8 '.
99
								'CHARACTER SET utf8 '.
100
								'FIELDS '.
100
								'FIELDS '.
101
								"	TERMINATED BY '\t' ".
101
								"	TERMINATED BY '\t' ".
102
								"	ENCLOSED BY '' ".
102
								"	ENCLOSED BY '' ".
103
								"	ESCAPED BY '\\\' ".
103
								"	ESCAPED BY '\\\' ".
104
								'IGNORE 1 LINES';
104
								'IGNORE 1 LINES';
105
		$this->getBdd()->requeter($requete);
105
		$this->getBdd()->requeter($requete);
106
	}
106
	}
107
 
107
 
108
	private function chargerVersions() {
108
	private function chargerVersions() {
109
		$versions = explode(',', Config::get('versions'));
109
		$versions = explode(',', Config::get('versions'));
110
		$versionsDonnees = explode(',', Config::get('versionsDonnees'));
110
		$versionsDonnees = explode(',', Config::get('versionsDonnees'));
111
		foreach ($versions as $id => $version) {
111
		foreach ($versions as $id => $version) {
112
			$versionDonnees = $versionsDonnees[$id];
112
			$versionDonnees = $versionsDonnees[$id];
113
			$this->chargerStructureSqlVersion($versionDonnees);
113
			$this->chargerStructureSqlVersion($versionDonnees);
114
			$this->chargerDonneesVersion($versionDonnees, $version);
114
			$this->chargerDonneesVersion($versionDonnees, $version);
115
		}
115
		}
116
	}
116
	}
117
 
117
 
118
	private function chargerStructureSqlVersion($versionDonnees) {
118
	private function chargerStructureSqlVersion($versionDonnees) {
119
		$fichierSqlTpl = Config::get('chemins.structureSqlVersionTpl');
119
		$fichierSqlTpl = Config::get('chemins.structureSqlVersionTpl');
120
		$fichierSql = sprintf($fichierSqlTpl, $versionDonnees, $versionDonnees);
120
		$fichierSql = sprintf($fichierSqlTpl, $versionDonnees, $versionDonnees);
121
		$contenuSql = $this->recupererContenu($fichierSql);
121
		$contenuSql = $this->recupererContenu($fichierSql);
122
		$this->executerScripSql($contenuSql);
122
		$this->executerScripSql($contenuSql);
123
	}
123
	}
124
 
124
 
125
	private function chargerDonneesVersion($versionDonnees, $version) {
125
	private function chargerDonneesVersion($versionDonnees, $version) {
126
		$fichierTsvTpl = Config::get('chemins.chorodepTpl');
126
		$fichierTsvTpl = Config::get('chemins.chorodepTpl');
127
		$fichierTsv = sprintf($fichierTsvTpl, $versionDonnees, $versionDonnees);
127
		$fichierTsv = sprintf($fichierTsvTpl, $versionDonnees, $versionDonnees);
128
		$tableTpl = Config::get('tables.chorodepTpl');
128
		$tableTpl = Config::get('tables.chorodepTpl');
129
		$table = sprintf($tableTpl, $version);
129
		$table = sprintf($tableTpl, $version);
130
		$champs = Config::get('chorodepChamps');
130
		$champs = Config::get('chorodepChamps'.$version);
131
		$requete = "LOAD DATA INFILE '$fichierTsv' ".
131
		$requete = "LOAD DATA INFILE '$fichierTsv' ".
132
						"REPLACE INTO TABLE $table ".
132
						"REPLACE INTO TABLE $table ".
133
						'CHARACTER SET utf8 '.
133
						'CHARACTER SET utf8 '.
134
						'FIELDS '.
134
						'FIELDS '.
135
						"	TERMINATED BY '\t' ".
135
						"	TERMINATED BY '\t' ".
136
						"	ENCLOSED BY '' ".
136
						"	ENCLOSED BY '' ".
137
						"	ESCAPED BY '\\\' ".
137
						"	ESCAPED BY '\\\' ".
138
						'IGNORE 1 LINES '.
-
 
139
						"($champs) ";
138
						"($champs) ";
140
		$this->getBdd()->requeter($requete);
139
		$this->getBdd()->requeter($requete);
141
	}
140
	}
142
 
141
 
143
	private function initialiserTraitement() {
142
	private function initialiserTraitement() {
144
		//------------------------------------------------------------------------------------------------------------//
143
		//------------------------------------------------------------------------------------------------------------//
145
		// Récupération des informations à vérifier
144
		// Récupération des informations à vérifier
146
		$table = $this->getNomTableDernierVersion();
145
		$table = $this->getNomTableDernierVersion();
147
		$requete = 	'SELECT * '.
146
		$requete = 	'SELECT * '.
148
					"FROM $table ";
147
					"FROM $table ";
149
		$taxons = $this->getBdd()->recupererTous($requete);
148
		$taxons = $this->getBdd()->recupererTous($requete);
150
		$tax_col = $taxons[1];
149
		$tax_col = $taxons[1];
151
		$col = array_keys($tax_col);
150
		$col = array_keys($tax_col);
152
		$this->initialiserTableaux($col);
151
		$this->initialiserTableaux($col);
153
		//------------------------------------------------------------------------------------------------------------//
152
		//------------------------------------------------------------------------------------------------------------//
154
		// Analyse des données
153
		// Analyse des données
155
		echo 'Traitement de la ligne n° :';
154
		echo 'Traitement de la ligne n° :';
156
		$i = 0;
155
		$i = 0;
157
		$j = 0;
156
		$j = 0;
158
		$aso_departements_analyses = array();
157
		$aso_departements_analyses = array();
159
		$this->nbre_ligne_avec_guillemet = 0;
158
		$this->nbre_ligne_avec_guillemet = 0;
160
		foreach ($taxons as $aso_champs) {
159
		foreach ($taxons as $aso_champs) {
161
			$nom = $aso_champs['nom_sci'];
160
			$nom = $aso_champs['nom_sci'];
162
			$num_taxo = $aso_champs['num_tax'];
161
			$num_taxo = $aso_champs['num_tax'];
163
			$num_nomenc = $aso_champs['num_nom'];
162
			$num_nomenc = $aso_champs['num_nom'];
164
			if ($num_nomenc == 'nc') {
163
			if ($num_nomenc == 'nc') {
165
				$this->nc_nbre_nom++;
164
				$this->nc_nbre_nom++;
166
			} else if ($num_nomenc != 'nc') {
165
			} else if ($num_nomenc != 'nc') {
167
				$this->nbre_nom++;
166
				$this->nbre_nom++;
168
				// Vérification de la nom duplication des numéros nomenclaturaux
167
				// Vérification de la nom duplication des numéros nomenclaturaux
169
				if ( !array_key_exists($num_nomenc, (array) $this->aso_num_nomenc) ) {
168
				if ( !array_key_exists($num_nomenc, (array) $this->aso_num_nomenc) ) {
170
					$this->aso_num_nomenc[$num_nomenc]['compteur'] = 1;
169
					$this->aso_num_nomenc[$num_nomenc]['compteur'] = 1;
171
					$this->aso_num_nomenc[$num_nomenc]['ligne'] = ($this->nbre_ligne+1);
170
					$this->aso_num_nomenc[$num_nomenc]['ligne'] = ($this->nbre_ligne+1);
172
				} else {
171
				} else {
173
					$this->aso_num_nomenc[$num_nomenc]['compteur']++;
172
					$this->aso_num_nomenc[$num_nomenc]['compteur']++;
174
					$this->aso_num_nomenc[$num_nomenc]['ligne'] .= ' - '.($this->nbre_ligne+1);
173
					$this->aso_num_nomenc[$num_nomenc]['ligne'] .= ' - '.($this->nbre_ligne+1);
175
				}
174
				}
176
			}
175
			}
177
			foreach ($aso_champs as $cle => $val ) {# Pour chaque département du taxon, on regarde la valeur
176
			foreach ($aso_champs as $cle => $val ) {# Pour chaque département du taxon, on regarde la valeur
178
				$this->nbre_ligne_avec_guillemet += preg_match('/"/', $val);
177
				$this->nbre_ligne_avec_guillemet += preg_match('/"/', $val);
179
				if ( preg_match('/^\d{2}$/', $cle) ) {# Nous vérifions que le nom du champs comprend bien le numéro du département entre ()
178
				if ( preg_match('/^\d{2}$/', $cle) ) {# Nous vérifions que le nom du champs comprend bien le numéro du département entre ()
180
					$nd = $cle;# Numéro du département
179
					$nd = $cle;# Numéro du département
181
					// Nous comptons le nombre de département en base de données
180
					// Nous comptons le nombre de département en base de données
182
					if (!isset($aso_departements_analyses[$nd])) {
181
					if (!isset($aso_departements_analyses[$nd])) {
183
						$this->nbre_dep_analyse++;
182
						$this->nbre_dep_analyse++;
184
						$aso_departements_analyses[$nd] = $nd;
183
						$aso_departements_analyses[$nd] = $nd;
185
					}
184
					}
186
					if ( $num_nomenc != 'nc' && isset($val) && $val != '') {# Si le taxon n'est pas abscent du département
185
					if ( $num_nomenc != 'nc' && isset($val) && $val != '') {# Si le taxon n'est pas abscent du département
187
						if ($val == '1') {# Présent
186
						if ($val == '1') {# Présent
188
							// Calcul du nombre de plante ayant un statut "Présent"
187
							// Calcul du nombre de plante ayant un statut "Présent"
189
							$this->nbre_plte_presente++;
188
							$this->nbre_plte_presente++;
190
							// Stockage par département du nombre de plante ayant un statut "Présent"
189
							// Stockage par département du nombre de plante ayant un statut "Présent"
191
							$this->aso_totaux_dep[$nd]['plte_presente']++;
190
							$this->aso_totaux_dep[$nd]['plte_presente']++;
192
							// Stockage des informations
191
							// Stockage des informations
193
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 3, $this->id_donnee_choro++);
192
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 3, $this->id_donnee_choro++);
194
						} else if ($val == '1?') {# Présence à confirmer
193
						} else if ($val == '1?') {# Présence à confirmer
195
							// Calcul du nombre de plante ayant un statut "Présence à confirmer"
194
							// Calcul du nombre de plante ayant un statut "Présence à confirmer"
196
							$this->nbre_plte_a_confirmer++;
195
							$this->nbre_plte_a_confirmer++;
197
							// Stockage par département du nombre de plante ayant un statut "Présence à confirmer"
196
							// Stockage par département du nombre de plante ayant un statut "Présence à confirmer"
198
							$this->aso_totaux_dep[$nd]['plte_a_confirmer']++;
197
							$this->aso_totaux_dep[$nd]['plte_a_confirmer']++;
199
							// Stockage des informations
198
							// Stockage des informations
200
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 4, $this->id_donnee_choro++);
199
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 4, $this->id_donnee_choro++);
201
						} else if (preg_match('/^\s*(?:\?)\s*$/', $val)) {# Douteux
200
						} else if (preg_match('/^\s*(?:\?)\s*$/', $val)) {# Douteux
202
							// Calcul du nombre de plante ayant un statut "Disparu ou douteux"
201
							// Calcul du nombre de plante ayant un statut "Disparu ou douteux"
203
							$this->nbre_plte_douteux++;
202
							$this->nbre_plte_douteux++;
204
							// Stockage par département du nombre de plante ayant un statut "Douteux"
203
							// Stockage par département du nombre de plante ayant un statut "Douteux"
205
							$this->aso_totaux_dep[$nd]['plte_douteux']++;
204
							$this->aso_totaux_dep[$nd]['plte_douteux']++;
206
							// Stockage des informations
205
							// Stockage des informations
207
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 5, $this->id_donnee_choro++);
206
							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 5, $this->id_donnee_choro++);
208
							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
207
							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
209
								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
208
								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
210
								$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
209
								$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
211
														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
210
														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
212
							}
211
							}
213
						} elseif (preg_match('/^\s*(?:#)\s*$/', $val)) {# Erreur
212
						} elseif (preg_match('/^\s*(?:#)\s*$/', $val)) {# Erreur
214
	                        # Calcul du nombre de plante ayant un statut "Erreur"
213
	                        # Calcul du nombre de plante ayant un statut "Erreur"
215
	                        $this->nbre_plte_erreur++;
214
	                        $this->nbre_plte_erreur++;
216
	                        # Stockage par département du nombre de plante ayant un statut "Erreur"
215
	                        # Stockage par département du nombre de plante ayant un statut "Erreur"
217
	                        $this->aso_totaux_dep[$nd]['plte_erreur']++;
216
	                        $this->aso_totaux_dep[$nd]['plte_erreur']++;
218
	                        # Stockage des informations
217
	                        # Stockage des informations
219
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
218
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
220
	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
219
	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
221
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
220
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
222
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
221
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
223
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
222
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
224
	                        }
223
	                        }
225
                    	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
224
                    	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
226
	                        # Calcul du nombre de plante ayant un statut "Disparu"
225
	                        # Calcul du nombre de plante ayant un statut "Disparu"
227
	                        $this->nbre_plte_disparue++;
226
	                        $this->nbre_plte_disparue++;
228
	                        # Stockage par département du nombre de plante ayant un statut "Disparu"
227
	                        # Stockage par département du nombre de plante ayant un statut "Disparu"
229
	                        $this->aso_totaux_dep[$nd]['plte_disparue']++;
228
	                        $this->aso_totaux_dep[$nd]['plte_disparue']++;
230
	                        # Stockage des informations
229
	                        # Stockage des informations
231
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
230
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
232
	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
231
	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
233
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
232
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
234
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
233
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
235
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
234
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
236
	                        }
235
	                        }
237
                    	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
236
                    	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
238
	                        # Calcul du nombre de plante ayant un statut "Erreur à confirmer"
237
	                        # Calcul du nombre de plante ayant un statut "Erreur à confirmer"
239
	                        $this->nbre_plte_erreur_a_confirmer++;
238
	                        $this->nbre_plte_erreur_a_confirmer++;
240
	                        # Stockage par département du nombre de plante ayant un statut "Erreur à confirmer"
239
	                        # Stockage par département du nombre de plante ayant un statut "Erreur à confirmer"
241
	                        $this->aso_totaux_dep[$nd]['plte_erreur_a_confirmer']++;
240
	                        $this->aso_totaux_dep[$nd]['plte_erreur_a_confirmer']++;
242
	                        # Stockage des informations
241
	                        # Stockage des informations
243
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
242
	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
244
                    		if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
243
                    		if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
245
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
244
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
246
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
245
	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
247
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
246
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
248
	                        }
247
	                        }
249
                    	} else {
248
                    	} else {
250
							// Ajout de la valeur dans une variable car elle n'est pas conforme.
249
							// Ajout de la valeur dans une variable car elle n'est pas conforme.
251
							$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
250
							$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
252
													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
251
													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
253
						}
252
						}
254
						$j++;
253
						$j++;
255
					} else if (isset($val) && $val != '') {
254
					} else if (isset($val) && $val != '') {
256
						if ($val == '1') {# Présent
255
						if ($val == '1') {# Présent
257
							// Calcul du nombre de plante 'nc' ayant un statut "Présent"
256
							// Calcul du nombre de plante 'nc' ayant un statut "Présent"
258
							$this->nc_nbre_plte_presente++;
257
							$this->nc_nbre_plte_presente++;
259
							// Stockage par département du nombre de plante 'nc' ayant un statut "Présent"
258
							// Stockage par département du nombre de plante 'nc' ayant un statut "Présent"
260
							$this->aso_totaux_dep[$nd]['nc_plte_presente']++;
259
							$this->aso_totaux_dep[$nd]['nc_plte_presente']++;
261
						} elseif ($val == '1?') {# Présence à confirmer
260
						} elseif ($val == '1?') {# Présence à confirmer
262
							// Calcul du nombre de plante 'nc' ayant un statut "Présence à confirmer"
261
							// Calcul du nombre de plante 'nc' ayant un statut "Présence à confirmer"
263
							$this->nc_nbre_plte_a_confirmer++;
262
							$this->nc_nbre_plte_a_confirmer++;
264
							// Stockage par département du nombre de plante 'nc' ayant un statut "Présence à confirmer"
263
							// Stockage par département du nombre de plante 'nc' ayant un statut "Présence à confirmer"
265
							$this->aso_totaux_dep[$nd]['nc_plte_a_confirmer']++;
264
							$this->aso_totaux_dep[$nd]['nc_plte_a_confirmer']++;
266
						} elseif (preg_match('/^(?:\?| \?|\? | \?)$/', $val)) {# Douteux
265
						} elseif (preg_match('/^(?:\?| \?|\? | \?)$/', $val)) {# Douteux
267
							// Calcul du nombre de plante 'nc' ayant un statut "Douteux"
266
							// Calcul du nombre de plante 'nc' ayant un statut "Douteux"
268
							$this->nc_nbre_plte_douteux++;
267
							$this->nc_nbre_plte_douteux++;
269
							// Stockage par département du nombre de plante 'nc' ayant un statut "Douteux"
268
							// Stockage par département du nombre de plante 'nc' ayant un statut "Douteux"
270
							$this->aso_totaux_dep[$nd]['nc_plte_douteux']++;
269
							$this->aso_totaux_dep[$nd]['nc_plte_douteux']++;
271
							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
270
							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
272
								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
271
								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
273
								$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
272
								$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
274
														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
273
														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
275
							}
274
							}
276
						} elseif (preg_match('/^(?:#| #|# | # )$/', $val)) {# Erreur
275
						} elseif (preg_match('/^(?:#| #|# | # )$/', $val)) {# Erreur
277
	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur"
276
	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur"
278
	                        $this->nc_nbre_plte_erreur++;
277
	                        $this->nc_nbre_plte_erreur++;
279
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur"
278
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur"
280
	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur']++;
279
	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur']++;
281
	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
280
	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
282
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
281
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
283
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
282
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
284
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
283
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
285
	                        }
284
	                        }
286
                    	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
285
                    	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
287
	                        # Calcul du nombre de plante 'nc' ayant un statut "Disparu"
286
	                        # Calcul du nombre de plante 'nc' ayant un statut "Disparu"
288
	                        $this->nc_nbre_plte_disparue++;
287
	                        $this->nc_nbre_plte_disparue++;
289
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Disparu"
288
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Disparu"
290
	                        $this->aso_totaux_dep[$nd]['nc_plte_disparue']++;
289
	                        $this->aso_totaux_dep[$nd]['nc_plte_disparue']++;
291
	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
290
	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
292
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
291
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
293
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
292
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
294
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
293
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
295
	                        }
294
	                        }
296
                    	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
295
                    	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
297
	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
296
	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
298
	                        $this->nc_nbre_plte_erreur_a_confirmer++;
297
	                        $this->nc_nbre_plte_erreur_a_confirmer++;
299
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
298
	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
300
	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur_a_confirmer']++;
299
	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur_a_confirmer']++;
301
	                        if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
300
	                        if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
302
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
301
	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
303
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
302
	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
304
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
303
	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
305
	                        }
304
	                        }
306
                    	} else {
305
                    	} else {
307
							// Ajout de la valeur dans une variable car elle n'est pas conforme.
306
							// Ajout de la valeur dans une variable car elle n'est pas conforme.
308
							$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
307
							$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
309
													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
308
													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
310
						}
309
						}
311
					}
310
					}
312
					// Affichage dans la console du numéro de l'enregistrement analysé.
311
					// Affichage dans la console du numéro de l'enregistrement analysé.
313
					//echo str_repeat(chr(8), ( strlen( $i ) + 1 ))."\t".$i++;
312
					//echo str_repeat(chr(8), ( strlen( $i ) + 1 ))."\t".$i++;
314
				}
313
				}
315
			}// fin du foreach
314
			}// fin du foreach
316
			// Affichage dans la console du numéro de l'enregistrement analysé.
315
			// Affichage dans la console du numéro de l'enregistrement analysé.
317
			echo str_repeat(chr(8), ( strlen( $this->nbre_ligne ) + 1 ))."\t".$this->nbre_ligne++;
316
			echo str_repeat(chr(8), ( strlen( $this->nbre_ligne ) + 1 ))."\t".$this->nbre_ligne++;
318
		}
317
		}
319
		echo "\n";
318
		echo "\n";
320
	}
319
	}
321
 
320
 
322
	private function initialiserTableaux($dep) {
321
	private function initialiserTableaux($dep) {
323
		foreach ($dep as $code_dep) {
322
		foreach ($dep as $code_dep) {
324
			if ( preg_match('/^\d{2}$/', $code_dep) ) {
323
			if ( preg_match('/^\d{2}$/', $code_dep) ) {
325
				$this->aso_totaux_dep[$code_dep]['plte_presente'] = 0;
324
				$this->aso_totaux_dep[$code_dep]['plte_presente'] = 0;
326
				$this->aso_totaux_dep[$code_dep]['plte_a_confirmer'] = 0;
325
				$this->aso_totaux_dep[$code_dep]['plte_a_confirmer'] = 0;
327
				$this->aso_totaux_dep[$code_dep]['plte_douteux'] = 0;
326
				$this->aso_totaux_dep[$code_dep]['plte_douteux'] = 0;
328
				$this->aso_totaux_dep[$code_dep]['plte_erreur'] = 0;
327
				$this->aso_totaux_dep[$code_dep]['plte_erreur'] = 0;
329
				$this->aso_totaux_dep[$code_dep]['plte_disparue'] = 0;
328
				$this->aso_totaux_dep[$code_dep]['plte_disparue'] = 0;
330
				$this->aso_totaux_dep[$code_dep]['plte_erreur_a_confirmer'] = 0;
329
				$this->aso_totaux_dep[$code_dep]['plte_erreur_a_confirmer'] = 0;
331
				$this->aso_totaux_dep[$code_dep]['autres_valeur_champ'] = 0;
330
				$this->aso_totaux_dep[$code_dep]['autres_valeur_champ'] = 0;
332
				$this->aso_totaux_dep[$code_dep]['nc_plte_presente'] = 0;
331
				$this->aso_totaux_dep[$code_dep]['nc_plte_presente'] = 0;
333
				$this->aso_totaux_dep[$code_dep]['nc_plte_a_confirmer'] = 0;
332
				$this->aso_totaux_dep[$code_dep]['nc_plte_a_confirmer'] = 0;
334
				$this->aso_totaux_dep[$code_dep]['nc_plte_douteux'] = 0;
333
				$this->aso_totaux_dep[$code_dep]['nc_plte_douteux'] = 0;
335
				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur'] = 0;
334
				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur'] = 0;
336
				$this->aso_totaux_dep[$code_dep]['nc_plte_disparue'] = 0;
335
				$this->aso_totaux_dep[$code_dep]['nc_plte_disparue'] = 0;
337
				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur_a_confirmer'] = 0;
336
				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur_a_confirmer'] = 0;
338
				$this->aso_totaux_dep[$code_dep]['nc_autres_valeur_champ'] = 0;
337
				$this->aso_totaux_dep[$code_dep]['nc_autres_valeur_champ'] = 0;
339
			}
338
			}
340
		}
339
		}
341
	}
340
	}
342
 
341
 
343
	private function verifierDonnees() {
342
	private function verifierDonnees() {
344
		// Ouverture du fichier contenant les résultats (sortie)
343
		// Ouverture du fichier contenant les résultats (sortie)
345
		if (!$handle = fopen($this->fichier_verif, 'w')) {
344
		if (!$handle = fopen($this->fichier_verif, 'w')) {
346
			echo "Impossible d'ouvrir le fichier ($this->fichier_verif)";
345
			echo "Impossible d'ouvrir le fichier ($this->fichier_verif)";
347
			exit;
346
			exit;
348
		}
347
		}
349
 
348
 
350
		// Création de la page
349
		// Création de la page
351
		$page = '<html>'."\n";
350
		$page = '<html>'."\n";
352
		$page .= '<head>'."\n";
351
		$page .= '<head>'."\n";
353
		$page .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
352
		$page .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
354
		$page .= '<title>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</title>'."\n";
353
		$page .= '<title>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</title>'."\n";
355
		$page .= '</head>'."\n";
354
		$page .= '</head>'."\n";
356
		$page .= '<body>'."\n";
355
		$page .= '<body>'."\n";
357
		$page .= '<h1>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</h1>'."\n";
356
		$page .= '<h1>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</h1>'."\n";
358
		$page .= '<hr/>'."\n";
357
		$page .= '<hr/>'."\n";
359
		$page .= 	'<p>'.
358
		$page .= 	'<p>'.
360
						'Adresse fichier analysé : '.'<br />'."\n".
359
						'Adresse fichier analysé : '.'<br />'."\n".
361
						'</p>'."\n";
360
						'</p>'."\n";
362
		$page .= '<hr/>'."\n";
361
		$page .= '<hr/>'."\n";
363
		$page .= '<h2>RESULTATS PROGRAMME DE VERIFICATION</h2>'."\n";
362
		$page .= '<h2>RESULTATS PROGRAMME DE VERIFICATION</h2>'."\n";
364
		$page .= 	'<p>'.
363
		$page .= 	'<p>'.
365
						'Nom du programme générant ce fichier : '.__FILE__.'<br />'."\n".
364
						'Nom du programme générant ce fichier : '.__FILE__.'<br />'."\n".
366
						'Nombre de lignes analysées : '.$this->nbre_ligne.'<br />'."\n".
365
						'Nombre de lignes analysées : '.$this->nbre_ligne.'<br />'."\n".
367
						'Nbre de départements analysés : '.$this->nbre_dep_analyse.'<br />'."\n".
366
						'Nbre de départements analysés : '.$this->nbre_dep_analyse.'<br />'."\n".
368
						'Date d\'exécution du programme : '.date('d.m.Y').'<br />'."\n".
367
						'Date d\'exécution du programme : '.date('d.m.Y').'<br />'."\n".
369
						'</p>'."\n";
368
						'</p>'."\n";
370
		$page .= '<hr/>'."\n";
369
		$page .= '<hr/>'."\n";
371
		$page .= '<h2>RESULTATS ANALYSE CHOROLOGIE</h2>'."\n";
370
		$page .= '<h2>RESULTATS ANALYSE CHOROLOGIE</h2>'."\n";
372
		$page .= 	'<p>'.
371
		$page .= 	'<p>'.
373
						'Nombre de nom "nc" : '.$this->nc_nbre_nom.'<br />'."\n".
372
						'Nombre de nom "nc" : '.$this->nc_nbre_nom.'<br />'."\n".
374
						'Nombre de nom : '.$this->nbre_nom.'<br />'."\n".
373
						'Nombre de nom : '.$this->nbre_nom.'<br />'."\n".
375
						'Valeurs autres que 1, 1?, ?, #, #? et -|- : '.$this->autres_valeur_champ.'<br />'."\n".
374
						'Valeurs autres que 1, 1?, ?, #, #? et -|- : '.$this->autres_valeur_champ.'<br />'."\n".
376
						'Valeurs autres que 1, 1?, ?, #, #? et -|- pour les plantes nc : <br />'."\n".$this->nc_autres_valeur_champ.'</br>'."\n".
375
						'Valeurs autres que 1, 1?, ?, #, #? et -|- pour les plantes nc : <br />'."\n".$this->nc_autres_valeur_champ.'</br>'."\n".
377
						'</p>'."\n";
376
						'</p>'."\n";
378
		$page .= '<hr/>'."\n";
377
		$page .= '<hr/>'."\n";
379
		$page .= '<h2>RESULTATS ANALYSE des CHAMPS</h2>'."\n";
378
		$page .= '<h2>RESULTATS ANALYSE des CHAMPS</h2>'."\n";
380
		$page .= 	'<p>'.
379
		$page .= 	'<p>'.
381
						'Nombre de guillemets antislashés: '.$this->nbre_ligne_avec_guillemet.'<br />'."\n".
380
						'Nombre de guillemets antislashés: '.$this->nbre_ligne_avec_guillemet.'<br />'."\n".
382
						'</p>'."\n";
381
						'</p>'."\n";
383
		$page .= '<hr/>'."\n";
382
		$page .= '<hr/>'."\n";
384
		$page .= '<h2>TABLEAUX</h2>'."\n";
383
		$page .= '<h2>TABLEAUX</h2>'."\n";
385
 
384
 
386
		// Tableau des numéros nomenclaturaux dupliqués
385
		// Tableau des numéros nomenclaturaux dupliqués
387
		$table = '<table><thead><tr><th colspan="3">Tableau des numéros nomenclaturaux dupliqués </th></tr>';
386
		$table = '<table><thead><tr><th colspan="3">Tableau des numéros nomenclaturaux dupliqués </th></tr>';
388
		$table .= '<tr><th>Numéro nomenclatural</th><th>Nbre d\'itération</th><th>Lignes</th></tr></thead>';
387
		$table .= '<tr><th>Numéro nomenclatural</th><th>Nbre d\'itération</th><th>Lignes</th></tr></thead>';
389
		$afficher_tab_num_duplique = 0;
388
		$afficher_tab_num_duplique = 0;
390
		ksort($this->aso_num_nomenc);
389
		ksort($this->aso_num_nomenc);
391
		$table .= '<tbody style="text-align: center;">';
390
		$table .= '<tbody style="text-align: center;">';
392
		foreach ($this->aso_num_nomenc as $cle_nomenc => $val ) {
391
		foreach ($this->aso_num_nomenc as $cle_nomenc => $val ) {
393
			$ligne = '<tr><td>'.$cle_nomenc.'</td><td>'.$val['compteur'].'</td><td>'.$val['ligne'].'</td></tr>';
392
			$ligne = '<tr><td>'.$cle_nomenc.'</td><td>'.$val['compteur'].'</td><td>'.$val['ligne'].'</td></tr>';
394
			if ($val['compteur'] > 1) {
393
			if ($val['compteur'] > 1) {
395
				$table .= $ligne;
394
				$table .= $ligne;
396
				$afficher_tab_num_duplique = 1;
395
				$afficher_tab_num_duplique = 1;
397
			}
396
			}
398
		}
397
		}
399
		if ( $afficher_tab_num_duplique == 1 ) {
398
		if ( $afficher_tab_num_duplique == 1 ) {
400
			$page .= $table.'</tbody></table>';
399
			$page .= $table.'</tbody></table>';
401
		}
400
		}
402
 
401
 
403
		// Tableau des résultats par départements
402
		// Tableau des résultats par départements
404
		$table = '<table><thead><tr><th colspan="14">Tableau des résulats par départements</th></tr>';
403
		$table = '<table><thead><tr><th colspan="14">Tableau des résulats par départements</th></tr>';
405
		$table .= '<tr><th>Département</th><th>Nbre pltes présentes</th><th>Nbre pltes à confirmer</th>'.
404
		$table .= '<tr><th>Département</th><th>Nbre pltes présentes</th><th>Nbre pltes à confirmer</th>'.
406
			'<th>Nbre pltes douteuses</th><th>Nbre pltes disparues</th><th>Nbre pltes erreur</th><th>Nbre pltes erreur à confirmer</th>'.
405
			'<th>Nbre pltes douteuses</th><th>Nbre pltes disparues</th><th>Nbre pltes erreur</th><th>Nbre pltes erreur à confirmer</th>'.
407
			'<th>Total</th><th>Nbre pltes nc présentes</th><th>Nbre pltes nc à confirmer</th>'.
406
			'<th>Total</th><th>Nbre pltes nc présentes</th><th>Nbre pltes nc à confirmer</th>'.
408
			'<th>Nbre nc pltes douteuses</th><th>Nbre nc pltes disparues</th><th>Nbre nc pltes erreur</th><th>Nbre nc pltes erreur à confirmer</th></tr></thead>';
407
			'<th>Nbre nc pltes douteuses</th><th>Nbre nc pltes disparues</th><th>Nbre nc pltes erreur</th><th>Nbre nc pltes erreur à confirmer</th></tr></thead>';
409
		$table .= '<tbody style="text-align: center;">';
408
		$table .= '<tbody style="text-align: center;">';
410
		ksort($this->aso_totaux_dep);
409
		ksort($this->aso_totaux_dep);
411
		foreach ($this->aso_totaux_dep as $cle_dep => $val ) {
410
		foreach ($this->aso_totaux_dep as $cle_dep => $val ) {
412
			$plt_total = $val{'plte_presente'} + $val{'plte_a_confirmer'} + $val{'plte_douteux'} + $val{'plte_disparue'} + $val{'plte_erreur'} + $val{'plte_erreur_a_confirmer'};
411
			$plt_total = $val{'plte_presente'} + $val{'plte_a_confirmer'} + $val{'plte_douteux'} + $val{'plte_disparue'} + $val{'plte_erreur'} + $val{'plte_erreur_a_confirmer'};
413
			$table .= '<tr><td>'.ZgFrDepartements::getNom($cle_dep).' ('.ZgFrDepartements::getIdChaine($cle_dep).') </td>'.
412
			$table .= '<tr><td>'.ZgFrDepartements::getNom($cle_dep).' ('.ZgFrDepartements::getIdChaine($cle_dep).') </td>'.
414
				'<td>'.$val{'plte_presente'}.'</td><td>'.$val{'plte_a_confirmer'}.'</td><td>'.$val{'plte_douteux'}.'</td>'.
413
				'<td>'.$val{'plte_presente'}.'</td><td>'.$val{'plte_a_confirmer'}.'</td><td>'.$val{'plte_douteux'}.'</td>'.
415
				'<td>'.$val{'plte_disparue'}.'</td><td>'.$val{'plte_erreur'}.'</td><td>'.$val{'plte_erreur_a_confirmer'}.'</td><td>'.$plt_total.'</td>'.
414
				'<td>'.$val{'plte_disparue'}.'</td><td>'.$val{'plte_erreur'}.'</td><td>'.$val{'plte_erreur_a_confirmer'}.'</td><td>'.$plt_total.'</td>'.
416
				'<td>'.$val{'nc_plte_presente'}.'</td><td>'.$val{'nc_plte_a_confirmer'}.'</td><td>'.$val{'nc_plte_douteux'}.'</td>'.
415
				'<td>'.$val{'nc_plte_presente'}.'</td><td>'.$val{'nc_plte_a_confirmer'}.'</td><td>'.$val{'nc_plte_douteux'}.'</td>'.
417
				'<td>'.$val{'nc_plte_disparue'}.'</td><td>'.$val{'nc_plte_erreur'}.'</td><td>'.$val{'nc_plte_erreur_a_confirmer'}.'</td></tr>';
416
				'<td>'.$val{'nc_plte_disparue'}.'</td><td>'.$val{'nc_plte_erreur'}.'</td><td>'.$val{'nc_plte_erreur_a_confirmer'}.'</td></tr>';
418
		}
417
		}
419
 
418
 
420
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
419
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
421
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
420
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
422
		$plt_total = $this->nbre_plte_presente + $this->nbre_plte_a_confirmer + $this->nbre_plte_douteux + $this->nbre_plte_disparue + $this->nbre_plte_erreur + $this->nbre_plte_erreur_a_confirmer;
421
		$plt_total = $this->nbre_plte_presente + $this->nbre_plte_a_confirmer + $this->nbre_plte_douteux + $this->nbre_plte_disparue + $this->nbre_plte_erreur + $this->nbre_plte_erreur_a_confirmer;
423
		$table .= '<tr><td>Totaux : '.$this->nbre_dep_analyse.' départements</td><td>'.$this->nbre_plte_presente.'</td>'.
422
		$table .= '<tr><td>Totaux : '.$this->nbre_dep_analyse.' départements</td><td>'.$this->nbre_plte_presente.'</td>'.
424
			'<td>'.$this->nbre_plte_a_confirmer.'</td><td>'.$this->nbre_plte_douteux.'</td><td>'.$this->nbre_plte_disparue.'</td>'.
423
			'<td>'.$this->nbre_plte_a_confirmer.'</td><td>'.$this->nbre_plte_douteux.'</td><td>'.$this->nbre_plte_disparue.'</td>'.
425
			'<td>'.$this->nbre_plte_erreur.'</td><td>'.$this->nbre_plte_erreur_a_confirmer.'</td><td>'.$plt_total.'</td>'.
424
			'<td>'.$this->nbre_plte_erreur.'</td><td>'.$this->nbre_plte_erreur_a_confirmer.'</td><td>'.$plt_total.'</td>'.
426
			'<td>'.$this->nc_nbre_plte_presente.'</td>'.'<td>'.$this->nc_nbre_plte_a_confirmer.'</td>'.
425
			'<td>'.$this->nc_nbre_plte_presente.'</td>'.'<td>'.$this->nc_nbre_plte_a_confirmer.'</td>'.
427
			'<td>'.$this->nc_nbre_plte_douteux.'</td><td>'.$this->nc_nbre_plte_disparue.'</td><td>'.$this->nc_nbre_plte_erreur.'</td><td>'.$this->nc_nbre_plte_erreur_a_confirmer.'</td></tr>';
426
			'<td>'.$this->nc_nbre_plte_douteux.'</td><td>'.$this->nc_nbre_plte_disparue.'</td><td>'.$this->nc_nbre_plte_erreur.'</td><td>'.$this->nc_nbre_plte_erreur_a_confirmer.'</td></tr>';
428
 
427
 
429
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
428
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
430
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
429
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
431
		$total_nbre_plte = ($this->nbre_plte_presente + $this->nbre_plte_a_confirmer + $this->nbre_plte_douteux + $this->nbre_plte_disparue + $this->nbre_plte_erreur + $this->nbre_plte_erreur_a_confirmer);
430
		$total_nbre_plte = ($this->nbre_plte_presente + $this->nbre_plte_a_confirmer + $this->nbre_plte_douteux + $this->nbre_plte_disparue + $this->nbre_plte_erreur + $this->nbre_plte_erreur_a_confirmer);
432
		$total_nbre_plte_nc = ($this->nc_nbre_plte_presente + $this->nc_nbre_plte_a_confirmer + $this->nc_nbre_plte_douteux + $this->nc_nbre_plte_disparue + $this->nc_nbre_plte_erreur + $this->nc_nbre_plte_erreur_a_confirmer);
431
		$total_nbre_plte_nc = ($this->nc_nbre_plte_presente + $this->nc_nbre_plte_a_confirmer + $this->nc_nbre_plte_douteux + $this->nc_nbre_plte_disparue + $this->nc_nbre_plte_erreur + $this->nc_nbre_plte_erreur_a_confirmer);
433
		$table .= '<tr><td>Totaux plante / plante nc</td><td colspan="7">'.$total_nbre_plte.'</td>'.
432
		$table .= '<tr><td>Totaux plante / plante nc</td><td colspan="7">'.$total_nbre_plte.'</td>'.
434
			'<td colspan="6">'.$total_nbre_plte_nc.'</td></tr>';
433
			'<td colspan="6">'.$total_nbre_plte_nc.'</td></tr>';
435
 
434
 
436
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
435
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
437
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
436
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
438
		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente + $this->nc_nbre_plte_a_confirmer + $this->nbre_plte_a_confirmer;
437
		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente + $this->nc_nbre_plte_a_confirmer + $this->nbre_plte_a_confirmer;
439
		$table .= '<tr><td>Total plantes présentes et à confirmer</td><td colspan="13">'.$plt_total.'</td></tr>';
438
		$table .= '<tr><td>Total plantes présentes et à confirmer</td><td colspan="13">'.$plt_total.'</td></tr>';
440
 
439
 
441
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
440
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
442
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
441
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
443
		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente;
442
		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente;
444
		$table .= '<tr><td>Total plantes présentes</td><td colspan="13">'.$plt_total.'</td></tr>';
443
		$table .= '<tr><td>Total plantes présentes</td><td colspan="13">'.$plt_total.'</td></tr>';
445
 
444
 
446
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
445
		$table .= '<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>'.
447
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
446
				'<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>';
448
		$plt_total = $total_nbre_plte + $total_nbre_plte_nc;
447
		$plt_total = $total_nbre_plte + $total_nbre_plte_nc;
449
		$table .= '<tr><td>Total données chorologiques</td><td colspan="13">'.$plt_total.'</td></tr>';
448
		$table .= '<tr><td>Total données chorologiques</td><td colspan="13">'.$plt_total.'</td></tr>';
450
 
449
 
451
		$table .= '</tbody></table>';
450
		$table .= '</tbody></table>';
452
		$page .= $table;
451
		$page .= $table;
453
 
452
 
454
		$page .= '<hr/>'."\n";
453
		$page .= '<hr/>'."\n";
455
		$page .= '<h2>NOTES</h2>'."\n";
454
		$page .= '<h2>NOTES</h2>'."\n";
456
		$page .= 	'<p>'.
455
		$page .= 	'<p>'.
457
						'1.- Chaque champ précédé par "ATTENTION" doit être vide.'."\n".
456
						'1.- Chaque champ précédé par "ATTENTION" doit être vide.'."\n".
458
						'S\'il ne l\'est pas, il y a une erreur'."\n".
457
						'S\'il ne l\'est pas, il y a une erreur'."\n".
459
						'</p>'."\n";
458
						'</p>'."\n";
460
		$page .= '</body>'."\n";
459
		$page .= '</body>'."\n";
461
		$page .= '</html>'."\n";
460
		$page .= '</html>'."\n";
462
		// Fermeture de la poignée sur le fichier de sortie
461
		// Fermeture de la poignée sur le fichier de sortie
463
		if (fwrite($handle, $page) === FALSE) {
462
		if (fwrite($handle, $page) === FALSE) {
464
			echo "Impossible d'écrire dans le fichier ($this->fichier_verif)";
463
			echo "Impossible d'écrire dans le fichier ($this->fichier_verif)";
465
			exit;
464
			exit;
466
		}
465
		}
467
		echo 'Ecriture du fichier de vérification de la chorologie réalisée!'."\n";
466
		echo 'Ecriture du fichier de vérification de la chorologie réalisée!'."\n";
468
		fclose($handle);
467
		fclose($handle);
469
	}
468
	}
470
 
469
 
471
	private function supprimerTous() {
470
	private function supprimerTous() {
472
		$tablesChorodep = implode(',', $this->getNomsTablesChorodep());
471
		$tablesChorodep = implode(',', $this->getNomsTablesChorodep());
473
		$tableContributeurs = Config::get('tables.chorodepContributeurs');
472
		$tableContributeurs = Config::get('tables.chorodepContributeurs');
474
		$tableSources = Config::get('tables.chorodepSources');
473
		$tableSources = Config::get('tables.chorodepSources');
475
		$tableOntologies = Config::get('tables.chorodepOntologies');
474
		$tableOntologies = Config::get('tables.chorodepOntologies');
476
		$requete = "DROP TABLE IF EXISTS chorodep_meta, $tablesChorodep, $tableContributeurs, $tableSources, $tableOntologies ";
475
		$requete = "DROP TABLE IF EXISTS chorodep_meta, $tablesChorodep, $tableContributeurs, $tableSources, $tableOntologies ";
477
		$this->getBdd()->requeter($requete);
476
		$this->getBdd()->requeter($requete);
478
	}
477
	}
479
 
478
 
480
	private function getNomsTablesChorodep() {
479
	private function getNomsTablesChorodep() {
481
		$versions = explode(',', Config::get('versions'));
480
		$versions = explode(',', Config::get('versions'));
482
		$tableTpl = Config::get('tables.chorodepTpl');
481
		$tableTpl = Config::get('tables.chorodepTpl');
483
		$tablesChorodep = array();
482
		$tablesChorodep = array();
484
		foreach ($versions as $version) {
483
		foreach ($versions as $version) {
485
			$tablesChorodep[] = sprintf($tableTpl, $version);
484
			$tablesChorodep[] = sprintf($tableTpl, $version);
486
		}
485
		}
487
		return $tablesChorodep;
486
		return $tablesChorodep;
488
	}
487
	}
489
 
488
 
490
	private function getNomTableDernierVersion() {
489
	private function getNomTableDernierVersion() {
491
		$version = $this->getDerniereVersion();
490
		$version = $this->getDerniereVersion();
492
		$table = sprintf(Config::get('tables.chorodepTpl'), $version);
491
		$table = sprintf(Config::get('tables.chorodepTpl'), $version);
493
		return $table;
492
		return $table;
494
	}
493
	}
495
 
494
 
496
	private function getDerniereVersion() {
495
	private function getDerniereVersion() {
497
		$version = array_pop(explode(',', Config::get('versions')));
496
		$version = array_pop(explode(',', Config::get('versions')));
498
		return $version;
497
		return $version;
499
	}
498
	}
500
}
499
}
501
 
500
 
502
class ZgFrDepartements {
501
class ZgFrDepartements {
503
	static private $departements =
502
	static private $departements =
504
        array(
503
        array(
505
        "01" => array("Ain", "01", 1),
504
        "01" => array("Ain", "01", 1),
506
        "02" => array("Aisne", "02", 2),
505
        "02" => array("Aisne", "02", 2),
507
        "03" => array("Allier", "03", 3),
506
        "03" => array("Allier", "03", 3),
508
        "04" => array("Alpes-de-Haute-Provence", "04", 4),
507
        "04" => array("Alpes-de-Haute-Provence", "04", 4),
509
        "05" => array("Hautes-Alpes", "05", 5),
508
        "05" => array("Hautes-Alpes", "05", 5),
510
        "06" => array("Alpes-Maritimes", "06", 6),
509
        "06" => array("Alpes-Maritimes", "06", 6),
511
        "07" => array("Ardèche", "07", 7),
510
        "07" => array("Ardèche", "07", 7),
512
        "08" => array("Ardennes", "08", 8),
511
        "08" => array("Ardennes", "08", 8),
513
        "09" => array("Ariège", "09", 9),
512
        "09" => array("Ariège", "09", 9),
514
        "10" => array("Aube", "10", 10),
513
        "10" => array("Aube", "10", 10),
515
        "11" => array("Aude", "11", 11),
514
        "11" => array("Aude", "11", 11),
516
        "12" => array("Aveyron", "12", 12),
515
        "12" => array("Aveyron", "12", 12),
517
        "13" => array("Bouches-du-Rhône", "13", 13),
516
        "13" => array("Bouches-du-Rhône", "13", 13),
518
        "14" => array("Calvados", "14", 14),
517
        "14" => array("Calvados", "14", 14),
519
        "15" => array("Cantal", "15", 15),
518
        "15" => array("Cantal", "15", 15),
520
        "16" => array("Charente", "16", 16),
519
        "16" => array("Charente", "16", 16),
521
        "17" => array("Charente-Maritime", "17", 17),
520
        "17" => array("Charente-Maritime", "17", 17),
522
        "18" => array("Cher", "18", 18),
521
        "18" => array("Cher", "18", 18),
523
        "19" => array("Corrèze", "19", 19),
522
        "19" => array("Corrèze", "19", 19),
524
        "20" => array("Corse", "20", 20),
523
        "20" => array("Corse", "20", 20),
525
        "2A" => array("Haute-Corse", "2A", 20),
524
        "2A" => array("Haute-Corse", "2A", 20),
526
        "2B" => array("Corse-du-Sud", "2B", 20),
525
        "2B" => array("Corse-du-Sud", "2B", 20),
527
        "21" => array("Côte-d'Or", "21", 21),
526
        "21" => array("Côte-d'Or", "21", 21),
528
        "22" => array("Côtes-d'Armor", "22", 22),
527
        "22" => array("Côtes-d'Armor", "22", 22),
529
        "23" => array("Creuse", "23", 23),
528
        "23" => array("Creuse", "23", 23),
530
        "24" => array("Dordogne", "24", 24),
529
        "24" => array("Dordogne", "24", 24),
531
        "25" => array("Doubs","25", 25),
530
        "25" => array("Doubs","25", 25),
532
        "26" => array("Drôme", "26", 26),
531
        "26" => array("Drôme", "26", 26),
533
        "27" => array("Eure", "27", 27),
532
        "27" => array("Eure", "27", 27),
534
        "28" => array("Eure-et-Loir", "28", 28),
533
        "28" => array("Eure-et-Loir", "28", 28),
535
        "29" => array("Finistère", "29", 29),
534
        "29" => array("Finistère", "29", 29),
536
        "30" => array("Gard", "30", 30),
535
        "30" => array("Gard", "30", 30),
537
        "31" => array("Haute-Garonne", "31", 31),
536
        "31" => array("Haute-Garonne", "31", 31),
538
        "32" => array("Gers", "32", 32),
537
        "32" => array("Gers", "32", 32),
539
        "33" => array("Gironde", "33", 33),
538
        "33" => array("Gironde", "33", 33),
540
        "34" => array("Hérault", "34", 34),
539
        "34" => array("Hérault", "34", 34),
541
        "35" => array("Ille-et-Vilaine", "35", 35),
540
        "35" => array("Ille-et-Vilaine", "35", 35),
542
        "36" => array("Indre", "36", 36),
541
        "36" => array("Indre", "36", 36),
543
        "37" => array("Indre-et-Loire", "37", 37),
542
        "37" => array("Indre-et-Loire", "37", 37),
544
        "38" => array("Isère", "38", 38),
543
        "38" => array("Isère", "38", 38),
545
        "39" => array("Jura", "39", 39),
544
        "39" => array("Jura", "39", 39),
546
        "40" => array("Landes", "40", 40),
545
        "40" => array("Landes", "40", 40),
547
        "41" => array("Loir-et-Cher", "41", 41),
546
        "41" => array("Loir-et-Cher", "41", 41),
548
        "42" => array("Loire", "42", 42),
547
        "42" => array("Loire", "42", 42),
549
        "43" => array("Haute-Loire", "43", 43),
548
        "43" => array("Haute-Loire", "43", 43),
550
        "44" => array("Loire-Atlantique", "44", 44),
549
        "44" => array("Loire-Atlantique", "44", 44),
551
        "45" => array("Loiret", "45", 45),
550
        "45" => array("Loiret", "45", 45),
552
        "46" => array("Lot", "46", 46),
551
        "46" => array("Lot", "46", 46),
553
        "47" => array("Lot-et-Garonne", "47", 47),
552
        "47" => array("Lot-et-Garonne", "47", 47),
554
        "48" => array("Lozére ", "48", 48),
553
        "48" => array("Lozére ", "48", 48),
555
        "49" => array("Maine-et-Loire", "49", 49),
554
        "49" => array("Maine-et-Loire", "49", 49),
556
        "50" => array("Manche", "50", 50),
555
        "50" => array("Manche", "50", 50),
557
        "51" => array("Marne", "51", 51),
556
        "51" => array("Marne", "51", 51),
558
        "52" => array("Haute-Marne", "52", 52),
557
        "52" => array("Haute-Marne", "52", 52),
559
        "53" => array("Mayenne", "53", 53),
558
        "53" => array("Mayenne", "53", 53),
560
        "54" => array("Meurthe-et-Moselle", "54", 54),
559
        "54" => array("Meurthe-et-Moselle", "54", 54),
561
        "55" => array("Meuse", "55", 55),
560
        "55" => array("Meuse", "55", 55),
562
        "56" => array("Morbihan", "56", 56),
561
        "56" => array("Morbihan", "56", 56),
563
        "57" => array("Moselle", "57", 57),
562
        "57" => array("Moselle", "57", 57),
564
        "58" => array("Nièvre", "58", 58),
563
        "58" => array("Nièvre", "58", 58),
565
        "59" => array("Nord", "59", 59),
564
        "59" => array("Nord", "59", 59),
566
        "60" => array("Oise", "60", 60),
565
        "60" => array("Oise", "60", 60),
567
        "61" => array("Orne", "61", 61),
566
        "61" => array("Orne", "61", 61),
568
        "62" => array("Pas-de-Calais", "62", 62),
567
        "62" => array("Pas-de-Calais", "62", 62),
569
        "63" => array("Puy-de-Dôme", "63", 63),
568
        "63" => array("Puy-de-Dôme", "63", 63),
570
        "64" => array("Pyrénées-Atlantiques", "64", 64),
569
        "64" => array("Pyrénées-Atlantiques", "64", 64),
571
        "65" => array("Hautes-Pyrénées", "65", 65),
570
        "65" => array("Hautes-Pyrénées", "65", 65),
572
        "66" => array("Pyrénées-Orientales", "66", 66),
571
        "66" => array("Pyrénées-Orientales", "66", 66),
573
        "67" => array("Bas-Rhin", "67", 67),
572
        "67" => array("Bas-Rhin", "67", 67),
574
        "68" => array("Haut-Rhin", "68", 68),
573
        "68" => array("Haut-Rhin", "68", 68),
575
        "69" => array("Rhône", "69", 69),
574
        "69" => array("Rhône", "69", 69),
576
        "70" => array("Haute-Saône", "70", 70),
575
        "70" => array("Haute-Saône", "70", 70),
577
        "71" => array("Saône-et-Loire", "71", 71),
576
        "71" => array("Saône-et-Loire", "71", 71),
578
        "72" => array("Sarthe", "72", 72),
577
        "72" => array("Sarthe", "72", 72),
579
        "73" => array("Savoie", "73", 73),
578
        "73" => array("Savoie", "73", 73),
580
        "74" => array("Haute-Savoie", "74", 74),
579
        "74" => array("Haute-Savoie", "74", 74),
581
        "75" => array("Paris", "75", 75),
580
        "75" => array("Paris", "75", 75),
582
        "76" => array("Seine-Maritime", "76", 76),
581
        "76" => array("Seine-Maritime", "76", 76),
583
        "77" => array("Seine-et-Marne", "77", 77),
582
        "77" => array("Seine-et-Marne", "77", 77),
584
        "78" => array("Yvelines", "78", 78),
583
        "78" => array("Yvelines", "78", 78),
585
        "79" => array("Deux-Sèvres", "79", 79),
584
        "79" => array("Deux-Sèvres", "79", 79),
586
        "80" => array("Somme", "80", 80),
585
        "80" => array("Somme", "80", 80),
587
        "81" => array("Tarn", "81", 81),
586
        "81" => array("Tarn", "81", 81),
588
        "82" => array("Tarn-et-Garonne", "82", 82),
587
        "82" => array("Tarn-et-Garonne", "82", 82),
589
        "83" => array("Var", "83", 83),
588
        "83" => array("Var", "83", 83),
590
        "84" => array("Vaucluse", "84", 84),
589
        "84" => array("Vaucluse", "84", 84),
591
        "85" => array("Vendée", "85", 85),
590
        "85" => array("Vendée", "85", 85),
592
        "86" => array("Vienne", "86", 86),
591
        "86" => array("Vienne", "86", 86),
593
        "87" => array("Haute-Vienne", "87", 87),
592
        "87" => array("Haute-Vienne", "87", 87),
594
        "88" => array("Vosges", "88", 88),
593
        "88" => array("Vosges", "88", 88),
595
        "89" => array("Yonne", "89", 89),
594
        "89" => array("Yonne", "89", 89),
596
        "90" => array("Territoire-de-Belfort", "90", 90),
595
        "90" => array("Territoire-de-Belfort", "90", 90),
597
        "91" => array("Essonne", "91", 91),
596
        "91" => array("Essonne", "91", 91),
598
        "92" => array("Hauts-de-Seine", "92", 92),
597
        "92" => array("Hauts-de-Seine", "92", 92),
599
        "93" => array("Seine-Saint-Denis", "93", 93),
598
        "93" => array("Seine-Saint-Denis", "93", 93),
600
        "94" => array("Val-de-Marne", "94", 94),
599
        "94" => array("Val-de-Marne", "94", 94),
601
        "95" => array("Val-d'Oise", "95", 95),
600
        "95" => array("Val-d'Oise", "95", 95),
602
        "96" => array("aaa", "96", 96),
601
        "96" => array("aaa", "96", 96),
603
        "971" => array("Guadeloupe", "971", 971),
602
        "971" => array("Guadeloupe", "971", 971),
604
        "972" => array("Martinique", "972", 972),
603
        "972" => array("Martinique", "972", 972),
605
        "973" => array("Guyane", "973", 973),
604
        "973" => array("Guyane", "973", 973),
606
        "974" => array("Réunion", "974", 974),
605
        "974" => array("Réunion", "974", 974),
607
        "99" => array("Etranger", "99", 99),
606
        "99" => array("Etranger", "99", 99),
608
        );
607
        );
609
 
608
 
610
	static public function get() {
609
	static public function get() {
611
		return self::$departements;
610
		return self::$departements;
612
	}
611
	}
613
 
612
 
614
    static public function getNom($n) {
613
    static public function getNom($n) {
615
		return self::$departements[$n][0];
614
		return self::$departements[$n][0];
616
	}
615
	}
617
 
616
 
618
	static public function getIdChaine($n) {
617
	static public function getIdChaine($n) {
619
		return self::$departements[$n][1];
618
		return self::$departements[$n][1];
620
	}
619
	}
621
 
620
 
622
	static public function getIdNumerique($n) {
621
	static public function getIdNumerique($n) {
623
		return (int)self::$departements[$n][2];
622
		return (int)self::$departements[$n][2];
624
	}
623
	}
625
 
624
 
626
	static public function getIdEflore($n) {
625
	static public function getIdEflore($n) {
627
		return (int)self::$departements[$n][3];
626
		return (int)self::$departements[$n][3];
628
	}
627
	}
629
}
628
}
630
?>
629
?>