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