Subversion Repositories eFlore/Applications.cel

Rev

Rev 2458 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2458 Rev 2564
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Service de listage des zones géographiques d'un utilisateur
4
 * Service de listage des zones géographiques d'un utilisateur
5
 *
5
 *
6
 * @internal   Mininum PHP version : 5.2
6
 * @internal   Mininum PHP version : 5.2
7
 * @category   CEL
7
 * @category   CEL
8
 * @package    Services
8
 * @package    Services
9
 * @subpackage Observations
9
 * @subpackage Observations
10
 * @version    0.1
10
 * @version    0.1
11
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
11
 * @author     Mathias CHOUET <mathias@tela-botanica.org>
12
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
12
 * @author     Jean-Pascal MILCENT <jpm@tela-botanica.org>
13
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
13
 * @author     Aurelien PERONNET <aurelien@tela-botanica.org>
14
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
14
 * @license    GPL v3 <http://www.gnu.org/licenses/gpl.txt>
15
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
15
 * @license    CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
16
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
16
 * @copyright  1999-2014 Tela Botanica <accueil@tela-botanica.org>
17
 */
17
 */
18
class InventoryLocationList extends Cel {
18
class InventoryLocationList extends Cel {
19
 
19
 
20
	public function getElement($uid) {
20
	public function getElement($uid) {
21
		// Controle detournement utilisateur
21
		// Controle detournement utilisateur
22
	 	$this->controleUtilisateur($uid[0]);
22
	 	$this->controleUtilisateur($uid[0]);
23
		$idUtilisateurP = Cel::db()->proteger($uid[0]);
23
		$idUtilisateurP = Cel::db()->proteger($uid[0]);
24
 
24
 
25
		$requete = 'SELECT DISTINCT ce_zone_geo, zone_geo, lieudit, station '.
25
		$requete = 'SELECT DISTINCT pays, ce_zone_geo, zone_geo, lieudit, station '.
26
			'FROM cel_obs '.
26
			'FROM cel_obs '.
27
			"WHERE ce_utilisateur = $idUtilisateurP ".
27
			"WHERE ce_utilisateur = $idUtilisateurP ".
28
			'ORDER BY ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC '.
28
			'ORDER BY pays ASC, ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC '.
29
			' -- '.__FILE__.':'.__LINE__;
29
			' -- '.__FILE__.':'.__LINE__;
30
		$resultats = Cel::db()->requeter($requete);
30
		$resultats = Cel::db()->requeter($requete);
31
 
31
 
32
		$retour = (is_array($resultats)) ? $resultats : array();
32
		$retour = (is_array($resultats)) ? $resultats : array();
33
		$this->envoyerJson($retour);
33
		$this->envoyerJson($retour);
34
		return true;
34
		return true;
35
	}
35
	}
36
}
36
}