Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 707 Rev 1039
Line 220... Line 220...
220
	}
220
	}
Line 221... Line 221...
221
	
221
	
222
	public function recupererIdInf() {
222
	public function recupererIdInf() {
223
		//SELECT num_nom FROM bfdtx_v2_00 WHERE num_tax_sup = (SELECT num_nom FROM bdtfx_v2_00 WHERE num_nom = X);
223
		//SELECT num_nom FROM bfdtx_v2_00 WHERE num_tax_sup = (SELECT num_nom FROM bdtfx_v2_00 WHERE num_nom = X);
224
		$req_relation = 'SELECT num_nom FROM '.$this->table
224
		$req_relation = 'SELECT num_nom FROM '.$this->table
225
							.' WHERE num_tax_sup = (SELECT num_nom FROM '
225
							.' WHERE num_nom = num_nom_retenu AND num_tax_sup = (SELECT num_nom FROM '
226
							.$this->table
226
							.$this->table
227
							.' WHERE '.implode(' AND ', $this->requete_condition).')';
227
							.' WHERE '.implode(' AND ', $this->requete_condition).')';
228
		$res_relation = $this->getBdd()->recupererTous($req_relation);
228
		$res_relation = $this->getBdd()->recupererTous($req_relation);
229
		return $res_relation;
229
		return $res_relation;
Line 230... Line 230...
230
	}
230
	}
231
	
231
	
-
 
232
	
232
	
233
	public function recupererIdSup() {
233
	public function recupererIdSup() {
234
		//SELECT num_nom FROM bfdtx_v2_00 WHERE num_nom = (SELECT num_tax_sup FROM bdtfx_v2_00 WHERE num_nom = X);
234
		//SELECT num_nom FROM bfdtx_v2_00 WHERE num_nom = (SELECT num_tax_sup FROM bdtfx_v2_00 WHERE num_nom = X);
235
		$this->requete_condition[] = "num_nom = num_nom_retenu" ;
235
		$req_relation = 'SELECT num_tax_sup as num_nom FROM '.$this->table
236
		$req_relation = 'SELECT num_tax_sup as num_nom FROM '.$this->table
236
							.' WHERE '.implode(' AND ', $this->requete_condition);
237
							.' WHERE '.implode(' AND ', $this->requete_condition);
Line 505... Line 506...
505
			$tab_num[] = $tab['num_nom']; //on regroupe ici les id des taxons dont on cherche le nb de taxon inf
506
			$tab_num[] = $tab['num_nom']; //on regroupe ici les id des taxons dont on cherche le nb de taxon inf
506
		}
507
		}
507
		$req = 'SELECT num_tax_sup, count(*) as nb FROM '.$this->table
508
		$req = 'SELECT num_tax_sup, count(*) as nb FROM '.$this->table
508
				.' WHERE num_tax_sup IN ('.implode(',',$tab_num)
509
				.' WHERE num_tax_sup IN ('.implode(',',$tab_num)
509
				.') AND num_nom = num_nom_retenu GROUP BY num_tax_sup';
510
				.') AND num_nom = num_nom_retenu GROUP BY num_tax_sup';
-
 
511
 
510
		$res = $this->getBdd()->recupererTous($req);
512
		$res = $this->getBdd()->recupererTous($req);
511
		if ($res) {
513
		if ($res) {
512
			$resultat = $res;
514
			$resultat = $res;
513
		} else {
515
		} else {
514
			$resultat = array(); //on retourne un tableau vide s'il n'y a pas de taxon inférieurs
516
			$resultat = array(); //on retourne un tableau vide s'il n'y a pas de taxon inférieurs