Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?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 BiblioBota - Organisme Carto.                                                   |
// |                                                                                                      |
// | 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: bboc_information.fonct.php,v 1.2 2005/04/13 10:12:34 jpm Exp $
/**
* Fonctions de l'application Organisme Carto.
*
* Fichier de fonctions fournissant des informations de l'application Organisme Carto.
*
*@package BiblioBota-OrganismeCarto
//Auteur original :
*@author        Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright     Tela-Botanica 2000-2005
*@version       $Revision: 1.2 $ $Date: 2005/04/13 10:12:34 $
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+


// +------------------------------------------------------------------------------------------------------+
// |                                           LISTE de FONCTIONS                                         |
// +------------------------------------------------------------------------------------------------------+

/**
* Fonction bboc_consulterNbreStructure() - Donne le nombre de structure.
*
* La fonction bboc_consulterNbreStructure() renvoit une phrase complete 
* indiquant le nombre de structure dans la carte passée en argument
*
* @param int l'identifiant de la carte.
* @param int l'identifiant du type de zones contenues dans la carte.
* @param int l'identifiant de la zone géo de la carte.
* @return string une chaine XHTML donnant le nombre de structure.
*/
function bboc_consulterNbreStructure($id_carte, $type_zone_carte, $id_zone_geo_carte)
{
    switch ($type_zone_carte){
        case '0' :
            $requete =
                    'SELECT count(B_S_IDSTR) as nbr '.
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
                    'WHERE B_S_CACHER = 0';
                break;
        
        case '1' :
            $requete =
                    'SELECT count(CP_ID_Continent) as nbr '.
                    'FROM '.BB_BDD_NOM.'.biblio_str, '.BB_BDD_NOM_CARTO.'.carto_PAYS '.
                    'WHERE B_S_CACHER = 0 '.
                    'AND B_S_PAYS = CP_ID_Pays '.
                    'AND CP_ID_Continent <> 0 '.
                    'AND CP_ID_Continent = "'.$id_zone_geo_carte.'"';
                break;
        
        case '2' :
            $requete = 
                    'SELECT count(B_S_IDSTR) as nbr '.
                    'FROM '.BB_BDD_NOM.'.biblio_str '.
                    'WHERE B_S_CACHER = 0 '.
                    'AND B_S_PAYS = "fr"';
                break;
    }
    
    $resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
    $ligne = mysql_fetch_object($resultat);
    
    return $ligne->nbr;
}

// +------------------------------------------------------------------------------------------------------+
// |                                            PIED du PROGRAMME                                         |
// +------------------------------------------------------------------------------------------------------+


/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: bboc_information.fonct.php,v $
* Revision 1.2  2005/04/13 10:12:34  jpm
* Ajout de la constante indiquant la bdd des tables de la carto.
*
* Revision 1.1  2005/03/01 15:19:44  jpm
* Ajout du fichier contenant les fonctions permettant de fournir des informations.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>