Subversion Repositories eFlore/Applications.cel

Rev

Rev 1014 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1014 Rev 1297
1
<?php
1
<?php
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
3
/**
3
/**
4
* PHP Version 5
4
* PHP Version 5
5
*
5
*
6
* @category  PHP
6
* @category  PHP
7
* @package   jrest
7
* @package   jrest
8
* @author    David Delon <david.delon@clapas.net>
8
* @author    David Delon <david.delon@clapas.net>
9
* @author    Aurélien Peronnet <aurelien@tela-botanica.org>
9
* @author    Aurélien Peronnet <aurelien@tela-botanica.org>
10
* @copyright 2010 Tela-Botanica
10
* @copyright 2010 Tela-Botanica
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
12
* @version   SVN: <svn_id>
12
* @version   SVN: <svn_id>
13
* @link      /doc/jrest/
13
* @link      /doc/jrest/
14
*/
14
*/
15
 
15
 
16
 
16
 
17
/**
17
/**
18
* InventoryObservationCount.php
18
* InventoryObservationCount.php
19
*
19
*
20
* in : utf8
20
* in : utf8
21
* out : utf8
21
* out : utf8
22
*
22
*
23
* Cas d'utilisation :
23
* Cas d'utilisation :
24
* Service recherche du nombre a partir de divers critères
24
* Service recherche du nombre a partir de divers critères
25
*
25
*
26
* 2: Le service recherche le nombre d'images correspondant au critères demandé
26
* 2: Le service recherche le nombre d'images correspondant au critères demandé
27
* 3: Le service renvoie le nombre calcule
27
* 3: Le service renvoie le nombre calcule
28
*/
28
*/
29
class InventoryObservationCount extends Cel {
29
class InventoryObservationCount extends Cel {
30
 
30
 
31
	/**
31
	/**
32
	 *  renvoie le nombre d' observations  correspondant aux criteres
32
	 *  renvoie le nombre d' observations  correspondant aux criteres
33
	 *	uid[0] : utilisateur obligatoire
33
	 *	uid[0] : utilisateur obligatoire
34
	 *	uid[1] : criteres de filtrage de la forme critere1=valeur1&critere2=valeur2
34
	 *	uid[1] : criteres de filtrage de la forme critere1=valeur1&critere2=valeur2
35
	 *  
35
	 *  
36
	*/
36
	*/
37
	function getElement($uid)
37
	function getElement($uid)
38
	{
38
	{
39
		// Controle detournement utilisateur
39
		// Controle detournement utilisateur
40
		$this->controleUtilisateur($uid[0]);
40
		$this->controleUtilisateur($uid[0]);
41
 
41
 
42
		$chercheur_observations = new RechercheObservation($this->config);
42
		$chercheur_observations = new RechercheObservation($this->config);
43
 
43
 
44
		$criteres = array();
-
 
45
 
-
 
46
		if(isset($uid[1]))
-
 
47
		{
-
 
48
			$criteres = $chercheur_observations->parserRequeteCriteres($uid[1]) ;
-
 
49
		}
-
 
50
 
44
		$criteres = $_GET;
51
		$retour = $chercheur_observations->compterObservations($uid[0], $criteres);
45
		$retour = $chercheur_observations->compterObservations($uid[0], $criteres);
52
		
46
		
53
		$this->envoyerJson($retour);
47
		$this->envoyerJson($retour);
54
		return true;
48
		return true;
55
	}
49
	}
56
}
50
}
57
?>
51
?>