Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 639 | Rev 1187 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 639 Rev 1186
Line 37... Line 37...
37
		} catch (Exception $e) {
37
		} catch (Exception $e) {
38
			$this->traiterErreur($e->getMessage());
38
			$this->traiterErreur($e->getMessage());
39
		}
39
		}
40
    }
40
    }
Line 41... Line 41...
41
 
41
 
42
	private function chargerDonnees($type) {
42
	protected function chargerDonnees($type) {
43
		$chemin = Config::get('chemins.'.$type);
43
		$chemin = Config::get('chemins.'.$type);
44
		$table = Config::get('tables.'.$type);
44
		$table = Config::get('tables.'.$type);
45
		$requete = "LOAD DATA INFILE '$chemin' ".
45
		$requete = "LOAD DATA INFILE '$chemin' ".
46
			"REPLACE INTO TABLE $table ".
46
			"REPLACE INTO TABLE $table ".
Line 67... Line 67...
67
					'ADD num_nom_retenu INT(10) '.
67
					'ADD num_nom_retenu INT(10) '.
68
					'NULL DEFAULT NULL AFTER num_nom';
68
					'NULL DEFAULT NULL AFTER num_nom';
69
			$this->getBdd()->requeter($requete);
69
			$this->getBdd()->requeter($requete);
70
		}
70
		}
71
	}
71
	}
-
 
72
	private function ajouterChamps() {
-
 
73
		$table = Config::get('tables.especes');
-
 
74
		
-
 
75
		$requete = 'ALTER TABLE '.$table.' ADD `num_nom` INT( 10 ) NOT NULL ,
-
 
76
					ADD `num_nom_retenu` INT( 10 ) NOT NULL ,
-
 
77
					ADD `nom_sci` VARCHAR( 70 ) NOT NULL ';
-
 
78
		$this->getBdd()->requeter($requete);
-
 
79
	}
Line 72... Line 80...
72
	
80
	
73
	private function genererNumNomRetenu() {
81
	private function genererNumNomRetenu() {
74
		$table = Config::get('tables.especes');
82
		$table = Config::get('tables.especes');
Line 75... Line 83...
75
		$table_referentiel = Config::get('tables.referentielTaxo');
83
		$table_referentiel = Config::get('tables.referentielTaxo');
76
		
84
		
77
		$requete = 'UPDATE '.$table.' s, '.$table_referentiel.' r '.
85
		$requete = 'UPDATE '.$table.' s, '.$table_referentiel.' r '.
Line 78... Line 86...
78
		           'SET s.num_nom_retenu = r.num_nom_retenu '.
86
		           'SET s.num_nom_retenu = r.num_nom_retenu, s.num_nom = r.num_nom, s.nom_sci = r.nom_sci '.
79
		           '	WHERE s.num_nom = r.num_nom ';
87
		           '	WHERE s.cd_nom = r.cd_nom ';
Line 80... Line 88...
80
		
88