Subversion Repositories Applications.gtt

Rev

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

Rev Author Line No. Line
2 jpm 1
<?php
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 4.1                                                                                      |
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
7
// | This library is free software; you can redistribute it and/or                                        |
8
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | License as published by the Free Software Foundation; either                                         |
10
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// |                                                                                                      |
12
// | This library is distributed in the hope that it will be useful,                                      |
13
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | Lesser General Public License for more details.                                                      |
16
// |                                                                                                      |
17
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | License along with this library; if not, write to the Free Software                                  |
19
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// +------------------------------------------------------------------------------------------------------+
21
 
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
23
// |@version 3                                                                                            |
24
 
25
include_once CHEMIN_CLASSES."BOG_debogage.inc.php";
26
/**
27
* class Absence
28
*
29
*/
30
 
31
class Absence
32
{
33
 
34
 
35
    /**Attributes: */
36
 
37
    var $_date_debut_absence=null;
38
 
39
    var $_date_fin_absence=null;
40
 
41
    var $_date_envoi_lettre=null;
42
 
43
    var $_utilisateur=null;//identifiant d'un utilisateur
44
 
45
    var $_motif=null;//identifiant d'un motif d'absence
46
 
47
    /*
48
    *constructeur
49
    *@param u : identifiant de l'utilisateur
50
    *@param m: motif
51
    *@param dd: date de debut d'absence
52
    */
53
    function Absence($u, $m, $dd)
54
    {
55
	$this->_utilisateur=$u;
56
	$this->_motif=$m;
57
	$this->_date_debut_absence =$dd;
58
    }
59
 
60
 
61
    /*
62
    *construit une absence a partir d'un tableau
63
    */
64
    function construireAbsence($tableau)
65
    {
66
	$this->_date_debut_absence =$tableau[GEST_CHAMPS_DATE_DEBUT_ABSENCE];
67
	$this->_date_fin_absence =$tableau[GEST_CHAMPS_DATE_FIN_ABSENCE];
68
	$this->_date_envoi_lettre =$tableau[GEST_CHAMPS_DATE_ENVOI_LETTRE];
69
	$this->_utilisateur =$tableau[GEST_CHAMPS_ID_UTILISATEUR];
70
	$this->_motif =$tableau[GEST_CHAMPS_ID_MOTIF];
71
    }
72
 
73
 
74
 
75
    /*
76
    *enregistre une absence dansla base de donnees
77
    *renvoie 1 si ok, 0 si aucun enregistrement effectue, -1 sinon
78
    */
79
 
80
    function enregistrerNewAbsence()
81
    {
82
	$table = GEST_ABSENCE;
83
 
84
	$champs =array(GEST_CHAMPS_DATE_DEBUT_ABSENCE => "$this->_date_debut_absence",
85
	GEST_CHAMPS_DATE_FIN_ABSENCE => "$this->_date_fin_absence",
86
	GEST_CHAMPS_DATE_ENVOI_LETTRE=> "$this->_date_envoi_lettre",
87
	GEST_CHAMPS_ID_UTILISATEUR => $this->_utilisateur,
88
	GEST_CHAMPS_ID_MOTIF => $this->_motif);
89
 
90
	$resultat =$GLOBALS['db']->autoExecute($table,$champs,DB_AUTOQUERY_INSERT);
91
	if (DB::isError($resultat)) {
92
	    die($resultat->getMessage());
93
	}
94
 
95
	$j=$GLOBALS['db']->affectedRows();
96
 
97
	if ($j==1)
98
	{
99
	    return 1;
100
	}elseif($j==0){
101
	    return 0;
102
	}else{
103
	    return -1;
104
	}
105
 
106
    }
107
 
108
    /**
109
    *fonction qui met a jour une absence
110
    *dasn la base de donnees
111
    *@return 1 si modification effectuee
112
    *@return -1 si erreur
113
    */
114
    function mettreAJourAbsence()
115
    {
116
	$requete= "UPDATE ".GEST_ABSENCE.
117
	          " SET ".GEST_CHAMPS_ID_MOTIF." = $this->_motif ,".
118
		  GEST_CHAMPS_DATE_DEBUT_ABSENCE." = \"$this->_date_debut_absence\" ,".
119
		  GEST_CHAMPS_DATE_FIN_ABSENCE." =\"$this->_date_fin_absence\" ,".
120
		  GEST_CHAMPS_DATE_ENVOI_LETTRE."= \" $this->_date_envoi_lettre\" ".
121
		  " WHERE ".GEST_CHAMPS_ID_UTILISATEUR." = $this->_utilisateur ".
122
		  " AND ".GEST_CHAMPS_ID_MOTIF." = $this->_motif ".
123
		  " AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE."= \"$this->_date_debut_absence\" ";
124
 
125
 
126
 
127
       $resultat=$GLOBALS['db']->query($requete);
128
 
129
       $j=$GLOBALS['db']->affectedRows();
130
       if ($j==1)
131
       {
132
	   return 1;
133
       }else return -1;
134
 
135
    }
136
 
137
 
138
    /**
139
    *enregistre la date d'envoie de la lettre
140
    *met a jour le champs date d'envoi de l'instance
141
    */
142
    function enregistrerDateEnvoi($d)
143
    {
144
	$this->_date_envoi_lettre=$d;
145
 
146
	$requete="UPDATE ".GEST_ABSENCE.
147
	" SET ".GEST_CHAMPS_DATE_ENVOI_LETTRE." ='$d '"
148
	." WHERE ".GEST_CHAMPS_ID_UTILISATEUR." =$this->_utilisateur AND "
149
	.GEST_CHAMPS_ID_MOTIF." = $this->_motif AND "
150
	.GEST_CHAMPS_DATE_DEBUT_ABSENCE." = '$this->_date_debut_absence' ";
151
 
152
	$resultat=$GLOBALS['db']->query($requete);
153
 
154
	(DB::isError($resultat)) ?
155
	die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
156
	$j=$GLOBALS['db']->affectedRows();
157
 
158
	switch ($j)
159
	{
160
	    case 1: return 1;
161
	    case 0: return 0;
162
	    default: return -1;
163
	}
164
 
165
    }
166
 
167
    /**
168
    *fonction recuperant lalist des absences de la semaine pour un utilisateur
169
    *@param :$user identifiant de l'utilisateur
170
    *@param : $date deb de la semaine
171
    *@param :$date fin de la semaine
172
    *les dates sont sosu le format mysql Y-m-d
173
    */
174
    function recupAbsence($user,$dateDeb,$dateFin)
175
    {
176
	$requete="SELECT ".GEST_CHAMPS_ID_MOTIF." ,".GEST_CHAMPS_DATE_DEBUT_ABSENCE." ,".
177
	GEST_CHAMPS_DATE_FIN_ABSENCE.
178
	" FROM ".GEST_ABSENCE.
179
	" WHERE ".GEST_CHAMPS_ID_UTILISATEUR." = $user ".
180
	" AND ((".GEST_CHAMPS_DATE_DEBUT_ABSENCE." <= \"$dateDeb\" ".
181
	" AND ".GEST_CHAMPS_DATE_FIN_ABSENCE." >= \"$dateDeb\" )".
182
	" OR (".GEST_CHAMPS_DATE_DEBUT_ABSENCE."> \"$dateDeb\" ".
183
	" AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE." <= \"$dateFin\") )".
184
	" ORDER BY ".GEST_CHAMPS_DATE_DEBUT_ABSENCE."";
185
 
186
	$resultat=$GLOBALS['db']->query($requete);
187
 
188
	(DB::isError($resultat)) ?
189
	die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
190
 
191
	$j=$resultat->numRows();
192
	$tab=array();
193
	if ($j>0)
194
	{
195
	    while($ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC))
196
	    {
197
		$case=array(GEST_CHAMPS_ID_MOTIF => $ligne[GEST_CHAMPS_ID_MOTIF],
198
		GEST_CHAMPS_DATE_DEBUT_ABSENCE => $ligne[GEST_CHAMPS_DATE_DEBUT_ABSENCE],
199
		GEST_CHAMPS_DATE_FIN_ABSENCE => $ligne[GEST_CHAMPS_DATE_FIN_ABSENCE]);
200
		array_push($tab,$case);
201
	    }
202
 
203
	}
204
 
205
	return $tab;
206
    }
207
 
208
    /**
209
    *fonction qui renvoie la liste des absences qui chevauchent
210
    *la periode d'absence
211
    */
212
    function existeAbsence()
213
    {
214
	$requete="SELECT * ".
215
	" FROM ".GEST_ABSENCE.
216
	" WHERE ".GEST_CHAMPS_ID_UTILISATEUR." = $this->_utilisateur ".
217
	" AND ((".GEST_CHAMPS_DATE_DEBUT_ABSENCE." <= \"$this->_date_debut_absence\" ".
218
	" AND ".GEST_CHAMPS_DATE_FIN_ABSENCE." >= \"$this->_date_debut_absence\" )".
219
	" OR (".GEST_CHAMPS_DATE_DEBUT_ABSENCE."> \"$this->_date_debut_absence\" ".
220
	" AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE." < \"$this->_date_fin_absence\" ))".
221
	" ORDER BY ".GEST_CHAMPS_DATE_DEBUT_ABSENCE."";
222
 
223
 
224
	$resultat=$GLOBALS['db']->query($requete);
225
 
226
	(DB::isError($resultat)) ?
227
	die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
228
 
229
	$j=$resultat->numRows();
230
	$tab=array();
231
	if ($j>0)
232
	{
233
	    while($ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC))
234
	    {
235
		$case=array(GEST_CHAMPS_ID_MOTIF => $ligne[GEST_CHAMPS_ID_MOTIF],
236
		GEST_CHAMPS_DATE_DEBUT_ABSENCE => $ligne[GEST_CHAMPS_DATE_DEBUT_ABSENCE],
237
		GEST_CHAMPS_DATE_FIN_ABSENCE => $ligne[GEST_CHAMPS_DATE_FIN_ABSENCE],
238
		GEST_CHAMPS_ID_UTILISATEUR =>$ligne[GEST_CHAMPS_ID_UTILISATEUR],
239
		GEST_CHAMPS_DATE_ENVOI_LETTRE => $ligne[GEST_CHAMPS_DATE_ENVOI_LETTRE]);
240
		array_push($tab,$case);
241
	    }
242
 
243
	}
244
 
245
	return $tab;
246
    }
247
    /**
248
    *fonction qui erifie s'il existe des absences qui chevauchent
249
    *et  si au moins une de ces absences a etet validee
250
    *@return true si au moins uen absence a ete validee
251
    *@return false si on peut donc modifier
252
    */
253
    function existeAbsenceValidee()
254
    {
255
	$tableau=$this->existeAbsence();
256
	$validee=false;
257
	if (count($tableau)>0)
258
	{
259
 
260
	    for($p=0;$p<count($tableau);$p++)
261
	    {
262
		$h=$tableau[$p];
263
		//test si au moins une lettre a ete envoyee
264
		if ($h[GEST_CHAMPS_DATE_ENVOI_LETTRE]!='0000-00-00')
265
		{
266
		    $validee=true;
267
		}
268
	    }
269
	}
270
	return $validee;
271
    }
272
 
273
    /**
274
    * renvoie un booleen true si la lettre a ete envoyee et faux sinon
275
    */
276
    function isEnvoi( )
277
    {
278
	$requete="SELECT ".GEST_CHAMPS_DATE_ENVOI_LETTRE.
279
	" FROM ".GEST_ABSENCE.
280
	" WHERE ".GEST_CHAMPS_ID_ABSENCE. " =$this->_id_absence";
281
 
282
	$resultat=$GLOBALS['db']->query($requete);
283
	(DB::isError($resultat)) ?
284
	die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
285
 
286
	$j=$resultat->numRows();
287
	if ($j==1)
288
	{
289
	    return true;
290
	}else {
291
	    return false;
292
	}
293
    }
294
 
295
    /**
296
    *fonction renvoyany l'identifiant d'un utilisateur
297
    */
298
    function getIdUserAbsence()
299
    {
300
	return $this->_utilisateur;
301
    }
302
    /**
303
    *fonction renvoyant la date de debut d'absence
304
    */
305
    function getDateDebAbsence()
306
    {
307
	return $this->_date_debut_absence;
308
    }
309
    /**
310
    *fonction renvoyant la date de fin d'absence
311
    */
312
    function getDateFinAbsence()
313
    {
314
	return $this->_date_fin_absence;
315
    }
316
    /**
317
    *fonction renvoyant le motif d'absence
318
    */
319
    function getIdMotif()
320
    {
321
	return $this->_motif;
322
    }
323
    /**
324
    *fonction qui renvoit la duree d'une absence
325
    */
326
    function getDureeAbsence()
327
    {
328
 
329
	if(($this->_date_fin_absence=='0000-00-00') or($this->_date_debut_absence==$this->_date_fin_absence))
330
	{
331
	   $duree=1;
332
	}else{
333
	$deb=explode('-',$this->getDateDebAbsence());
334
	$fin=explode('-',$this->getDateFinAbsence());
335
	$dateDeb=mktime(0,0,0,$deb[1],$deb[2],$deb[0]);
336
 
337
	$dateFin=mktime(0,0,0,$fin[1],$fin[2],$fin[0]);
338
	$duree=(intval((($dateFin-$dateDeb)/3600)/24)+1);
339
	}
340
 
341
	return $duree;
342
 
343
    }
344
    /**
345
    *fonction renvoyant la date d'envoi de la lettre d'absence
346
    */
347
    function getDateEnvoi()
348
    {
349
	return $this->_date_envoi_lettre;
350
    }
351
    /**
352
    *fonction qui recupere la liste d'absence contigues
353
    *a une absence donnee t qui ont le meme motif
354
    *pour un utilisateur donne
355
    *renvoie l'objet absence precedent
356
    *renvoie -1 s'il n'existe pas
357
    */
358
    function getAbsencesPrec()
359
    {
360
	//recuperation de l'absence juste avant
361
	//recuperation par maximum date de debut
362
	//recuperation des absences non encore validees
363
	$requete="SELECT MAX(".GEST_CHAMPS_DATE_FIN_ABSENCE.") ".
364
	         " FROM ".GEST_ABSENCE.
365
		 " WHERE ".GEST_CHAMPS_ID_UTILISATEUR." = $this->_utilisateur ".
366
		 " AND ".GEST_CHAMPS_ID_MOTIF." = $this->_motif ".
367
		 " AND ".GEST_CHAMPS_DATE_ENVOI_LETTRE."= \"0000-00-00\"".
368
		 " AND ".GEST_CHAMPS_DATE_FIN_ABSENCE. "< \"$this->_date_debut_absence\"".
369
		 " AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE. " <\"$this->_date_debut_absence\"";
370
 
371
 
372
	$resultat=$GLOBALS['db']->query($requete);
373
	(DB::isError($resultat)) ?
374
	          die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
375
	$ligne=$resultat->fetchRow(DB_FETCHMODE_ORDERED);
376
	if($ligne[0]!=null)
377
	{
378
	 //recuperation de l'objet absence precedente
379
	$absence=&Absence::recupererAbsenceDateFin($this->_utilisateur,$this->_motif,$ligne[0]);
380
	return $absence;
381
 
382
	}else return -1;
383
    }
384
    /**
385
    *fonnction qui recuprer l'absence du meme motif situe juste apres
386
    *cette absence
387
    *renvoi l'absence
388
    *renvoie -1 si vide ou erreur
389
    */
390
    function getAbsencesSuiv()
391
    {
392
	$requete= " SELECT MIN(".GEST_CHAMPS_DATE_DEBUT_ABSENCE.")".
393
	          " FROM ".GEST_ABSENCE.
394
		  " WHERE ".GEST_CHAMPS_ID_MOTIF." = $this->_motif ".
395
		  " AND ".GEST_CHAMPS_ID_UTILISATEUR." = $this->_utilisateur ".
396
		  " AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE." > \"$this->_date_debut_absence\" ".
397
		  " AND ".GEST_CHAMPS_DATE_ENVOI_LETTRE. " = \"0000-00-00\"";
398
 
399
 
400
       	$resultat=$GLOBALS['db']->query($requete);
401
 
402
	(DB::isError($resultat)) ?
403
	          die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
404
 
405
	$ligne =$resultat->fetchRow(DB_FETCHMODE_ORDERED);
406
 
407
 
408
	if($ligne[0]!=null)
409
	{
410
	 //recuperation de l'objet absence precedente
411
	$absence=&Absence::recupererAbsenceDateFin($this->_utilisateur,$this->_motif,$ligne[0]);
412
	return $absence;
413
 
414
	}  else return -1;
415
    }
416
 
417
 
418
    /**
419
    *fonction recuperant une absence a partir de
420
    *@param id : identifiant utiliateur
421
    *@param : motif
422
    *@param : datedebut de l'absence
423
    *@return absence
424
    *-1 si erreur ou rien
425
    */
426
    function recupererAbsenceDateDeb($id,$motif,$dateDeb)
427
    {
428
	$requete=" SELECT * FROM ".GEST_ABSENCE.
429
	         " WHERE ".GEST_CHAMPS_ID_UTILISATEUR." =$id ".
430
		 " AND ".GEST_CHAMPS_ID_MOTIF." = $motif ".
431
		 " AND ".GEST_CHAMPS_DATE_DEBUT." =\"$dateDeb\"";
432
 
433
 
434
 
435
       $resultat=$GLOBALS['db']->query($requete);
436
 
437
       $ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC);
438
 
439
       $k=$resultat->numRows();
440
 
441
       (DB::isError($resultat)) ?
442
                 die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
443
       if($k==1)
444
       {
445
       $absence=new Absence($ligne[GEST_CHAMPS_ID_UTILISATEUR],$ligne[GEST_CHAMPS_ID_MOTIF],$ligne[GEST_CHAMPS_DATE_DEBUT_ABSENCE]);
446
 
447
       $absence->setDateFin($ligne[GEST_CHAMPS_DATE_FIN_ABSENCE]);
448
 
449
       $absence->setDateEnvoi($ligne[GEST_CHAMPS_DATE_ENVOI_LETTRE]);
450
       return $absence;
451
       }else return -1;
452
 
453
    }
454
 
455
    /**fonction qui recupere une absence de la base de donnees
456
    *@param : $id : identifiant de l'utilisateur
457
    *@param: $motif : identifiant du motif d'absence
458
    *@param : $date: date de fin de l'absence
459
    *@return -1 si erreur
460
    *@return  objet absence
461
    */
462
    function recupererAbsenceDateFin($id,$motif,$dateFin)
463
    {
464
	$requete=" SELECT * FROM ".GEST_ABSENCE.
465
	         " WHERE ".GEST_CHAMPS_ID_UTILISATEUR." =$id ".
466
		 " AND ".GEST_CHAMPS_ID_MOTIF." = $motif ".
467
		 " AND ".GEST_CHAMPS_DATE_FIN_ABSENCE." =\"$dateFin\"";
468
 
469
 
470
       $resultat=$GLOBALS['db']->query($requete);
471
 
472
       $ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC);
473
 
474
       $k=$resultat->numRows();
475
 
476
       (DB::isError($resultat)) ?
477
                 die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
478
       if($k==1)
479
       {
480
       $absence=new Absence($ligne[GEST_CHAMPS_ID_UTILISATEUR],$ligne[GEST_CHAMPS_ID_MOTIF],$ligne[GEST_CHAMPS_DATE_DEBUT_ABSENCE]);
481
 
482
       $absence->setDateFin($ligne[GEST_CHAMPS_DATE_FIN_ABSENCE]);
483
 
484
       $absence->setDateEnvoi($ligne[GEST_CHAMPS_DATE_ENVOI_LETTRE]);
485
       return $absence;
486
       }else return -1;
487
 
488
    }
489
    /**
490
    *met a jour la det de debut
491
    *
492
    */
493
    function setDateDeb( $dateDeb )
494
    {
495
	$this->_date_debut_absence =$dateDeb;
496
    }
497
 
498
 
499
    /**
500
    *met a jour la date de fin
501
    *  verification si date de fin superieur ou egale a date debut
502
    *renvoi 1 si modification effectuee
503
    *-1 si erreur
504
    */
505
    function setDateFin($dateFin )
506
    {
507
	$deb=$this->_date_debut_absence;
508
 
509
 
510
	if ($deb<=$dateFin )
511
	{
512
	    $this->_date_fin_absence=$dateFin;
513
	    return 1;
514
	}else{
515
	    return -1;
516
	}
517
 
518
    }
519
 
520
 
521
    /**
522
    *met a jour la date d'envoi
523
    *
524
    */
525
    function setDateEnvoi( $dateEnvoi )
526
    {
527
	$this->_date_envoi_lettre=$dateEnvoi;
528
    }
529
 
530
    /*
531
    *supprime une absence
532
    *@param : $user : identifiant de l'utilisateur
533
    *@date : date de l'absence : debut d'absence au format Y-m-d
534
    */
535
    function supprimerAbsence($user,$dateDeb)
536
    {
537
	$requete="DELETE FROM ".GEST_ABSENCE.
538
	" WHERE ".GEST_CHAMPS_ID_UTILISATEUR." = $user "
539
	." AND ".GEST_CHAMPS_DATE_DEBUT_ABSENCE." = \"$dateDeb\" ";
540
 
541
	$resultat=$GLOBALS['db']->query($requete);
542
 
543
	(DB::isError($resultat)) ?
544
	die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
545
 
546
	$j=$GLOBALS['db']->affectedRows();
547
	return $j;
548
    }
549
 
550
    /**
551
    *recuperer absence pour un utilisateur
552
    *@param id : identifiant utilisateur
553
    */
554
 
555
    function recupererTableauAbsence($id)
556
    {
557
	$table =array();
558
	$requete=" SELECT ".GEST_CHAMPS_DATE_DEBUT_ABSENCE." , ".GEST_CHAMPS_DATE_FIN_ABSENCE.
559
	" , ".GEST_CHAMPS_DATE_ENVOI_LETTRE." , ".GEST_CHAMPS_LIBELLE_MOTIF.
560
	" FROM ".GEST_ABSENCE." a, ".GEST_MOTIF_ABSENCE." m WHERE "
561
	.GEST_CHAMPS_ID_UTILISATEUR." =$id AND "
562
	."a.".GEST_CHAMPS_ID_MOTIF." = m.".GEST_CHAMPS_ID_MOTIF." ";
563
 
564
 
565
	$resultat =$GLOBALS['db']->query($requete) ;
566
 
567
	(DB::isError($resultat)) ? die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
568
	while($ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC))
569
	{
570
	    $case =array(
571
	    GEST_CHAMPS_DATE_DEBUT_ABSENCE =>$ligne[GEST_CHAMPS_DATE_DEBUT_ABSENCE],
572
	    GEST_CHAMPS_DATE_FIN_ABSENCE =>$ligne[GEST_CHAMPS_DATE_FIN_ABSENCE],
573
	    GEST_CHAMPS_DATE_ENVOI_LETTRE =>$ligne[GEST_CHAMPS_DATE_ENVOI_LETTRE],
574
	    GEST_CHAMPS_LIBELLE_MOTIF =>$ligne[GEST_CHAMPS_LIBELLE_MOTIF]);
575
 
576
	    array_push($table,$case);
577
	}
578
 
579
	return $table;
580
    }
581
    /*
582
    *affichage des absences
583
    */
584
 
585
    function afficherAbsence()
586
    {
587
	echo "absence : ";
588
 
589
	$t=array(
590
	$this->_utilisateur,$this->_motif,$this->_date_debut_absence,
591
	$this->_date_fin_absence,$this->_date_envoi_lettre);
592
 
593
	foreach ($t as $p)
594
	{
595
	    if (isset($p)){
596
	    echo "$p  <br />";}
597
	}
598
 
599
 
600
    }
601
 
602
}
603
?>