Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Details | Compare with Previous | 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 BiblioBota - Organisme Carto.                                                   |
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
// +------------------------------------------------------------------------------------------------------+
30 mathias 24
// CVS : $Id: bboc_information.fonct.php,v 1.2 2005/04/13 10:12:34 jpm Exp $
2 jp_milcent 25
/**
26
* Fonctions de l'application Organisme Carto.
27
*
28
* Fichier de fonctions fournissant des informations de l'application Organisme Carto.
29
*
30
*@package BiblioBota-OrganismeCarto
31
//Auteur original :
32
*@author        Jean-Charles GRANGER <tela@vecteur.org>
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
35
*@copyright     Tela-Botanica 2000-2005
30 mathias 36
*@version       $Revision: 1.2 $ $Date: 2005/04/13 10:12:34 $
2 jp_milcent 37
// +------------------------------------------------------------------------------------------------------+
38
*/
39
 
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
43
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                           LISTE de FONCTIONS                                         |
47
// +------------------------------------------------------------------------------------------------------+
48
 
49
/**
50
* Fonction bboc_consulterNbreStructure() - Donne le nombre de structure.
51
*
52
* La fonction bboc_consulterNbreStructure() renvoit une phrase complete
53
* indiquant le nombre de structure dans la carte passée en argument
54
*
55
* @param int l'identifiant de la carte.
56
* @param int l'identifiant du type de zones contenues dans la carte.
57
* @param int l'identifiant de la zone géo de la carte.
58
* @return string une chaine XHTML donnant le nombre de structure.
59
*/
60
function bboc_consulterNbreStructure($id_carte, $type_zone_carte, $id_zone_geo_carte)
61
{
62
    switch ($type_zone_carte){
63
        case '0' :
64
            $requete =
65
                    'SELECT count(B_S_IDSTR) as nbr '.
66
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
67
                    'WHERE B_S_CACHER = 0';
68
                break;
69
 
70
        case '1' :
71
            $requete =
72
                    'SELECT count(CP_ID_Continent) as nbr '.
73
                    'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
74
                    'WHERE B_S_CACHER = 0 '.
75
                    'AND B_S_PAYS = CP_ID_Pays '.
76
                    'AND CP_ID_Continent <> 0 '.
77
                    'AND CP_ID_Continent = "'.$id_zone_geo_carte.'"';
78
                break;
79
 
80
        case '2' :
81
            $requete =
82
                    'SELECT count(B_S_IDSTR) as nbr '.
83
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
84
                    'WHERE B_S_CACHER = 0 '.
85
                    'AND B_S_PAYS = "fr"';
86
                break;
87
    }
88
 
89
    $resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
90
    $ligne = mysql_fetch_object($resultat);
91
 
92
    return $ligne->nbr;
93
}
94
 
95
// +------------------------------------------------------------------------------------------------------+
96
// |                                            PIED du PROGRAMME                                         |
97
// +------------------------------------------------------------------------------------------------------+
98
 
99
 
100
/* +--Fin du code ----------------------------------------------------------------------------------------+
101
*
30 mathias 102
* $Log: bboc_information.fonct.php,v $
2 jp_milcent 103
* Revision 1.2  2005/04/13 10:12:34  jpm
104
* Ajout de la constante indiquant la bdd des tables de la carto.
105
*
106
* Revision 1.1  2005/03/01 15:19:44  jpm
107
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
108
*
109
*
110
* +-- Fin du code ----------------------------------------------------------------------------------------+
111
*/
112
?>