Subversion Repositories Applications.annuaire

Rev

Rev 293 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/**
* PHP Version 5
*
* @category  PHP
* @package   annuaire
* @author    aurelien <aurelien@tela-botanica.org>
* @copyright 2010 Tela-Botanica
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version   SVN: <svn_id>
* @link      /doc/annuaire/
*/

Class NbInscrits extends JRestService {

        public function getRessource() {
                $this->getElement(array());
        }
        
        public function getElement($uid){

                $id_annuaire = Config::get('annuaire_defaut');
                
                if(isset($uid[0])) {
                        $id_annuaire = $uid[0]; 
                }
                
                $json = true;
                if(isset($uid[1]) && $uid[1] == 'html') {
                        $json = false;
                } 

            $controleur = new AnnuaireControleur();
                $valeurs = $controleur->chargerNombreAnnuaireListeInscrits($id_annuaire);
                
                if(!$json) {
                        $valeurs = '<html>
                                                        </head>
                                                        <meta content="text/html; charset='.Config::get('sortie_encodage').'" http-equiv="Content-Type">
                                                        </head>'.
                                                        '<body>
                                                                <div id="contenu">'.$valeurs.'
                                                                </div>
                                                        </body>'.
                                                '</html>';
                } 

                $this->envoyer($valeurs,'text/html',Config::get('sortie_encodage'),$json);
        }
}
?>