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_info_structure.inc.php,v 1.1 2004/09/16 12:06:31 jpm Exp $
|
2 |
jp_milcent |
23 |
/**
|
|
|
24 |
* Appli bb_consultation : gestion des informations avancées "structure" de Biblio Bota
|
|
|
25 |
*
|
|
|
26 |
* Ce fichier permet d'afficher les informations sur les organismes liés à la botanique.
|
|
|
27 |
*
|
|
|
28 |
*@package BiblioBota-Consultation
|
|
|
29 |
//Auteur original :
|
|
|
30 |
*@author Jean-Charles GRANGER <tela@vecteur.org>
|
|
|
31 |
//Autres auteurs :
|
|
|
32 |
*@author Jean-Pascal MILCENT <jpm@clapas.org>
|
|
|
33 |
*@copyright Tela-Botanica 2000-2004
|
30 |
mathias |
34 |
*@version $Revision: 1.1 $ $Date: 2004/09/16 12:06:31 $
|
2 |
jp_milcent |
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
// | CORPS du PROGRAMME |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
|
|
|
47 |
if ($var_biblio['open_proposer_str'] == 1) {
|
|
|
48 |
// Si Open Moderation est ouvert, alors proposer la modification des données
|
|
|
49 |
$the_url_edit = BB_URL_COURANTE_ADMIN.'&action=edit&ensemble=str&ref='.$tableau['str'];
|
|
|
50 |
$sortie .= '<p>'."\n";
|
|
|
51 |
$sortie .= '<a href="'.$the_url_edit.'">'."\n".
|
|
|
52 |
'<img class="'.BB_CLASS_IMG_MODIFIER.'" src="'.BB_IMG_MODIFIER.'" alt="'.'Modifier la fiche structure'.'" />'."\n".
|
|
|
53 |
'</a>'."\n";
|
|
|
54 |
$sortie .= '<a class="texte_tb2" href="'.$the_url_edit.'">'.'Corriger la fiche...'.'</a>'."\n";
|
|
|
55 |
$sortie .= '</p>'."\n";
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
$query = 'SELECT * '.
|
|
|
59 |
'FROM '.$tbl['str'].', '.$tbl['pays'].', '.$tbl['typestr'].' '.
|
|
|
60 |
'WHERE ('.$tbl['str'].'.B_S_IDSTR = '.$tableau['str'].') '.
|
|
|
61 |
'AND ('.$tbl['str'].'.B_S_TYPESTR = '.$tbl['typestr'].'.B_TYPSTR_ID) '.
|
|
|
62 |
'AND ('.$tbl['str'].'.B_S_PAYS = '.$tbl['pays'].'.GC_ID) '.
|
|
|
63 |
'AND ('.$tbl['pays'].'.GC_LOCALE = "'.$GLOBALS['_GEN_commun']['i18n'].'")';
|
|
|
64 |
$do_query = mysql_query($query) or die('<b>Erreur de requête (choix de structure)</b> : '.$query);
|
|
|
65 |
$nb = mysql_num_rows($do_query);
|
|
|
66 |
|
|
|
67 |
if ($nb == 0) {
|
|
|
68 |
$sortie .= '<p class="erreur">'.
|
|
|
69 |
'<b>Erreur !</b> :<br /><br/>aucune structure ne correspond à l\'identifiant str='.$tableau['str'].'.'.
|
|
|
70 |
'</p>'."\n";
|
|
|
71 |
} else if ($nb > 1) {
|
|
|
72 |
$sortie .= '<p class="erreur">'.
|
|
|
73 |
'<b>Erreur !</b> :<br /><br />le moteur bbc_information a trouvé plusieurs données pour l\'identifiant str='.$tableau['str'].'.'.
|
|
|
74 |
'</p>'."\n";
|
|
|
75 |
} else {
|
|
|
76 |
$row = mysql_fetch_object($do_query);
|
|
|
77 |
|
|
|
78 |
$get_nom = $row->B_S_NOM;
|
|
|
79 |
$get_sigle = $row->B_S_SIGLE;
|
|
|
80 |
$get_service = $row->B_S_SERVICE;
|
|
|
81 |
$get_typestr = $row->B_TYPSTR_LABEL;
|
|
|
82 |
$get_numtypestr = $row->B_S_TYPESTR;
|
|
|
83 |
$get_datecreation = $row->B_S_DATECREATION;
|
|
|
84 |
$get_nbrperso = $row->B_S_NBRPERSO;
|
|
|
85 |
$get_vocactiv = $row->B_S_VOCACTIV;
|
|
|
86 |
$get_adresse1 = $row->B_S_ADRESSE1;
|
|
|
87 |
$get_adresse2 = $row->B_S_ADRESSE2;
|
|
|
88 |
$get_cp = $row->B_S_CODEPOSTAL;
|
|
|
89 |
$get_ville = $row->B_S_VILLE;
|
|
|
90 |
$get_pays = $row->GC_NAME;
|
|
|
91 |
$get_tel = $row->B_S_TEL;
|
|
|
92 |
$get_fax = $row->B_S_FAX;
|
|
|
93 |
$get_mail = $row->B_S_MAIL;
|
|
|
94 |
$get_image = $row->B_S_IMAGE;
|
|
|
95 |
$get_comment = $row->B_S_COMMENT;
|
|
|
96 |
$get_majfiche = $row->B_S_MAJFICHE;
|
|
|
97 |
|
|
|
98 |
mysql_free_result($do_query);
|
|
|
99 |
|
|
|
100 |
// Titre de la structure
|
|
|
101 |
$sortie .= '<h1 class="titlePage">';
|
|
|
102 |
$sortie .= $get_nom;
|
|
|
103 |
if ($get_sigle != '') {
|
|
|
104 |
$sortie .= ' ('.$get_sigle.')';
|
|
|
105 |
}
|
|
|
106 |
$sortie .= '</h1>'."\n";
|
|
|
107 |
|
|
|
108 |
// Type de structure et vocation
|
|
|
109 |
$sortie .= '<h2 class="insTitle1">'.'Type de structure, vocation'.'</h2>'."\n";
|
|
|
110 |
$sortie .= '<p>'."\n";
|
|
|
111 |
if ($get_typestr != '') {
|
|
|
112 |
$sortie .= '<span class="champ_cle">'.'Type de structure :'.'</span> <span class="champ_valeur">'.$get_typestr.'</span>'."\n";
|
|
|
113 |
}
|
|
|
114 |
if ($get_vocactiv != '') {
|
|
|
115 |
if ($get_typestr != '') {
|
|
|
116 |
$sortie .= '<br />'."\n";
|
|
|
117 |
}
|
|
|
118 |
$sortie .= '<span class="champ_cle">'.'Vocation / Activité :'.'</span> <span class="champ_valeur">'.$get_vocactiv.'</span>'."\n";
|
|
|
119 |
}
|
|
|
120 |
$sortie .= '</p>'."\n";
|
|
|
121 |
|
|
|
122 |
// Bloc d'adresse
|
|
|
123 |
$sortie .= '<h2 class="insTitle1">'.'Adresse'.'</h2>'."\n";
|
|
|
124 |
$sortie .= '<p>'."\n";
|
|
|
125 |
|
|
|
126 |
if ($get_service != '') {
|
|
|
127 |
$sortie .= $get_service."\n";
|
|
|
128 |
}
|
|
|
129 |
if ($get_adresse1 != '') {
|
|
|
130 |
if ($get_service != '') {
|
|
|
131 |
$sortie .= '<br />'."\n";
|
|
|
132 |
}
|
|
|
133 |
$sortie .= $get_adresse1."\n";
|
|
|
134 |
}
|
|
|
135 |
|
|
|
136 |
if ($get_adresse2 != '') {
|
|
|
137 |
if (($get_service != '') || ($get_adresse1 != '')) {
|
|
|
138 |
$sortie .= '<br />'."\n";
|
|
|
139 |
}
|
|
|
140 |
$sortie .= $get_adresse2."\n";
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
if ($get_cp != '') {
|
|
|
144 |
if (($get_service != '') || ($get_adresse1 != '') || ($get_adresse2 != '')) {
|
|
|
145 |
$sortie .= '<br />'."\n";
|
|
|
146 |
}
|
|
|
147 |
$sortie .= $get_cp."\n";
|
|
|
148 |
}
|
|
|
149 |
|
|
|
150 |
if ($get_ville != '') {
|
|
|
151 |
$sortie .= ' '.$get_ville."\n";
|
|
|
152 |
}
|
|
|
153 |
|
|
|
154 |
if ($get_pays != '') {
|
|
|
155 |
if (($get_service != '') || ($get_adresse1 != '') || ($get_ville != '') || ($get_cp != '')) {
|
|
|
156 |
$sortie .= '<br />'."\n";
|
|
|
157 |
}
|
|
|
158 |
$sortie .= $get_pays."\n";
|
|
|
159 |
}
|
|
|
160 |
|
|
|
161 |
// Bloc contact
|
|
|
162 |
$sortie .= '<br /><br />'."\n";
|
|
|
163 |
|
|
|
164 |
if ($get_tel != '') {
|
|
|
165 |
$sortie .= '<span class="champ_cle">'.'Téléphone :'.'</span> <span class="champ_valeur">'.$get_tel.'</span>'."\n";
|
|
|
166 |
}
|
|
|
167 |
if ($get_fax != '') {
|
|
|
168 |
if ($get_tel != '') {
|
|
|
169 |
$sortie .= '<br />'."\n";
|
|
|
170 |
}
|
|
|
171 |
$sortie .= '<span class="champ_cle">'.'Fax :'.'</span> <span class="champ_valeur">'.$get_fax.'</span>'."\n";
|
|
|
172 |
}
|
|
|
173 |
|
|
|
174 |
if ($get_mail != '') {
|
|
|
175 |
if (($get_fax != '') || ($get_tel != '')) {
|
|
|
176 |
$sortie .= '<br />'."\n";
|
|
|
177 |
}
|
|
|
178 |
$sortie .= '<span class="champ_cle">'.'Courriel :'.'</span> '.
|
|
|
179 |
'<span class="champ_valeur"> '.
|
|
|
180 |
'<a href="mailto:'.$get_mail.'">'.$get_mail.'</a>'.
|
|
|
181 |
'</span>'."\n";
|
|
|
182 |
}
|
|
|
183 |
|
|
|
184 |
// Logo ou image de la structure
|
|
|
185 |
if ($get_image != '') {
|
|
|
186 |
$sortie .= '<img class="bb_img_structure" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$get_image.'" '.
|
|
|
187 |
'alt="'.'Illustration de la structure : '.$get_nom.'" />';
|
|
|
188 |
}
|
|
|
189 |
$sortie .= '</p>'."\n";
|
|
|
190 |
|
|
|
191 |
// Bloc info supplémentaires
|
|
|
192 |
if ($get_nbrperso > 0 OR $get_datecreation > 0 OR $get_comment != '') {
|
|
|
193 |
$sortie .= '<h2 class="insTitle1">'.'Informations supplémentaires'.'</h2>'."\n";
|
|
|
194 |
$sortie .= '<p>'."\n";
|
|
|
195 |
// Calcul de la date de création
|
|
|
196 |
if ($get_datecreation > 0) {
|
|
|
197 |
$sortie .= '<span class="champ_cle">'.'Date de création :'.'</span> '.
|
|
|
198 |
'<span class="champ_valeur">'.FormateDateYYYYMMJJ($get_datecreation).'</span>'."\n";
|
|
|
199 |
}
|
|
|
200 |
// Nbre de salariés ou de membres
|
|
|
201 |
if ($get_nbrperso > 0) {
|
|
|
202 |
if ($get_datecreation > 0) {
|
|
|
203 |
$sortie .= '<br />'."\n";
|
|
|
204 |
}
|
|
|
205 |
if ($get_numtypestr == 3) {
|
|
|
206 |
$sticker = 'salariés';
|
|
|
207 |
} else {
|
|
|
208 |
$sticker = 'membres';
|
|
|
209 |
}
|
|
|
210 |
$sortie .= '<span class="champ_cle">'.'Nombre de '.$sticker.' :'.'</span> '.
|
|
|
211 |
'<span class="champ_valeur">'.$get_nbrperso.'</span>'."\n";
|
|
|
212 |
}
|
|
|
213 |
// Info - commentaires
|
|
|
214 |
if ($get_comment != '') {
|
|
|
215 |
if (($get_datecreation > 0) || ($get_nbrperso > 0)) {
|
|
|
216 |
$sortie .= '<br />'."\n";
|
|
|
217 |
}
|
|
|
218 |
$sortie .= '<span class="champ_cle">'.'Informations complémentaires :'.'</span> '.
|
|
|
219 |
'<span class="champ_valeur">'.$get_comment.'</span>'."\n";
|
|
|
220 |
}
|
|
|
221 |
$sortie .= '</p>'."\n";
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
// A partir d'ici on affiche les liens de la structure
|
|
|
225 |
$sortie .= '<h2 class="insTitle1">'.'Liens web'.'</h2>'."\n";
|
|
|
226 |
$sortie .= '<p>'."\n";
|
|
|
227 |
$query_lk = 'SELECT '.$tbl['link'].'.* '.
|
|
|
228 |
'FROM '.$tbl['link'].' '.
|
|
|
229 |
'WHERE '.$tbl['link'].'.B_L_LKSTR = '.$tableau['str'].' '.
|
|
|
230 |
'AND B_L_CACHER = 0 '.
|
|
|
231 |
'ORDER BY B_L_TITRE';
|
|
|
232 |
$do_query_lk = mysql_query($query_lk) or die('<b>Erreur de requête (liens web)</b> : '.$query_lk);
|
|
|
233 |
$nb_lk = mysql_num_rows($do_query_lk);
|
|
|
234 |
|
|
|
235 |
if ($nb_lk == 0) {
|
|
|
236 |
$sortie .= 'Pas de lien web référencé.';
|
|
|
237 |
} else {
|
|
|
238 |
$o = 1;
|
|
|
239 |
while ($row = mysql_fetch_object($do_query_lk)) {
|
|
|
240 |
$idlink = $row->B_L_IDLINK;
|
|
|
241 |
$titrelink = $row->B_L_TITRE;
|
|
|
242 |
$urllink = $row->B_L_URL;
|
|
|
243 |
$resumlink = $row->B_L_RESUMCLE;
|
|
|
244 |
$comlink = $row->B_L_COMMENT;
|
|
|
245 |
$datelink = $row->B_L_MAJFICHE;
|
|
|
246 |
$get_part = $row->B_L_PARTENAIRE;
|
|
|
247 |
$get_ref = $row->B_L_REFERENCE;
|
|
|
248 |
|
|
|
249 |
$sortie .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'" /> '."\n";
|
|
|
250 |
|
|
|
251 |
$sortie .= '<a href="'.$urllink.'" target="_blank">';
|
|
|
252 |
if ($titrelink != '') {
|
|
|
253 |
$sortie .= $titrelink;
|
|
|
254 |
} else {
|
|
|
255 |
$sortie .= $urllink;
|
|
|
256 |
}
|
|
|
257 |
$sortie .= '</a>'."\n";
|
|
|
258 |
|
|
|
259 |
if ($resumlink != '') {
|
|
|
260 |
$sortie .= ' - '.$resumlink;
|
|
|
261 |
}
|
|
|
262 |
if ($comlink != '') {
|
|
|
263 |
$sortie .= ' - '.$comlink;
|
|
|
264 |
}
|
|
|
265 |
// if ($datelink > 0) $sortie .= " [".date('d/m/Y',$datelink)."]";
|
|
|
266 |
|
|
|
267 |
if (($nb_lk - $o) > 0) {
|
|
|
268 |
$sortie .= '<br />'."\n";
|
|
|
269 |
}
|
|
|
270 |
if ($get_ref == 1) {
|
|
|
271 |
$sortie .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
|
|
|
272 |
}
|
|
|
273 |
if ($get_part == 1) {
|
|
|
274 |
$sortie .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
|
|
|
275 |
}
|
|
|
276 |
$o++;
|
|
|
277 |
}
|
|
|
278 |
}
|
|
|
279 |
$sortie .= '</p>'."\n";
|
|
|
280 |
mysql_free_result($do_query_lk);
|
|
|
281 |
|
|
|
282 |
// Là on affiche les Voir Aussi Structures ... si y'en a
|
|
|
283 |
$UnVoirAussi = new VoirAussi($tableau['str'],$tbl['str']);
|
|
|
284 |
if ($UnVoirAussi->NbVA > 0) {
|
|
|
285 |
$liste_va = $UnVoirAussi->ListerVoirAussi();
|
|
|
286 |
$sortie .= '<h2 class="insTitle1">'.'Voir Aussi'.'</h2>'."\n";
|
|
|
287 |
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
|
|
|
288 |
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
|
|
|
289 |
$sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
|
|
|
290 |
if ($liste_va[$i]['desc'] != '') {
|
|
|
291 |
$sortie .= ' - '.'<i>'.$liste_va[$i]['desc'].'</i>';
|
|
|
292 |
}
|
|
|
293 |
if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
|
|
|
294 |
$sortie .= '<br />'."\n";
|
|
|
295 |
}
|
|
|
296 |
}
|
|
|
297 |
$sortie .= '<br />'."\n";
|
|
|
298 |
}
|
|
|
299 |
|
|
|
300 |
// Affichage des méta données
|
|
|
301 |
$sortie .= '<p class="bb_txt_centre texte_inactif">'.
|
|
|
302 |
'Dernière mise à jour de la fiche : '.date('d/m/Y',$get_majfiche).' - fiche '.$tableau['str'].
|
|
|
303 |
'</p>'."\n\n";
|
|
|
304 |
}
|
|
|
305 |
|
|
|
306 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
307 |
*
|
30 |
mathias |
308 |
* $Log: bbc_info_structure.inc.php,v $
|
2 |
jp_milcent |
309 |
* Revision 1.1 2004/09/16 12:06:31 jpm
|
|
|
310 |
* Décomposition du fichier information en plusieurs fichiers.
|
|
|
311 |
*
|
|
|
312 |
*
|
|
|
313 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
314 |
*/
|
|
|
315 |
?>
|