Subversion Repositories eFlore/Archives.herbiers

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/bibliotheque/hb_commun.fonct.php
New file
0,0 → 1,111
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Herbier. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: hb_commun.fonct.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Fonctions communes aux applications d'Herbier
*
* Bibliothèque de fonctions communes aux applications d'Herbier.
*
*@package Herbier
*@subpackage Fonctions
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
/**
* Fonction getCountryName() - Renvois le nom d'un pays en fonction de son identifiant passé en paramètre
*
* Renvois le nom d'un pays en fonction de son identifiant passé en paramètre,
* le nom renvoyé est le nom entier (exemple : France), l'identifiant est l'extension
* des noms de domaines internet de chaque pays (exemple : fr)
*
* @param string l'identifiant du pays.
* @return string le nom du pays.
* @access public
*/
function getCountryName($id)
{
$requete = 'SELECT GC_NAME '.
'FROM gen_COUNTRY '.
'WHERE GC_ID = "'.$id.'"';
$resultat = mysql_query($requete) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
return $ligne->GC_NAME;
}
 
/**
* Fonction getPreservationMethod() - Renvois un tableau de méthode de préservation
*
* Renvoie un tableau contenant en l'ensemble des
* méthode de préservation pour une collection donnée
* La colection est identifiant par l'argument $id
*
* @param string $id l'identifiant de la collection
* @return array les nom des méthodes de préservation
* @access public
*/
function getPreservationMethod($id)
{
$array_pres = array();
$requete = 'SELECT HERBIERS_PRES.LABEL '.
'FROM HERBIERS_PRES, HERBIERS_ont_pres '.
'WHERE HERBIERS_ont_pres.ID = '.$id.' '.
'AND HERBIERS_ont_pres.ID_PRES = HERBIERS_PRES.ID_PRES';
$resultat = mysql_query($requete) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
while ($ligne = mysql_fetch_object($resultat)) {
array_push($array_pres, $ligne->LABEL);
}
return $array_pres;
}
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/04/06 13:29:17 jpm
* Ajout et modifications des objets représentant la base de données Herbier.
*
* Revision 1.1 2005/03/08 14:13:21 jpm
* Ajout des classes d'accès à la base de données.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>