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 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
22 |
// CVS : $Id: bbc_affichage_structure.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
|
|
|
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
|
|
|
35 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
|
|
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
37 |
*/
|
|
|
38 |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
// | ENTETE du PROGRAMME |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
|
|
|
43 |
|
|
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
45 |
// | LISTE de FONCTIONS |
|
|
|
46 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
47 |
|
|
|
48 |
/** Fonction mkresu() - Traitement des requêtes.
|
|
|
49 |
*
|
|
|
50 |
* Fonction traitant la requête d'intérogation de la base de données pour le
|
|
|
51 |
* paramêtre "structure".
|
|
|
52 |
*
|
|
|
53 |
* @return string les résultats à afficher.
|
|
|
54 |
*/
|
|
|
55 |
function mkresu()
|
|
|
56 |
{
|
|
|
57 |
global $result_final;
|
|
|
58 |
global $nbr_final;
|
|
|
59 |
global $tbl;
|
|
|
60 |
global $TabFinder;
|
|
|
61 |
global $var_biblio;
|
|
|
62 |
|
|
|
63 |
$ret = '';
|
|
|
64 |
$ret .= '<ul id="bb_liste_resultat_structure">'."\n";
|
|
|
65 |
|
|
|
66 |
$i = 1;
|
|
|
67 |
while ($ligne = mysql_fetch_object($result_final)) {
|
|
|
68 |
$get_idstr = $ligne->B_S_IDSTR;
|
|
|
69 |
$get_name = $ligne->B_S_NOM;
|
|
|
70 |
$get_cp = $ligne->B_S_CODEPOSTAL;
|
|
|
71 |
$get_ville = $ligne->B_S_VILLE;
|
|
|
72 |
$get_pays = $ligne->GC_NAME;
|
|
|
73 |
$get_date = $ligne->B_S_MAJFICHE;
|
|
|
74 |
$get_categ = $ligne->B_S_TYPESTR;
|
|
|
75 |
$get_categ_nom = $ligne->B_TYPSTR_LABEL;
|
|
|
76 |
|
|
|
77 |
$ret .= '<li>'."\n";
|
|
|
78 |
|
|
|
79 |
$ret .= '<b>';
|
|
|
80 |
$ret .= ColorizeFound($get_name, stripslashes($TabFinder['chaine']));
|
|
|
81 |
$ret .= '</b> ';
|
|
|
82 |
|
|
|
83 |
$ret .= '(';
|
|
|
84 |
$ret .= ColorizeFound($get_ville, strtoupper($TabFinder['geo']));
|
|
|
85 |
|
|
|
86 |
if (($get_ville != '') && ($get_pays != '')) {
|
|
|
87 |
$ret .= ' - ';
|
|
|
88 |
}
|
|
|
89 |
|
|
|
90 |
if (($get_pays == 'France') && ($get_cp != '')) {
|
|
|
91 |
// Calcul du code département pour la France
|
|
|
92 |
if ($get_cp < 97000) {
|
|
|
93 |
$calc_dpt = floor($get_cp / 1000);
|
|
|
94 |
} else {
|
|
|
95 |
$calc_dpt = floor($get_cp / 100);
|
|
|
96 |
}
|
|
|
97 |
$dpt_qu = 'SELECT GFD_NAME '.
|
|
|
98 |
'FROM '.$tbl['dpt'].' '.
|
|
|
99 |
'WHERE GFD_ID = '.$calc_dpt;
|
|
|
100 |
$do_dpt = mysql_query($dpt_qu) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $dpt_qu));
|
|
|
101 |
$nbr_dpt = mysql_num_rows($do_dpt);
|
|
|
102 |
if ($nbr_dpt == 1) {
|
|
|
103 |
$resu_dpt = mysql_fetch_object($do_dpt);
|
|
|
104 |
$nom_dpt = $resu_dpt->GFD_NAME;
|
|
|
105 |
} else {
|
|
|
106 |
return '<b>Erreur lors de la recherche du département :</b> '.$nbr_dpt.' départements trouvés.';
|
|
|
107 |
}
|
|
|
108 |
$ret .= ColorizeFound($nom_dpt, ucFirst($TabFinder['geo'])) . ' - ';
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
if ($get_pays != '') {
|
|
|
112 |
if ($TabFinder['geo'] != '') {
|
|
|
113 |
$ret .= ColorizeFound($get_pays, ucFirst($TabFinder['geo']));
|
|
|
114 |
} else {
|
|
|
115 |
$ret .= $get_pays;
|
|
|
116 |
}
|
|
|
117 |
}
|
|
|
118 |
|
|
|
119 |
$ret .= ') - '."\n";
|
|
|
120 |
|
|
|
121 |
if ($get_categ != '') {
|
|
|
122 |
$ret .= $get_categ_nom;
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
// Vérification de l'accès à la consultation avancée transversale de Bilblio Bota.
|
|
|
126 |
if ($var_biblio['open_biblio_str'] == true) {
|
|
|
127 |
$ret .= ' - <a href="'.BB_URL_COURANTE_CONSULTATION_AVANCEE.'&str='.$get_idstr.'&arg_0=str%3D'.$get_idstr.'&arg_1=coll%3D'.
|
|
|
128 |
$get_idstr.'&arg_2=book%3D'.$get_idstr.'&arg_3=media%3D'.$get_idstr.'">'.
|
|
|
129 |
'Plus d\'infos'.
|
|
|
130 |
'</a>';
|
|
|
131 |
}
|
|
|
132 |
|
|
|
133 |
if ($i < $nbr_final) {
|
|
|
134 |
$ret .= '<br /><br />';
|
|
|
135 |
}
|
|
|
136 |
$i++;
|
|
|
137 |
$ret .= '</li>'."\n";
|
|
|
138 |
}
|
|
|
139 |
$ret .= '</ul>'."\n";
|
|
|
140 |
|
|
|
141 |
// Vérification de l'accès à la proposition de nouvelles structures.
|
|
|
142 |
if ($var_biblio['open_proposer_str'] == true) {
|
|
|
143 |
$ret .= '<p class="bb_txt_centre">'.
|
|
|
144 |
'<hr size="1" />'.
|
|
|
145 |
'<a href="'.BB_URL_COURANTE_ADMIN.'&action=new&ensemble=str">'.'Proposer un nouvel organisme'.'</a>'.
|
|
|
146 |
'<hr size="1" />'.
|
|
|
147 |
'</p>'."\n";
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
return $ret;
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
154 |
*
|
|
|
155 |
* $Log: not supported by cvs2svn $
|
|
|
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
|
|
|
160 |
* Début mise en conformité avec la convention de codage et le standard XHTML Strict.
|
|
|
161 |
*
|
|
|
162 |
*
|
|
|
163 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
164 |
*/
|
|
|
165 |
?>
|