Subversion Repositories Applications.projet

Rev

Rev 11 | Rev 97 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 ddelon 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 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
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU 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
// +------------------------------------------------------------------------------------------------------+
15 ddelon 22
// CVS : $Id: document.class.php,v 1.4 2005-09-28 16:29:39 ddelon Exp $
2 ddelon 23
/**
24
* Application projet
25
*
26
* La classe document
27
*
28
*@package projet
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
15 ddelon 34
*@version       $Revision: 1.4 $
2 ddelon 35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
42
 
43
include_once PROJET_CHEMIN_CLASSES.'fichier.class.php' ;
44
 
45
// +------------------------------------------------------------------------------------------------------+
46
// |                                            ENTETE du PROGRAMME                                       |
47
// +------------------------------------------------------------------------------------------------------+
48
 
49
/**
50
 * class document
51
 * Représente un document associé à un projet. C'est à dire un fichier
52
 * téléchargeable disposant en plus d'une visibilité, d'un nom long, d'une
53
 * description et d'une url.
54
 */
55
class document extends fichier
56
{
57
    /*** Attributes: ***/
58
 
59
    /**
60
     * Description qui apparaitra à l'écran.
61
     * @access private
62
     */
63
    var $_description;
64
    /**
65
     * Date de dernière mise à jour des attributs du fichier.
66
     * @access private
67
     */
68
    var $_date_mise_a_jour;
69
    /**
70
     * Soit public, soit privé.
71
     * @access private
72
     */
73
    var $_visibilite;
74
    /**
75
     * Le nom du fichier tel qu'il apparaitra à l'écran.
76
     * @access private
77
     */
78
    var $_nom_long;
79
    /**
80
     * Un objet PEAR:DB
81
     * @access private
82
     */
83
    var $_db;
84
 
85
    /**
86
     * L'identifiant du document dans la table projet_document.
87
     * @access private
88
     */
89
    var $_id;
90
 
91
    /**
92
     *
93
     * @access private
94
     */
95
    var $_chemin_icone;
96
 
97
    /**
98
     * L'identifiant du père, peut être à NULL
99
     * @access private
100
     */
101
    var $_id_pere;
102
 
103
    /**
104
     * L'identifiant du propriétaire. Provient d'un annuaire. Peut être à NULL.
105
     * @access private
106
     */
107
    var $_id_proprietaire;
108
    /**
109
     * L'identifiant du projet auquel appartient le document. Peut être à NULL.
110
     * @access private
111
     */
112
    var $_id_projet;
113
 
114
    /**
115
    *   Le chemin du fichier, depuis le répertoire du projet
116
    *
117
    */
118
    var $_pd_lien ;
119
    /**
120
     *
121
     *
122
     * @param int id_document L'identifiant du document dans la base.
123
     * @param int objetDB un objet PEAR:DB
124
     * @return void
125
     * @access public
126
     */
127
    function document( $id_document = "",  &$objetDB, $chemin = '', $chemin_icones = '')
128
    {
129
        $this->_db = $objetDB ;
130
        $this->_chemin_icone = $chemin_icones ;
131
        if ($id_document != "") {
132
            $requete = "select * from projet_documents where pd_id=".$id_document ;
133
            $resultat = $this->_db->query ($requete) ;
134
            if (DB::isError($resultat)) {
135
                die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
136
            }
137
            $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
15 ddelon 138
    		if ($resultat->numRows()>0) {
139
	            fichier::fichier($chemin.$ligne->pd_lien, $this->_db) ;
140
	            $this->_id = $ligne->pd_id ;
141
	            if (is_object ($this->_type_mime)) $this->_type_mime->setCheminIcone ($chemin_icones) ;
142
	            $this->_id_proprietaire = $ligne->pd_ce_utilisateur ;
143
	            $this->_nom_long = $ligne->pd_nom ;
144
	            $this->_visibilite = $ligne->pd_visibilite ;
145
	            $this->_date_mise_a_jour = $ligne->pd_date_de_mise_a_jour ;
146
	            $this->_description = $ligne->pd_description ;
147
	            $this->_pd_lien = $ligne->pd_lien;
148
	            if ($this->_isRacine($ligne->pd_pere)) {
149
	                $this->_id_pere = 0 ;
150
	            } else {
151
	                $this->_id_pere = $ligne->pd_pere ;
152
	            }
153
    		}
2 ddelon 154
        }
155
 
156
    } // end of member function document
157
 
158
    /**
159
     *
160
     *
161
     * @param int id_document L'identifiant du document dans la base.
162
     * @param int objetDB Un objet PEAR:DB
163
     * @return document
164
     * @access public
165
     */
15 ddelon 166
    function __construct( $id_document = "",  &$objetDB, $chemin = '', $chemin_icones = '' )
2 ddelon 167
    {
15 ddelon 168
 
169
       $this->document($id_document, $objetDB, $chemin, $chemin_icones);
2 ddelon 170
 
171
    } // end of member function __construct
172
 
173
 
174
    /**
175
     * Renvoie le nom long du fichier.
176
     *
177
     * @return string
178
     * @access public
179
     */
180
    function getNomLong( )
181
    {
182
        return $this->_nom_long ;
183
    } // end of member function getNomLong
184
 
185
    /**
186
     * Renvoie la visibilité du document, soit "public" soit "prive"
187
     *
188
     * @return visibilite
189
     * @access public
190
     */
191
    function getVisibilite( )
192
    {
193
        return $this->_visibilite ;
194
    } // end of member function getVisibilite
195
 
196
    /**
197
     * Renvoie la description du document, sous forme de chaine.
198
     *
199
     * @return string
200
     * @access public
201
     */
202
    function getDescription( )
203
    {
204
        return $this->_description ;
205
    } // end of member function getDescription
206
 
207
    /**
208
     * Renvoie la date de création ou de mise à jour du fichier.
209
     *
210
     * @return date
211
     * @access public
212
     */
213
    function getDateMiseAJour( )
214
    {
215
        return $this->_date_mise_a_jour ;
216
    } // end of member function getDateMiseAJour
217
 
218
    /**
219
     * Renvoie l'identifiant d'un document.
220
     *
221
     * @return int
222
     * @access public
223
     */
224
    function getIdDocument( )
225
    {
226
        return $this->_id ;
227
    } // end of member function getIdDocument
228
 
229
    /**
230
     * Renvoie le chemin de l'icone du fichier. Fait un appel à type_fichier_mime.
231
     *
232
     * @return string
233
     * @access public
234
     */
235
    function getCheminIcone()
236
    {
237
        if ($this->isRepertoire()) {
238
            return $this->_chemin_icone."repertoire.gif" ;
239
        } else {
240
            return $this->_type_mime->getCheminIcone() ;
241
        }
242
    } // end of member function getCheminIcone
243
 
244
    /**
245
     * Permet de récupérer le nom du répertoire racine associé à un projet.
246
     *
247
     * @param int id_projet L'identifiant du projet dont on veux récupérer le répertoire racine.
248
     * @param DB objetDB Un objet PEAR:DB
249
     * @return string
250
     * @static
251
     * @access public
252
     */
253
    function getNomRepertoireProjet( $id_projet , &$objetDB)
254
    {
255
        // Dans la table projet_documents, pour les répertoires racines, pd_pere = null
256
        $requete = "select pd_nom from projet_documents where pd_ce_projet=$id_projet and pd_pere is null" ;
257
        $resultat = $objetDB->query ($requete) ;
258
        if (DB::isError($resultat)) {
259
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
260
        }
261
        $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
262
        return $ligne->pd_nom ;
263
    } // end of member function getNomRepertoireProjet
264
 
265
 
266
    /**
267
     * Renvoie true si le document passé en paramètre est le répertoire racine.
268
     *
269
     * @param int id_document L'identifiant du document dont on veut savoir si c'est la racine.
270
     * @return bool
271
     * @access public
272
     */
273
    function _isRacine( $id_document )
274
    {
15 ddelon 275
    	if ($id_document) {
276
	        $requete = "select pd_pere from projet_documents where pd_id=".$id_document ;
277
	        $resultat = $this->_db->query ($requete) ;
278
	        if (DB::isError($resultat)) {
279
	            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
280
	        }
281
	        $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
282
	        if ($resultat->numRows() >0) {
283
	        	if ($ligne->pd_pere == null){
284
	            	return true ;
285
	        	}
286
	        }
287
    	}
2 ddelon 288
        return false ;
289
    } // end of member function _isRacine
290
 
291
    /**
292
     * Renvoie le chemin d'un fichier ou d'un répertoire. Contrairement à la classe
293
     * mère, cette méthode renvoie une URL projet et non pas un fichier.
294
     *
295
     * @return string
296
     * @access public
297
     */
298
    function getChemin( )
299
    {
300
        if ($this->isRepertoire()) {
301
            return $this->_id ;
302
        } else {
303
            return $this->_chemin ;
304
        }
305
    } // end of member function getChemin
306
 
307
 
308
    /**
309
     * Renvoie pour le répertoire courant, les identifiants et les noms de tous les
310
     * répertoires père jusqu'à la racine. 0 => ['id'], ['nom'] 1 => [id'], ['nom'] etc.
311
     * En commençant par la racine et en descendant.  Pour la racine id vaut "" et nom
312
     * vaut "".
313
     *
314
     * @param int id_repertoire L'identifiant d'un répertoire.
315
     * @return Array
316
     * @access public
317
     */
318
    function getCheminIdRepertoire( $id_repertoire, &$objetDB )
319
    {
320
        if ($id_repertoire == "") $id_repertoire = 0;
321
        // on commence par rechercher le répertoire père, dans la base de donnée
322
        $requete = "select pd_pere, pd_nom, pd_id from projet_documents where pd_id=$id_repertoire" ;
323
        $resultat = $objetDB->query ($requete) ;
324
        if (DB::isError($resultat)) {
325
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
326
        }
327
        $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
328
        $chemin_rep_id_nom = array() ;
15 ddelon 329
        if ($resultat->numRows()>0) {
330
    	    if ($ligne->pd_pere == 0) {
331
        	    $tab = array ($ligne->pd_id, $ligne->pd_nom) ;
2 ddelon 332
            return $tab ;
15 ddelon 333
        	}
334
        	else {
335
	            $requete_pere = "select pd_id, pd_nom from projet_documents where pd_id=$ligne->pd_pere" ;
336
	            $resultat_pere = $objetDB->query ($requete_pere) ;
337
	            if (DB::isError($resultat_pere)) {
338
	                die ("Echec de la requete<br />".$resultat_pere->getMessage()."<br />".$resultat_pere->getDebugInfo()) ;
339
	            }
340
	            $ligne_pere = $resultat_pere->fetchRow (DB_FETCHMODE_OBJECT) ;
341
	            array_push ($chemin_rep_id_nom, $ligne->pd_id,$ligne->pd_nom) ;
342
	            $tab = document::getCheminIdRepertoire($ligne_pere->pd_id, $objetDB) ;
343
	            $chemin_rep_id_nom = array_merge ($chemin_rep_id_nom, $tab) ;
344
        	}
2 ddelon 345
        }
346
        $tabl_resultat = array() ;
347
        for ($i = 0; $i < count ($chemin_rep_id_nom); $i++) {
348
            $val1 = array_pop ($chemin_rep_id_nom) ;
349
            $val2 = array_pop ($chemin_rep_id_nom) ;
350
            array_push ($tabl_resultat, $val2, $val1) ;
351
        }
352
        return $tabl_resultat ;
353
    } // end of member function getCheminIdRepertoire
354
 
355
    /**
356
     *  Calcule le chemin vers le fichier ou le répertoire uploadé
357
     *  renvoie un chaine de la forme dir1/dir2/fichier.ext
358
     *  En prenant comme racine le répertoire du projet, exclu.
359
     * @return  string  Le chemin
360
     */
361
 
362
    function calculeCheminUploaded ($radical) {
363
        // On recherche le chemin vers le fichier, en fonction du répertoire
364
        // ici on renomme le fichier à partir du dernier ID de la table gen_voiraussi
365
        $requete_document = "select pd_id from projet_documents order by pd_id desc limit 1,1" ;
366
        $resultat_document = $this->_db->query($requete_document) ;
367
        $ligne_document = $resultat_document->fetchRow(DB_FETCHMODE_OBJECT) ;
368
        $nouveau_nom = $ligne_document->pd_id+ 1 ;
369
 
370
        $extension = preg_replace("/([^\.]+)\.([a-zA-Z0-9]+$)/", "\\2", $_FILES['fichier']['name']) ;
371
 
372
        $nouveau_nom = $radical."_".$nouveau_nom.".".$extension ;
373
        if ($this->_id_pere != '') {
374
            // On appelle la méthode getCheminIdRepertoire qui renvoie un tableau avec la liste
375
            // des répertoires jusqu'à la racine, on enlève la racine ($i = 0) et on concatène
376
            // toutes les entrées pour obtenir le chemin jusqu'au répertoire courant
377
            $chemin_repertoire_entre_racine_et_repertoire_a_cree = '' ;
378
            $tableau_navigation = $this->getCheminIdRepertoire($this->_id_pere, $this->_db) ;
379
            for ($i = 0; $i < count ($tableau_navigation); $i+=2) $chemin_repertoire_entre_racine_et_repertoire_a_cree.= $tableau_navigation[$i]."/";
380
            $chemin = $chemin_repertoire_entre_racine_et_repertoire_a_cree.$nouveau_nom ;
381
        } else {
382
            // Si l'on est à la racine du projet, le chemin est le nom du fichier
383
            return $nouveau_nom ;
384
        }
385
        return $chemin ;
386
    }
387
 
388
    /**
389
     * Enregistre une ligne dans la table projet_document
390
     * Le tableau de valeur doit contenir les éléments suivants 'document_nom','document_description','document_visibilite','fichier'
391
     *
392
     * @param Array tableau_de_valeur Le tableau de valeur a insérer dans la base avec pour clé les noms des éléments
393
     * @access  public
394
     * @return void
395
     */
396
 
397
    function enregistrerSQL ($valeur, $chemin) {
398
 
399
        // On teste si on a affaire à un répertoire ou un fichier
400
        if (isset ($_FILES['fichier']['name'])) {
401
            // On tente de déterminer le type du fichier à partir de son nom dans $valeur['$fichier']
402
            $tableau_nom = explode (".", $_FILES['fichier']['name']) ;
403
 
404
            // On prend le dernier élément du tableau, si c'est un tableau
405
            if (is_array($tableau_nom)) {
406
                $extension = array_pop($tableau_nom) ;
407
                $type = type_fichier_mime::factory($extension, $this->_db) ;
408
                $id_extension = $type->getIdType() ;
409
            } else {
410
                $id_extension = 12 ;
411
            }
412
            $pd_lien = $chemin ;
413
        } else {    // Le cas ou on a affaire à un répertoire
414
            $id_extension = 0 ;
415
            // Le nom du répertoire est son identifiant avec un slash à la fin
416
            $pd_lien = $chemin."/" ;
417
            if ($this->_id_pere != '') {
418
                // On appelle la méthode getCheminIdRepertoire qui renvoie un tableau avec la liste
419
                // des répertoires jusqu'à la racine, on enlève la racine ($i = 0) et on concatène
420
                // toutes les entrées pour obtenir le chemin jusqu'au répertoire courant
421
                $chemin_repertoire_entre_racine_et_repertoire_a_cree = '' ;
422
                $tableau_navigation = $this->getCheminIdRepertoire($this->_id_pere, $this->_db) ;
423
                for ($i = 0; $i < count ($tableau_navigation); $i+=2) $chemin_repertoire_entre_racine_et_repertoire_a_cree.= $tableau_navigation[$i]."/";
424
                $pd_lien .= $chemin_repertoire_entre_racine_et_repertoire_a_cree ;
425
            }
426
            $pd_lien .= SQL_obtenirNouveauId($this->_db, 'projet_documents', 'pd_id')."/" ;
427
        }
428
        $id = SQL_obtenirNouveauId($this->_db, 'projet_documents', 'pd_id') ;
429
 
430
        $requete = "insert into projet_documents set pd_id=".$id ;
431
        $requete .= ", pd_nom=\"".$valeur['document_nom']."\", pd_description=\"".$valeur['document_description']."\"".
432
                    ", pd_visibilite=\"".$valeur['document_visibilite']."\", pd_date_de_mise_a_jour=NOW(),".
433
                    "pd_ce_projet=\"".$this->_id_projet."\", pd_ce_utilisateur=\"".$this->_id_proprietaire."\"".
434
                    ", pd_pere=\"$this->_id_pere\", pd_ce_type=\"$id_extension\", pd_lien=\"$pd_lien\"" ;
435
 
436
        $resultat = $this->_db->query ($requete) ;
437
        if (DB::isError($resultat)) {
438
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
439
        }
440
        $this->_id = $id ;
441
        return $pd_lien;
442
    }
443
 
444
 
445
    /**
446
     * Met à jour une ligne dans la table projet_document
447
     * Le tableau de valeur doit contenir les éléments suivants 'document_nom','document_description','document_visibilite','fichier'
448
     *
449
     * @param Array tableau_de_valeur Le tableau de valeur a insérer dans la base avec pour clé les noms des éléments
450
     * @access  public
451
     * @return void
452
     */
453
 
454
    function majSQL ($valeur) {
455
        $requete = "update projet_documents set pd_nom=\"".$valeur['document_nom']."\", pd_description=\"".$valeur['document_description']."\"".
456
                    ", pd_visibilite=\"".$valeur['document_visibilite']."\", pd_date_de_mise_a_jour=NOW()".
457
                    " where pd_id=".$this->_id;
458
 
459
        $resultat = $this->_db->query ($requete) ;
460
        if (DB::isError($resultat)) {
461
            die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
462
        }
463
        return ;
464
    }
465
 
466
    /** Supprime les donnéexs du document dans la table projet_documents
467
     *
468
     *
469
     * @return true en cas de succès
470
     */
471
 
472
    function suppressionSQL () {
473
        $requete = 'delete from projet_documents where pd_id='.$this->_id ;
474
        $resultat = $this->_db->query ($requete) ;
475
        if ($this->_db->affectedRows()) return true ;
476
        return false ;
477
    }
478
 
479
    /**
480
     * Déplace un document au sein d'un même projet
481
     *
482
     * @param int repertoire_destination L'identifiant du répertoire destination.
483
     * @return bool
484
     * @access public
485
     */
486
    function deplace( $repertoire_destination, $repertoire_projet )
487
    {
488
        // On récupère les informations du répertoire cible
489
        if ($repertoire_destination != 0) {
490
            $repertoire_cible = new document ($repertoire_destination, $this->_db) ;
491
            $rep = $repertoire_cible->_pd_lien ;
492
        } else {
493
            $rep = $repertoire_projet.'/' ;
494
        }
495
 
496
        // On récupère le nom du fichier
497
        $decoupe = explode ('/', $this->_pd_lien) ;
498
        $nom_fichier = $decoupe[count($decoupe)-1] ;
499
        $requete = 'update projet_documents set pd_lien="'.$rep.$nom_fichier.'", pd_pere='.$repertoire_destination.' where pd_id='.$this->_id ;
500
        $resultat = $this->_db->query ($requete) ;
501
        if (DB::isError($resultat)) {
502
            echo ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
503
            return false ;
504
        }
505
        return fichier::deplace ($this->_chemin, PROJET_CHEMIN_FICHIER.$rep.$nom_fichier) ;
506
 
507
    } // end of member function deplace
508
 
509
 
510
    /**
511
     * Pour modifier l'identifiant du projet auquel appartient un document.
512
     *
513
     * @param int id_projet L'identifiant du projet.
514
     * @return void
515
     * @access public
516
     */
517
    function setIdProjet( $id_projet )
518
    {
519
        $this->_id_projet = $id_projet ;
520
    } // end of member function setIdProjet
521
 
522
    /**
523
     * Permet de modifier l'identifiant du propietaire d'un projet.
524
     *
525
     * @param int id_proprietaire L'identifiant du proprietaire d'un document.
526
     * @return void
527
     * @access public
528
     */
529
    function setIdProprietaire( $id_proprietaire )
530
    {
531
        $this->_id_proprietaire = $id_proprietaire ;
532
    } // end of member function setIdProprietaire
533
 
534
    /**
535
     * Permet de modifier l'identifiant du répertoire d'un document.
536
     *
537
     * @param int id_repertoire L'identifiant du repertoire d'un document.
538
     * @return void
539
     * @access public
540
     */
541
    function setIdRepertoire( $id_repertoire )
542
    {
543
        $this->_id_pere = $id_repertoire;
544
    } // end of member function setIdRepertoire
545
 
546
    /**
547
     * initAttributes sets all document attributes to its default                    value make
548
     * sure to call this method within your class constructor
549
     */
550
    function initAttributes( )
551
    {
552
        $this->_visibilite = "public";
553
    }
554
 
555
    /**
556
     * Renvoie les derniers documents de l'ensemble des projets.
557
     *
558
     * @param int nombre Le nombre de document à renvoyer
559
     * @return Array
560
     * @static
561
     * @access public
562
     */
563
    function getDocumentsRecents( $nombre = 10, &$objetDB, $chemin, $chemin_icones, $id_projet = '' )
564
    {
565
        // on recherche les documents, hors répertoire
566
        $requete = 'select pd_id from projet_documents where pd_ce_type<>0 ';
567
        if ($id_projet != '') $requete .= ' and pd_ce_projet='.$id_projet.' ';
568
        $requete .= 'order by pd_date_de_mise_a_jour desc limit 0,'.$nombre ;
569
        $resultat = $objetDB->query ($requete) ;
570
        if (DB::isError ($resultat)) {
571
            die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
572
        }
573
        $tableau_document = array() ;
574
 
575
        while ($ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT)) {
576
            array_push ($tableau_document, new document ($ligne->pd_id, $objetDB, $chemin, $chemin_icones)) ;
577
        }
578
        return $tableau_document ;
579
    } // end of member function getDocumentsRecents
580
 
581
 
582
} // end of document
583
 
584
 
585
?>