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) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or                                        |
// | modify it under the terms of the GNU Lesser General Public                                           |
// | License as published by the Free Software Foundation; either                                         |
// | version 2.1 of the License, or (at your option) any later version.                                   |
// |                                                                                                      |
// | This library 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                                    |
// | Lesser General Public License for more details.                                                      |
// |                                                                                                      |
// | You should have received a copy of the GNU Lesser General Public                                     |
// | License along with this library; if not, write to the Free Software                                  |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbc_affichage_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Fonctions de création de l'affichage des résultats d'une structure.
*
* Contient une fonction créant l'affichage des résultats pour le paramètre "structure".
*
*@package BiblioBota-Consultation
*@subpackage Fonctions
//Auteur original :
*@author        Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright     Tela-Botanica 2000-2004
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/

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


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

/** Fonction mkresu() - Traitement des requêtes.
*
* Fonction traitant la requête d'intérogation de la base de données pour le
* paramêtre "structure".
*
* @return  string les résultats à afficher.
*/
function mkresu()
{
    global $result_final;
    global $nbr_final;
    global $tbl;
    global $TabFinder;
    global $var_biblio;
    
    $ret = '';
    $ret .= '<ul id="bb_liste_resultat_structure">'."\n";
    
    $i = 1;
    while ($ligne = mysql_fetch_object($result_final)) {
        $get_idstr = $ligne->B_S_IDSTR;
        $get_name =  $ligne->B_S_NOM;
        $get_cp = $ligne->B_S_CODEPOSTAL;
        $get_ville = $ligne->B_S_VILLE;
        $get_pays = $ligne->GC_NAME;
        $get_date = $ligne->B_S_MAJFICHE;
        $get_categ = $ligne->B_S_TYPESTR;
        $get_categ_nom = $ligne->B_TYPSTR_LABEL;
        
        $ret .= '<li>'."\n";
        
        $ret .= '<b>';
        $ret .= ColorizeFound($get_name, stripslashes($TabFinder['chaine']));
        $ret .= '</b> ';
        
        $ret .= '(';
        $ret .= ColorizeFound($get_ville, strtoupper($TabFinder['geo']));
        
        if (($get_ville != '') && ($get_pays != '')) {
            $ret .= ' - ';
        }
        
        if (($get_pays == 'France') && ($get_cp != '')) {
            // Calcul du code département pour la France
            if ($get_cp < 97000) {
                $calc_dpt = floor($get_cp / 1000);
            } else {
                $calc_dpt = floor($get_cp / 100);
            }
            $dpt_qu =   'SELECT GFD_NAME '.
                        'FROM '.$tbl['dpt'].' '.
                        'WHERE GFD_ID = '.$calc_dpt;
            $do_dpt = mysql_query($dpt_qu) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $dpt_qu));
            $nbr_dpt = mysql_num_rows($do_dpt);
            if ($nbr_dpt == 1) {
                $resu_dpt = mysql_fetch_object($do_dpt);
                $nom_dpt = $resu_dpt->GFD_NAME;
            } else {
                return '<b>Erreur lors de la recherche du département :</b> '.$nbr_dpt.' départements trouvés.';
            }
            $ret .= ColorizeFound($nom_dpt, ucFirst($TabFinder['geo'])) . ' - ';
        }
        
        if ($get_pays != '') {
            if ($TabFinder['geo'] != '') {
                $ret .= ColorizeFound($get_pays, ucFirst($TabFinder['geo']));
            } else {
                $ret .= $get_pays;
            }
        }
        
        $ret .= ') - '."\n";
        
        if ($get_categ != '') {
            $ret .= $get_categ_nom;
        }
        
        // Vérification de l'accès à la consultation avancée transversale de Bilblio Bota.
        if ($var_biblio['open_biblio_str'] == true) {
            $ret .= ' - <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.
                                    $get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
                        'Plus d\'infos'.
                        '</a>';
        }
        
        if ($i < $nbr_final) {
            $ret .= '<br /><br />';
        }
        $i++;
        $ret .= '</li>'."\n";
    }
    $ret .= '</ul>'."\n";
    
    // Vérification de l'accès à la proposition de nouvelles structures.
    if ($var_biblio['open_proposer_str'] == true) {
        $ret .= '<p class="bb_txt_centre">'.
                    '<hr size="1" />'.
                    '<a href="'.BB_URL_COURANTE_ADMIN.'&amp;action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'.
                    '<hr size="1" />'.
                '</p>'."\n";
    }
    
    return $ret;
}

/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.3  2005/05/17 10:10:08  jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.2  2004/09/15 11:21:07  jpm
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>