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) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bbc_affichage_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
22
// CVS : $Id: bbc_affichage_structure.fonct.php,v 1.2 2004/09/15 11:21:07 jpm Exp $
23
/**
23
/**
24
* Fonctions de création de l'affichage des résultats d'une structure.
24
* Fonctions de création de l'affichage des résultats d'une structure.
25
*
25
*
26
* Contient une fonction créant l'affichage des résultats pour le paramètre "structure".
26
* Contient une fonction créant l'affichage des résultats pour le paramètre "structure".
27
*
27
*
28
*@package BiblioBota-Consultation
28
*@package BiblioBota-Consultation
29
*@subpackage Fonctions
29
*@subpackage Fonctions
30
//Auteur original :
30
//Auteur original :
31
*@author        Jean-Charles GRANGER <tela@vecteur.org>
31
*@author        Jean-Charles GRANGER <tela@vecteur.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
33
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
35
*@version       $Revision: 1.2 $ $Date: 2004/09/15 11:21:07 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
-
 
42
                                    /*Mettre ici les inclusions de fichiers*/                             
42
 
43
 
43
 
44
                    
44
// +------------------------------------------------------------------------------------------------------+
45
// +------------------------------------------------------------------------------------------------------+
45
// |                                           LISTE de FONCTIONS                                         |
46
// |                                           LISTE de FONCTIONS                                         |
46
// +------------------------------------------------------------------------------------------------------+
47
// +------------------------------------------------------------------------------------------------------+
-
 
48
                                        /*Mettre ici la liste de fonctions.*/
47
 
49
 
48
/** Fonction mkresu() - Traitement des requêtes.
50
/** Fonction mkresu() - Traitement des requêtes.
49
*
51
*
50
* Fonction traitant la requête d'intérogation de la base de données pour le
52
* Fonction traitant la requête d'intérogation de la base de données pour le
51
* paramêtre "structure".
53
* paramêtre "structure".
52
*
54
*
53
* @return  string les résultats à afficher.
55
* @return  string les résultats à afficher.
54
*/
56
*/
55
function mkresu()
57
function mkresu()
56
{
58
{
57
    global $result_final;
59
    global $result_final;
58
    global $nbr_final;
60
    global $nbr_final;
59
    global $tbl;
61
    global $tbl;
60
    global $TabFinder;
62
    global $TabFinder;
61
    global $var_biblio;
63
    global $var_biblio;
-
 
64
    global $GS_GLOBAL;
62
    
65
    
63
    $ret = '';
66
    $ret = '';
64
    $ret .= '<ul id="bb_liste_resultat_structure">'."\n";
67
    $ret .= '<ul id="bb_liste_resultat_structure">'."\n";
65
    
68
    
66
    $i = 1;
69
    $i = 1;
67
    while ($ligne = mysql_fetch_object($result_final)) {
70
    while ($row = mysql_fetch_object($result_final)) {
68
        $get_idstr = $ligne->B_S_IDSTR;
71
        $get_idstr = $row->B_S_IDSTR;
69
        $get_name =  $ligne->B_S_NOM;
72
        $get_name =  $row->B_S_NOM;
70
        $get_cp = $ligne->B_S_CODEPOSTAL;
73
        $get_cp = $row->B_S_CODEPOSTAL;
71
        $get_ville = $ligne->B_S_VILLE;
74
        $get_ville = $row->B_S_VILLE;
72
        $get_pays = $ligne->GC_NAME;
75
        $get_pays = $row->GC_NAME;
73
        $get_date = $ligne->B_S_MAJFICHE;
76
        $get_date = $row->B_S_MAJFICHE;
74
        $get_categ = $ligne->B_S_TYPESTR;
77
        $get_categ = $row->B_S_TYPESTR;
75
        $get_categ_nom = $ligne->B_TYPSTR_LABEL;
78
        $get_categ_nom = $row->B_TYPSTR_LABEL;
76
        
79
        
77
        $ret .= '<li>'."\n";
80
        $ret .= '<li>'."\n";
78
        
81
        
79
        $ret .= '<b>';
82
        $ret .= '<b>';
80
        $ret .= ColorizeFound($get_name, stripslashes($TabFinder['chaine']));
83
        $ret .= ColorizeFound($get_name, stripslashes($TabFinder['chaine']));
81
        $ret .= '</b> ';
84
        $ret .= '</b> ';
82
        
85
        
83
        $ret .= '(';
86
        $ret .= '(';
84
        $ret .= ColorizeFound($get_ville, strtoupper($TabFinder['geo']));
87
        $ret .= ColorizeFound($get_ville, strtoupper($TabFinder['geo']));
85
        
88
        
86
        if (($get_ville != '') && ($get_pays != '')) {
89
        if (($get_ville != '') && ($get_pays != '')) {
87
            $ret .= ' - ';
90
            $ret .= ' - ';
88
        }
91
        }
89
        
92
        
90
        if (($get_pays == 'France') && ($get_cp != '')) {
93
        if (($get_pays == 'France') && ($get_cp != '')) {
91
            // Calcul du code département pour la France
94
            // Calcul du code département pour la France
92
            if ($get_cp < 97000) {
95
            if ($get_cp < 97000) {
93
                $calc_dpt = floor($get_cp / 1000);
96
                $calc_dpt = floor($get_cp / 1000);
94
            } else {
97
            } else {
95
                $calc_dpt = floor($get_cp / 100);
98
                $calc_dpt = floor($get_cp / 100);
96
            }
99
            }
97
            $dpt_qu =   'SELECT GFD_NAME '.
100
            $dpt_qu =   'SELECT GFD_NAME '.
98
                        'FROM '.$tbl['dpt'].' '.
101
                        'FROM '.$tbl['dpt'].' '.
99
                        'WHERE GFD_ID = '.$calc_dpt;
102
                        'WHERE GFD_ID = '.$calc_dpt;
100
            $do_dpt = mysql_query($dpt_qu) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $dpt_qu));
103
            $do_dpt = mysql_query($dpt_qu) or die("<B>Erreur lors de la recherche du département :</B> $dpt_qu");
101
            $nbr_dpt = mysql_num_rows($do_dpt);
104
            $nbr_dpt = mysql_num_rows($do_dpt);
102
            if ($nbr_dpt == 1) {
105
            if ($nbr_dpt == 1) {
103
                $resu_dpt = mysql_fetch_object($do_dpt);
106
                $resu_dpt = mysql_fetch_object($do_dpt);
104
                $nom_dpt = $resu_dpt->GFD_NAME;
107
                $nom_dpt = $resu_dpt->GFD_NAME;
105
            } else {
108
            } else {
106
                return '<b>Erreur lors de la recherche du département :</b> '.$nbr_dpt.' départements trouvés.';
109
                die('<b>Erreur lors de la recherche du département :</b> '.$nbr_dpt.' départements trouvés.');
107
            }
110
            }
108
            $ret .= ColorizeFound($nom_dpt, ucFirst($TabFinder['geo'])) . ' - ';
111
            $ret .= ColorizeFound($nom_dpt, ucFirst($TabFinder['geo'])) . ' - ';
109
        }
112
        }
110
        
113
        
111
        if ($get_pays != '') {
114
        if ($get_pays != '') {
112
            if ($TabFinder['geo'] != '') {
115
            if ($TabFinder['geo'] != '') {
113
                $ret .= ColorizeFound($get_pays, ucFirst($TabFinder['geo']));
116
                $ret .= ColorizeFound($get_pays, ucFirst($TabFinder['geo']));
114
            } else {
117
            } else {
115
                $ret .= $get_pays;
118
                $ret .= $get_pays;
116
            }
119
            }
117
        }
120
        }
118
        
121
        
119
        $ret .= ') - '."\n";
122
        $ret .= ') - '."\n";
120
        
123
        
121
        if ($get_categ != '') {
124
        if ($get_categ != '') {
122
            $ret .= $get_categ_nom;
125
            $ret .= $get_categ_nom;
123
        }
126
        }
124
        
127
        
125
        // Vérification de l'accès à la consultation avancée transversale de Bilblio Bota.
128
        // Vérification de l'accès à la consultation avancée transversale de Bilblio Bota.
126
        if ($var_biblio['open_biblio_str'] == true) {
129
        if ($var_biblio['open_biblio_str'] == true) {
127
            $ret .= ' - <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.
130
            $ret .= ' - <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;str='.$get_idstr.'&amp;arg_0=str%3D'.$get_idstr.'&amp;arg_1=coll%3D'.
128
                                    $get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
131
                                    $get_idstr.'&amp;arg_2=book%3D'.$get_idstr.'&amp;arg_3=media%3D'.$get_idstr.'">'.
129
                        'Plus d\'infos'.
132
                        'Plus d\'infos'.
130
                        '</a>';
133
                        '</a>';
131
        }
134
        }
132
        
135
        
133
        if ($i < $nbr_final) {
136
        if ($i < $nbr_final) {
134
            $ret .= '<br /><br />';
137
            $ret .= '<br /><br />';
135
        }
138
        }
136
        $i++;
139
        $i++;
137
        $ret .= '</li>'."\n";
140
        $ret .= '</li>'."\n";
138
    }
141
    }
139
    $ret .= '</ul>'."\n";
142
    $ret .= '</ul>'."\n";
140
    
143
    
141
    // Vérification de l'accès à la proposition de nouvelles structures.
144
    // Vérification de l'accès à la proposition de nouvelles structures.
142
    if ($var_biblio['open_proposer_str'] == true) {
145
    if ($var_biblio['open_proposer_str'] == true) {
143
        $ret .= '<p class="bb_txt_centre">'.
146
        $ret .= '<p class="bb_txt_centre">'.
144
                    '<hr size="1" />'.
147
                    '<hr size="1" />'.
145
                    '<a href="'.BB_URL_COURANTE_ADMIN.'&amp;action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'.
148
                    '<a href="'.BB_URL_COURANTE_ADMIN.'&amp;action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'.
146
                    '<hr size="1" />'.
149
                    '<hr size="1" />'.
147
                '</p>'."\n";
150
                '</p>'."\n";
148
    }
151
    }
149
    
152
    
150
    return $ret;
153
    return $ret;
151
}
154
}
152
 
155
 
153
/* +--Fin du code ----------------------------------------------------------------------------------------+
156
/* +--Fin du code ----------------------------------------------------------------------------------------+
154
*
157
*
155
* $Log: not supported by cvs2svn $
158
* $Log: bbc_affichage_structure.fonct.php,v $
156
* Revision 1.3  2005/05/17 10:10:08  jpm
-
 
157
* Correction des bogues avant mise en ligne du site v4.
-
 
158
*
-
 
159
* Revision 1.2  2004/09/15 11:21:07  jpm
159
* Revision 1.2  2004/09/15 11:21:07  jpm
160
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
160
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
161
*
161
*
162
*
162
*
163
* +-- Fin du code ----------------------------------------------------------------------------------------+
163
* +-- Fin du code ----------------------------------------------------------------------------------------+
164
*/
164
*/
165
?>
165
?>