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_info_fascicule.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
|
|
|
23 |
/**
|
|
|
24 |
* Appli bb_consultation : gestion des informations avancées "fascicule" de Biblio Bota
|
|
|
25 |
*
|
|
|
26 |
* Ce fichier permet d'afficher les informations concernant les "fascicules" d'un organisme lié à 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
|
|
|
34 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
|
|
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
36 |
*/
|
|
|
37 |
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
// | ENTETE du PROGRAMME |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
// | CORPS du PROGRAMME |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
|
|
|
47 |
global $locusfasc;
|
|
|
48 |
// DEBUT FASCICULE
|
|
|
49 |
|
|
|
50 |
// $unex est composé de :
|
|
|
51 |
// - [0] nom de collection
|
|
|
52 |
// - [1] point de départ de la requete
|
|
|
53 |
|
|
|
54 |
$unex = explode('-', $tableau['fasc']);
|
|
|
55 |
|
|
|
56 |
$tableau['locusfasc'] = $locusfasc;
|
|
|
57 |
if ($tableau['locusfasc'] == '') {
|
|
|
58 |
$tableau['locusfasc'] = 0;
|
|
|
59 |
}
|
|
|
60 |
$requete = 'SELECT '.$tbl['str'].'.B_S_IDSTR,'.$tbl['str'].'.B_S_NOM, '.$tbl['collection'].'.B_C_NOMCOMPLET '.
|
|
|
61 |
'FROM '.$tbl['str'].', '.$tbl['collection'].' '.
|
|
|
62 |
'WHERE '.$tbl['str'].'.B_S_IDSTR = '.$tbl['collection'].'.B_C_LKSTR '.
|
|
|
63 |
'AND B_C_CRAI = "'.$unex[0].'"';
|
|
|
64 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
65 |
$nb_titre = mysql_num_rows($resultat);
|
|
|
66 |
|
|
|
67 |
if ($nb_titre != 1) {
|
|
|
68 |
$sortie .= '<p class="erreur"><strong>'.'Erreur de récupération des noms (str et coll)'.'</stong>'.' : '.
|
|
|
69 |
$requete.' '.'donne'.' '.$nb_titre.' '.'résultats'.'</p>'."\n";
|
|
|
70 |
} else {
|
|
|
71 |
$ligne = mysql_fetch_object($resultat);
|
|
|
72 |
$le_numero = $ligne->B_S_IDSTR;
|
|
|
73 |
$le_nom = $ligne->B_S_NOM;
|
|
|
74 |
$la_coll = $ligne->B_C_NOMCOMPLET;
|
|
|
75 |
mysql_free_result($resultat);
|
|
|
76 |
|
|
|
77 |
$tableau['args'] = '&arg_0=str%3D'.$le_numero.'&arg_1=coll%3D'.$le_numero.
|
|
|
78 |
'&arg_2=book%3D'.$le_numero.'&arg_3=media%3D'.$le_numero;
|
|
|
79 |
$tableau['pass'] = $le_numero;
|
|
|
80 |
|
|
|
81 |
if ($tableau['locusfasc'] > 0) {
|
|
|
82 |
$tableau['pstart'] = $tableau['locusfasc'];
|
|
|
83 |
$depart = $tableau['locusfasc'];
|
|
|
84 |
} else {
|
|
|
85 |
$depart = $tableau['pstart'];
|
|
|
86 |
}
|
|
|
87 |
if ($depart == '') {
|
|
|
88 |
$depart = 0;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
// Affichage de la navigation avancée : retour aux collections
|
|
|
92 |
$sortie .= CreateNavigBiblio('goback', 'coll', $tableau, 'Retour aux périodiques', 1);
|
|
|
93 |
|
|
|
94 |
// Affichage du titre de la page
|
|
|
95 |
$sortie .= '<h1>'.$le_nom.' '.':'.' '.'fascicules'.'</h1>'."\n";
|
|
|
96 |
$sortie .= '<h2>'.'du périodique'.' '.$la_coll.'</h2>'."\n";
|
|
|
97 |
|
|
|
98 |
// Comptage du nombre total de données
|
|
|
99 |
$requete = 'SELECT COUNT(*) AS COMPTE '.
|
|
|
100 |
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].' '.
|
|
|
101 |
'WHERE B_SER_CRAICOLL = B_F_CRAICOLL '.
|
|
|
102 |
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
|
|
|
103 |
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
|
|
|
104 |
'AND B_F_CACHER = 0';
|
|
|
105 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
106 |
$ligne = mysql_fetch_object($resultat);
|
|
|
107 |
$num_c = $ligne->COMPTE;
|
|
|
108 |
mysql_free_result($resultat);
|
|
|
109 |
|
|
|
110 |
$requete = 'SELECT '.$tbl['serie'].'.*, '.$tbl['fascicule'].'.*, '.$tbl['collection'].'.* '.
|
|
|
111 |
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].', '.$tbl['collection'].' '.
|
|
|
112 |
'WHERE B_C_CRAI = B_SER_CRAICOLL '.
|
|
|
113 |
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
|
|
|
114 |
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
|
|
|
115 |
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
|
|
|
116 |
'ORDER BY B_F_NUMERO DESC '.
|
|
|
117 |
'LIMIT '.$depart.', '.$var_biblio['how_bloc'];
|
|
|
118 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
119 |
$num = mysql_num_rows($resultat);
|
|
|
120 |
|
|
|
121 |
// Affichage du nombre de résultat trouvé
|
|
|
122 |
$tableau['step'] = $var_biblio['how_bloc'];
|
|
|
123 |
$tableau['pend'] = $num_c;
|
|
|
124 |
$tableau['libelle'] = 'fascicule';
|
|
|
125 |
$tableau['feminin'] = 0;
|
|
|
126 |
$tableau['locusfasc'] = $tableau['pstart'];
|
|
|
127 |
|
|
|
128 |
$sortie .= '<p id="frag_nbre_resultat">';
|
|
|
129 |
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $num, $num_c);
|
|
|
130 |
$sortie .= '</p>'."\n";
|
|
|
131 |
|
|
|
132 |
// Fragmenteur de pages, pour une navigation plus facile
|
|
|
133 |
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE.'&fasc='.$tableau['fasc']);
|
|
|
134 |
|
|
|
135 |
$frag_txt = $frag->fragmente($tableau, $num_c);
|
|
|
136 |
if (($frag->nb_pages)>1) {
|
|
|
137 |
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
$sortie .= '<ul id="bb_liste_fascicule">'."\n";
|
|
|
141 |
while ($ligne = mysql_fetch_object($resultat)) {
|
|
|
142 |
$nom = $ligne->B_C_NOMCOMPLET;
|
|
|
143 |
$crai = $ligne->B_F_CRAICOLL;
|
|
|
144 |
$serie = $ligne->B_F_CRAISERIE;
|
|
|
145 |
$titreserie = $ligne->B_SER_SOUSTITRE;
|
|
|
146 |
$fasc = $ligne->B_F_NUMERO;
|
|
|
147 |
$titre = $ligne->B_F_TITRE;
|
|
|
148 |
$nbpages = $ligne->B_F_NBPAGES;
|
|
|
149 |
$date = $ligne->B_F_DATE;
|
|
|
150 |
$image = $ligne->B_F_IMAGE;
|
|
|
151 |
$comment = $ligne->B_F_COMMENT;
|
|
|
152 |
$datemaj = $ligne->B_F_MAJFICHE;
|
|
|
153 |
|
|
|
154 |
$tableau['pass'] = $crai.'-'.$serie.'-'.$fasc;
|
|
|
155 |
|
|
|
156 |
$sortie .= '<li>'."\n";
|
|
|
157 |
|
|
|
158 |
// Affichage de l'image du fascicule
|
|
|
159 |
if ($image != '') {
|
|
|
160 |
$sortie .= '<img class="bb_img_fascicule" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" alt="'.'Image de la couverture du fascicule'.'" />'."\n";
|
|
|
161 |
}
|
|
|
162 |
|
|
|
163 |
// Affichage des informations sur le fascicule
|
|
|
164 |
$sortie .= '<b>'.$nom.'</b>';
|
|
|
165 |
if ($titreserie != '') {
|
|
|
166 |
$sortie .= ', <b>'.$titreserie.'</b>';
|
|
|
167 |
}
|
|
|
168 |
$sortie .= ', '.$titre."\n";
|
|
|
169 |
|
|
|
170 |
if ($date > 0) {
|
|
|
171 |
$sortie .= ' - '.FormateDateYYYYMMJJ($date);
|
|
|
172 |
}
|
|
|
173 |
if ($nbpages > 0) {
|
|
|
174 |
$sortie .= ' - '.$nbpages.' p.';
|
|
|
175 |
}
|
|
|
176 |
if ($comment != '') {
|
|
|
177 |
$sortie .= ' - '.$comment;
|
|
|
178 |
}
|
|
|
179 |
|
|
|
180 |
// Comptage du nombre d'articles indexés pour le fascicule
|
|
|
181 |
$query_ser = 'SELECT COUNT(*) AS CPT '.
|
|
|
182 |
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
|
|
|
183 |
'WHERE B_A_CRAICOLL = "'.$crai.'" '.
|
|
|
184 |
'AND B_A_CRAISERIE = '.$serie.' '.
|
|
|
185 |
'AND B_A_CRAIFASC = "'.$fasc.'" '.
|
|
|
186 |
'AND B_I_IDITEM = B_A_IDART '.
|
|
|
187 |
'AND B_I_CACHER = 0';
|
|
|
188 |
|
|
|
189 |
$result_ser = mysql_query($query_ser) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_ser));
|
|
|
190 |
$nb_ser = mysql_num_rows($result_ser);
|
|
|
191 |
|
|
|
192 |
if($nb_ser != 1) {
|
|
|
193 |
die ('<p><b>'.'Echec du programme'.' '.':'.' '.'</b> '.'Nombre de comptages incohérent'.' '.'('.$nb_ser.')'.'</p>'."\n");
|
|
|
194 |
}
|
|
|
195 |
$row_ser = mysql_fetch_object($result_ser);
|
|
|
196 |
$intobiblio = $row_ser->CPT;
|
|
|
197 |
mysql_free_result($result_ser);
|
|
|
198 |
|
|
|
199 |
// Affichage de la consultation des articles
|
|
|
200 |
if ($intobiblio > 1) {
|
|
|
201 |
$pluriel_art = 's';
|
|
|
202 |
} else {
|
|
|
203 |
$pluriel_art = '';
|
|
|
204 |
}
|
|
|
205 |
if ($intobiblio > 0) {
|
|
|
206 |
$sortie .= CreateNavigBiblio('goto', 'art', $tableau, $intobiblio.' article'.$pluriel_art.' '.'indexé'.$pluriel_art, 0);
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
// Affichage des Voir Aussi Fascicules ... s'il y'en a
|
|
|
210 |
$UnVoirAussi = new VoirAussi($crai.'-'.$serie.'-'.$fasc, $tbl['fascicule']);
|
|
|
211 |
if ($UnVoirAussi->NbVA > 0) {
|
|
|
212 |
$sortie .= ' '.'-'.' '.'Consulter'.' '.':'.' ';
|
|
|
213 |
$liste_va = $UnVoirAussi->ListerVoirAussi();
|
|
|
214 |
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
|
|
|
215 |
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
|
|
|
216 |
$sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
|
|
|
217 |
if ($liste_va[$i]['desc'] != '') {
|
|
|
218 |
$ret .= ' - '.'<em>'.$liste_va[$i]['desc'].'</em>';
|
|
|
219 |
}
|
|
|
220 |
}
|
|
|
221 |
}
|
|
|
222 |
$sortie .= '</li>'."\n";
|
|
|
223 |
}
|
|
|
224 |
$sortie .= '</ul>'."\n";
|
|
|
225 |
mysql_free_result($resultat);
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
229 |
*
|
|
|
230 |
* $Log: not supported by cvs2svn $
|
|
|
231 |
*
|
|
|
232 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
233 |
*/
|
|
|
234 |
?>
|