Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 862 → Rev 863

/trunk/jrest/services/InventoryContributionList.php
1,21 → 1,28
<?php
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
 
/**
* PHP Version 5
*
* @category PHP
* @package papyrus_bp
* @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/
*/
 
Class InventoryContributionList extends DBAccessor {
/**
* Classe renvoyant une liste très succinte des contributions de l'utilisateur
*
*/
class InventoryContributionList extends Cel {
 
 
protected $config;
 
function InventoryContributionList($config) {
 
$this->config=$config;
}
 
function getRessource() {
echo '';
}
 
 
function getElement($uid){
 
if(!isset($uid[0])) {
22,47 → 29,38
echo '';
}
 
$DB=$this->connectDB($this->config,'database_cel');
 
$query="SELECT * FROM cel_inventory ".
"WHERE identifiant = '".$DB->escapeSimple($uid[0])."' ".
$requete_contributions = "SELECT * FROM cel_obs ".
"WHERE ce_utilisateur = ".$this->proteger($uid[0])." ".
"ORDER BY date_modification DESC LIMIT 0,5";
 
$res =& $DB->query($query);
$resultat_contributions = $this->requeter($requete_contributions);
$resume = '';
 
if (DB::isError($res)) {
die($res->getMessage());
}
if (is_array($resultat_contributions)) {
 
$resume = "";
 
 
while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) {
$row['nom_sel'] = htmlspecialchars($row['nom_sel']);
$row['identifiant'] = htmlspecialchars($row['identifiant']);
$row['location'] = htmlspecialchars($row['location']);
$row['id_location'] = htmlspecialchars($row['id_location']);
$row['station'] = htmlspecialchars($row['station']);
$row['milieu'] = htmlspecialchars($row['milieu']);
$row['commentaire'] = htmlspecialchars($row['commentaire']);
$row['transmission'] = htmlspecialchars($row['transmission']);
 
 
$resume.= '<p>'.$row['nom_sel'] ." (".$row['num_nom_sel'].") ".
'Location : '. $row['location'].",". $row['station'] . "," . $row['milieu'] . "," . $row['commentaire'] . "," . $row['transmission'] .
'</p>';
 
foreach ($resultat_contributions as $ligne) {
$ligne['nom_sel'] = htmlspecialchars($ligne['nom_sel']);
$ligne['ce_utilisateur'] = htmlspecialchars($ligne['ce_utilisateur']);
$ligne['zone_geo'] = htmlspecialchars($ligne['location']);
$ligne['id_zone_geo'] = htmlspecialchars($ligne['id_zone_geo']);
$ligne['station'] = htmlspecialchars($ligne['station']);
$ligne['milieu'] = htmlspecialchars($ligne['milieu']);
$ligne['commentaire'] = htmlspecialchars($ligne['commentaire']);
$ligne['transmission'] = htmlspecialchars($ligne['transmission']);
$resume.= '<p>'.$ligne['nom_sel'] ." (".$ligne['nom_sel_nn'].") ".
'Location : '. $ligne['location'].",". $ligne['station'] . "," .
$ligne['milieu'] . "," . $ligne['commentaire'] . "," . $ligne['transmission'] .
'</p>';
}
}
 
 
header("Content-Type: text/html; charset=ISO-8859-1");
print $resume;
exit;
}
 
}
 
 
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.5 2008-11-13 11:29:12 ddelon
77,5 → 75,4
*
*
*/
 
?>