Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 891 Rev 905
Line 30... Line 30...
30
		$this->insererDonneesIndex();
30
		$this->insererDonneesIndex();
31
	}
31
	}
Line 32... Line 32...
32
	
32
	
33
	private function recupererDonneesBaseflor() {
33
	private function recupererDonneesBaseflor() {
34
		$table = Config::get('tables.donnees');
34
		$table = Config::get('tables.donnees');
-
 
35
		$requete = "SELECT cle, num_nomen, BDNT FROM $table WHERE num_nomen != 0 ".
-
 
36
			"	AND num_nomen != 0 ".
-
 
37
			"	AND !(ve_lumiere = '' and ve_mat_org_sol = '' and ve_temperature = '' and ve_continentalite = '' ".
-
 
38
			"	and ve_humidite_atmos = ''  and ve_humidite_edaph = '' and ve_nutriments_sol = '' and ve_salinite = ''".
35
		$requete = "SELECT cle, num_nomen, BDNT FROM $table ;";
39
			"	and ve_texture_sol = '' and ve_reaction_sol = '')";
36
		$resultat = $this->Bdd->recupererTous($requete);
40
		$resultat = $this->Bdd->recupererTous($requete);
37
		$this->valeurs_insertion['baseflor'] = $resultat;
41
		$this->valeurs_insertion['baseflor'] = $resultat;
38
		$this->valeurs_insertion['rangSup'] = $resultat;
42
		$this->valeurs_insertion['rangSup'] = $resultat;
Line 43... Line 47...
43
		$requete = "SELECT cle, num_nomen, bdnt FROM $table ;";
47
		$requete = "SELECT cle, num_nomen, bdnt FROM $table ;";
44
		$resultat = $this->Bdd->recupererTous($requete);
48
		$resultat = $this->Bdd->recupererTous($requete);
45
		$this->valeurs_insertion['rangSup']= $resultat;
49
		$this->valeurs_insertion['rangSup']= $resultat;
Line 46... Line 50...
46
 
50
 
-
 
51
	}
Line 47... Line 52...
47
	}
52
 
48
	
53
	
49
	private function insererDonneesIndex() {
54
	private function insererDonneesIndex() {
50
		$table = Config::get('tables.index');
55
		$table = Config::get('tables.index');
51
		$requete_truncate = 'TRUNCATE TABLE '.$table;
56
		$requete_truncate = 'TRUNCATE TABLE '.$table;
52
		$this->Bdd->requeter($requete_truncate);
57
		$this->Bdd->requeter($requete_truncate);
53
		$i = 0;
58
		$i = 0;
54
		foreach ($this->valeurs_insertion as $tab => $res){
59
		foreach ($this->valeurs_insertion as $tab => $res){
-
 
60
			if ($tab == 'baseflor') {
55
			if ($tab == 'baseflor') {
61
				foreach ($res as  $valeurs ) {
56
				foreach ($res as  $valeurs ) {
62
					if ($valeurs['num_nomen'] != 0) {
57
					$requete = "INSERT INTO $table VALUES({$i},{$valeurs['cle']},null,'".strtolower($valeurs['BDNT']).".nn:{$valeurs['num_nomen']}')";
63
						$requete = "INSERT INTO $table VALUES({$i},{$valeurs['cle']},null,'".strtolower($valeurs['BDNT']).".nn:{$valeurs['num_nomen']}')";
58
					$this->Bdd->requeter($requete);
64
						$this->Bdd->requeter($requete);
-
 
65
						$i++;
59
					$i++;
66
						$this->message->afficherAvancement('Insertion des valeurs issues de baseflor en cours');
60
					$this->message->afficherAvancement('Insertion des valeurs issues de baseflor en cours');
67
					}
61
				}
68
				}
-
 
69
			} else {
62
			} else {
70
				foreach ($res as  $valeurs ) {
63
				foreach ($res as  $valeurs ) {
71
					if ($valeurs['num_nomen'] != 0) {
64
					$requete = "INSERT INTO $table VALUES({$i},null,{$valeurs['cle']},'{$valeurs['bdnt']}.nn{$valeurs['num_nomen']}')";
72
						$requete = "INSERT INTO $table VALUES({$i},null,{$valeurs['cle']},'{$valeurs['bdnt']}.nn:{$valeurs['num_nomen']}')";
65
					$this->Bdd->requeter($requete);
73
						$this->Bdd->requeter($requete);
-
 
74
						$i++;
66
					$i++;
75
						$this->message->afficherAvancement('Insertion des valeurs issues des rangs supérieurs en cours');
67
					$this->message->afficherAvancement('Insertion des valeurs issues des rangs supérieurs en cours');
76
					}
68
				}
77
				}
69
			}
78
			}