Subversion Repositories eFlore/Archives.herbiers

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jp_milcent 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Herbier.                                                                        |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: hb_commun.fonct.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
25
/**
26
* Fonctions communes aux applications d'Herbier
27
*
28
* Bibliothèque de fonctions communes aux applications d'Herbier.
29
*
30
*@package Herbier
31
*@subpackage Fonctions
32
//Auteur original :
33
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
34
//Autres auteurs :
35
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
36
*@copyright     Tela-Botanica 2000-2005
37
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
 
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                            CORPS du PROGRAMME                                        |
47
// +------------------------------------------------------------------------------------------------------+
48
/**
49
* Fonction getCountryName() - Renvois le nom d'un pays en fonction de son identifiant passé en paramètre
50
*
51
* Renvois le nom d'un pays en fonction de son identifiant passé en paramètre,
52
* le nom renvoyé est le nom entier (exemple : France), l'identifiant est l'extension
53
* des noms de domaines internet de chaque pays (exemple : fr)
54
*
55
* @param  string l'identifiant du pays.
56
* @return string le nom du pays.
57
* @access public
58
*/
59
function getCountryName($id)
60
{
61
    $requete =   'SELECT GC_NAME '.
62
                'FROM gen_COUNTRY '.
63
                'WHERE GC_ID = "'.$id.'"';
64
    $resultat = mysql_query($requete) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
65
    $ligne = mysql_fetch_object($resultat);
66
    return $ligne->GC_NAME;
67
}
68
 
69
/**
70
* Fonction getPreservationMethod() - Renvois un tableau de méthode de préservation
71
*
72
* Renvoie un tableau contenant en l'ensemble des
73
* méthode de préservation pour une collection donnée
74
* La colection est identifiant par l'argument $id
75
*
76
* @param  string $id l'identifiant de la collection
77
* @return array les  nom des méthodes de préservation
78
* @access public
79
*/
80
function getPreservationMethod($id)
81
{
82
    $array_pres = array();
83
    $requete =  'SELECT HERBIERS_PRES.LABEL '.
84
                'FROM HERBIERS_PRES, HERBIERS_ont_pres '.
85
                'WHERE HERBIERS_ont_pres.ID = '.$id.' '.
86
                'AND HERBIERS_ont_pres.ID_PRES = HERBIERS_PRES.ID_PRES';
87
    $resultat = mysql_query($requete) or die (BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
88
    while ($ligne = mysql_fetch_object($resultat)) {
89
        array_push($array_pres, $ligne->LABEL);
90
    }
91
    return $array_pres;
92
}
93
 
94
// +------------------------------------------------------------------------------------------------------+
95
// |                                            PIED du PROGRAMME                                         |
96
// +------------------------------------------------------------------------------------------------------+
97
 
98
 
99
/* +--Fin du code ----------------------------------------------------------------------------------------+
100
*
101
* $Log: not supported by cvs2svn $
102
* Revision 1.2  2005/04/06 13:29:17  jpm
103
* Ajout et modifications des objets représentant la base de données Herbier.
104
*
105
* Revision 1.1  2005/03/08 14:13:21  jpm
106
* Ajout des classes d'accès à la base de données.
107
*
108
*
109
* +-- Fin du code ----------------------------------------------------------------------------------------+
110
*/
111
?>