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 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
24 |
// CVS : $Id: bboc_information.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
|
|
|
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
|
|
|
36 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
|
|
|
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 |
*
|
|
|
102 |
* $Log: not supported by cvs2svn $
|
|
|
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
|
|
|
107 |
* Ajout de la constante indiquant la bdd des tables de la carto.
|
|
|
108 |
*
|
|
|
109 |
* Revision 1.1 2005/03/01 15:19:44 jpm
|
|
|
110 |
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
|
|
|
111 |
*
|
|
|
112 |
*
|
|
|
113 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
114 |
*/
|
|
|
115 |
?>
|