Subversion Repositories Applications.gtt

Rev

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