Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 30
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of BiblioBota - Organisme Carto.                                                   |
8
// | This file is part of BiblioBota - Organisme Carto.                                                   |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
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                                 |
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                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: bboc_information.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
24
// CVS : $Id: bboc_information.fonct.php,v 1.2 2005/04/13 10:12:34 jpm Exp $
25
/**
25
/**
26
* Fonctions de l'application Organisme Carto.
26
* Fonctions de l'application Organisme Carto.
27
*
27
*
28
* Fichier de fonctions fournissant des informations de l'application Organisme Carto.
28
* Fichier de fonctions fournissant des informations de l'application Organisme Carto.
29
*
29
*
30
*@package BiblioBota-OrganismeCarto
30
*@package BiblioBota-OrganismeCarto
31
//Auteur original :
31
//Auteur original :
32
*@author        Jean-Charles GRANGER <tela@vecteur.org>
32
*@author        Jean-Charles GRANGER <tela@vecteur.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
35
*@copyright     Tela-Botanica 2000-2005
35
*@copyright     Tela-Botanica 2000-2005
36
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
36
*@version       $Revision: 1.2 $ $Date: 2005/04/13 10:12:34 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
 
43
 
44
 
44
 
45
// +------------------------------------------------------------------------------------------------------+
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                           LISTE de FONCTIONS                                         |
46
// |                                           LISTE de FONCTIONS                                         |
47
// +------------------------------------------------------------------------------------------------------+
47
// +------------------------------------------------------------------------------------------------------+
48
 
48
 
49
/**
49
/**
50
* Fonction bboc_consulterNbreStructure() - Donne le nombre de structure.
50
* Fonction bboc_consulterNbreStructure() - Donne le nombre de structure.
51
*
51
*
52
* La fonction bboc_consulterNbreStructure() renvoit une phrase complete 
52
* La fonction bboc_consulterNbreStructure() renvoit une phrase complete 
53
* indiquant le nombre de structure dans la carte passée en argument
53
* indiquant le nombre de structure dans la carte passée en argument
54
*
54
*
55
* @param int l'identifiant de la carte.
55
* @param int l'identifiant de la carte.
56
* @param int l'identifiant du type de zones contenues dans 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.
57
* @param int l'identifiant de la zone géo de la carte.
58
* @return string une chaine XHTML donnant le nombre de structure.
58
* @return string une chaine XHTML donnant le nombre de structure.
59
*/
59
*/
60
function bboc_consulterNbreStructure($id_carte, $type_zone_carte, $id_zone_geo_carte)
60
function bboc_consulterNbreStructure($id_carte, $type_zone_carte, $id_zone_geo_carte)
61
{
61
{
62
    switch ($type_zone_carte){
62
    switch ($type_zone_carte){
63
        case '0' :
63
        case '0' :
64
            $requete =
64
            $requete =
65
                    'SELECT count(B_S_IDSTR) as nbr '.
65
                    'SELECT count(B_S_IDSTR) as nbr '.
66
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
66
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
67
                    'WHERE B_S_CACHER = 0';
67
                    'WHERE B_S_CACHER = 0';
68
                break;
68
                break;
69
        
69
        
70
        case '1' :
70
        case '1' :
71
            $requete =
71
            $requete =
72
                    'SELECT count(CP_ID_Continent) as nbr '.
72
                    'SELECT count(CP_ID_Continent) as nbr '.
73
                    'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
73
                    'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
74
                    'WHERE B_S_CACHER = 0 '.
74
                    'WHERE B_S_CACHER = 0 '.
75
                    'AND B_S_PAYS = CP_ID_Pays '.
75
                    'AND B_S_PAYS = CP_ID_Pays '.
76
                    'AND CP_ID_Continent <> 0 '.
76
                    'AND CP_ID_Continent <> 0 '.
77
                    'AND CP_ID_Continent = "'.$id_zone_geo_carte.'"';
77
                    'AND CP_ID_Continent = "'.$id_zone_geo_carte.'"';
78
                break;
78
                break;
79
        
79
        
80
        case '2' :
80
        case '2' :
81
            $requete = 
81
            $requete = 
82
                    'SELECT count(B_S_IDSTR) as nbr '.
82
                    'SELECT count(B_S_IDSTR) as nbr '.
83
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
83
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
84
                    'WHERE B_S_CACHER = 0 '.
84
                    'WHERE B_S_CACHER = 0 '.
85
                    'AND B_S_PAYS = "fr"';
85
                    'AND B_S_PAYS = "fr"';
86
                break;
86
                break;
87
    }
87
    }
88
    
88
    
89
    $resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
89
    $resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
90
    $ligne = mysql_fetch_object($resultat);
90
    $ligne = mysql_fetch_object($resultat);
91
    
91
    
92
    return $ligne->nbr;
92
    return $ligne->nbr;
93
}
93
}
94
 
94
 
95
// +------------------------------------------------------------------------------------------------------+
95
// +------------------------------------------------------------------------------------------------------+
96
// |                                            PIED du PROGRAMME                                         |
96
// |                                            PIED du PROGRAMME                                         |
97
// +------------------------------------------------------------------------------------------------------+
97
// +------------------------------------------------------------------------------------------------------+
98
 
98
 
99
 
99
 
100
/* +--Fin du code ----------------------------------------------------------------------------------------+
100
/* +--Fin du code ----------------------------------------------------------------------------------------+
101
*
101
*
102
* $Log: not supported by cvs2svn $
102
* $Log: bboc_information.fonct.php,v $
103
* Revision 1.3  2005/05/17 10:10:08  jpm
-
 
104
* Correction des bogues avant mise en ligne du site v4.
-
 
105
*
-
 
106
* Revision 1.2  2005/04/13 10:12:34  jpm
103
* Revision 1.2  2005/04/13 10:12:34  jpm
107
* Ajout de la constante indiquant la bdd des tables de la carto.
104
* Ajout de la constante indiquant la bdd des tables de la carto.
108
*
105
*
109
* Revision 1.1  2005/03/01 15:19:44  jpm
106
* Revision 1.1  2005/03/01 15:19:44  jpm
110
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
107
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
111
*
108
*
112
*
109
*
113
* +-- Fin du code ----------------------------------------------------------------------------------------+
110
* +-- Fin du code ----------------------------------------------------------------------------------------+
114
*/
111
*/
115
?>
112
?>