Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2457 → Rev 2458

/trunk/jrest/services/InventoryImageCount.php
1,58 → 1,46
<?php
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
 
// declare(encoding='UTF-8');
/**
* @author Aurélien Peronnet <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright © 2010, Aurélien Peronnet
*/
 
/**
* InventoryImageCount.php
*
* in : utf8
* out : utf8
* Cas d'utilisation :
* Service recherche du nombre a partir de divers critères
*
*
* 2: Le service recherche le nombre d'images correspondant aux critères demandés
* 3: Le service renvoie le nombre calculé
*/
class InventoryImageCount extends Cel {
*
* @internal Mininum PHP version : 5.2
* @category CEL
* @package Services
* @subpackage Images
* @version 0.1
* @author Mathias CHOUET <mathias@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
*/
class InventoryImageCount extends Cel {
 
/**
* renvoie le nombre d'images correspondant aux criteres
* Renvoie le nombre d'images correspondant aux criteres
* uid[0] : utilisateur obligatoire
* uid[1] : critères de filtrage de la forme critère1=valeur1;critère2=valeur2
*/
function getElement($uid)
{
//TODO : remplacer le contenu du $uid[1] par le tableau $_GET;
public function getElement($uid) {
// Controle detournement utilisateur
$this->controleUtilisateur($uid[0]);
$chercheur_images = new RechercheImage($this->config);
 
$numero_page = 0;
$taille_page = 50;
$criteres = array();
 
$criteres = $_GET;
$chercheurImages = new RechercheImage($this->config);
$retour = $chercheurImages->compterImages($uid[0], $criteres);
 
$retour = $chercheur_images->compterImages($uid[0], $criteres);
 
$retour_encode = json_encode($retour) ;
$retour_encode = json_encode($retour);
$retour_encode = $this->nettoyerCaracteresNuls($retour_encode);
 
header("content-type: application/json");
header('content-type: application/json');
print $retour_encode ;
exit() ;
}
 
private function nettoyerCaracteresNuls($chaine) {
return str_replace('\u0000','',$chaine);
return str_replace('\u0000','',$chaine);
}
}
?>
}