* @copyright 2010 Tela-Botanica * @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL * @version SVN: * @link /doc/papyrus_bp/ */ Class Resume extends JRestService { public function getElement($uid){ $id_utilisateur = $uid[0]; $mail_utilisateur = $uid[1]; $sql= 'SELECT bf_id_fiche, bf_titre, bf_date_maj_fiche FROM bazar_fiche'. ' WHERE bf_ce_utilisateur = '.$id_utilisateur. ' AND bf_statut_fiche = 1'. ' ORDER BY bf_date_maj_fiche DESC '. ' LIMIT 0,5'; $fiches = $projets = $this->bdd->query($sql)->fetchAll(); $resume = array(); $resume['titre'] = 'Mes derniers événements publiés'; $resume['lien_appli'] = ' Consulter tous les évenements '; if(!$fiches) { $resume['message'] = 'Aucune fiche saisie pour le moment'; } else { foreach($fiches as $fiche) { $cible_lien = 'http://www.tela-botanica.org/page:evenements?vue=1&action=8&id_fiche='.$fiche['bf_id_fiche']; $date_pub = ' publiée le '.$fiche['bf_date_maj_fiche']; $resume_item = array('element' => htmlspecialchars($fiche['bf_titre']).$date_pub, 'lien' => $cible_lien); $resume['elements'][] = $resume_item; } } $this->envoyer($resume); } } ?>