<?php


Class InventoryRss extends DBAccessor {


	var $config;
	
	function InventoryRss($config) {

		$this->config=$config;
	}
	

	function getRessource(){
		
			$DB=$this->connectDB($this->config,'database_cel');
			
   	
  	$rss = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?> \n";
	$rss .= "<rss version=\"0.91\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n";
	$rss .='
		  <channel>
		 <title>Carnet en ligne</title>
		 <link>http://www.tela-botanica.org/cel/jrest/InventoryRss</link>
		 <description>Carnet en ligne</description>
		 <language>fr</language>';

					
		  	$query="SELECT * FROM cel_inventory order by date_modification DESC LIMIT 0,100";
		  
   		    $res =& $DB->query($query);
    
	        if (DB::isError($res)) {
    	        die($res->getMessage());
        	}
        	

		   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['commentaire'] = htmlspecialchars($row['commentaire']);
           $row['transmission'] = htmlspecialchars($row['transmission']);
		   	


		  $lk="http://www.tela-botanica.org/cel/jrest/util/cel_inventory.php?PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=0&PME_sys_operation=PME_op_Change&PME_sys_rec=".$row['id'];
		  $link_desc=' <a href="'.$lk.'">Correction</a>';
		  $link_desc=htmlspecialchars($link_desc);

	           $rss.= '  <item>
			  <title>'.$row['nom_sel'] ." (".$row['num_nom_sel'].") ". ' par ' . $row['identifiant'].'</title>
			  <author>'.$row['identifiant'].'</author>
			  <link>http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/'.$row['num_nom_sel'].'/cel</link>
			  <description>'.$row['nom_sel']. ' modifie le ' .$row['date_modification'] . ' par ' . $row['identifiant'] ." : " . $row['location'] . ",". $row['station'] . "," . $row['commentaire'] . "," . $row['transmission'] .
			   $link_desc.
			   '</description>
				<dc:format>text/html</dc:format>
			 </item>';
	
	
	
       }

   $rss.= '</channel> </rss>';
        	
        	
    header("Content-Type: text/xml; charset=ISO-8859-1");
	print $rss;
	exit;	
}

} 


/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.4  2007-06-06 13:31:16  ddelon
* v0.09
*
* Revision 1.3  2007-05-22 12:54:09  ddelon
* Securisation acces utilisateur
*
*
* 
*/

?>
