1 | <?php |
---|
2 | // +-------------------------------------------------+ |
---|
3 | // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net) |
---|
4 | // +-------------------------------------------------+ |
---|
5 | // $Id: export.inc.php,v 1.20 2013-04-17 08:37:34 mbertin Exp $ |
---|
6 | |
---|
7 | if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access"); |
---|
8 | |
---|
9 | require_once("$class_path/marc_table.class.php"); |
---|
10 | require_once("$class_path/category.class.php"); |
---|
11 | function _export_($id,$keep_expl=0,$params=array()) { |
---|
12 | global $charset; |
---|
13 | $requete="select * from notices where notice_id=$id"; |
---|
14 | $resultat=mysql_query($requete); |
---|
15 | |
---|
16 | $rn=mysql_fetch_object($resultat); |
---|
17 | |
---|
18 | $dt=$rn->typdoc; |
---|
19 | $bl=$rn->niveau_biblio; |
---|
20 | |
---|
21 | $notice.="<notice>\n"; |
---|
22 | $notice.=" <rs>n</rs>\n"; |
---|
23 | $notice.=" <dt>".$dt."</dt>\n"; |
---|
24 | $notice.=" <bl>".$bl."</bl>\n"; |
---|
25 | $notice.=" <hl>*</hl>\n"; |
---|
26 | $notice.=" <el>1</el>\n"; |
---|
27 | $notice.=" <ru>i</ru>\n"; |
---|
28 | |
---|
29 | |
---|
30 | //ISBN ou autre et PRIX |
---|
31 | if ($rn->code || $rn->prix ) { |
---|
32 | $notice_prix_code_temp=""; |
---|
33 | if ($rn->code) $notice_prix_code_temp.=" <s c='a'>".htmlspecialchars($rn->code,ENT_QUOTES,$charset)."</s>\n"; |
---|
34 | if ($rn->prix) $notice_prix_code_temp.=" <s c='d'>".htmlspecialchars($rn->prix,ENT_QUOTES,$charset)."</s>\n"; |
---|
35 | if ($notice_prix_code_temp) |
---|
36 | $notice.=" <f c='010' ind=' '>\n".$notice_prix_code_temp." </f>\n"; |
---|
37 | } |
---|
38 | |
---|
39 | //Langues |
---|
40 | $notice_langue_temp=""; |
---|
41 | $notice_org_langue_temp=""; |
---|
42 | $rqttmp_lang = "select code_langue from notices_langues where num_notice='$rn->notice_id' and type_langue=0 order by ordre_langue "; |
---|
43 | $restmp_lang = mysql_query($rqttmp_lang); |
---|
44 | while ($tmp_lang = mysql_fetch_object($restmp_lang)) $notice_langue_temp.=" <s c='a'>".htmlspecialchars($tmp_lang->code_langue,ENT_QUOTES,$charset)."</s>\n"; |
---|
45 | |
---|
46 | $rqttmp_lang = "select code_langue from notices_langues where num_notice='$rn->notice_id' and type_langue=1 order by ordre_langue "; |
---|
47 | $restmp_lang = mysql_query($rqttmp_lang); |
---|
48 | while ($tmp_lang = mysql_fetch_object($restmp_lang)) $notice_org_langue_temp.=" <s c='c'>".htmlspecialchars($tmp_lang->code_langue,ENT_QUOTES,$charset)."</s>\n"; |
---|
49 | |
---|
50 | if ($notice_langue_temp || $notice_org_langue_temp) { |
---|
51 | $notice.=" <f c='101' ind=' '>\n"; |
---|
52 | $notice.=$notice_langue_temp ; |
---|
53 | $notice.=$notice_org_langue_temp ; |
---|
54 | $notice.=" </f>\n"; |
---|
55 | } |
---|
56 | |
---|
57 | //Titres |
---|
58 | if ($rn->tit1) { |
---|
59 | $notice.=" <f c='200' ind='1 '>\n"; |
---|
60 | $notice.=" <s c='a'>".htmlspecialchars($rn->tit1,ENT_QUOTES,$charset)."</s>\n"; |
---|
61 | if ($rn->tit2) { |
---|
62 | $notice.=" <s c='c'>".htmlspecialchars($rn->tit2,ENT_QUOTES,$charset)."</s>\n"; |
---|
63 | } |
---|
64 | if ($rn->tit3) { |
---|
65 | $notice.=" <s c='d'>".htmlspecialchars($rn->tit3,ENT_QUOTES,$charset)."</s>\n"; |
---|
66 | } |
---|
67 | if ($rn->tit4) { |
---|
68 | $notice.=" <s c='e'>".htmlspecialchars($rn->tit4,ENT_QUOTES,$charset)."</s>\n"; |
---|
69 | } |
---|
70 | $notice.=" </f>\n"; |
---|
71 | } |
---|
72 | |
---|
73 | //Mention d'édition |
---|
74 | if ($rn->mention_edition) { |
---|
75 | $notice.=" <f c='205' ind=' '>\n"; |
---|
76 | $notice.=" <s c='a'>".htmlspecialchars($rn->mention_edition,ENT_QUOTES,$charset)."</s>\n"; |
---|
77 | $notice.=" </f>\n"; |
---|
78 | } |
---|
79 | |
---|
80 | //Editeur |
---|
81 | if ($rn->ed1_id) { |
---|
82 | $requete="select * from publishers where ed_id=".$rn->ed1_id; |
---|
83 | $resultat=mysql_query($requete); |
---|
84 | $red=mysql_fetch_object($resultat); |
---|
85 | $notice.=" <f c='210' ind=' '>\n"; |
---|
86 | $notice.=" <s c='c'>".htmlspecialchars($red->ed_name,ENT_QUOTES,$charset)."</s>\n"; |
---|
87 | if ($red->ed_ville) $notice.=" <s c='a'>".htmlspecialchars($red->ed_ville,ENT_QUOTES,$charset)."</s>\n"; |
---|
88 | //Year |
---|
89 | if ($rn->year) { |
---|
90 | $notice.=" <s c='d'>".htmlspecialchars($rn->year,ENT_QUOTES,$charset)."</s>\n"; |
---|
91 | } |
---|
92 | $notice.=" </f>\n"; |
---|
93 | } |
---|
94 | if ($rn->ed2_id) { |
---|
95 | $requete="select * from publishers where ed_id=".$rn->ed2_id; |
---|
96 | $resultat=mysql_query($requete); |
---|
97 | $red=mysql_fetch_object($resultat); |
---|
98 | $notice.=" <f c='210' ind=' '>\n"; |
---|
99 | $notice.=" <s c='c'>".htmlspecialchars($red->ed_name,ENT_QUOTES,$charset)."</s>\n"; |
---|
100 | if ($red->ed_ville) $notice.=" <s c='a'>".htmlspecialchars($red->ed_ville,ENT_QUOTES,$charset)."</s>\n"; |
---|
101 | $notice.=" </f>\n"; |
---|
102 | } |
---|
103 | |
---|
104 | //Collation |
---|
105 | if ($rn->npages || $rn->ill || $rn->size || $rn->accomp) { |
---|
106 | $notice.=" <f c='215' ind=' '>\n"; |
---|
107 | if ($rn->npages) $notice.=" <s c='a'>".htmlspecialchars($rn->npages,ENT_QUOTES,$charset)."</s>\n"; |
---|
108 | if ($rn->ill) $notice.=" <s c='c'>".htmlspecialchars($rn->ill,ENT_QUOTES,$charset)."</s>\n"; |
---|
109 | if ($rn->size) $notice.=" <s c='d'>".htmlspecialchars($rn->size,ENT_QUOTES,$charset)."</s>\n"; |
---|
110 | if ($rn->accomp) $notice.=" <s c='e'>".htmlspecialchars($rn->accomp,ENT_QUOTES,$charset)."</s>\n"; |
---|
111 | $notice.=" </f>\n"; |
---|
112 | } |
---|
113 | |
---|
114 | //Collection |
---|
115 | if ($rn->coll_id) { |
---|
116 | $requete="select collection_name from collections where collection_id=".$rn->coll_id; |
---|
117 | $resultat=mysql_query($requete); |
---|
118 | $notice.=" <f c='225' ind=' '>\n"; |
---|
119 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,0,0),ENT_QUOTES,$charset)."</s>\n"; |
---|
120 | //sous-collection |
---|
121 | if ($rn->subcoll_id){ |
---|
122 | $requete="select * from sub_collections where sub_coll_id=".$rn->subcoll_id; |
---|
123 | $resultat=mysql_query($requete); |
---|
124 | $subcoll=mysql_fetch_object($resultat); |
---|
125 | $notice.=" <s c='i'>".htmlspecialchars($subcoll->sub_coll_name,ENT_QUOTES,$charset)."</s>\n"; |
---|
126 | } |
---|
127 | if ($rn->nocoll) $notice.=" <s c='v'>".htmlspecialchars($rn->nocoll,ENT_QUOTES,$charset)."</s>\n"; |
---|
128 | $notice.=" </f>\n"; |
---|
129 | } |
---|
130 | |
---|
131 | //Notes |
---|
132 | //Générale |
---|
133 | if ($rn->n_gen) { |
---|
134 | $notice.=" <f c='300' ind=' '>\n"; |
---|
135 | $notice.=" <s c='a'>".htmlspecialchars($rn->n_gen,ENT_QUOTES,$charset)."</s>\n"; |
---|
136 | $notice.=" </f>\n"; |
---|
137 | } |
---|
138 | //de contenu |
---|
139 | if ($rn->n_contenu) { |
---|
140 | $notice.=" <f c='327' ind=' '>\n"; |
---|
141 | $notice.=" <s c='a'>".htmlspecialchars($rn->n_contenu,ENT_QUOTES,$charset)."</s>\n"; |
---|
142 | $notice.=" </f>\n"; |
---|
143 | } |
---|
144 | //Résumé |
---|
145 | if ($rn->n_resume) { |
---|
146 | $notice.=" <f c='330' ind=' '>\n"; |
---|
147 | $notice.=" <s c='a'>".htmlspecialchars($rn->n_resume,ENT_QUOTES,$charset)."</s>\n"; |
---|
148 | $notice.=" </f>\n"; |
---|
149 | } |
---|
150 | |
---|
151 | //dewey |
---|
152 | if ($rn->indexint) { |
---|
153 | $requete = "select * from indexint where indexint_id=".$rn -> indexint; |
---|
154 | $resultat = mysql_query($requete); |
---|
155 | if ($code_dewey=mysql_fetch_object($resultat)) { |
---|
156 | $notice.=" <f c='676' ind=' '>\n"; |
---|
157 | $notice.=" <s c='a'>".htmlspecialchars( $code_dewey -> indexint_name,ENT_QUOTES,$charset)."</s>\n"; |
---|
158 | $notice.=" <s c='l'>".htmlspecialchars( $code_dewey -> indexint_comment,ENT_QUOTES,$charset)."</s>\n"; |
---|
159 | $notice.=" </f>\n"; |
---|
160 | } |
---|
161 | } |
---|
162 | |
---|
163 | //Titre de série |
---|
164 | $serie=""; |
---|
165 | if ($rn->tparent_id!=0 || $rn->tnvol!==false) { |
---|
166 | $requete="select serie_name from series where serie_id=".$rn->tparent_id; |
---|
167 | $resultat=mysql_query($requete); |
---|
168 | if (mysql_num_rows($resultat)) $serie=mysql_result($resultat,0,0); |
---|
169 | $notice_461temp=""; |
---|
170 | if ($serie!=="") $notice_461temp.=" <s c='t'>".htmlspecialchars($serie,ENT_QUOTES,$charset)."</s>\n"; |
---|
171 | if ($rn->tnvol) $notice_461temp.=" <s c='v'>".htmlspecialchars($rn->tnvol,ENT_QUOTES,$charset)."</s>\n"; |
---|
172 | if ($notice_461temp) $notice.=" <f c='461' ind=' '>\n".$notice_461temp." </f>\n"; |
---|
173 | } |
---|
174 | |
---|
175 | //Auteurs |
---|
176 | $requete = "SELECT author_name, author_rejete, author_type, responsability_fonction, responsability_type "; |
---|
177 | $requete .= "FROM authors, responsability where responsability_notice=$id and responsability_author=author_id "; |
---|
178 | $requete .= "ORDER BY responsability_type, responsability_ordre, author_type, responsability_fonction"; |
---|
179 | $resultat=mysql_query($requete); |
---|
180 | if (mysql_num_rows($resultat)) { |
---|
181 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
182 | $resptype=mysql_result($resultat,$i, 4); |
---|
183 | $prenom=mysql_result($resultat,$i, 1); |
---|
184 | if (!$resptype) { |
---|
185 | //Auteur principal |
---|
186 | $notice.=" <f c='700' ind=' '>\n"; |
---|
187 | |
---|
188 | if (!$prenom) { |
---|
189 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
190 | } |
---|
191 | else { |
---|
192 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
193 | $notice.=" <s c='b'>".htmlspecialchars(mysql_result($resultat,$i, 1),ENT_QUOTES,$charset)."</s>\n"; |
---|
194 | } |
---|
195 | $notice.=" <s c='4'>".htmlspecialchars(mysql_result($resultat,$i, 3),ENT_QUOTES,$charset)."</s>\n"; |
---|
196 | $notice.=" </f>\n"; |
---|
197 | } |
---|
198 | if ($resptype==1) { |
---|
199 | //Co-auteurs |
---|
200 | $notice.=" <f c='701' ind=' '>\n"; |
---|
201 | if (!$prenom) { |
---|
202 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
203 | } |
---|
204 | else { |
---|
205 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
206 | $notice.=" <s c='b'>".htmlspecialchars(mysql_result($resultat,$i, 1),ENT_QUOTES,$charset)."</s>\n"; |
---|
207 | } |
---|
208 | $notice.=" <s c='4'>".htmlspecialchars(mysql_result($resultat,$i, 3),ENT_QUOTES,$charset)."</s>\n"; |
---|
209 | $notice.=" </f>\n"; |
---|
210 | } |
---|
211 | if ($resptype==2) { |
---|
212 | //Auteurs secondaires |
---|
213 | $notice.=" <f c='702' ind=' '>\n"; |
---|
214 | if (!$prenom) { |
---|
215 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
216 | } |
---|
217 | else { |
---|
218 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i, 0),ENT_QUOTES,$charset)."</s>\n"; |
---|
219 | $notice.=" <s c='b'>".htmlspecialchars(mysql_result($resultat,$i, 1),ENT_QUOTES,$charset)."</s>\n"; |
---|
220 | } |
---|
221 | $notice.=" <s c='4'>".htmlspecialchars(mysql_result($resultat,$i, 3),ENT_QUOTES,$charset)."</s>\n"; |
---|
222 | $notice.=" </f>\n"; |
---|
223 | } |
---|
224 | } |
---|
225 | } |
---|
226 | |
---|
227 | //Lien |
---|
228 | if ($rn->lien) { |
---|
229 | $notice.=" <f c='856' ind=' '>\n"; |
---|
230 | $notice.=" <s c='u'>".htmlspecialchars($rn->lien,ENT_QUOTES,$charset)."</s>\n"; |
---|
231 | if ($rn->eformat) $notice.=" <s c='q'>".htmlspecialchars($rn->eformat,ENT_QUOTES,$charset)."</s>\n"; |
---|
232 | $notice.=" </f>\n"; |
---|
233 | } |
---|
234 | |
---|
235 | |
---|
236 | //Périodique |
---|
237 | if ($rn->niveau_biblio=="a") { |
---|
238 | //Récupération du titre du périodique |
---|
239 | $requete="select tit1,bulletin_numero,bulletin_notice,mention_date, date_date, bulletin_titre from notices, bulletins, analysis where analysis_notice=$id and analysis_bulletin=bulletin_id and bulletin_notice=notice_id"; |
---|
240 | $resultat=mysql_query($requete); |
---|
241 | $r_bull=@mysql_fetch_object($resultat); |
---|
242 | $data_bull=""; |
---|
243 | if (($r_bull)&&($r_bull->tit1)) { |
---|
244 | if ($r_bull->tit1) $data_bull.=" <s c='t'>".htmlspecialchars($r_bull->tit1,ENT_QUOTES,$charset)."</s>\n"; |
---|
245 | if ($r_bull->bulletin_numero) $data_bull.=" <s c='v'>".htmlspecialchars($r_bull->bulletin_numero,ENT_QUOTES,$charset)."</s>\n"; |
---|
246 | if ($r_bull->mention_date) $data_bull.=" <s c='d'>".htmlspecialchars($r_bull->mention_date,ENT_QUOTES,$charset)."</s>\n"; |
---|
247 | if ($r_bull->bulletin_titre) $data_bull.=" <s c='u'>".htmlspecialchars($r_bull->bulletin_titre,ENT_QUOTES,$charset)."</s>\n"; |
---|
248 | if ($r_bull->date_date) $data_bull.=" <s c='e'>".htmlspecialchars($r_bull->date_date,ENT_QUOTES,$charset)."</s>\n"; |
---|
249 | if ($rn->npages) $data_bull.=" <s c='p'>".htmlspecialchars($rn->npages,ENT_QUOTES,$charset)."</s>\n"; |
---|
250 | } |
---|
251 | if ($data_bull) $notice.=" <f c='464' ind=' '>\n".$data_bull." </f>\n"; |
---|
252 | } |
---|
253 | |
---|
254 | //Mots_clés |
---|
255 | if ($rn->index_l) { |
---|
256 | global $pmb_keyword_sep; |
---|
257 | $tmp=explode($pmb_keyword_sep,$rn->index_l); |
---|
258 | foreach ( $tmp as $value ) { |
---|
259 | if($tmp2=trim($value)){ |
---|
260 | $notice.=" <f c='610' ind=' '>\n"; |
---|
261 | $notice.=" <s c='a'>".htmlspecialchars($tmp2,ENT_QUOTES,$charset)."</s>\n"; |
---|
262 | $notice.=" </f>\n"; |
---|
263 | } |
---|
264 | } |
---|
265 | } |
---|
266 | |
---|
267 | $requete = "SELECT libelle_categorie FROM categories, notices_categories "; |
---|
268 | $requete .= "WHERE notcateg_notice=$id AND categories.num_noeud = notices_categories.num_noeud "; |
---|
269 | $requete .= "ORDER BY ordre_categorie, libelle_categorie "; |
---|
270 | $resultat=mysql_query($requete); |
---|
271 | |
---|
272 | //Descripteurs |
---|
273 | if (mysql_num_rows($resultat)) { |
---|
274 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
275 | $notice.=" <f c='606' ind=' '>\n"; |
---|
276 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i),ENT_QUOTES,$charset)."</s>\n"; |
---|
277 | $notice.=" </f>\n"; |
---|
278 | } |
---|
279 | } |
---|
280 | |
---|
281 | //Thème(s) |
---|
282 | $requete="select ncl.notices_custom_list_lib from notices_custom_lists ncl, notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='theme' and ncv.notices_custom_champ=ncl.notices_custom_champ and ncv.notices_custom_integer=ncl.notices_custom_list_value"; |
---|
283 | $resultat=mysql_query($requete); |
---|
284 | if (mysql_num_rows($resultat)) { |
---|
285 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
286 | $notice.=" <f c='900' ind=' '>\n"; |
---|
287 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i),ENT_QUOTES,$charset)."</s>\n"; |
---|
288 | $notice.=" </f>\n"; |
---|
289 | } |
---|
290 | } |
---|
291 | //Genre(s) |
---|
292 | $requete="select ncl.notices_custom_list_lib from notices_custom_lists ncl, notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='genre' and ncv.notices_custom_champ=ncl.notices_custom_champ and ncv.notices_custom_integer=ncl.notices_custom_list_value"; |
---|
293 | $resultat=mysql_query($requete); |
---|
294 | if (mysql_num_rows($resultat)) { |
---|
295 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
296 | $notice.=" <f c='901' ind=' '>\n"; |
---|
297 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i),ENT_QUOTES,$charset)."</s>\n"; |
---|
298 | $notice.=" </f>\n"; |
---|
299 | } |
---|
300 | } |
---|
301 | //Niveau |
---|
302 | $requete="select ncl.notices_custom_list_lib from notices_custom_lists ncl, notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='niveau' and ncv.notices_custom_champ=ncl.notices_custom_champ and ncv.notices_custom_integer=ncl.notices_custom_list_value"; |
---|
303 | $resultat=mysql_query($requete); |
---|
304 | if (mysql_num_rows($resultat)) { |
---|
305 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
306 | $notice.=" <f c='906' ind=' '>\n"; |
---|
307 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i),ENT_QUOTES,$charset)."</s>\n"; |
---|
308 | $notice.=" </f>\n"; |
---|
309 | } |
---|
310 | } |
---|
311 | //Discipline |
---|
312 | $requete="select ncl.notices_custom_list_lib from notices_custom_lists ncl, notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='discipline' and ncv.notices_custom_champ=ncl.notices_custom_champ and ncv.notices_custom_integer=ncl.notices_custom_list_value"; |
---|
313 | $resultat=mysql_query($requete); |
---|
314 | if (mysql_num_rows($resultat)) { |
---|
315 | for ($i=0; $i<mysql_num_rows($resultat); $i++) { |
---|
316 | $notice.=" <f c='902' ind=' '>\n"; |
---|
317 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,$i),ENT_QUOTES,$charset)."</s>\n"; |
---|
318 | $notice.=" </f>\n"; |
---|
319 | } |
---|
320 | } |
---|
321 | //Année de péremption |
---|
322 | $requete="select ncv.notices_custom_integer from notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='annee_peremption'"; |
---|
323 | $resultat=mysql_query($requete); |
---|
324 | if (mysql_num_rows($resultat)) { |
---|
325 | $notice.=" <f c='903' ind=' '>\n"; |
---|
326 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,0),ENT_QUOTES,$charset)."</s>\n"; |
---|
327 | $notice.=" </f>\n"; |
---|
328 | } |
---|
329 | //Date de saisie |
---|
330 | $requete="select ncv.notices_custom_date from notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='date_creation'"; |
---|
331 | $resultat=mysql_query($requete); |
---|
332 | if (mysql_num_rows($resultat)) { |
---|
333 | $notice.=" <f c='904' ind=' '>\n"; |
---|
334 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,0),ENT_QUOTES,$charset)."</s>\n"; |
---|
335 | $notice.=" </f>\n"; |
---|
336 | } |
---|
337 | //Type doc |
---|
338 | $requete="select ncl.notices_custom_list_lib from notices_custom_lists ncl, notices_custom_values ncv, notices_custom nc where ncv.notices_custom_origine=$id and ncv.notices_custom_champ=nc.idchamp and name='type_nature' and ncv.notices_custom_champ=ncl.notices_custom_champ and ncv.notices_custom_integer=ncl.notices_custom_list_value"; |
---|
339 | $resultat=mysql_query($requete); |
---|
340 | if (mysql_num_rows($resultat)) { |
---|
341 | $notice.=" <f c='905' ind=' '>\n"; |
---|
342 | $notice.=" <s c='a'>".htmlspecialchars(mysql_result($resultat,0),ENT_QUOTES,$charset)."</s>\n"; |
---|
343 | $notice.=" </f>\n"; |
---|
344 | } |
---|
345 | //Origine |
---|
346 | $requete="select orinot_nom from notices, origine_notice where notice_id=$id and origine_catalogage=orinot_id"; |
---|
347 | $resultat=mysql_query($requete); |
---|
348 | if (mysql_num_rows($resultat)) { |
---|
349 | $notice.=" <f c='801' ind=' '>\n"; |
---|
350 | $notice.=" <s c='b'>".htmlspecialchars(mysql_result($resultat,0),ENT_QUOTES,$charset)."</s>\n"; |
---|
351 | $notice.=" </f>\n"; |
---|
352 | } |
---|
353 | |
---|
354 | // Ajout, eventuel, des exemplaires : |
---|
355 | if($keep_expl) { |
---|
356 | $requete = "select expl_cb, expl_typdoc, expl_cote, expl_section, expl_statut, expl_note, expl_comment from exemplaires where expl_notice = $id"; |
---|
357 | $resultat = mysql_query($requete); |
---|
358 | $nb = mysql_num_rows($resultat); |
---|
359 | for($i=0; $i < $nb ; $i++) { |
---|
360 | $expl =@mysql_fetch_object($resultat); |
---|
361 | $notice.=" <f c='995' ind=' '>\n"; |
---|
362 | if($expl->expl_cb && $expl->expl_cb != "") { |
---|
363 | $notice.=" <s c='f'>".htmlspecialchars($expl->expl_cb,ENT_QUOTES,$charset)."</s>\n"; |
---|
364 | } |
---|
365 | if($expl->expl_typdoc && $expl->expl_typdoc != "") { |
---|
366 | $notice.=" <s c='r'>".htmlspecialchars($expl->expl_typdoc,ENT_QUOTES,$charset)."</s>\n"; |
---|
367 | } |
---|
368 | if($expl->expl_cote && $expl->expl_cote != "") { |
---|
369 | $notice.=" <s c='k'>".htmlspecialchars($expl->expl_cote,ENT_QUOTES,$charset)."</s>\n"; |
---|
370 | } |
---|
371 | if($expl->expl_section && $expl->expl_section != "") { |
---|
372 | $notice.=" <s c='t'>".htmlspecialchars($expl->expl_section,ENT_QUOTES,$charset)."</s>\n"; |
---|
373 | } |
---|
374 | if($expl->expl_statut && $expl->expl_statut != "") { |
---|
375 | $notice.=" <s c='q'>".htmlspecialchars($expl->expl_statut,ENT_QUOTES,$charset)."</s>\n"; |
---|
376 | } |
---|
377 | if($expl->expl_note && $expl->expl_note != "") { |
---|
378 | $notice.=" <s c='u'>".htmlspecialchars($expl->expl_note,ENT_QUOTES,$charset)."</s>\n"; |
---|
379 | } |
---|
380 | $notice.=" </f>\n"; |
---|
381 | } |
---|
382 | } |
---|
383 | |
---|
384 | $notice.="</notice>\n"; |
---|
385 | return $notice; |
---|
386 | } |
---|
387 | |
---|
388 | ?> |
---|