| 11 | jpm | 1 | <?php
 | 
        
           | 771 | delphine | 2 | // /opt/lampp/bin/php cli.php chorodep -a chargerVersions
 | 
        
           | 242 | jpm | 3 | class Chorodep extends EfloreScript {
 | 
        
           | 11 | jpm | 4 | 	protected $nbre_dep = 0;
 | 
        
           |  |  | 5 | 	private $type_donnee = '';
 | 
        
           |  |  | 6 | 	protected $aso_num_nomenc = array();
 | 
        
           |  |  | 7 | 	protected $nbre_ligne = 0;
 | 
        
           |  |  | 8 | 	protected $nbre_plte_presente = 0;
 | 
        
           |  |  | 9 | 	protected $nbre_plte_a_confirmer = 0;
 | 
        
           |  |  | 10 | 	protected $nbre_plte_douteux = 0;
 | 
        
           |  |  | 11 | 	protected $nbre_plte_erreur = 0;
 | 
        
           |  |  | 12 | 	protected $nbre_plte_disparue = 0;
 | 
        
           | 242 | jpm | 13 | 	protected $nbre_plte_erreur_a_confirmer = 0;
 | 
        
           | 11 | jpm | 14 | 	protected $nc_autres_valeur_champ = 0;
 | 
        
           | 242 | jpm | 15 | 	protected $nc_nbre_plte_presente = 0;
 | 
        
           |  |  | 16 | 	protected $nc_nbre_plte_a_confirmer = 0;
 | 
        
           |  |  | 17 | 	protected $nc_nbre_plte_douteux = 0;
 | 
        
           |  |  | 18 | 	protected $nc_nbre_plte_disparue = 0;
 | 
        
           |  |  | 19 | 	protected $nc_nbre_plte_erreur = 0;
 | 
        
           |  |  | 20 | 	protected $nc_nbre_plte_erreur_a_confirmer = 0;
 | 
        
           |  |  | 21 |   | 
        
           | 11 | jpm | 22 | 	protected $aso_totaux_dep = array();
 | 
        
           | 242 | jpm | 23 | 	private $fichier_verif = './chorodep_verif.html';
 | 
        
           | 11 | jpm | 24 |   | 
        
           | 242 | jpm | 25 | 	public function executer() {
 | 
        
           |  |  | 26 | 		try {
 | 
        
           |  |  | 27 | 			$this->initialiserProjet('chorodep');
 | 
        
           | 11 | jpm | 28 |   | 
        
           | 242 | jpm | 29 | 			// Lancement de l'action demandée
 | 
        
           |  |  | 30 | 			$cmd = $this->getParametre('a');
 | 
        
           |  |  | 31 | 			switch ($cmd) {
 | 
        
           |  |  | 32 |   | 
        
           |  |  | 33 | 				case 'chargerTous' :
 | 
        
           |  |  | 34 | 					$this->chargerStructureSql();
 | 
        
           |  |  | 35 | 					$this->chargerVersions();
 | 
        
           |  |  | 36 | 					$this->chargerChorodepContributeurs();
 | 
        
           |  |  | 37 | 					$this->chargerChorodepSources();
 | 
        
           |  |  | 38 | 					$this->chargerChorodepOntologies();
 | 
        
           | 1182 | mathias | 39 | 					$this->chargerNVSP();
 | 
        
           | 242 | jpm | 40 | 					break;
 | 
        
           |  |  | 41 | 				case 'chargerStructureSql' :
 | 
        
           |  |  | 42 | 					$this->chargerStructureSql();
 | 
        
           |  |  | 43 | 					break;
 | 
        
           |  |  | 44 | 				case 'chargerVersions' :
 | 
        
           |  |  | 45 | 					$this->chargerVersions();
 | 
        
           |  |  | 46 | 					break;
 | 
        
           |  |  | 47 | 				case 'chargerChorodep' :
 | 
        
           |  |  | 48 | 					$this->chargerChorodepContributeurs();
 | 
        
           |  |  | 49 | 					$this->chargerChorodepSources();
 | 
        
           |  |  | 50 | 					$this->chargerChorodepOntologies();
 | 
        
           |  |  | 51 | 					break;
 | 
        
           |  |  | 52 | 				case 'verifierDonnees' :
 | 
        
           |  |  | 53 | 					$this->initialiserTraitement();
 | 
        
           |  |  | 54 | 					$this->verifierDonnees();
 | 
        
           |  |  | 55 | 					break;
 | 
        
           |  |  | 56 | 				case 'supprimerTous' :
 | 
        
           |  |  | 57 | 					$this->supprimerTous();
 | 
        
           |  |  | 58 | 					break;
 | 
        
           | 1124 | mathias | 59 | 				// noms vernaculaires et statuts de protection
 | 
        
           | 1179 | mathias | 60 | 				case 'chargerNVSP' :
 | 
        
           |  |  | 61 | 					$this->chargerNVSP();
 | 
        
           | 1124 | mathias | 62 | 					break;
 | 
        
           |  |  | 63 | 				case 'nettoyageNVSP' :
 | 
        
           |  |  | 64 | 					$this->nettoyageNVSP();
 | 
        
           |  |  | 65 | 					break;
 | 
        
           |  |  | 66 | 				case 'chargerStructureNVSP' :
 | 
        
           |  |  | 67 | 					$this->chargerStructureNVSP();
 | 
        
           |  |  | 68 | 					break;
 | 
        
           | 1179 | mathias | 69 | 				case 'genererNomsVernaculaires' :
 | 
        
           |  |  | 70 | 					$this->genererNomsVernaculaires();
 | 
        
           | 1124 | mathias | 71 | 					break;
 | 
        
           | 1179 | mathias | 72 | 				case 'genererStatutsProtection' :
 | 
        
           |  |  | 73 | 					$this->genererStatutsProtection();
 | 
        
           | 1124 | mathias | 74 | 					break;
 | 
        
           | 242 | jpm | 75 | 				default :
 | 
        
           |  |  | 76 | 					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
 | 
        
           |  |  | 77 | 			}
 | 
        
           |  |  | 78 | 		} catch (Exception $e) {
 | 
        
           |  |  | 79 | 			$this->traiterErreur($e->getMessage());
 | 
        
           |  |  | 80 | 		}
 | 
        
           | 11 | jpm | 81 | 	}
 | 
        
           |  |  | 82 |   | 
        
           | 242 | jpm | 83 | 	private function chargerChorodepContributeurs() {
 | 
        
           |  |  | 84 | 		$chemin = Config::get('chemins.chorodepContributeurs');
 | 
        
           |  |  | 85 | 		$table = Config::get('tables.chorodepContributeurs');
 | 
        
           |  |  | 86 | 		$requete = "LOAD DATA INFILE '$chemin' ".
 | 
        
           |  |  | 87 | 						"REPLACE INTO TABLE $table ".
 | 
        
           |  |  | 88 | 						'CHARACTER SET utf8 '.
 | 
        
           |  |  | 89 | 						'FIELDS '.
 | 
        
           |  |  | 90 | 						"	TERMINATED BY '\t' ".
 | 
        
           |  |  | 91 | 						"	ENCLOSED BY '' ".
 | 
        
           |  |  | 92 | 						"	ESCAPED BY '\\\' ".
 | 
        
           |  |  | 93 | 						'IGNORE 2 LINES';
 | 
        
           |  |  | 94 | 		$this->getBdd()->requeter($requete);
 | 
        
           |  |  | 95 | 	}
 | 
        
           | 11 | jpm | 96 |   | 
        
           | 242 | jpm | 97 | 	private function chargerChorodepSources() {
 | 
        
           |  |  | 98 | 		$chemin = Config::get('chemins.chorodepSources');
 | 
        
           |  |  | 99 | 		$table = Config::get('tables.chorodepSources');
 | 
        
           |  |  | 100 | 		$requete = "LOAD DATA INFILE '$chemin' ".
 | 
        
           |  |  | 101 | 							"REPLACE INTO TABLE $table ".
 | 
        
           |  |  | 102 | 							'CHARACTER SET utf8 '.
 | 
        
           |  |  | 103 | 							'FIELDS '.
 | 
        
           |  |  | 104 | 							"	TERMINATED BY '\t' ".
 | 
        
           |  |  | 105 | 							"	ENCLOSED BY '' ".
 | 
        
           |  |  | 106 | 							"	ESCAPED BY '\\\' ".
 | 
        
           |  |  | 107 | 							'IGNORE 2 LINES';
 | 
        
           |  |  | 108 | 		$this->getBdd()->requeter($requete);
 | 
        
           |  |  | 109 | 	}
 | 
        
           | 11 | jpm | 110 |   | 
        
           | 242 | jpm | 111 | 	private function chargerChorodepOntologies() {
 | 
        
           |  |  | 112 | 		$chemin = Config::get('chemins.chorodepOntologies');
 | 
        
           |  |  | 113 | 		$table = Config::get('tables.chorodepOntologies');
 | 
        
           |  |  | 114 | 		$requete = "LOAD DATA INFILE '$chemin' ".
 | 
        
           |  |  | 115 | 								"REPLACE INTO TABLE $table ".
 | 
        
           |  |  | 116 | 								'CHARACTER SET utf8 '.
 | 
        
           |  |  | 117 | 								'FIELDS '.
 | 
        
           |  |  | 118 | 								"	TERMINATED BY '\t' ".
 | 
        
           |  |  | 119 | 								"	ENCLOSED BY '' ".
 | 
        
           |  |  | 120 | 								"	ESCAPED BY '\\\' ".
 | 
        
           |  |  | 121 | 								'IGNORE 1 LINES';
 | 
        
           |  |  | 122 | 		$this->getBdd()->requeter($requete);
 | 
        
           | 11 | jpm | 123 | 	}
 | 
        
           |  |  | 124 |   | 
        
           | 242 | jpm | 125 | 	private function chargerVersions() {
 | 
        
           |  |  | 126 | 		$versions = explode(',', Config::get('versions'));
 | 
        
           |  |  | 127 | 		$versionsDonnees = explode(',', Config::get('versionsDonnees'));
 | 
        
           |  |  | 128 | 		foreach ($versions as $id => $version) {
 | 
        
           |  |  | 129 | 			$versionDonnees = $versionsDonnees[$id];
 | 
        
           |  |  | 130 | 			$this->chargerStructureSqlVersion($versionDonnees);
 | 
        
           |  |  | 131 | 			$this->chargerDonneesVersion($versionDonnees, $version);
 | 
        
           | 11 | jpm | 132 | 		}
 | 
        
           |  |  | 133 | 	}
 | 
        
           | 242 | jpm | 134 |   | 
        
           |  |  | 135 | 	private function chargerStructureSqlVersion($versionDonnees) {
 | 
        
           | 249 | jpm | 136 | 		$fichierSqlTpl = Config::get('chemins.structureSqlVersionTpl');
 | 
        
           | 242 | jpm | 137 | 		$fichierSql = sprintf($fichierSqlTpl, $versionDonnees, $versionDonnees);
 | 
        
           |  |  | 138 | 		$contenuSql = $this->recupererContenu($fichierSql);
 | 
        
           |  |  | 139 | 		$this->executerScripSql($contenuSql);
 | 
        
           |  |  | 140 | 	}
 | 
        
           |  |  | 141 |   | 
        
           |  |  | 142 | 	private function chargerDonneesVersion($versionDonnees, $version) {
 | 
        
           | 249 | jpm | 143 | 		$fichierTsvTpl = Config::get('chemins.chorodepTpl');
 | 
        
           | 242 | jpm | 144 | 		$fichierTsv = sprintf($fichierTsvTpl, $versionDonnees, $versionDonnees);
 | 
        
           | 249 | jpm | 145 | 		$tableTpl = Config::get('tables.chorodepTpl');
 | 
        
           | 242 | jpm | 146 | 		$table = sprintf($tableTpl, $version);
 | 
        
           | 773 | delphine | 147 | 		$champs = Config::get('chorodepChamps'.$version);
 | 
        
           | 242 | jpm | 148 | 		$requete = "LOAD DATA INFILE '$fichierTsv' ".
 | 
        
           |  |  | 149 | 						"REPLACE INTO TABLE $table ".
 | 
        
           |  |  | 150 | 						'CHARACTER SET utf8 '.
 | 
        
           |  |  | 151 | 						'FIELDS '.
 | 
        
           |  |  | 152 | 						"	TERMINATED BY '\t' ".
 | 
        
           |  |  | 153 | 						"	ENCLOSED BY '' ".
 | 
        
           |  |  | 154 | 						"	ESCAPED BY '\\\' ".
 | 
        
           |  |  | 155 | 						"($champs) ";
 | 
        
           |  |  | 156 | 		$this->getBdd()->requeter($requete);
 | 
        
           |  |  | 157 | 	}
 | 
        
           |  |  | 158 |   | 
        
           | 11 | jpm | 159 | 	private function initialiserTraitement() {
 | 
        
           |  |  | 160 | 		//------------------------------------------------------------------------------------------------------------//
 | 
        
           |  |  | 161 | 		// Récupération des informations à vérifier
 | 
        
           | 1124 | mathias | 162 | 		$table = $this->getNomTableDerniereVersion();
 | 
        
           | 11 | jpm | 163 | 		$requete = 	'SELECT * '.
 | 
        
           | 242 | jpm | 164 | 					"FROM $table ";
 | 
        
           |  |  | 165 | 		$taxons = $this->getBdd()->recupererTous($requete);
 | 
        
           | 11 | jpm | 166 | 		$tax_col = $taxons[1];
 | 
        
           |  |  | 167 | 		$col = array_keys($tax_col);
 | 
        
           |  |  | 168 | 		$this->initialiserTableaux($col);
 | 
        
           |  |  | 169 | 		//------------------------------------------------------------------------------------------------------------//
 | 
        
           |  |  | 170 | 		// Analyse des données
 | 
        
           |  |  | 171 | 		echo 'Traitement de la ligne n° :';
 | 
        
           |  |  | 172 | 		$i = 0;
 | 
        
           |  |  | 173 | 		$j = 0;
 | 
        
           |  |  | 174 | 		$aso_departements_analyses = array();
 | 
        
           |  |  | 175 | 		$this->nbre_ligne_avec_guillemet = 0;
 | 
        
           |  |  | 176 | 		foreach ($taxons as $aso_champs) {
 | 
        
           |  |  | 177 | 			$nom = $aso_champs['nom_sci'];
 | 
        
           |  |  | 178 | 			$num_taxo = $aso_champs['num_tax'];
 | 
        
           |  |  | 179 | 			$num_nomenc = $aso_champs['num_nom'];
 | 
        
           |  |  | 180 | 			if ($num_nomenc == 'nc') {
 | 
        
           |  |  | 181 | 				$this->nc_nbre_nom++;
 | 
        
           |  |  | 182 | 			} else if ($num_nomenc != 'nc') {
 | 
        
           |  |  | 183 | 				$this->nbre_nom++;
 | 
        
           |  |  | 184 | 				// Vérification de la nom duplication des numéros nomenclaturaux
 | 
        
           |  |  | 185 | 				if ( !array_key_exists($num_nomenc, (array) $this->aso_num_nomenc) ) {
 | 
        
           |  |  | 186 | 					$this->aso_num_nomenc[$num_nomenc]['compteur'] = 1;
 | 
        
           |  |  | 187 | 					$this->aso_num_nomenc[$num_nomenc]['ligne'] = ($this->nbre_ligne+1);
 | 
        
           |  |  | 188 | 				} else {
 | 
        
           |  |  | 189 | 					$this->aso_num_nomenc[$num_nomenc]['compteur']++;
 | 
        
           |  |  | 190 | 					$this->aso_num_nomenc[$num_nomenc]['ligne'] .= ' - '.($this->nbre_ligne+1);
 | 
        
           |  |  | 191 | 				}
 | 
        
           |  |  | 192 | 			}
 | 
        
           |  |  | 193 | 			foreach ($aso_champs as $cle => $val ) {# Pour chaque département du taxon, on regarde la valeur
 | 
        
           |  |  | 194 | 				$this->nbre_ligne_avec_guillemet += preg_match('/"/', $val);
 | 
        
           |  |  | 195 | 				if ( preg_match('/^\d{2}$/', $cle) ) {# Nous vérifions que le nom du champs comprend bien le numéro du département entre ()
 | 
        
           |  |  | 196 | 					$nd = $cle;# Numéro du département
 | 
        
           |  |  | 197 | 					// Nous comptons le nombre de département en base de données
 | 
        
           |  |  | 198 | 					if (!isset($aso_departements_analyses[$nd])) {
 | 
        
           |  |  | 199 | 						$this->nbre_dep_analyse++;
 | 
        
           |  |  | 200 | 						$aso_departements_analyses[$nd] = $nd;
 | 
        
           |  |  | 201 | 					}
 | 
        
           |  |  | 202 | 					if ( $num_nomenc != 'nc' && isset($val) && $val != '') {# Si le taxon n'est pas abscent du département
 | 
        
           |  |  | 203 | 						if ($val == '1') {# Présent
 | 
        
           |  |  | 204 | 							// Calcul du nombre de plante ayant un statut "Présent"
 | 
        
           |  |  | 205 | 							$this->nbre_plte_presente++;
 | 
        
           |  |  | 206 | 							// Stockage par département du nombre de plante ayant un statut "Présent"
 | 
        
           |  |  | 207 | 							$this->aso_totaux_dep[$nd]['plte_presente']++;
 | 
        
           |  |  | 208 | 							// Stockage des informations
 | 
        
           |  |  | 209 | 							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 3, $this->id_donnee_choro++);
 | 
        
           |  |  | 210 | 						} else if ($val == '1?') {# Présence à confirmer
 | 
        
           |  |  | 211 | 							// Calcul du nombre de plante ayant un statut "Présence à confirmer"
 | 
        
           |  |  | 212 | 							$this->nbre_plte_a_confirmer++;
 | 
        
           |  |  | 213 | 							// Stockage par département du nombre de plante ayant un statut "Présence à confirmer"
 | 
        
           |  |  | 214 | 							$this->aso_totaux_dep[$nd]['plte_a_confirmer']++;
 | 
        
           |  |  | 215 | 							// Stockage des informations
 | 
        
           |  |  | 216 | 							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 4, $this->id_donnee_choro++);
 | 
        
           |  |  | 217 | 						} else if (preg_match('/^\s*(?:\?)\s*$/', $val)) {# Douteux
 | 
        
           |  |  | 218 | 							// Calcul du nombre de plante ayant un statut "Disparu ou douteux"
 | 
        
           |  |  | 219 | 							$this->nbre_plte_douteux++;
 | 
        
           |  |  | 220 | 							// Stockage par département du nombre de plante ayant un statut "Douteux"
 | 
        
           |  |  | 221 | 							$this->aso_totaux_dep[$nd]['plte_douteux']++;
 | 
        
           |  |  | 222 | 							// Stockage des informations
 | 
        
           |  |  | 223 | 							$this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 5, $this->id_donnee_choro++);
 | 
        
           |  |  | 224 | 							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
 | 
        
           |  |  | 225 | 								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
 | 
        
           |  |  | 226 | 								$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 227 | 														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 228 | 							}
 | 
        
           |  |  | 229 | 						} elseif (preg_match('/^\s*(?:#)\s*$/', $val)) {# Erreur
 | 
        
           |  |  | 230 | 	                        # Calcul du nombre de plante ayant un statut "Erreur"
 | 
        
           |  |  | 231 | 	                        $this->nbre_plte_erreur++;
 | 
        
           |  |  | 232 | 	                        # Stockage par département du nombre de plante ayant un statut "Erreur"
 | 
        
           |  |  | 233 | 	                        $this->aso_totaux_dep[$nd]['plte_erreur']++;
 | 
        
           |  |  | 234 | 	                        # Stockage des informations
 | 
        
           |  |  | 235 | 	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
 | 
        
           |  |  | 236 | 	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
 | 
        
           |  |  | 237 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
 | 
        
           |  |  | 238 | 	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 239 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 240 | 	                        }
 | 
        
           |  |  | 241 |                     	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
 | 
        
           |  |  | 242 | 	                        # Calcul du nombre de plante ayant un statut "Disparu"
 | 
        
           |  |  | 243 | 	                        $this->nbre_plte_disparue++;
 | 
        
           |  |  | 244 | 	                        # Stockage par département du nombre de plante ayant un statut "Disparu"
 | 
        
           |  |  | 245 | 	                        $this->aso_totaux_dep[$nd]['plte_disparue']++;
 | 
        
           |  |  | 246 | 	                        # Stockage des informations
 | 
        
           |  |  | 247 | 	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
 | 
        
           |  |  | 248 | 	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
 | 
        
           |  |  | 249 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
 | 
        
           |  |  | 250 | 	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 251 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 252 | 	                        }
 | 
        
           | 242 | jpm | 253 |                     	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
 | 
        
           |  |  | 254 | 	                        # Calcul du nombre de plante ayant un statut "Erreur à confirmer"
 | 
        
           |  |  | 255 | 	                        $this->nbre_plte_erreur_a_confirmer++;
 | 
        
           |  |  | 256 | 	                        # Stockage par département du nombre de plante ayant un statut "Erreur à confirmer"
 | 
        
           |  |  | 257 | 	                        $this->aso_totaux_dep[$nd]['plte_erreur_a_confirmer']++;
 | 
        
           |  |  | 258 | 	                        # Stockage des informations
 | 
        
           |  |  | 259 | 	                        $this->tab_choro_dep[$j] = array(ZgFrDepartements::getIdChaine($nd), $num_taxo, $num_nomenc, 6, $this->id_donnee_choro++);
 | 
        
           |  |  | 260 |                     		if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
 | 
        
           |  |  | 261 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
 | 
        
           |  |  | 262 | 	                            $autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 263 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 264 | 	                        }
 | 
        
           | 11 | jpm | 265 |                     	} else {
 | 
        
           |  |  | 266 | 							// Ajout de la valeur dans une variable car elle n'est pas conforme.
 | 
        
           |  |  | 267 | 							$this->autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 268 | 													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 269 | 						}
 | 
        
           |  |  | 270 | 						$j++;
 | 
        
           |  |  | 271 | 					} else if (isset($val) && $val != '') {
 | 
        
           |  |  | 272 | 						if ($val == '1') {# Présent
 | 
        
           |  |  | 273 | 							// Calcul du nombre de plante 'nc' ayant un statut "Présent"
 | 
        
           |  |  | 274 | 							$this->nc_nbre_plte_presente++;
 | 
        
           |  |  | 275 | 							// Stockage par département du nombre de plante 'nc' ayant un statut "Présent"
 | 
        
           |  |  | 276 | 							$this->aso_totaux_dep[$nd]['nc_plte_presente']++;
 | 
        
           |  |  | 277 | 						} elseif ($val == '1?') {# Présence à confirmer
 | 
        
           |  |  | 278 | 							// Calcul du nombre de plante 'nc' ayant un statut "Présence à confirmer"
 | 
        
           |  |  | 279 | 							$this->nc_nbre_plte_a_confirmer++;
 | 
        
           |  |  | 280 | 							// Stockage par département du nombre de plante 'nc' ayant un statut "Présence à confirmer"
 | 
        
           |  |  | 281 | 							$this->aso_totaux_dep[$nd]['nc_plte_a_confirmer']++;
 | 
        
           |  |  | 282 | 						} elseif (preg_match('/^(?:\?| \?|\? | \?)$/', $val)) {# Douteux
 | 
        
           |  |  | 283 | 							// Calcul du nombre de plante 'nc' ayant un statut "Douteux"
 | 
        
           |  |  | 284 | 							$this->nc_nbre_plte_douteux++;
 | 
        
           |  |  | 285 | 							// Stockage par département du nombre de plante 'nc' ayant un statut "Douteux"
 | 
        
           |  |  | 286 | 							$this->aso_totaux_dep[$nd]['nc_plte_douteux']++;
 | 
        
           |  |  | 287 | 							if (preg_match('/(?: \?|\? | \? )/', $val)) {# Douteux
 | 
        
           |  |  | 288 | 								// Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "?".
 | 
        
           |  |  | 289 | 								$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 290 | 														' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 291 | 							}
 | 
        
           |  |  | 292 | 						} elseif (preg_match('/^(?:#| #|# | # )$/', $val)) {# Erreur
 | 
        
           |  |  | 293 | 	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur"
 | 
        
           |  |  | 294 | 	                        $this->nc_nbre_plte_erreur++;
 | 
        
           |  |  | 295 | 	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur"
 | 
        
           |  |  | 296 | 	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur']++;
 | 
        
           |  |  | 297 | 	                        if (preg_match('/(?: #|# | # )/', $val)) {# Erreur avec espace
 | 
        
           |  |  | 298 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#".
 | 
        
           |  |  | 299 | 	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 300 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 301 | 	                        }
 | 
        
           |  |  | 302 |                     	} elseif (preg_match('/^\s*(?:-\|-)\s*$/', $val)) {# Disparu
 | 
        
           |  |  | 303 | 	                        # Calcul du nombre de plante 'nc' ayant un statut "Disparu"
 | 
        
           |  |  | 304 | 	                        $this->nc_nbre_plte_disparue++;
 | 
        
           |  |  | 305 | 	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Disparu"
 | 
        
           |  |  | 306 | 	                        $this->aso_totaux_dep[$nd]['nc_plte_disparue']++;
 | 
        
           |  |  | 307 | 	                        if (preg_match('/(?: -\|-|-\|- | -\|- )/', $val)) {# Disparu avec espace
 | 
        
           |  |  | 308 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "-|-".
 | 
        
           |  |  | 309 | 	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 310 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 311 | 	                        }
 | 
        
           | 242 | jpm | 312 |                     	} elseif (preg_match('/^\s*(?:#\?)\s*$/', $val)) {# Erreur à confirmer
 | 
        
           |  |  | 313 | 	                        # Calcul du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
 | 
        
           |  |  | 314 | 	                        $this->nc_nbre_plte_erreur_a_confirmer++;
 | 
        
           |  |  | 315 | 	                        # Stockage par département du nombre de plante 'nc' ayant un statut "Erreur à confirmer"
 | 
        
           |  |  | 316 | 	                        $this->aso_totaux_dep[$nd]['nc_plte_erreur_a_confirmer']++;
 | 
        
           |  |  | 317 | 	                        if (preg_match('/^(?:\s+#\?|#\?\s+|\s+#\?\s+)$/', $val)) {# Erreur à confirmer avec espace
 | 
        
           |  |  | 318 | 	                            # Ajout de la valeur dans une variable car elle n'est pas tout à fait conforme à "#?".
 | 
        
           |  |  | 319 | 	                            $nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 320 | 	                                                    ' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 321 | 	                        }
 | 
        
           | 11 | jpm | 322 |                     	} else {
 | 
        
           |  |  | 323 | 							// Ajout de la valeur dans une variable car elle n'est pas conforme.
 | 
        
           |  |  | 324 | 							$this->nc_autres_valeur_champ .= '<'.$val.'> '.'(Ligne n°: '.($this->nbre_ligne+2).
 | 
        
           |  |  | 325 | 													' - N° nomenclatural: '.$num_nomenc.' - N° département: '.$nd.')<br />';
 | 
        
           |  |  | 326 | 						}
 | 
        
           |  |  | 327 | 					}
 | 
        
           |  |  | 328 | 					// Affichage dans la console du numéro de l'enregistrement analysé.
 | 
        
           |  |  | 329 | 					//echo str_repeat(chr(8), ( strlen( $i ) + 1 ))."\t".$i++;
 | 
        
           |  |  | 330 | 				}
 | 
        
           |  |  | 331 | 			}// fin du foreach
 | 
        
           |  |  | 332 | 			// Affichage dans la console du numéro de l'enregistrement analysé.
 | 
        
           |  |  | 333 | 			echo str_repeat(chr(8), ( strlen( $this->nbre_ligne ) + 1 ))."\t".$this->nbre_ligne++;
 | 
        
           |  |  | 334 | 		}
 | 
        
           |  |  | 335 | 		echo "\n";
 | 
        
           |  |  | 336 | 	}
 | 
        
           |  |  | 337 |   | 
        
           | 242 | jpm | 338 | 	private function initialiserTableaux($dep) {
 | 
        
           |  |  | 339 | 		foreach ($dep as $code_dep) {
 | 
        
           |  |  | 340 | 			if ( preg_match('/^\d{2}$/', $code_dep) ) {
 | 
        
           |  |  | 341 | 				$this->aso_totaux_dep[$code_dep]['plte_presente'] = 0;
 | 
        
           |  |  | 342 | 				$this->aso_totaux_dep[$code_dep]['plte_a_confirmer'] = 0;
 | 
        
           |  |  | 343 | 				$this->aso_totaux_dep[$code_dep]['plte_douteux'] = 0;
 | 
        
           |  |  | 344 | 				$this->aso_totaux_dep[$code_dep]['plte_erreur'] = 0;
 | 
        
           |  |  | 345 | 				$this->aso_totaux_dep[$code_dep]['plte_disparue'] = 0;
 | 
        
           |  |  | 346 | 				$this->aso_totaux_dep[$code_dep]['plte_erreur_a_confirmer'] = 0;
 | 
        
           |  |  | 347 | 				$this->aso_totaux_dep[$code_dep]['autres_valeur_champ'] = 0;
 | 
        
           |  |  | 348 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_presente'] = 0;
 | 
        
           |  |  | 349 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_a_confirmer'] = 0;
 | 
        
           |  |  | 350 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_douteux'] = 0;
 | 
        
           |  |  | 351 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur'] = 0;
 | 
        
           |  |  | 352 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_disparue'] = 0;
 | 
        
           |  |  | 353 | 				$this->aso_totaux_dep[$code_dep]['nc_plte_erreur_a_confirmer'] = 0;
 | 
        
           |  |  | 354 | 				$this->aso_totaux_dep[$code_dep]['nc_autres_valeur_champ'] = 0;
 | 
        
           |  |  | 355 | 			}
 | 
        
           |  |  | 356 | 		}
 | 
        
           |  |  | 357 | 	}
 | 
        
           |  |  | 358 |   | 
        
           |  |  | 359 | 	private function verifierDonnees() {
 | 
        
           | 11 | jpm | 360 | 		// Ouverture du fichier contenant les résultats (sortie)
 | 
        
           |  |  | 361 | 		if (!$handle = fopen($this->fichier_verif, 'w')) {
 | 
        
           |  |  | 362 | 			echo "Impossible d'ouvrir le fichier ($this->fichier_verif)";
 | 
        
           |  |  | 363 | 			exit;
 | 
        
           |  |  | 364 | 		}
 | 
        
           |  |  | 365 |   | 
        
           |  |  | 366 | 		// Création de la page
 | 
        
           |  |  | 367 | 		$page = '<html>'."\n";
 | 
        
           |  |  | 368 | 		$page .= '<head>'."\n";
 | 
        
           | 242 | jpm | 369 | 		$page .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\n";
 | 
        
           | 11 | jpm | 370 | 		$page .= '<title>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</title>'."\n";
 | 
        
           |  |  | 371 | 		$page .= '</head>'."\n";
 | 
        
           |  |  | 372 | 		$page .= '<body>'."\n";
 | 
        
           |  |  | 373 | 		$page .= '<h1>RESULTAT DE LA VERIFICATION DU FICHIER TABULE DE LA CHOROLOGIE</h1>'."\n";
 | 
        
           |  |  | 374 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 375 | 		$page .= 	'<p>'.
 | 
        
           |  |  | 376 | 						'Adresse fichier analysé : '.'<br />'."\n".
 | 
        
           |  |  | 377 | 						'</p>'."\n";
 | 
        
           |  |  | 378 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 379 | 		$page .= '<h2>RESULTATS PROGRAMME DE VERIFICATION</h2>'."\n";
 | 
        
           |  |  | 380 | 		$page .= 	'<p>'.
 | 
        
           |  |  | 381 | 						'Nom du programme générant ce fichier : '.__FILE__.'<br />'."\n".
 | 
        
           |  |  | 382 | 						'Nombre de lignes analysées : '.$this->nbre_ligne.'<br />'."\n".
 | 
        
           |  |  | 383 | 						'Nbre de départements analysés : '.$this->nbre_dep_analyse.'<br />'."\n".
 | 
        
           | 242 | jpm | 384 | 						'Date d\'exécution du programme : '.date('d.m.Y').'<br />'."\n".
 | 
        
           | 11 | jpm | 385 | 						'</p>'."\n";
 | 
        
           |  |  | 386 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 387 | 		$page .= '<h2>RESULTATS ANALYSE CHOROLOGIE</h2>'."\n";
 | 
        
           |  |  | 388 | 		$page .= 	'<p>'.
 | 
        
           |  |  | 389 | 						'Nombre de nom "nc" : '.$this->nc_nbre_nom.'<br />'."\n".
 | 
        
           |  |  | 390 | 						'Nombre de nom : '.$this->nbre_nom.'<br />'."\n".
 | 
        
           | 242 | jpm | 391 | 						'Valeurs autres que 1, 1?, ?, #, #? et -|- : '.$this->autres_valeur_champ.'<br />'."\n".
 | 
        
           |  |  | 392 | 						'Valeurs autres que 1, 1?, ?, #, #? et -|- pour les plantes nc : <br />'."\n".$this->nc_autres_valeur_champ.'</br>'."\n".
 | 
        
           | 11 | jpm | 393 | 						'</p>'."\n";
 | 
        
           |  |  | 394 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 395 | 		$page .= '<h2>RESULTATS ANALYSE des CHAMPS</h2>'."\n";
 | 
        
           |  |  | 396 | 		$page .= 	'<p>'.
 | 
        
           |  |  | 397 | 						'Nombre de guillemets antislashés: '.$this->nbre_ligne_avec_guillemet.'<br />'."\n".
 | 
        
           |  |  | 398 | 						'</p>'."\n";
 | 
        
           |  |  | 399 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 400 | 		$page .= '<h2>TABLEAUX</h2>'."\n";
 | 
        
           |  |  | 401 |   | 
        
           |  |  | 402 | 		// Tableau des numéros nomenclaturaux dupliqués
 | 
        
           |  |  | 403 | 		$table = '<table><thead><tr><th colspan="3">Tableau des numéros nomenclaturaux dupliqués </th></tr>';
 | 
        
           |  |  | 404 | 		$table .= '<tr><th>Numéro nomenclatural</th><th>Nbre d\'itération</th><th>Lignes</th></tr></thead>';
 | 
        
           |  |  | 405 | 		$afficher_tab_num_duplique = 0;
 | 
        
           |  |  | 406 | 		ksort($this->aso_num_nomenc);
 | 
        
           |  |  | 407 | 		$table .= '<tbody style="text-align: center;">';
 | 
        
           |  |  | 408 | 		foreach ($this->aso_num_nomenc as $cle_nomenc => $val ) {
 | 
        
           |  |  | 409 | 			$ligne = '<tr><td>'.$cle_nomenc.'</td><td>'.$val['compteur'].'</td><td>'.$val['ligne'].'</td></tr>';
 | 
        
           |  |  | 410 | 			if ($val['compteur'] > 1) {
 | 
        
           |  |  | 411 | 				$table .= $ligne;
 | 
        
           |  |  | 412 | 				$afficher_tab_num_duplique = 1;
 | 
        
           |  |  | 413 | 			}
 | 
        
           |  |  | 414 | 		}
 | 
        
           |  |  | 415 | 		if ( $afficher_tab_num_duplique == 1 ) {
 | 
        
           |  |  | 416 | 			$page .= $table.'</tbody></table>';
 | 
        
           |  |  | 417 | 		}
 | 
        
           |  |  | 418 |   | 
        
           |  |  | 419 | 		// Tableau des résultats par départements
 | 
        
           | 242 | jpm | 420 | 		$table = '<table><thead><tr><th colspan="14">Tableau des résulats par départements</th></tr>';
 | 
        
           | 11 | jpm | 421 | 		$table .= '<tr><th>Département</th><th>Nbre pltes présentes</th><th>Nbre pltes à confirmer</th>'.
 | 
        
           | 242 | jpm | 422 | 			'<th>Nbre pltes douteuses</th><th>Nbre pltes disparues</th><th>Nbre pltes erreur</th><th>Nbre pltes erreur à confirmer</th>'.
 | 
        
           | 11 | jpm | 423 | 			'<th>Total</th><th>Nbre pltes nc présentes</th><th>Nbre pltes nc à confirmer</th>'.
 | 
        
           | 242 | jpm | 424 | 			'<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>';
 | 
        
           | 11 | jpm | 425 | 		$table .= '<tbody style="text-align: center;">';
 | 
        
           |  |  | 426 | 		ksort($this->aso_totaux_dep);
 | 
        
           |  |  | 427 | 		foreach ($this->aso_totaux_dep as $cle_dep => $val ) {
 | 
        
           | 242 | jpm | 428 | 			$plt_total = $val{'plte_presente'} + $val{'plte_a_confirmer'} + $val{'plte_douteux'} + $val{'plte_disparue'} + $val{'plte_erreur'} + $val{'plte_erreur_a_confirmer'};
 | 
        
           | 11 | jpm | 429 | 			$table .= '<tr><td>'.ZgFrDepartements::getNom($cle_dep).' ('.ZgFrDepartements::getIdChaine($cle_dep).') </td>'.
 | 
        
           |  |  | 430 | 				'<td>'.$val{'plte_presente'}.'</td><td>'.$val{'plte_a_confirmer'}.'</td><td>'.$val{'plte_douteux'}.'</td>'.
 | 
        
           | 242 | jpm | 431 | 				'<td>'.$val{'plte_disparue'}.'</td><td>'.$val{'plte_erreur'}.'</td><td>'.$val{'plte_erreur_a_confirmer'}.'</td><td>'.$plt_total.'</td>'.
 | 
        
           | 11 | jpm | 432 | 				'<td>'.$val{'nc_plte_presente'}.'</td><td>'.$val{'nc_plte_a_confirmer'}.'</td><td>'.$val{'nc_plte_douteux'}.'</td>'.
 | 
        
           | 242 | jpm | 433 | 				'<td>'.$val{'nc_plte_disparue'}.'</td><td>'.$val{'nc_plte_erreur'}.'</td><td>'.$val{'nc_plte_erreur_a_confirmer'}.'</td></tr>';
 | 
        
           | 11 | jpm | 434 | 		}
 | 
        
           |  |  | 435 |   | 
        
           | 242 | jpm | 436 | 		$table .= '<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>'.
 | 
        
           |  |  | 437 | 				'<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>';
 | 
        
           |  |  | 438 | 		$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;
 | 
        
           | 11 | jpm | 439 | 		$table .= '<tr><td>Totaux : '.$this->nbre_dep_analyse.' départements</td><td>'.$this->nbre_plte_presente.'</td>'.
 | 
        
           |  |  | 440 | 			'<td>'.$this->nbre_plte_a_confirmer.'</td><td>'.$this->nbre_plte_douteux.'</td><td>'.$this->nbre_plte_disparue.'</td>'.
 | 
        
           | 242 | jpm | 441 | 			'<td>'.$this->nbre_plte_erreur.'</td><td>'.$this->nbre_plte_erreur_a_confirmer.'</td><td>'.$plt_total.'</td>'.
 | 
        
           | 11 | jpm | 442 | 			'<td>'.$this->nc_nbre_plte_presente.'</td>'.'<td>'.$this->nc_nbre_plte_a_confirmer.'</td>'.
 | 
        
           | 242 | jpm | 443 | 			'<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>';
 | 
        
           | 11 | jpm | 444 |   | 
        
           |  |  | 445 | 		$table .= '<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>'.
 | 
        
           |  |  | 446 | 				'<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>';
 | 
        
           | 242 | jpm | 447 | 		$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);
 | 
        
           |  |  | 448 | 		$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);
 | 
        
           |  |  | 449 | 		$table .= '<tr><td>Totaux plante / plante nc</td><td colspan="7">'.$total_nbre_plte.'</td>'.
 | 
        
           |  |  | 450 | 			'<td colspan="6">'.$total_nbre_plte_nc.'</td></tr>';
 | 
        
           | 11 | jpm | 451 |   | 
        
           | 242 | jpm | 452 | 		$table .= '<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>'.
 | 
        
           |  |  | 453 | 				'<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>';
 | 
        
           | 11 | jpm | 454 | 		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente + $this->nc_nbre_plte_a_confirmer + $this->nbre_plte_a_confirmer;
 | 
        
           | 242 | jpm | 455 | 		$table .= '<tr><td>Total plantes présentes et à confirmer</td><td colspan="13">'.$plt_total.'</td></tr>';
 | 
        
           | 11 | jpm | 456 |   | 
        
           | 242 | jpm | 457 | 		$table .= '<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>'.
 | 
        
           |  |  | 458 | 				'<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>';
 | 
        
           | 11 | jpm | 459 | 		$plt_total = $this->nbre_plte_presente + $this->nc_nbre_plte_presente;
 | 
        
           | 242 | jpm | 460 | 		$table .= '<tr><td>Total plantes présentes</td><td colspan="13">'.$plt_total.'</td></tr>';
 | 
        
           | 11 | jpm | 461 |   | 
        
           | 242 | jpm | 462 | 		$table .= '<tr><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>'.
 | 
        
           |  |  | 463 | 				'<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>';
 | 
        
           | 11 | jpm | 464 | 		$plt_total = $total_nbre_plte + $total_nbre_plte_nc;
 | 
        
           | 242 | jpm | 465 | 		$table .= '<tr><td>Total données chorologiques</td><td colspan="13">'.$plt_total.'</td></tr>';
 | 
        
           | 11 | jpm | 466 |   | 
        
           |  |  | 467 | 		$table .= '</tbody></table>';
 | 
        
           |  |  | 468 | 		$page .= $table;
 | 
        
           |  |  | 469 |   | 
        
           |  |  | 470 | 		$page .= '<hr/>'."\n";
 | 
        
           |  |  | 471 | 		$page .= '<h2>NOTES</h2>'."\n";
 | 
        
           |  |  | 472 | 		$page .= 	'<p>'.
 | 
        
           |  |  | 473 | 						'1.- Chaque champ précédé par "ATTENTION" doit être vide.'."\n".
 | 
        
           |  |  | 474 | 						'S\'il ne l\'est pas, il y a une erreur'."\n".
 | 
        
           |  |  | 475 | 						'</p>'."\n";
 | 
        
           |  |  | 476 | 		$page .= '</body>'."\n";
 | 
        
           |  |  | 477 | 		$page .= '</html>'."\n";
 | 
        
           |  |  | 478 | 		// Fermeture de la poignée sur le fichier de sortie
 | 
        
           |  |  | 479 | 		if (fwrite($handle, $page) === FALSE) {
 | 
        
           |  |  | 480 | 			echo "Impossible d'écrire dans le fichier ($this->fichier_verif)";
 | 
        
           |  |  | 481 | 			exit;
 | 
        
           |  |  | 482 | 		}
 | 
        
           |  |  | 483 | 		echo 'Ecriture du fichier de vérification de la chorologie réalisée!'."\n";
 | 
        
           |  |  | 484 | 		fclose($handle);
 | 
        
           |  |  | 485 | 	}
 | 
        
           |  |  | 486 |   | 
        
           | 242 | jpm | 487 | 	private function supprimerTous() {
 | 
        
           |  |  | 488 | 		$tablesChorodep = implode(',', $this->getNomsTablesChorodep());
 | 
        
           |  |  | 489 | 		$tableContributeurs = Config::get('tables.chorodepContributeurs');
 | 
        
           |  |  | 490 | 		$tableSources = Config::get('tables.chorodepSources');
 | 
        
           |  |  | 491 | 		$tableOntologies = Config::get('tables.chorodepOntologies');
 | 
        
           | 349 | jpm | 492 | 		$requete = "DROP TABLE IF EXISTS chorodep_meta, $tablesChorodep, $tableContributeurs, $tableSources, $tableOntologies ";
 | 
        
           | 242 | jpm | 493 | 		$this->getBdd()->requeter($requete);
 | 
        
           |  |  | 494 | 	}
 | 
        
           |  |  | 495 |   | 
        
           |  |  | 496 | 	private function getNomsTablesChorodep() {
 | 
        
           |  |  | 497 | 		$versions = explode(',', Config::get('versions'));
 | 
        
           |  |  | 498 | 		$tableTpl = Config::get('tables.chorodepTpl');
 | 
        
           |  |  | 499 | 		$tablesChorodep = array();
 | 
        
           |  |  | 500 | 		foreach ($versions as $version) {
 | 
        
           |  |  | 501 | 			$tablesChorodep[] = sprintf($tableTpl, $version);
 | 
        
           |  |  | 502 | 		}
 | 
        
           |  |  | 503 | 		return $tablesChorodep;
 | 
        
           |  |  | 504 | 	}
 | 
        
           |  |  | 505 |   | 
        
           | 1124 | mathias | 506 | 	private function getNomTableDerniereVersion() {
 | 
        
           | 242 | jpm | 507 | 		$version = $this->getDerniereVersion();
 | 
        
           |  |  | 508 | 		$table = sprintf(Config::get('tables.chorodepTpl'), $version);
 | 
        
           |  |  | 509 | 		return $table;
 | 
        
           |  |  | 510 | 	}
 | 
        
           |  |  | 511 |   | 
        
           |  |  | 512 | 	private function getDerniereVersion() {
 | 
        
           |  |  | 513 | 		$version = array_pop(explode(',', Config::get('versions')));
 | 
        
           |  |  | 514 | 		return $version;
 | 
        
           |  |  | 515 | 	}
 | 
        
           | 1124 | mathias | 516 |   | 
        
           |  |  | 517 | 	// ----------
 | 
        
           |  |  | 518 | 	// intégration des noms vernaculaires et statuts de protection (NVSP) dans
 | 
        
           |  |  | 519 | 	// une table dédiée, pour permettre le service intégratif de l'applciation "chorologie"
 | 
        
           |  |  | 520 | 	// (basé sur les scripts de "gentiana-services")
 | 
        
           | 1179 | mathias | 521 | 	// @NOTE pas très content d'avoir mis ça là - c'est pratique mais pas très logique
 | 
        
           | 1124 | mathias | 522 | 	// ----------
 | 
        
           |  |  | 523 |   | 
        
           |  |  | 524 | 	/**
 | 
        
           | 1179 | mathias | 525 | 	 * Effectue toutes les étapes du chargement des noms vernaculaires et statuts
 | 
        
           |  |  | 526 | 	 * de protection
 | 
        
           |  |  | 527 | 	 */
 | 
        
           |  |  | 528 | 	protected function chargerNVSP() {
 | 
        
           |  |  | 529 | 		$this->nettoyageNVSP();
 | 
        
           |  |  | 530 | 		$this->chargerStructureNVSP();
 | 
        
           |  |  | 531 | 		$this->genererNomsVernaculaires();
 | 
        
           |  |  | 532 | 		$this->genererStatutsProtection();
 | 
        
           |  |  | 533 | 	}
 | 
        
           |  |  | 534 |   | 
        
           |  |  | 535 | 	/**
 | 
        
           | 1124 | mathias | 536 | 	 * Dézingue tout le bousin
 | 
        
           |  |  | 537 | 	 * @TODO chaque méthode devrait s'autonettoyer au début afin d'être répétable
 | 
        
           |  |  | 538 | 	 * sans avoir à tout reprendre depuis le début (principe du dump)
 | 
        
           |  |  | 539 | 	 */
 | 
        
           |  |  | 540 | 	protected function nettoyageNVSP() {
 | 
        
           |  |  | 541 | 		echo "---- suppression des tables\n";
 | 
        
           |  |  | 542 | 		$tableStatutsProtection = Config::get('tables.statuts_protection');
 | 
        
           |  |  | 543 | 		$tableNomsVernaculaires = Config::get('tables.noms_vernaculaires');
 | 
        
           |  |  | 544 | 		$req = "DROP TABLE IF EXISTS `" . $tableStatutsProtection . "`";
 | 
        
           |  |  | 545 | 		$this->getBdd()->requeter($req);
 | 
        
           |  |  | 546 | 		$req = "DROP TABLE IF EXISTS `" . $tableNomsVernaculaires . "`;";
 | 
        
           |  |  | 547 | 		$this->getBdd()->requeter($req);
 | 
        
           |  |  | 548 | 	}
 | 
        
           |  |  | 549 |   | 
        
           |  |  | 550 | 	/**
 | 
        
           |  |  | 551 | 	 * Crée les tables vides
 | 
        
           |  |  | 552 | 	 */
 | 
        
           |  |  | 553 | 	protected function chargerStructureNVSP() {
 | 
        
           |  |  | 554 | 		echo "---- création des tables\n";
 | 
        
           |  |  | 555 | 		$contenuSql = $this->recupererContenu(Config::get('chemins.structureNVSP'));
 | 
        
           |  |  | 556 | 		$this->executerScripSql($contenuSql);
 | 
        
           |  |  | 557 | 	}
 | 
        
           |  |  | 558 |   | 
        
           |  |  | 559 | 	/**
 | 
        
           |  |  | 560 | 	 * Va chercher les noms vernaculaires pour chaque espèce, et les rajoute
 | 
        
           |  |  | 561 | 	 * dans la table dédiée
 | 
        
           |  |  | 562 | 	 */
 | 
        
           | 1179 | mathias | 563 | 	protected function genererNomsVernaculaires() {
 | 
        
           | 1124 | mathias | 564 | 		$tableNomsVernaculaires = Config::get('tables.noms_vernaculaires');
 | 
        
           |  |  | 565 | 		restore_error_handler();
 | 
        
           |  |  | 566 | 		restore_exception_handler();
 | 
        
           |  |  | 567 | 		ini_set("display_errors", true);
 | 
        
           |  |  | 568 | 		error_reporting(E_ALL);
 | 
        
           |  |  | 569 | 		$squeletteUrlNvjfl = Config::get("url_nvjfl");
 | 
        
           |  |  | 570 | 		echo "---- récupération des noms vernaculaires depuis eFlore\n";
 | 
        
           |  |  | 571 | 		$depart = 0;
 | 
        
           |  |  | 572 | 		$nbInsertions = 0;
 | 
        
           |  |  | 573 | 		$yenaencore = true;
 | 
        
           |  |  | 574 | 		$tailleTranche = 1000;
 | 
        
           |  |  | 575 | 		while ($yenaencore) {
 | 
        
           |  |  | 576 | 			$url = sprintf($squeletteUrlNvjfl, $depart, $tailleTranche);
 | 
        
           |  |  | 577 | 			$noms = $this->chargerDonnees($url);
 | 
        
           |  |  | 578 | 			// Si quelqu'un parvient à dédoublonner les $valeurs, on enlève le IGNORE
 | 
        
           |  |  | 579 | 			$req = "INSERT IGNORE INTO " . $tableNomsVernaculaires . " VALUES ";
 | 
        
           |  |  | 580 | 			$valeurs = array();
 | 
        
           |  |  | 581 | 			// insertion des données
 | 
        
           |  |  | 582 | 			foreach ($noms['resultat'] as $res) {
 | 
        
           |  |  | 583 | 				$numTaxons = explode(',', $res['num_taxon']);
 | 
        
           |  |  | 584 | 				$nvP = $this->getBdd()->proteger($res['nom']);
 | 
        
           |  |  | 585 | 				foreach ($numTaxons as $numTaxon) {
 | 
        
           |  |  | 586 | 					$valeurs[] = "(" . $numTaxon . ", " . $nvP  . ")";
 | 
        
           |  |  | 587 | 				}
 | 
        
           |  |  | 588 | 			}
 | 
        
           |  |  | 589 | 			$req .= implode(",", $valeurs);
 | 
        
           |  |  | 590 | 			$this->getBdd()->executer($req);
 | 
        
           |  |  | 591 | 			// prochain tour
 | 
        
           |  |  | 592 | 			$nbInsertions += count($valeurs); // Faux car INSERT IGNORE - dédoublonner ou compter les insertions réelles
 | 
        
           |  |  | 593 | 			$depart += $tailleTranche;
 | 
        
           |  |  | 594 | 			$total = $noms['entete']['total'];
 | 
        
           |  |  | 595 | 			$yenaencore = $depart <= $total;
 | 
        
           |  |  | 596 | 			echo "insérés: " . min($depart, $total) . " noms, " . $nbInsertions . " attributions\n";
 | 
        
           |  |  | 597 | 		}
 | 
        
           |  |  | 598 | 	}
 | 
        
           |  |  | 599 |   | 
        
           |  |  | 600 | 	 /**
 | 
        
           |  |  | 601 | 	  * Va chercher les statuts de protection pour chaque espèce et les rajoute
 | 
        
           |  |  | 602 | 	  * à la table; importe un fichier dump SQL des lois
 | 
        
           |  |  | 603 | 	  */
 | 
        
           | 1179 | mathias | 604 | 	 protected function genererStatutsProtection() {
 | 
        
           | 1124 | mathias | 605 | 	 	$tableChorologie = $this->getNomTableDerniereVersion();
 | 
        
           |  |  | 606 | 	 	$tableStatutsProtection = Config::get('tables.statuts_protection');
 | 
        
           |  |  | 607 | 	 	echo "---- récupération des statuts de protection depuis eFlore\n";
 | 
        
           |  |  | 608 | 	 	$req = "SELECT distinct num_nom FROM " . $tableChorologie;
 | 
        
           |  |  | 609 | 	 	$resultat = $this->getBdd()->recupererTous($req);
 | 
        
           |  |  | 610 | 	 	// pour chaque taxon mentionné (inefficace mais évite d'implémenter un
 | 
        
           |  |  | 611 | 	 	// mode liste sur le service eflore/sptb
 | 
        
           |  |  | 612 | 	 	$squeletteUrlSptb = Config::get("url_sptb");
 | 
        
           | 1199 | delphine | 613 | 	 	$statuts != array();
 | 
        
           |  |  | 614 |   | 
        
           | 1124 | mathias | 615 | 	 	foreach ($resultat as $res) {
 | 
        
           |  |  | 616 | 	 		$nn = $res['num_nom'];
 | 
        
           |  |  | 617 | 	 		//echo "NN: $nn\n";
 | 
        
           |  |  | 618 | 	 		if ($nn != 0) {
 | 
        
           |  |  | 619 | 	 			$url = sprintf($squeletteUrlSptb, $nn);
 | 
        
           |  |  | 620 | 	 			//echo "URL: $url\n";
 | 
        
           |  |  | 621 | 	 			$statuts = $this->chargerDonnees($url);
 | 
        
           |  |  | 622 | 	 			//echo "STATUTS: " . print_r($statuts, true) . "\n";
 | 
        
           | 1199 | delphine | 623 | 	 			if ($statuts != array() && array_count_values($statuts) > 0) {
 | 
        
           | 1124 | mathias | 624 | 	 				$json = array();
 | 
        
           |  |  | 625 | 	 				foreach ($statuts as $statut) {
 | 
        
           |  |  | 626 |  						$nouveauStatut = array();
 | 
        
           |  |  | 627 |  						$nouveauStatut['zone'] = $statut['code_zone_application'];
 | 
        
           |  |  | 628 |  						$json[] =  $nouveauStatut;
 | 
        
           |  |  | 629 | 	 				}
 | 
        
           |  |  | 630 | 	 				// Si au moins un statut
 | 
        
           |  |  | 631 | 	 				if (count($json) > 0) {
 | 
        
           |  |  | 632 | 	 					$json = json_encode($json);
 | 
        
           |  |  | 633 | 	 					//echo "JSON: " . print_r($json, true) . "\n";
 | 
        
           |  |  | 634 | 	 					// Insertion d'un bout de JSON
 | 
        
           |  |  | 635 | 	 					$jsonP = $this->getBdd()->proteger($json);
 | 
        
           |  |  | 636 | 	 					$nnP = $this->getBdd()->proteger($nn);
 | 
        
           |  |  | 637 | 	 					$reqIns = "INSERT INTO " . $tableStatutsProtection
 | 
        
           |  |  | 638 | 	 					. " values($nnP, $jsonP)";
 | 
        
           |  |  | 639 | 	 					//echo "ReqIns: $reqIns\n";
 | 
        
           |  |  | 640 | 	 					$this->getBdd()->executer($reqIns);
 | 
        
           |  |  | 641 | 	 				}
 | 
        
           |  |  | 642 | 	 			}
 | 
        
           |  |  | 643 | 	 		}
 | 
        
           |  |  | 644 | 	 	}
 | 
        
           |  |  | 645 | 	 }
 | 
        
           | 11 | jpm | 646 | }
 | 
        
           |  |  | 647 |   | 
        
           |  |  | 648 | class ZgFrDepartements {
 | 
        
           |  |  | 649 | 	static private $departements =
 | 
        
           |  |  | 650 |         array(
 | 
        
           |  |  | 651 |         "01" => array("Ain", "01", 1),
 | 
        
           |  |  | 652 |         "02" => array("Aisne", "02", 2),
 | 
        
           |  |  | 653 |         "03" => array("Allier", "03", 3),
 | 
        
           |  |  | 654 |         "04" => array("Alpes-de-Haute-Provence", "04", 4),
 | 
        
           |  |  | 655 |         "05" => array("Hautes-Alpes", "05", 5),
 | 
        
           |  |  | 656 |         "06" => array("Alpes-Maritimes", "06", 6),
 | 
        
           |  |  | 657 |         "07" => array("Ardèche", "07", 7),
 | 
        
           |  |  | 658 |         "08" => array("Ardennes", "08", 8),
 | 
        
           |  |  | 659 |         "09" => array("Ariège", "09", 9),
 | 
        
           |  |  | 660 |         "10" => array("Aube", "10", 10),
 | 
        
           |  |  | 661 |         "11" => array("Aude", "11", 11),
 | 
        
           |  |  | 662 |         "12" => array("Aveyron", "12", 12),
 | 
        
           |  |  | 663 |         "13" => array("Bouches-du-Rhône", "13", 13),
 | 
        
           |  |  | 664 |         "14" => array("Calvados", "14", 14),
 | 
        
           |  |  | 665 |         "15" => array("Cantal", "15", 15),
 | 
        
           |  |  | 666 |         "16" => array("Charente", "16", 16),
 | 
        
           |  |  | 667 |         "17" => array("Charente-Maritime", "17", 17),
 | 
        
           |  |  | 668 |         "18" => array("Cher", "18", 18),
 | 
        
           |  |  | 669 |         "19" => array("Corrèze", "19", 19),
 | 
        
           |  |  | 670 |         "20" => array("Corse", "20", 20),
 | 
        
           |  |  | 671 |         "2A" => array("Haute-Corse", "2A", 20),
 | 
        
           |  |  | 672 |         "2B" => array("Corse-du-Sud", "2B", 20),
 | 
        
           |  |  | 673 |         "21" => array("Côte-d'Or", "21", 21),
 | 
        
           |  |  | 674 |         "22" => array("Côtes-d'Armor", "22", 22),
 | 
        
           |  |  | 675 |         "23" => array("Creuse", "23", 23),
 | 
        
           |  |  | 676 |         "24" => array("Dordogne", "24", 24),
 | 
        
           |  |  | 677 |         "25" => array("Doubs","25", 25),
 | 
        
           |  |  | 678 |         "26" => array("Drôme", "26", 26),
 | 
        
           |  |  | 679 |         "27" => array("Eure", "27", 27),
 | 
        
           |  |  | 680 |         "28" => array("Eure-et-Loir", "28", 28),
 | 
        
           |  |  | 681 |         "29" => array("Finistère", "29", 29),
 | 
        
           |  |  | 682 |         "30" => array("Gard", "30", 30),
 | 
        
           |  |  | 683 |         "31" => array("Haute-Garonne", "31", 31),
 | 
        
           |  |  | 684 |         "32" => array("Gers", "32", 32),
 | 
        
           |  |  | 685 |         "33" => array("Gironde", "33", 33),
 | 
        
           |  |  | 686 |         "34" => array("Hérault", "34", 34),
 | 
        
           |  |  | 687 |         "35" => array("Ille-et-Vilaine", "35", 35),
 | 
        
           |  |  | 688 |         "36" => array("Indre", "36", 36),
 | 
        
           |  |  | 689 |         "37" => array("Indre-et-Loire", "37", 37),
 | 
        
           |  |  | 690 |         "38" => array("Isère", "38", 38),
 | 
        
           |  |  | 691 |         "39" => array("Jura", "39", 39),
 | 
        
           |  |  | 692 |         "40" => array("Landes", "40", 40),
 | 
        
           |  |  | 693 |         "41" => array("Loir-et-Cher", "41", 41),
 | 
        
           |  |  | 694 |         "42" => array("Loire", "42", 42),
 | 
        
           |  |  | 695 |         "43" => array("Haute-Loire", "43", 43),
 | 
        
           |  |  | 696 |         "44" => array("Loire-Atlantique", "44", 44),
 | 
        
           |  |  | 697 |         "45" => array("Loiret", "45", 45),
 | 
        
           |  |  | 698 |         "46" => array("Lot", "46", 46),
 | 
        
           |  |  | 699 |         "47" => array("Lot-et-Garonne", "47", 47),
 | 
        
           |  |  | 700 |         "48" => array("Lozére ", "48", 48),
 | 
        
           |  |  | 701 |         "49" => array("Maine-et-Loire", "49", 49),
 | 
        
           |  |  | 702 |         "50" => array("Manche", "50", 50),
 | 
        
           |  |  | 703 |         "51" => array("Marne", "51", 51),
 | 
        
           |  |  | 704 |         "52" => array("Haute-Marne", "52", 52),
 | 
        
           |  |  | 705 |         "53" => array("Mayenne", "53", 53),
 | 
        
           |  |  | 706 |         "54" => array("Meurthe-et-Moselle", "54", 54),
 | 
        
           |  |  | 707 |         "55" => array("Meuse", "55", 55),
 | 
        
           |  |  | 708 |         "56" => array("Morbihan", "56", 56),
 | 
        
           |  |  | 709 |         "57" => array("Moselle", "57", 57),
 | 
        
           |  |  | 710 |         "58" => array("Nièvre", "58", 58),
 | 
        
           |  |  | 711 |         "59" => array("Nord", "59", 59),
 | 
        
           |  |  | 712 |         "60" => array("Oise", "60", 60),
 | 
        
           |  |  | 713 |         "61" => array("Orne", "61", 61),
 | 
        
           |  |  | 714 |         "62" => array("Pas-de-Calais", "62", 62),
 | 
        
           |  |  | 715 |         "63" => array("Puy-de-Dôme", "63", 63),
 | 
        
           |  |  | 716 |         "64" => array("Pyrénées-Atlantiques", "64", 64),
 | 
        
           |  |  | 717 |         "65" => array("Hautes-Pyrénées", "65", 65),
 | 
        
           |  |  | 718 |         "66" => array("Pyrénées-Orientales", "66", 66),
 | 
        
           |  |  | 719 |         "67" => array("Bas-Rhin", "67", 67),
 | 
        
           |  |  | 720 |         "68" => array("Haut-Rhin", "68", 68),
 | 
        
           |  |  | 721 |         "69" => array("Rhône", "69", 69),
 | 
        
           |  |  | 722 |         "70" => array("Haute-Saône", "70", 70),
 | 
        
           |  |  | 723 |         "71" => array("Saône-et-Loire", "71", 71),
 | 
        
           |  |  | 724 |         "72" => array("Sarthe", "72", 72),
 | 
        
           |  |  | 725 |         "73" => array("Savoie", "73", 73),
 | 
        
           |  |  | 726 |         "74" => array("Haute-Savoie", "74", 74),
 | 
        
           |  |  | 727 |         "75" => array("Paris", "75", 75),
 | 
        
           |  |  | 728 |         "76" => array("Seine-Maritime", "76", 76),
 | 
        
           |  |  | 729 |         "77" => array("Seine-et-Marne", "77", 77),
 | 
        
           |  |  | 730 |         "78" => array("Yvelines", "78", 78),
 | 
        
           |  |  | 731 |         "79" => array("Deux-Sèvres", "79", 79),
 | 
        
           |  |  | 732 |         "80" => array("Somme", "80", 80),
 | 
        
           |  |  | 733 |         "81" => array("Tarn", "81", 81),
 | 
        
           |  |  | 734 |         "82" => array("Tarn-et-Garonne", "82", 82),
 | 
        
           |  |  | 735 |         "83" => array("Var", "83", 83),
 | 
        
           |  |  | 736 |         "84" => array("Vaucluse", "84", 84),
 | 
        
           |  |  | 737 |         "85" => array("Vendée", "85", 85),
 | 
        
           |  |  | 738 |         "86" => array("Vienne", "86", 86),
 | 
        
           |  |  | 739 |         "87" => array("Haute-Vienne", "87", 87),
 | 
        
           |  |  | 740 |         "88" => array("Vosges", "88", 88),
 | 
        
           |  |  | 741 |         "89" => array("Yonne", "89", 89),
 | 
        
           |  |  | 742 |         "90" => array("Territoire-de-Belfort", "90", 90),
 | 
        
           |  |  | 743 |         "91" => array("Essonne", "91", 91),
 | 
        
           |  |  | 744 |         "92" => array("Hauts-de-Seine", "92", 92),
 | 
        
           |  |  | 745 |         "93" => array("Seine-Saint-Denis", "93", 93),
 | 
        
           |  |  | 746 |         "94" => array("Val-de-Marne", "94", 94),
 | 
        
           |  |  | 747 |         "95" => array("Val-d'Oise", "95", 95),
 | 
        
           |  |  | 748 |         "96" => array("aaa", "96", 96),
 | 
        
           |  |  | 749 |         "971" => array("Guadeloupe", "971", 971),
 | 
        
           |  |  | 750 |         "972" => array("Martinique", "972", 972),
 | 
        
           |  |  | 751 |         "973" => array("Guyane", "973", 973),
 | 
        
           |  |  | 752 |         "974" => array("Réunion", "974", 974),
 | 
        
           |  |  | 753 |         "99" => array("Etranger", "99", 99),
 | 
        
           |  |  | 754 |         );
 | 
        
           |  |  | 755 |   | 
        
           |  |  | 756 | 	static public function get() {
 | 
        
           |  |  | 757 | 		return self::$departements;
 | 
        
           |  |  | 758 | 	}
 | 
        
           |  |  | 759 |   | 
        
           |  |  | 760 |     static public function getNom($n) {
 | 
        
           |  |  | 761 | 		return self::$departements[$n][0];
 | 
        
           |  |  | 762 | 	}
 | 
        
           |  |  | 763 |   | 
        
           |  |  | 764 | 	static public function getIdChaine($n) {
 | 
        
           |  |  | 765 | 		return self::$departements[$n][1];
 | 
        
           |  |  | 766 | 	}
 | 
        
           |  |  | 767 |   | 
        
           |  |  | 768 | 	static public function getIdNumerique($n) {
 | 
        
           |  |  | 769 | 		return (int)self::$departements[$n][2];
 | 
        
           |  |  | 770 | 	}
 | 
        
           |  |  | 771 |   | 
        
           |  |  | 772 | 	static public function getIdEflore($n) {
 | 
        
           |  |  | 773 | 		return (int)self::$departements[$n][3];
 | 
        
           |  |  | 774 | 	}
 | 
        
           |  |  | 775 | }
 | 
        
           | 1124 | mathias | 776 | ?>
 |