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