Subversion Repositories Applications.gtt

Rev

Rev 104 | Rev 128 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 104 Rev 110
1
<?php
1
<?php
2
// +------------------------------------------------------------------------------------------------------+
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 5.1.1                                                                                    |
3
// | PHP version 5.1.1                                                                                    |
4
// +------------------------------------------------------------------------------------------------------+
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
6
// +------------------------------------------------------------------------------------------------------+
7
// | This file is part of eFlore.                                                                         |
7
// | This file is part of eFlore.                                                                         |
8
// |                                                                                                      |
8
// |                                                                                                      |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | it under the terms of the GNU General Public License as published by                                 |
10
// | it under the terms of the GNU General Public License as published by                                 |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | (at your option) any later version.                                                                  |
12
// | (at your option) any later version.                                                                  |
13
// |                                                                                                      |
13
// |                                                                                                      |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | GNU General Public License for more details.                                                         |
17
// | GNU General Public License for more details.                                                         |
18
// |                                                                                                      |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU General Public License                                    |
19
// | You should have received a copy of the GNU General Public License                                    |
20
// | along with Foobar; if not, write to the Free Software                                                |
20
// | along with Foobar; if not, write to the Free Software                                                |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// +------------------------------------------------------------------------------------------------------+
22
// +------------------------------------------------------------------------------------------------------+
23
// CVS : $Id$
23
// CVS : $Id$
24
/**
24
/**
25
* Classe Utilisateur
25
* Classe Utilisateur
26
*
26
*
27
* Description
27
* Description
28
*
28
*
29
*@package eFlore
29
*@package eFlore
30
*@subpackage modele
30
*@subpackage modele
31
//Auteur original :
31
//Auteur original :
32
*@version 3
32
*@version 3
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@version 4
35
*@version 4
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
37
*@author        aucun
37
*@author        aucun
38
*@copyright     Tela-Botanica 2000-2006
38
*@copyright     Tela-Botanica 2000-2006
39
*@version       $Revision$ $Date$
39
*@version       $Revision$ $Date$
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
*/
41
*/
42
 
42
 
43
/**
43
/**
44
* class Utilisateur : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
44
* class Utilisateur : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
45
* classe métier
45
* classe métier
46
*/
46
*/
47
class Utilisateur extends aGttSql {
47
class Utilisateur extends aGttSql {
48
	/*** Constantes : */
48
	/*** Constantes : */
49
	const GU_TOUS = 'UTILISATEUR_TOUS';
49
	const GU_TOUS = 'UTILISATEUR_TOUS';
50
	const GU_ID = 'UTILISATEUR_ID';
50
	const GU_ID = 'UTILISATEUR_ID';
51
	const GU_ID_MAX = 'UTILISATEUR_ID_MAX';
51
	const GU_ID_MAX = 'UTILISATEUR_ID_MAX';
52
	const GU_CE_STATUT = 'UTILISATEUR_CE_STATUT';
52
	const GU_CE_STATUT = 'UTILISATEUR_CE_STATUT';
53
	const GU_MAIL = 'UTILISATEUR_MAIL';
53
	const GU_MAIL = 'UTILISATEUR_MAIL';
54
	const GU_TOUS_AFFICHABLE = 'UTILISATEUR_TOUS_AFFICHABLE';
54
	const GU_TOUS_AFFICHABLE = 'UTILISATEUR_TOUS_AFFICHABLE';
55
	const GU_ADMIN = 'UTILISATEUR_ADMIN';
55
	const GU_ADMIN = 'UTILISATEUR_ADMIN';
56
 
56
 
57
	/*** Attributs : */
57
	/*** Attributs : */
58
	private $id_utilisateur;
58
	private $id_utilisateur;
59
	private $ce_statut = 0;
59
	private $ce_statut = 0;
60
	private $nom;
60
	private $nom;
61
	private $prenom;
61
	private $prenom;
62
	private $password;
62
	private $password;
63
	private $email;
63
	private $email;
64
	private $telephone;
64
	private $telephone;
65
	private $adresse;
65
	private $adresse;
66
	private $code_postal;
66
	private $code_postal;
67
	private $ville;
67
	private $ville;
68
	private $quota_heures_supp = 0;
68
	private $quota_heures_supp = 0;
69
	private $conges_payes = 0;
69
	private $conges_payes = 0;
70
	private $temps_de_travail_jour = 7;
70
	private $temps_de_travail_jour = 7;
71
	private $temps_de_travail_mois = 0;
71
	private $temps_de_travail_mois = 0;
-
 
72
	private $tdt_lundi = 0;
-
 
73
	private $tdt_mardi = 0;
-
 
74
	private $tdt_mercredi = 0;
-
 
75
	private $tdt_jeudi = 0;
-
 
76
	private $tdt_vendredi = 0;
-
 
77
	private $tdt_samedi = 0;
-
 
78
	private $tdt_dimanche = 0;
72
	private $mark_admin = 0;
79
	private $mark_admin = 0;
73
	private $mark_recapitulatif = 1;
80
	private $mark_recapitulatif = 1;
74
	private $notes;
81
	private $notes;
75
 
82
 
76
	/*** Aggregations : */
83
	/*** Aggregations : */
77
 
84
 
78
	/*** Constructeur : */
85
	/*** Constructeur : */
79
	public function __construct($cmd = null, $parametres = null)
86
	public function __construct($cmd = null, $parametres = null)
80
	{
87
	{
81
		$this->dao_table_nom = 'gestion_utilisateur';
88
		$this->dao_table_nom = 'gestion_utilisateur';
82
		$this->dao_correspondance = array(
89
		$this->dao_correspondance = array(
83
			'gu_id_utilisateur'	=> 'id_utilisateur',
90
			'gu_id_utilisateur'	=> 'id_utilisateur',
84
			'gu_ce_statut'	=> 'ce_statut',
91
			'gu_ce_statut'	=> 'ce_statut',
85
			'gu_nom'	=> 'nom',
92
			'gu_nom'	=> 'nom',
86
			'gu_prenom'	=> 'prenom',
93
			'gu_prenom'	=> 'prenom',
87
			'gu_password'	=> 'password',
94
			'gu_password'	=> 'password',
88
			'gu_email'	=> 'email',
95
			'gu_email'	=> 'email',
89
			'gu_telephone'	=> 'telephone',
96
			'gu_telephone'	=> 'telephone',
90
			'gu_adresse'	=> 'adresse',
97
			'gu_adresse'	=> 'adresse',
91
			'gu_code_postal'	=> 'code_postal',
98
			'gu_code_postal'	=> 'code_postal',
92
			'gu_ville'	=> 'ville',
99
			'gu_ville'	=> 'ville',
93
			'gu_quota_heures_supp'	=> 'quota_heures_supp',
100
			'gu_quota_heures_supp'	=> 'quota_heures_supp',
94
			'gu_conges_payes'	=> 'conges_payes',
101
			'gu_conges_payes'	=> 'conges_payes',
95
			'gu_temps_de_travail_jour'	=> 'temps_de_travail_jour',
102
			'gu_temps_de_travail_jour'	=> 'temps_de_travail_jour',
96
			'gu_temps_de_travail_mois'	=> 'temps_de_travail_mois',
103
			'gu_temps_de_travail_mois'	=> 'temps_de_travail_mois',
-
 
104
			'gu_tdt_lundi'	=> 'tdt_lundi',
-
 
105
			'gu_tdt_mardi'	=> 'tdt_mardi',
-
 
106
			'gu_tdt_mercredi'	=> 'tdt_mercredi',
-
 
107
			'gu_tdt_jeudi'	=> 'tdt_jeudi',
-
 
108
			'gu_tdt_vendredi'	=> 'tdt_vendredi',
-
 
109
			'gu_tdt_samedi'	=> 'tdt_samedi',
-
 
110
			'gu_tdt_dimanche'	=> 'tdt_dimanche',
97
			'gu_mark_admin'	=> 'mark_admin',
111
			'gu_mark_admin'	=> 'mark_admin',
98
			'gu_mark_recapitulatif'	=> 'mark_recapitulatif',
112
			'gu_mark_recapitulatif'	=> 'mark_recapitulatif',
99
			'gu_notes'	=> 'notes');
113
			'gu_notes'	=> 'notes');
100
 
114
 
101
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
115
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
102
		if (!is_null($cmd)) {
116
		if (!is_null($cmd)) {
103
			$this->consulter($cmd, $parametres, true);
117
			$this->consulter($cmd, $parametres, true);
104
		}
118
		}
105
	}
119
	}
106
 
120
 
107
	/*** Accesseurs : */
121
	/*** Accesseurs : */
108
	// Id Utilisateur
122
	// Id Utilisateur
109
	public function getIdUtilisateur()
123
	public function getIdUtilisateur()
110
	{
124
	{
111
		return $this->id_utilisateur;
125
		return $this->id_utilisateur;
112
	}
126
	}
113
	public function setIdUtilisateur( $iu )
127
	public function setIdUtilisateur( $iu )
114
	{
128
	{
115
		$this->id_utilisateur = $iu;
129
		$this->id_utilisateur = $iu;
116
	}
130
	}
117
 
131
 
118
	// Gus Id Utilisateur Statut
132
	// Gus Id Utilisateur Statut
119
	public function getCeStatut()
133
	public function getCeStatut()
120
	{
134
	{
121
		return $this->ce_statut;
135
		return $this->ce_statut;
122
	}
136
	}
123
	public function setCeStatut( $cs )
137
	public function setCeStatut( $cs )
124
	{
138
	{
125
		$this->ce_statut = $cs;
139
		$this->ce_statut = $cs;
126
	}
140
	}
127
 
141
 
128
	// Nom
142
	// Nom
129
	public function getNom()
143
	public function getNom()
130
	{
144
	{
131
		return $this->nom;
145
		return $this->nom;
132
	}
146
	}
133
	public function setNom( $n )
147
	public function setNom( $n )
134
	{
148
	{
135
		$this->nom = strtoupper($n);
149
		$this->nom = strtoupper($n);
136
	}
150
	}
137
 
151
 
138
	// Prenom
152
	// Prenom
139
	public function getPrenom()
153
	public function getPrenom()
140
	{
154
	{
141
		return $this->prenom;
155
		return $this->prenom;
142
	}
156
	}
143
	public function setPrenom( $p )
157
	public function setPrenom( $p )
144
	{
158
	{
145
		$this->prenom = $p;
159
		$this->prenom = $p;
146
	}
160
	}
147
 
161
 
148
	// Password
162
	// Password
149
	public function getPassword()
163
	public function getPassword()
150
	{
164
	{
151
		return $this->password;
165
		return $this->password;
152
	}
166
	}
153
	public function setPassword( $p )
167
	public function setPassword( $p )
154
	{
168
	{
155
		$this->password = md5($p);
169
		$this->password = md5($p);
156
	}
170
	}
157
 
171
 
158
	// Email
172
	// Email
159
	public function getEmail()
173
	public function getEmail()
160
	{
174
	{
161
		return $this->email;
175
		return $this->email;
162
	}
176
	}
163
	public function setEmail( $e )
177
	public function setEmail( $e )
164
	{
178
	{
165
		$this->email = $e;
179
		$this->email = $e;
166
	}
180
	}
167
 
181
 
168
	// Telephone
182
	// Telephone
169
	public function getTelephone()
183
	public function getTelephone()
170
	{
184
	{
171
		return $this->telephone;
185
		return $this->telephone;
172
	}
186
	}
173
	public function setTelephone( $t )
187
	public function setTelephone( $t )
174
	{
188
	{
175
		$this->telephone = (string) $t;
189
		$this->telephone = (string) $t;
176
	}
190
	}
177
 
191
 
178
	// Adresse
192
	// Adresse
179
	public function getAdresse()
193
	public function getAdresse()
180
	{
194
	{
181
		return $this->adresse;
195
		return $this->adresse;
182
	}
196
	}
183
	public function setAdresse( $a )
197
	public function setAdresse( $a )
184
	{
198
	{
185
		$this->adresse = $a;
199
		$this->adresse = $a;
186
	}
200
	}
187
 
201
 
188
	// Code Postal
202
	// Code Postal
189
	public function getCodePostal()
203
	public function getCodePostal()
190
	{
204
	{
191
		return $this->code_postal;
205
		return $this->code_postal;
192
	}
206
	}
193
	public function setCodePostal( $cp )
207
	public function setCodePostal( $cp )
194
	{
208
	{
195
		$this->code_postal = $cp;
209
		$this->code_postal = $cp;
196
	}
210
	}
197
 
211
 
198
	// Ville
212
	// Ville
199
	public function getVille()
213
	public function getVille()
200
	{
214
	{
201
		return $this->ville;
215
		return $this->ville;
202
	}
216
	}
203
	public function setVille( $v )
217
	public function setVille( $v )
204
	{
218
	{
205
		$this->ville = $v;
219
		$this->ville = $v;
206
	}
220
	}
207
 
221
 
208
	// Quota Heures Supp
222
	// Quota Heures Supp
209
	public function getQuotaHeuresSupp()
223
	public function getQuotaHeuresSupp()
210
	{
224
	{
211
		return $this->quota_heures_supp;
225
		return $this->quota_heures_supp;
212
	}
226
	}
213
	public function setQuotaHeuresSupp( $qhs )
227
	public function setQuotaHeuresSupp( $qhs )
214
	{
228
	{
215
		$this->quota_heures_supp = $qhs;
229
		$this->quota_heures_supp = $qhs;
216
	}
230
	}
217
 
231
 
218
	// Conges Payes
232
	// Conges Payes
219
	public function getCongesPayes()
233
	public function getCongesPayes()
220
	{
234
	{
221
		return $this->conges_payes;
235
		return $this->conges_payes;
222
	}
236
	}
223
	public function setCongesPayes( $cp )
237
	public function setCongesPayes( $cp )
224
	{
238
	{
225
		$this->conges_payes = $cp;
239
		$this->conges_payes = $cp;
226
	}
240
	}
227
 
241
 
228
	// Temps De Travail Jour
242
	// Temps De Travail Jour
229
	public function getTempsDeTravailJour()
243
	public function getTempsDeTravailJour()
230
	{
244
	{
231
		return $this->temps_de_travail_jour;
245
		return $this->temps_de_travail_jour;
232
	}
246
	}
233
	public function setTempsDeTravailJour( $tdt )
247
	public function setTempsDeTravailJour( $tdt )
234
	{
248
	{
235
		$this->temps_de_travail_jour = $tdt;
249
		$this->temps_de_travail_jour = $tdt;
236
	}
250
	}
237
 
251
 
238
	// Temps De Travail Mois
252
	// Temps De Travail Mois
239
	public function getTempsDeTravailMois()
253
	public function getTempsDeTravailMois()
240
	{
254
	{
241
		return $this->temps_de_travail_mois;
255
		return $this->temps_de_travail_mois;
242
	}
256
	}
243
	public function setTempsDeTravailMois( $tdt )
257
	public function setTempsDeTravailMois( $tdt )
244
	{
258
	{
245
		$this->temps_de_travail_mois = $tdt;
259
		$this->temps_de_travail_mois = $tdt;
246
	}
260
	}
-
 
261
 
-
 
262
	// Tdt Lundi
-
 
263
	public function getTdtLundi()
-
 
264
	{
-
 
265
		return $this->tdt_lundi;
-
 
266
	}
-
 
267
	public function setTdtLundi( $tdt )
-
 
268
	{
-
 
269
		$this->tdt_lundi = $tdt;
-
 
270
	}
-
 
271
 
-
 
272
	// Tdt Mardi
-
 
273
	public function getTdtMardi()
-
 
274
	{
-
 
275
		return $this->tdt_mardi;
-
 
276
	}
-
 
277
	public function setTdtMardi( $tdt )
-
 
278
	{
-
 
279
		$this->tdt_mardi = $tdt;
-
 
280
	}
-
 
281
	
-
 
282
	// Tdt Mercredi
-
 
283
	public function getTdtMercredi()
-
 
284
	{
-
 
285
		return $this->tdt_mercredi;
-
 
286
	}
-
 
287
	public function setTdtMercredi( $tdt )
-
 
288
	{
-
 
289
		$this->tdt_mercredi = $tdt;
-
 
290
	}
-
 
291
	
-
 
292
	// Tdt Jeudi
-
 
293
	public function getTdtJeudi()
-
 
294
	{
-
 
295
		return $this->tdt_jeudi;
-
 
296
	}
-
 
297
	public function setTdtJeudi( $tdt )
-
 
298
	{
-
 
299
		$this->tdt_jeudi = $tdt;
-
 
300
	}
-
 
301
 
-
 
302
	// Tdt Vendredi
-
 
303
	public function getTdtVendredi()
-
 
304
	{
-
 
305
		return $this->tdt_vendredi;
-
 
306
	}
-
 
307
	public function setTdtVendredi( $tdt )
-
 
308
	{
-
 
309
		$this->tdt_vendredi = $tdt;
-
 
310
	}
-
 
311
	
-
 
312
	// Tdt Samedi
-
 
313
	public function getTdtSamedi()
-
 
314
	{
-
 
315
		return $this->tdt_samedi;
-
 
316
	}
-
 
317
	public function setTdtSamedi( $tdt )
-
 
318
	{
-
 
319
		$this->tdt_samedi = $tdt;
-
 
320
	}
-
 
321
 
-
 
322
	// Tdt Dimanche
-
 
323
	public function getTdtDimanche()
-
 
324
	{
-
 
325
		return $this->tdt_dimanche;
-
 
326
	}
-
 
327
	public function setTdtDimanche( $tdt )
-
 
328
	{
-
 
329
		$this->tdt_dimanche = $tdt;
-
 
330
	}
247
 
331
 
248
	// Mark Admin
332
	// Mark Admin
249
	public function getMarkAdmin()
333
	public function getMarkAdmin()
250
	{
334
	{
251
		return $this->mark_admin;
335
		return $this->mark_admin;
252
	}
336
	}
253
	public function setMarkAdmin( $ma )
337
	public function setMarkAdmin( $ma )
254
	{
338
	{
255
		$this->mark_admin = $ma;
339
		$this->mark_admin = $ma;
256
	}
340
	}
257
 
341
 
258
	// Mark Recapitulatif
342
	// Mark Recapitulatif
259
	public function getMarkRecapitulatif()
343
	public function getMarkRecapitulatif()
260
	{
344
	{
261
		return $this->mark_recapitulatif;
345
		return $this->mark_recapitulatif;
262
	}
346
	}
263
	public function setMarkRecapitulatif( $mr )
347
	public function setMarkRecapitulatif( $mr )
264
	{
348
	{
265
		$this->mark_recapitulatif = $mr;
349
		$this->mark_recapitulatif = $mr;
266
	}
350
	}
267
 
351
 
268
	// Notes
352
	// Notes
269
	public function getNotes()
353
	public function getNotes()
270
	{
354
	{
271
		return $this->notes;
355
		return $this->notes;
272
	}
356
	}
273
	public function setNotes( $n )
357
	public function setNotes( $n )
274
	{
358
	{
275
		$this->notes = $n;
359
		$this->notes = $n;
276
	}
360
	}
277
 
361
 
278
	/*** Méthodes : */
362
	/*** Méthodes : */
279
 
363
 
280
	/**
364
	/**
281
	* Consulter la table gestion_utilisateur.
365
	* Consulter la table gestion_utilisateur.
282
	* @return mixed un tableau d'objets Utilisateur s'il y en a plusieurs, l'objet Utilisateur s'il y en a 1 seul sinon false.
366
	* @return mixed un tableau d'objets Utilisateur s'il y en a plusieurs, l'objet Utilisateur s'il y en a 1 seul sinon false.
283
	*/
367
	*/
284
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
368
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
285
	{
369
	{
286
		switch ($cmd) {
370
		switch ($cmd) {
287
			case Utilisateur::GU_TOUS:
371
			case Utilisateur::GU_TOUS:
288
				$requete = 	'SELECT * '.
372
				$requete = 	'SELECT * '.
289
							'FROM gestion_utilisateur '.
373
							'FROM gestion_utilisateur '.
290
							'ORDER BY gu_prenom, gu_nom ASC';
374
							'ORDER BY gu_prenom, gu_nom ASC';
291
				break;
375
				break;
292
			case Utilisateur::GU_ID:
376
			case Utilisateur::GU_ID:
293
				$requete = 	'SELECT * '.
377
				$requete = 	'SELECT * '.
294
							'FROM gestion_utilisateur '.
378
							'FROM gestion_utilisateur '.
295
							'WHERE gu_id_utilisateur = #0 ';
379
							'WHERE gu_id_utilisateur = #0 ';
296
				break;
380
				break;
297
			case Utilisateur::GU_ID_MAX:
381
			case Utilisateur::GU_ID_MAX:
298
				$requete =	'SELECT MAX(gu_id_utilisateur) AS gu_id_utilisateur '.
382
				$requete =	'SELECT MAX(gu_id_utilisateur) AS gu_id_utilisateur '.
299
							'FROM gestion_utilisateur ';
383
							'FROM gestion_utilisateur ';
300
				break;
384
				break;
301
			case Utilisateur::GU_CE_STATUT:
385
			case Utilisateur::GU_CE_STATUT:
302
				$requete =	'SELECT * '.
386
				$requete =	'SELECT * '.
303
							'FROM gestion_utilisateur '.
387
							'FROM gestion_utilisateur '.
304
							'WHERE gu_ce_statut = "#0" ';
388
							'WHERE gu_ce_statut = "#0" ';
305
				break;
389
				break;
306
			case Utilisateur::GU_MAIL:
390
			case Utilisateur::GU_MAIL:
307
				$requete =	'SELECT * '.
391
				$requete =	'SELECT * '.
308
							'FROM gestion_utilisateur '.
392
							'FROM gestion_utilisateur '.
309
							'WHERE gu_email = "#0" ';
393
							'WHERE gu_email = "#0" ';
310
				break;
394
				break;
311
			case Utilisateur::GU_TOUS_AFFICHABLE:
395
			case Utilisateur::GU_TOUS_AFFICHABLE:
312
				$requete = 	'SELECT * '.
396
				$requete = 	'SELECT * '.
313
							'FROM gestion_utilisateur '.
397
							'FROM gestion_utilisateur '.
314
							'WHERE gu_mark_recapitulatif = 0 '.
398
							'WHERE gu_mark_recapitulatif = 0 '.
315
							'ORDER BY gu_prenom, gu_nom ASC';
399
							'ORDER BY gu_prenom, gu_nom ASC';
316
				break;
400
				break;
317
			case Utilisateur::GU_ADMIN:
401
			case Utilisateur::GU_ADMIN:
318
				$requete = 	'SELECT * '.
402
				$requete = 	'SELECT * '.
319
							'FROM gestion_utilisateur '.
403
							'FROM gestion_utilisateur '.
320
							'WHERE gu_mark_admin = 1 ';
404
							'WHERE gu_mark_admin = 1 ';
321
				break;
405
				break;
322
			
406
			
323
			default :
407
			default :
324
				$message = 'Commande '.$cmd.'inconnue!';
408
				$message = 'Commande '.$cmd.'inconnue!';
325
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
409
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
326
    			trigger_error($e, E_USER_ERROR);
410
    			trigger_error($e, E_USER_ERROR);
327
		}
411
		}
328
		return parent::consulter($requete, $parametres, $instancier);
412
		return parent::consulter($requete, $parametres, $instancier);
329
	}
413
	}
330
 
414
 
331
	public function supprimer()
415
	public function supprimer()
332
	{
416
	{
333
		$requete = 	'DELETE FROM gestion_utilisateur '.
417
		$requete = 	'DELETE FROM gestion_utilisateur '.
334
					'WHERE gu_id_utilisateur = '.$this->getIdUtilisateur();
418
					'WHERE gu_id_utilisateur = '.$this->getIdUtilisateur();
335
		$resultat = $GLOBALS['db']->query($requete);
419
		$resultat = $GLOBALS['db']->query($requete);
336
		(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
420
		(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
337
 
421
 
338
		if ($GLOBALS['db']->affectedRows() == 1) {
422
		if ($GLOBALS['db']->affectedRows() == 1) {
339
			return true;
423
			return true;
340
		} elseif ($GLOBALS['db']->affectedRows() == 0) {
424
		} elseif ($GLOBALS['db']->affectedRows() == 0) {
341
			return false;
425
			return false;
342
		}
426
		}
343
	}
427
	}
344
 
428
 
345
	/**augmenter le nombre d'heure sup
429
	/**augmenter le nombre d'heure sup
346
	*un acces est fait a la bse de donnees pour enregistrer les changements en temps reel
430
	*un acces est fait a la bse de donnees pour enregistrer les changements en temps reel
347
 	*/
431
 	*/
348
	function augmenterQuotaHeuresSup($nb)
432
	public function augmenterQuotaHeuresSup($nb)
349
	{
433
	{
350
		$this->quota_heures_supp =  $this->quota_heures_supp + $nb;
434
		$this->quota_heures_supp =  $this->quota_heures_supp + abs($nb);
351
	}
435
	}
352
 
436
 
353
	/**diminuer le nb d'heures sup*/
437
	/**diminuer le nb d'heures sup*/
354
	public function diminuerQuotaHeuresSup($nb)
438
	public function diminuerQuotaHeuresSup($nb)
355
	{
439
	{
356
		$this->quota_heures_supp =  $this->quota_heures_supp - $nb;
440
		$this->quota_heures_supp =  $this->quota_heures_supp -  abs($nb);
357
		/*un quota heure supp negatif implique qu'il y a des heures a rattraper*/
441
		/*un quota heure supp negatif implique qu'il y a des heures a rattraper*/
358
	}
442
	}
359
 
443
 
360
	/**augmenter le nombre de jours de conges */
444
	/**augmenter le nombre de jours de conges */
361
	function augmenterCongesPayes($nb)
445
	public function augmenterCongesPayes($nb)
362
	{
446
	{
363
		$this->conges_payes = $this->conges_payes + $nb;
447
		$this->conges_payes = $this->conges_payes +  abs($nb);
364
	}
448
	}
365
 
449
 
366
	/**diminuer le nombre de jour de conges */
450
	/**diminuer le nombre de jour de conges */
367
	function diminuerCongesPayes($nb)
451
	public function diminuerCongesPayes($nb)
368
	{
452
	{
369
		$this->conges_payes = $this->conges_payes - $nb;
453
		$this->conges_payes = $this->conges_payes -  abs($nb);
370
	}
454
	}
371
}
455
}
372
 
456
 
373
/* +--Fin du code ----------------------------------------------------------------------------------------+
457
/* +--Fin du code ----------------------------------------------------------------------------------------+
374
*
458
*
375
* $Log$
459
* $Log$
376
*
460
*
377
* +-- Fin du code ----------------------------------------------------------------------------------------+
461
* +-- Fin du code ----------------------------------------------------------------------------------------+
378
*/
462
*/
379
?>
463
?>