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 NoteFrais
25
* Classe NoteFrais
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 NoteFrais : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
44
* class NoteFrais : 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 NoteFrais extends aGttSql {
47
class NoteFrais extends aGttSql {
48
	/*** Constantes : */
48
	/*** Constantes : */
49
	const GNF_ID = 'NOTEFRAIS_ID';
49
	const GNF_ID = 'NOTEFRAIS_ID';
50
	const GNF_ID_MAX = 'NOTEFRAIS_ID_MAX';
50
	const GNF_ID_MAX = 'NOTEFRAIS_ID_MAX';
51
 
51
 
52
	/*** Attributs : */
52
	/*** Attributs : */
53
	private $id_note_frais;
53
	private $id_note_frais;
54
	private $ce_utilisateur;
54
	private $ce_utilisateur;
55
	private $libelle;
55
	private $libelle;
56
 
56
 
57
	/*** Aggregations : */
57
	/*** Aggregations : */
58
 
58
 
59
	/*** Constructeur : */
59
	/*** Constructeur : */
60
	public function __construct($cmd = null, $parametres = null)
60
	public function __construct($cmd = null, $parametres = null)
61
	{
61
	{
62
		$this->dao_table_nom = 'gestion_note_frais';
62
		$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_note_frais';
63
		$this->dao_correspondance = array(
63
		$this->dao_correspondance = array(
64
			'gnf_id_note_frais'	=> 'id_note_frais',
64
			'gnf_id_note_frais'	=> 'id_note_frais',
65
			'gnf_ce_utilisateur'	=> 'ce_utilisateur',
65
			'gnf_ce_utilisateur'	=> 'ce_utilisateur',
66
			'gnf_libelle'	=> 'libelle');
66
			'gnf_libelle'	=> 'libelle');
67
 
67
 
68
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
68
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
69
		if (!is_null($cmd)) {
69
		if (!is_null($cmd)) {
70
			$this->consulter($cmd, $parametres, true);
70
			$this->consulter($cmd, $parametres, true);
71
		}
71
		}
72
	}
72
	}
73
 
73
 
74
	/*** Accesseurs : */
74
	/*** Accesseurs : */
75
	// Id Note Frais
75
	// Id Note Frais
76
	public function getIdNoteFrais()
76
	public function getIdNoteFrais()
77
	{
77
	{
78
		return $this->id_note_frais;
78
		return $this->id_note_frais;
79
	}
79
	}
80
	public function setIdNoteFrais( $inf )
80
	public function setIdNoteFrais( $inf )
81
	{
81
	{
82
		$this->id_note_frais = $inf;
82
		$this->id_note_frais = $inf;
83
	}
83
	}
84
 
84
 
85
	// Ce Utilisateur
85
	// Ce Utilisateur
86
	public function getCeUtilisateur()
86
	public function getCeUtilisateur()
87
	{
87
	{
88
		return $this->ce_utilisateur;
88
		return $this->ce_utilisateur;
89
	}
89
	}
90
	public function setCeUtilisateur( $cu )
90
	public function setCeUtilisateur( $cu )
91
	{
91
	{
92
		$this->ce_utilisateur = $cu;
92
		$this->ce_utilisateur = $cu;
93
	}
93
	}
94
 
94
 
95
	// Libelle
95
	// Libelle
96
	public function getLibelle()
96
	public function getLibelle()
97
	{
97
	{
98
		return $this->libelle;
98
		return $this->libelle;
99
	}
99
	}
100
	public function setLibelle( $l )
100
	public function setLibelle( $l )
101
	{
101
	{
102
		$this->libelle = $l;
102
		$this->libelle = $l;
103
	}
103
	}
104
 
104
 
105
	/*** Méthodes : */
105
	/*** Méthodes : */
106
 
106
 
107
	/**
107
	/**
108
	* Consulter la table gestion_note_frais.
108
	* Consulter la table gestion_note_frais.
109
	* @return mixed un tableau d'objets NoteFrais s'il y en a plusieurs, l'objet NoteFrais s'il y en a 1 seul sinon false.
109
	* @return mixed un tableau d'objets NoteFrais s'il y en a plusieurs, l'objet NoteFrais s'il y en a 1 seul sinon false.
110
	*/
110
	*/
111
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
111
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
112
	{
112
	{
113
		switch ($cmd) {
113
		switch ($cmd) {
114
			case NoteFrais::GNF_ID:
114
			case NoteFrais::GNF_ID:
115
				$requete = 	'SELECT * '.
115
				$requete = 	'SELECT * '.
116
							'FROM gestion_note_frais '.
116
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_note_frais '.
117
							'WHERE gnf_id_note_frais = #0 ';
117
							'WHERE gnf_id_note_frais = #0 ';
118
				break;
118
				break;
119
			case NoteFrais::GNF_ID_MAX:
119
			case NoteFrais::GNF_ID_MAX:
120
				$requete =	'SELECT MAX(gnf_id_note_frais) '.
120
				$requete =	'SELECT MAX(gnf_id_note_frais) '.
121
							'FROM gestion_note_frais ';
121
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_note_frais ';
122
				break;
122
				break;
123
			default :
123
			default :
124
				$message = 'Commande '.$cmd.'inconnue!';
124
				$message = 'Commande '.$cmd.'inconnue!';
125
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
125
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
126
    			trigger_error($e, E_USER_ERROR);
126
    			trigger_error($e, E_USER_ERROR);
127
		}
127
		}
128
		return parent::consulter($requete, $parametres, $instancier);
128
		return parent::consulter($requete, $parametres, $instancier);
129
	}
129
	}
130
}
130
}
131
 
131
 
132
/* +--Fin du code ----------------------------------------------------------------------------------------+
132
/* +--Fin du code ----------------------------------------------------------------------------------------+
133
*
133
*
134
* $Log$
134
* $Log$
135
*
135
*
136
* +-- Fin du code ----------------------------------------------------------------------------------------+
136
* +-- Fin du code ----------------------------------------------------------------------------------------+
137
*/
137
*/
138
?>
138
?>
139
139