Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 1187 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1187 Rev 1276
Line 12... Line 12...
12
			$cmd = $this->getParametre('a');
12
			$cmd = $this->getParametre('a');
13
		    switch ($cmd) {
13
		    switch ($cmd) {
14
		    	case 'chargerTous' :
14
		    	case 'chargerTous' :
15
		    		$this->chargerStructureSql();
15
		    		$this->chargerStructureSql();
16
		    		$this->chargerDonnees('especes');
16
		    		$this->chargerDonnees('especes');
17
		    		$this->chargerDonnees('lois');
-
 
18
		    		$this-> ajouterChamps();
-
 
19
		    		$this->genererChampNumNomRetenu();
17
		    		$this->genererChampNumNomRetenu();
20
		    		break;
18
		    		break;
21
	    		case 'chargerStructureSql' :
19
	    		case 'chargerStructureSql' :
22
	    			$this->chargerStructureSql();
20
	    			$this->chargerStructureSql();
23
	    			break;
21
	    			break;
24
				case 'chargerDonnees' :
22
				case 'chargerDonnees' :
25
		    		$this->chargerDonnees('especes');
23
		    		$this->chargerDonnees('especes');
26
		    		$this->chargerDonnees('lois');
-
 
27
		    		$this-> ajouterChamps();
-
 
28
		    		$this->genererChampNumNomRetenu();
24
		    		$this->genererChampNumNomRetenu();
29
					break;
25
					break;
30
				case 'genererChampNumNomRetenu' :
26
				case 'genererChampNumNomRetenu' :
31
		    		$this-> ajouterChamps();
-
 
32
					$this->genererChampNumNomRetenu();
27
					$this->genererChampNumNomRetenu();
33
					break;
28
					break;
34
				case 'supprimerTous' :
29
				case 'supprimerTous' :
35
					$this->supprimerTous();
30
					$this->supprimerTous();
36
					break;
31
					break;
Line 70... Line 65...
70
					'ADD num_nom_retenu INT(10) '.
65
					'ADD num_nom_retenu INT(10) '.
71
					'NULL DEFAULT NULL AFTER num_nom';
66
					'NULL DEFAULT NULL AFTER num_nom';
72
			$this->getBdd()->requeter($requete);
67
			$this->getBdd()->requeter($requete);
73
		}
68
		}
74
	}
69
	}
75
	private function ajouterChamps() {
-
 
76
		$table = Config::get('tables.especes');
-
 
77
		
-
 
78
		$requete = 'ALTER TABLE '.$table.' ADD `num_nom` INT( 10 ) NOT NULL ,
-
 
79
					ADD `num_nom_retenu` INT( 10 ) NOT NULL ,
-
 
80
					ADD `nom_sci` VARCHAR( 70 ) NOT NULL ';
-
 
81
		$this->getBdd()->requeter($requete);
-
 
82
	}
-
 
Line 83... Line 70...
83
	
70
	
84
	private function genererNumNomRetenu() {
71
	private function genererNumNomRetenu() {
85
		$table = Config::get('tables.especes');
72
		$table = Config::get('tables.especes');
Line 86... Line 73...
86
		$table_referentiel = Config::get('tables.referentielTaxo');
73
		$table_referentiel = Config::get('tables.referentielTaxo');
87
		
74
		
88
		$requete = 'UPDATE '.$table.' s, '.$table_referentiel.' r '.
75
		$requete = 'UPDATE '.$table.' s, '.$table_referentiel.' r '.
Line 89... Line 76...
89
		           'SET s.num_nom_retenu = r.num_nom_retenu, s.num_nom = r.num_nom, s.nom_sci = r.nom_sci '.
76
		  		'SET s.num_nom_retenu = r.num_nom '.
90
		           '	WHERE s.cd_nom = r.cd_nom ';
77
		  		'WHERE s.cd_nom = r.cd_nom ';
Line 91... Line 78...
91
		
78