Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 1103 Rev 1105
Line 1... Line 1...
1
<?php
1
<?php
2
/**
2
/**
3
* Description :
-
 
4
* Retourne la liste des taxons répertoriés par le projet chorodep
3
* Retourne la liste des noms répertoriés par le projet chorodep
5
* 
4
* 
6
* @package chorodep
5
* @package chorodep
7
* @author Tela Botanica <equipe-dev@tela-botanica.org>
6
* @author Tela Botanica <equipe-dev@tela-botanica.org>
8
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
7
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
9
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
8
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
Line 56... Line 55...
56
	protected function setMasque($parametres) {
55
	protected function setMasque($parametres) {
57
		if(isset($parametres['masque.nom']) && $parametres['masque.nom'] != '') {
56
		if(isset($parametres['masque.nom']) && $parametres['masque.nom'] != '') {
58
			$this->masque['nom'] = $parametres['masque.nom'];
57
			$this->masque['nom'] = $parametres['masque.nom'];
59
		}
58
		}
60
		if(isset($parametres['masque.zone-geo']) && $parametres['masque.zone-geo'] != '') {
59
		if(isset($parametres['masque.zone-geo']) && $parametres['masque.zone-geo'] != '') {
61
			$this->masque['zone-geo'] = $parametres['masque.zone-geo'];
60
			$zg = $parametres['masque.zone-geo'];
-
 
61
			// Tango Corse
-
 
62
			if ($zg == '2A' || $zg == '2B') {
-
 
63
				$zg = '20';
-
 
64
			}
-
 
65
			$this->masque['zone-geo'] = $zg;
62
		}
66
		}
63
	}
67
	}
Line 64... Line 68...
64
 
68
 
65
	/**
69
	/**
Line 113... Line 117...
113
		$donnees['resultat'] = $noms;
117
		$donnees['resultat'] = $noms;
Line 114... Line 118...
114
 
118
 
115
		return $donnees;
119
		return $donnees;
Line -... Line 120...
-
 
120
	}
-
 
121
 
-
 
122
	/**
-
 
123
	 * Renvoie la liste des noms répertoriés par chorodep; si un masque a été
116
	}
124
	 * défini sur une zone géographique, retourne aussi la présence sur cette zone
117
 
125
	 */
-
 
126
	protected function listeNoms() {
-
 
127
		$req = "SELECT DISTINCT num_nom, nom_sci";
-
 
128
		if (isset($this->masque['zone-geo']) && $this->masque['zone-geo'] != null) {
-
 
129
			$req .= ", `" . $this->masque['zone-geo'] . "` as presence";
118
	protected function listeNoms() {
130
		}
119
		$req = "SELECT DISTINCT num_nom, nom_sci FROM " . $this->table;
131
		$req .= " FROM " . $this->table;
120
		$req .= $this->construireWhere();
132
		$req .= $this->construireWhere();
Line 121... Line 133...
121
		$req .= " ORDER BY ".$this->tri." ".$this->tri_dir." ";
133
		$req .= " ORDER BY ".$this->tri." ".$this->tri_dir." ";
Line 141... Line 153...
141
			if(isset($this->masque['nom'])) {
153
			if(isset($this->masque['nom'])) {
142
				$masqueNom = $this->getBdd()->proteger($this->masque['nom']);
154
				$masqueNom = $this->getBdd()->proteger($this->masque['nom']);
143
				$conditions[] = "nom_sci LIKE $masqueNom";
155
				$conditions[] = "nom_sci LIKE $masqueNom";
144
			}
156
			}
145
			if(isset($this->masque['zone-geo'])) {
157
			if(isset($this->masque['zone-geo'])) {
146
				$masqueZg = $this->getBdd()->proteger($this->masque['zone-geo']);
158
				$masqueZg = $this->masque['zone-geo'];
147
				//$conditions[] = "code_insee = $masqueZg";
159
				$conditions[] = "`$masqueZg` in ('1', '1?')";
148
			}
160
			}
149
			$where = " WHERE ".implode(' AND ', $conditions);
161
			$where = " WHERE ".implode(' AND ', $conditions);
150
		}
162
		}
151
		return $where;
163
		return $where;
152
	}
164
	}