Subversion Repositories Applications.gtt

Rev

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

Rev 104 Rev 170
Line 1... Line 1...
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 AbsenceMotif
25
* Classe AbsenceMotif
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 AbsenceMotif : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
44
* class AbsenceMotif : 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 AbsenceMotif extends aGttSql {
47
class AbsenceMotif extends aGttSql {
48
	/*** Constantes : */
48
	/*** Constantes : */
49
	const GAM_TOUS = 'ABSENCEMOTIF_TOUS';
49
	const GAM_TOUS = 'ABSENCEMOTIF_TOUS';
50
	const GAM_ID = 'ABSENCEMOTIF_ID';
50
	const GAM_ID = 'ABSENCEMOTIF_ID';
51
	const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
51
	const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
52
	const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';
52
	const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';
53
 
53
 
54
	/*** Attributs : */
54
	/*** Attributs : */
55
	private $id_absence_motif;
55
	private $id_absence_motif;
56
	private $libelle;
56
	private $libelle;
57
	private $mark_cp_diminuer;
57
	private $mark_cp_diminuer;
58
	private $mark_hs_diminuer;
58
	private $mark_hs_diminuer;
59
	
59
	
60
	/*** Aggregations : */
60
	/*** Aggregations : */
61
 
61
 
62
	/*** Constructeur : */
62
	/*** Constructeur : */
63
	public function __construct($cmd = null, $parametres = null)
63
	public function __construct($cmd = null, $parametres = null)
64
	{
64
	{
65
		$this->dao_table_nom = 'gestion_absence_motif';
65
		$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_absence_motif';
66
		$this->dao_correspondance = array(
66
		$this->dao_correspondance = array(
67
			'gam_id_absence_motif'	=> 'id_absence_motif',
67
			'gam_id_absence_motif'	=> 'id_absence_motif',
68
			'gam_libelle'	=> 'libelle',
68
			'gam_libelle'	=> 'libelle',
69
			'gam_mark_cp_diminuer'	=> 'mark_cp_diminuer',
69
			'gam_mark_cp_diminuer'	=> 'mark_cp_diminuer',
70
			'gam_mark_hs_diminuer'	=> 'mark_hs_diminuer');
70
			'gam_mark_hs_diminuer'	=> 'mark_hs_diminuer');
71
 
71
 
72
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
72
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
73
		if (!is_null($cmd)) {
73
		if (!is_null($cmd)) {
74
			$this->consulter($cmd, $parametres, true);
74
			$this->consulter($cmd, $parametres, true);
75
		}
75
		}
76
	}
76
	}
77
 
77
 
78
	/*** Accesseurs : */
78
	/*** Accesseurs : */
79
	// Id Absence Motif
79
	// Id Absence Motif
80
	public function getIdAbsenceMotif()
80
	public function getIdAbsenceMotif()
81
	{
81
	{
82
		return $this->id_absence_motif;
82
		return $this->id_absence_motif;
83
	}
83
	}
84
	public function setIdAbsenceMotif( $iam )
84
	public function setIdAbsenceMotif( $iam )
85
	{
85
	{
86
		$this->id_absence_motif = $iam;
86
		$this->id_absence_motif = $iam;
87
	}
87
	}
88
 
88
 
89
	// Libelle
89
	// Libelle
90
	public function getLibelle()
90
	public function getLibelle()
91
	{
91
	{
92
		return $this->libelle;
92
		return $this->libelle;
93
	}
93
	}
94
	public function setLibelle( $l )
94
	public function setLibelle( $l )
95
	{
95
	{
96
		$this->libelle = $l;
96
		$this->libelle = $l;
97
	}
97
	}
Line 98... Line 98...
98
 
98
 
99
	// CP Diminuer
99
	// CP Diminuer
100
	public function getMarkCpDiminuer()
100
	public function getMarkCpDiminuer()
101
	{
101
	{
Line 114... Line 114...
114
	public function setMarkHsDiminuer( $hd )
114
	public function setMarkHsDiminuer( $hd )
115
	{
115
	{
116
		$this->mark_hs_diminuer = $hd;
116
		$this->mark_hs_diminuer = $hd;
117
	}
117
	}
Line 118... Line 118...
118
 
118
 
119
	/*** Méthodes : */
119
	/*** Méthodes : */
120
 
120
 
121
	/**
121
	/**
122
	* Consulter la table gestion_absence_motif.
122
	* Consulter la table gestion_absence_motif.
123
	* @return mixed un tableau d'objets AbsenceMotif s'il y en a plusieurs, l'objet AbsenceMotif s'il y en a 1 seul sinon false.
123
	* @return mixed un tableau d'objets AbsenceMotif s'il y en a plusieurs, l'objet AbsenceMotif s'il y en a 1 seul sinon false.
124
	*/
124
	*/
125
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
125
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
126
	{
126
	{
127
		switch ($cmd) {
127
		switch ($cmd) {
128
			case AbsenceMotif::GAM_TOUS:
128
			case AbsenceMotif::GAM_TOUS:
129
				$requete = 	'SELECT * '.
129
				$requete = 	'SELECT * '.
130
							'FROM gestion_absence_motif ';
130
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
131
				break;
131
				break;
132
			case AbsenceMotif::GAM_ID:
132
			case AbsenceMotif::GAM_ID:
133
				$requete = 	'SELECT * '.
133
				$requete = 	'SELECT * '.
134
							'FROM gestion_absence_motif '.
134
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
135
							'WHERE gam_id_absence_motif = #0 ';
135
							'WHERE gam_id_absence_motif = #0 ';
136
				break;
136
				break;
137
			case AbsenceMotif::GAM_ID_MAX:
137
			case AbsenceMotif::GAM_ID_MAX:
138
				$requete =	'SELECT MAX(gam_id_absence_motif) AS gam_id_absence_motif '.
138
				$requete =	'SELECT MAX(gam_id_absence_motif) AS gam_id_absence_motif '.
139
							'FROM gestion_absence_motif ';
139
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
140
				break;
140
				break;
141
			case AbsenceMotif::GAM_LIBELLE:
141
			case AbsenceMotif::GAM_LIBELLE:
142
				$requete =	'SELECT * '.
142
				$requete =	'SELECT * '.
143
							'FROM gestion_absence_motif '.
143
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
144
							'WHERE gam_libelle = "#0" ';
144
							'WHERE gam_libelle = "#0" ';
145
				break;
145
				break;
146
			default :
146
			default :
147
				$message = 'Commande '.$cmd.'inconnue!';
147
				$message = 'Commande '.$cmd.'inconnue!';
148
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
148
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
149
    			trigger_error($e, E_USER_ERROR);
149
    			trigger_error($e, E_USER_ERROR);
150
		}
150
		}
151
		return parent::consulter($requete, $parametres, $instancier);
151
		return parent::consulter($requete, $parametres, $instancier);
152
	}
152
	}
153
}
153
}
154
 
154
 
155
/* +--Fin du code ----------------------------------------------------------------------------------------+
155
/* +--Fin du code ----------------------------------------------------------------------------------------+
156
*
156
*
157
* $Log$
157
* $Log$
158
*
158
*
159
* +-- Fin du code ----------------------------------------------------------------------------------------+
159
* +-- Fin du code ----------------------------------------------------------------------------------------+
160
*/
160
*/
161
?>
161
?>