Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 26 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26 Rev 27
Line -... Line 1...
-
 
1
<?php
-
 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
-
 
3
// +------------------------------------------------------------------------------------------------------+
-
 
4
// | PHP version 5.1.1                                                                                    |
-
 
5
// +------------------------------------------------------------------------------------------------------+
-
 
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
-
 
7
// +------------------------------------------------------------------------------------------------------+
-
 
8
// | This file is part of eFlore.                                                                         |
-
 
9
// |                                                                                                      |
-
 
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
-
 
11
// | it under the terms of the GNU General Public License as published by                                 |
-
 
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
-
 
13
// | (at your option) any later version.                                                                  |
-
 
14
// |                                                                                                      |
-
 
15
// | Foobar is distributed in the hope that it will be useful,                                            |
-
 
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
-
 
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
-
 
18
// | GNU General Public License for more details.                                                         |
-
 
19
// |                                                                                                      |
-
 
20
// | You should have received a copy of the GNU General Public License                                    |
-
 
21
// | along with Foobar; if not, write to the Free Software                                                |
-
 
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
-
 
23
// +------------------------------------------------------------------------------------------------------+
-
 
24
// CVS : $Id$
-
 
25
/**
-
 
26
* Titre
-
 
27
*
-
 
28
* Description
-
 
29
*
-
 
30
*@package eFlore
-
 
31
*@subpackage ef_fiche
-
 
32
//Auteur original :
-
 
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
-
 
34
//Autres auteurs :
-
 
35
*@author        aucun
-
 
36
*@copyright     Tela-Botanica 2000-2006
-
 
37
*@version       $Revision$ $Date$
-
 
38
// +------------------------------------------------------------------------------------------------------+
-
 
39
*/
-
 
40
 
-
 
41
// +------------------------------------------------------------------------------------------------------+
-
 
42
// |                                            ENTETE du PROGRAMME                                       |
-
 
43
// +------------------------------------------------------------------------------------------------------+
-
 
44
/** Inclusion du fichier de configuration de l'application Revue. */
-
 
45
//require_once BB_CHEMIN_APPLI.'bb_revue/configuration/bbre_config.inc.php';
-
 
46
 
-
 
47
// +------------------------------------------------------------------------------------------------------+
-
 
48
// |                                            CORPS du PROGRAMME                                        |
-
 
49
// +------------------------------------------------------------------------------------------------------+
-
 
50
// Initialisation de la variable à retourner
-
 
51
$retour = '';
-
 
52
$retour .= '<!-- BiblioBota - Revue : DEBUT -->'."\n";
-
 
53
$retour .= '<div id="biblio_revue">';
-
 
54
 
-
 
55
$aso_revues = array();
-
 
56
$query =    'SELECT '.$GLOBALS['tbl']['collection'].'.* '.
-
 
57
            'FROM '.$GLOBALS['tbl']['collection'].' '.
-
 
58
            'WHERE B_C_CACHER = 0 '.
-
 
59
            'ORDER BY B_C_NOMCOMPLET ';
-
 
60
$do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
-
 
61
$nbre_revues_total = mysql_num_rows($do_query);
-
 
62
$nbre_revues_avec_article = 0;
-
 
63
 
-
 
64
if ($nbre_revues_total == 0) {
-
 
65
	// Titre de la page
-
 
66
	$retour .= '<h1>'.'Revues indexées dans la base de données du projet BiblioBota.'.'</h1>';
-
 
67
	$retour .= '<p>'.'Pas encore de revues indexées...'.'</p>'."\n";
-
 
68
} else {
-
 
69
	while ($row = mysql_fetch_object($do_query)) {
-
 
70
		$aso_revue = array();
-
 
71
        $aso_revue['id'] = $row->B_C_CRAI;
-
 
72
        $aso_revue['idlink'] = $row->B_C_LKSTR;
-
 
73
        $aso_revue['nom_complet'] = $row->B_C_NOMCOMPLET;
-
 
74
        $aso_revue['abreviation'] = $row->B_C_ABREGE;
-
 
75
        $aso_revue['date_debut'] = $row->B_C_DATECREATION;
-
 
76
        $aso_revue['suite_de'] = $row->B_C_FAISUITE;
-
 
77
        $aso_revue['date_fin'] = $row->B_C_DATEFIN;
-
 
78
        $aso_revue['periodicite'] = $row->B_C_PERIODICITE;
-
 
79
        $aso_revue['contact_nom'] = $row->B_C_CONTACTNOM;
-
 
80
        $aso_revue['contact_mail'] = $row->B_C_CONTACTMAIL;
-
 
81
        $aso_revue['logo'] = $row->B_C_IMAGE;
-
 
82
        $aso_revue['commentaires'] = $row->B_C_COMMENT;
-
 
83
        $aso_revue['date_maj'] = $row->B_C_MAJFICHE;
-
 
84
		$aso_revue['fasc_nbre'] = 0;
-
 
85
		$aso_revue['fasc_date_premier'] = '';
-
 
86
		$aso_revue['fasc_date_dernier'] = '';
-
 
87
		$aso_revue['fasc_maj_dernier'] = '';
-
 
88
		$aso_revue['fasc_nom_dernier'] = '';
-
 
89
		
-
 
90
		// Construction de l'url de la page contenant les info sur l'organisme:
-
 
91
		$Url = clone $GLOBALS['_BIBLIOBOTA_']['url'];
-
 
92
		$Url->setId(BB_URL_APPLI_ORGA_ID);
-
 
93
		$Url->addQueryString('appli', 'bb_consultation');
-
 
94
		$Url->addQueryString('consultation', 'avancee');
-
 
95
		$Url->addQueryString('coll', $aso_revue['idlink']);
-
 
96
		$aso_revue['url'] = $Url->getUrl();
-
 
97
		
-
 
98
		$aso_fasc_serie = array();
-
 
99
		$query_fasc =	'SELECT '.$GLOBALS['tbl']['fascicule'].'.* '.
-
 
100
	               		'FROM '.$GLOBALS['tbl']['fascicule'].' '.                		
-
 
101
						'WHERE  B_F_CRAICOLL = "'.$row->B_C_CRAI.'" '.
-
 
102
						'AND B_F_CACHER = 0 '.
-
 
103
						'ORDER BY B_F_CRAISERIE, B_F_NUMERO DESC';
-
 
104
		$do_query_fasc = mysql_query($query_fasc) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_fasc));
-
 
105
		// Initialisation de la date
-
 
106
		$initialiser = true;		
-
 
107
		
-
 
108
		while ($row_fasc = mysql_fetch_object($do_query_fasc)) {
-
 
109
			if (!isset($aso_fasc_serie[$row_fasc->B_F_CRAISERIE])) {
-
 
110
				$aso_fasc = array();
-
 
111
				$aso_fasc['nbre_fasc'] = 1;
-
 
112
				$aso_fasc['nom_serie'] = $row_fasc->B_F_CRAISERIE;
-
 
113
				$aso_fasc['nom_fin_serie'] = $row_fasc->B_SER_SOUSTITRE;
-
 
114
				$aso_fasc['nom_fin_fasc'] = $row_fasc->B_F_TITRE;
-
 
115
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE] = $aso_fasc;
-
 
116
			} else {
-
 
117
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc']++;
-
 
118
			}
-
 
119
			// Nombre de fascicule dans la collection
-
 
120
			$aso_revue['fasc_nbre']++;
-
 
121
			// Calcule de la date du premier fascicule et de la date du dernier
-
 
122
			if (preg_match('/^(\d{4})(?:\.(\d{2})|)$/', $row_fasc->B_F_DATE, $match)) {
-
 
123
				if (isset($match[1]) && $match[1] != '') {
-
 
124
					$annee = $match[1];
-
 
125
					$mois = '00';
-
 
126
					if (isset($match[2]) && $match[2] != '') {
-
 
127
						$mois = $match[2];
-
 
128
					}
-
 
129
					$date = $annee.'-'.$mois;
-
 
130
					
-
 
131
					// Initialisation avec une date pour la série courrante
-
 
132
					if ($aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc'] == 1) {
-
 
133
						$aso_fasc['date_debut'] = $date;
-
 
134
						$aso_fasc['date_fin'] = $date;
-
 
135
					}
-
 
136
					// Initialisation avec une date pour la collection toute série confondue					
-
 
137
					if ($initialiser) {
-
 
138
						$initialiser = false;
-
 
139
						$aso_revue['fasc_date_premier'] = $date;
-
 
140
						$aso_revue['fasc_date_dernier'] = $date;
-
 
141
					}		
-
 
142
					// Date premier fascicule dans la série
-
 
143
					if (strcasecmp($date, $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_debut']) < 0) {
-
 
144
						$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_debut'] = $date;
-
 
145
					}
-
 
146
					// Date premier fascicule dans la collection
-
 
147
					//echo $date.'<'.$aso_revue['fasc_date_premier'].'/'.strcasecmp($date, $aso_revue['fasc_date_premier']).'<br>';
-
 
148
					if (strcasecmp($date, $aso_revue['fasc_date_premier']) < 0) {
-
 
149
						//echo $aso_revue['fasc_date_premier'].'<'.$date.'<br>';
-
 
150
						$aso_revue['fasc_date_premier'] = $date;
-
 
151
						 
-
 
152
					}
-
 
153
					// Date dernier fascicule dans la série
-
 
154
					if (strcasecmp($date, $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_fin']) > 0) {
-
 
155
						$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_fin'] = $date;
-
 
156
						$aso_revue['fasc_nom_dernier'] = $row_fasc->B_F_TITRE;
-
 
157
						$aso_revue['fasc_maj_dernier'] = $row_fasc->B_F_MAJFICHE;
-
 
158
					}
-
 
159
					// Date dernier fascicule dans la collection
-
 
160
					if (strcasecmp($date, $aso_revue['fasc_date_dernier']) > 0) {
-
 
161
						$aso_revue['fasc_date_dernier'] = $date;
-
 
162
					}
-
 
163
				} 
-
 
164
				
-
 
165
			}
-
 
166
		}
-
 
167
		mysql_free_result($do_query_fasc);
-
 
168
		ksort($aso_fasc_serie, SORT_DESC);
-
 
169
		$aso_revue['aso_fasc_serie'] = $aso_fasc_serie;
-
 
170
		
-
 
171
		$query_art =	'SELECT COUNT('.$GLOBALS['tbl']['article'].'.B_A_IDART) AS nbre_article '.
-
 
172
	               		'FROM '.$GLOBALS['tbl']['article'].' '.		
-
 
173
						'WHERE B_A_CRAICOLL = "'.$row->B_C_CRAI.'" '.
-
 
174
						'GROUP BY B_A_CRAICOLL';
-
 
175
		//echo $query_art.'<br/>';
-
 
176
		$resultat_art = mysql_query($query_art) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_art));
-
 
177
		$ligne_article = mysql_fetch_assoc($resultat_art);
-
 
178
		//echo '<pre>'.print_r($ligne_article, true).'</pre>';
-
 
179
		$aso_revue['nbre_article'] = $ligne_article['nbre_article'];
-
 
180
		if ($aso_revue['nbre_article'] != 0) {
-
 
181
			$nbre_revues_avec_article++;
-
 
182
		} 
-
 
183
		$aso_revues[] = $aso_revue;
-
 
184
	}
-
 
185
	mysql_free_result($do_query);
-
 
186
	
-
 
187
	if ($GLOBALS['_GEN_commun']['info_application']->affichage_type == 'tableau') {	
-
 
188
		// Titre de la page
-
 
189
		$retour .= '<h1>'.$nbre_revues_total.' revues indexées'.'</h1>';
-
 
190
		$retour .= 	'<p>'.
-
 
191
						'Liste de toutes les revues indexées dans la base de données du projet BiblioBota. '.'<br />'.
-
 
192
						'Les revues ne possédant pas d\'articles indexés figurent dans ce tableau.'.
-
 
193
					'</p>';
-
 
194
		$o = 1;
-
 
195
		$retour .= '<table id="liste_biblio_revue" class="table_bordure" summary="Tableau résumant les informations sur les revues indexées dans la base de données du projet BiblioBota.">'."\n";
-
 
196
		$retour .= '<thead><tr>'.
-
 
197
				'<th>Collection</th>'.
-
 
198
				'<th>Date début (collection)</th>'.
-
 
199
				'<th>Date début (indexation)</th>'.
-
 
200
				'<th>Date fin (collection)</th>'.
-
 
201
				'<th>Date fin (indexation)</th>'.
-
 
202
				'<th title="Nombre de fascicules pour la collection, toutes séries confondues">Nombre fascicules</th>'.
-
 
203
				'<th title="Nombre d\'articles pour la collection, toutes séries et fascicules confondues">Nombre d\'articles</th>'.
-
 
204
				'<th>Périodicité</th>'.
-
 
205
				'<th>Contact</th>'.
-
 
206
				'<th title="Nom du dernier fascicule indexée dans la dernière série">Dernier fascicule</th>'.
-
 
207
				'<th title="Date de publication du dernier fascicule indexée dans la dernière série">Date dernier fascicule</th>'.
-
 
208
				'</tr></thead>'."\n";
-
 
209
		$retour .= '<tbody>';
-
 
210
		foreach ($aso_revues as $revue) {
-
 
211
			$retour .= '<tr>';
-
 
212
			$retour .= '<th>';
-
 
213
		    if ($revue['nom_complet'] != '') {
-
 
214
	            $retour .= 	'<h5 class="bbre_titre">'.
-
 
215
	            				'<a href="'.$revue['url'].'">'.
-
 
216
	            					$revue['nom_complet'].
-
 
217
	            				'</a>'.
-
 
218
							'</h5>';
-
 
219
	            if ($revue['suite_de'] != '') {
-
 
220
					$retour .= '<p><span class="bb_intitule">Fait suite à : </span>'.$revue['suite_de'].'</p>';
-
 
221
				}
-
 
222
				if ($revue['abreviation'] != '') {
-
 
223
					$retour .= '<p><span class="bb_intitule">Abréviation : </span>'.$revue['abreviation'].'</p>';
-
 
224
				}
-
 
225
	            if ($revue['commentaires'] != '') {
-
 
226
	            	$retour .= '<p>'.$revue['commentaires'].'</p>';
-
 
227
	        	}
-
 
228
	            if ($revue['logo'] != '') {
-
 
229
	            	$retour .= '<img class="bbre_couverture" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$revue['logo'].'" alt="Couverture de la revue '.$revue['nom_complet'].'"/>';
-
 
230
	        	}
-
 
231
	        	$retour .= '<p class="texte_inactif">Id. coll. : '.$revue['id'].' - Mise à jour : '.date('d/m/Y', $revue['date_maj']).'</p>';
-
 
232
			} else {
-
 
233
				$retour .= '?';
-
 
234
			}
-
 
235
	        $retour .= '</th>';
-
 
236
			$retour .= '<td>';
-
 
237
			if ($revue['date_debut'] != '') {
-
 
238
				$retour .= $revue['date_debut'];
-
 
239
			} else {
-
 
240
				$retour .= '?';
-
 
241
			}
-
 
242
			$retour .= '</td>';
-
 
243
			$retour .= '<td>';
-
 
244
			if ($revue['fasc_date_premier'] != '') {
-
 
245
				$retour .= donnerDateConviviale($revue['fasc_date_premier']);
-
 
246
			} else {
-
 
247
				$retour .= '?';
-
 
248
			}
-
 
249
			$retour .= '</td>';
-
 
250
			$retour .= '<td>';
-
 
251
			if ($revue['date_fin'] != '') {
-
 
252
				$retour .
1
253