Subversion Repositories Applications.gtt

Rev

Rev 104 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 jpm 1
<?php
170 mathias 2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 5.1.1                                                                                    |
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
7
// | This file is part of eFlore.                                                                         |
8
// |                                                                                                      |
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                                 |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | (at your option) any later version.                                                                  |
13
// |                                                                                                      |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | GNU General Public License for more details.                                                         |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU General Public License                                    |
20
// | along with Foobar; if not, write to the Free Software                                                |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// +------------------------------------------------------------------------------------------------------+
10 jpm 23
// CVS : $Id$
170 mathias 24
/**
10 jpm 25
* Classe FraisKm
170 mathias 26
*
27
* Description
28
*
29
*@package eFlore
30
*@subpackage modele
31
//Auteur original :
32
*@version 3
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
34
//Autres auteurs :
35
*@version 4
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
37
*@author        aucun
38
*@copyright     Tela-Botanica 2000-2006
10 jpm 39
*@version       $Revision$ $Date$
170 mathias 40
// +------------------------------------------------------------------------------------------------------+
41
*/
42
 
43
/**
44
* class FraisKm : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
45
* classe métier
46
*/
47
class FraisKm extends aGttSql {
48
	/*** Constantes : */
49
	const GFK_ID = 'FRAISKM_ID';
50
	const GFK_ID_MAX = 'FRAISKM_ID_MAX';
51
 
52
	/*** Attributs : */
53
	private $id_frais_km;
54
	private $gfkt_id_frais_km_taux;
55
	private $ce_utilisateur;
56
	private $date;
57
	private $nbre_km;
58
	private $objet;
59
	private $trajet;
60
	private $montant_total;
61
 
62
	/*** Aggregations : */
63
 
64
	/*** Constructeur : */
65
	public function __construct($cmd = null, $parametres = null)
66
	{
67
		$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_frais_km';
68
		$this->dao_correspondance = array(
10 jpm 69
			'gfk_id_frais_km'	=> 'id_frais_km',
70
			'gfkt_id_frais_km_taux'	=> 'gfkt_id_frais_km_taux',
71
			'gfk_ce_utilisateur'	=> 'ce_utilisateur',
72
			'gfk_date'	=> 'date',
73
			'gfk_nbre_km'	=> 'nbre_km',
74
			'gfk_objet'	=> 'objet',
75
			'gfk_trajet'	=> 'trajet',
76
			'gfk_montant_total'	=> 'montant_total');
170 mathias 77
 
78
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
79
		if (!is_null($cmd)) {
80
			$this->consulter($cmd, $parametres, true);
81
		}
82
	}
83
 
84
	/*** Accesseurs : */
10 jpm 85
	// Id Frais Km
170 mathias 86
	public function getIdFraisKm()
87
	{
88
		return $this->id_frais_km;
89
	}
90
	public function setIdFraisKm( $ifk )
91
	{
92
		$this->id_frais_km = $ifk;
93
	}
94
 
10 jpm 95
	// Gfkt Id Frais Km Taux
170 mathias 96
	public function getGfktIdFraisKmTaux()
97
	{
98
		return $this->gfkt_id_frais_km_taux;
99
	}
100
	public function setGfktIdFraisKmTaux( $gifkt )
101
	{
102
		$this->gfkt_id_frais_km_taux = $gifkt;
103
	}
104
 
10 jpm 105
	// Ce Utilisateur
170 mathias 106
	public function getCeUtilisateur()
107
	{
108
		return $this->ce_utilisateur;
109
	}
110
	public function setCeUtilisateur( $cu )
111
	{
112
		$this->ce_utilisateur = $cu;
113
	}
114
 
10 jpm 115
	// Date
170 mathias 116
	public function getDate()
117
	{
118
		return $this->date;
119
	}
120
	public function setDate( $d )
121
	{
122
		$this->date = $d;
123
	}
124
 
10 jpm 125
	// Nbre Km
170 mathias 126
	public function getNbreKm()
127
	{
128
		return $this->nbre_km;
129
	}
130
	public function setNbreKm( $nk )
131
	{
132
		$this->nbre_km = $nk;
133
	}
134
 
10 jpm 135
	// Objet
170 mathias 136
	public function getObjet()
137
	{
138
		return $this->objet;
139
	}
140
	public function setObjet( $o )
141
	{
142
		$this->objet = $o;
143
	}
144
 
10 jpm 145
	// Trajet
170 mathias 146
	public function getTrajet()
147
	{
148
		return $this->trajet;
149
	}
150
	public function setTrajet( $t )
151
	{
152
		$this->trajet = $t;
153
	}
154
 
10 jpm 155
	// Montant Total
170 mathias 156
	public function getMontantTotal()
157
	{
158
		return $this->montant_total;
159
	}
160
	public function setMontantTotal( $mt )
161
	{
162
		$this->montant_total = $mt;
163
	}
164
 
165
	/*** Méthodes : */
166
 
167
	/**
168
	* Consulter la table gestion_frais_km.
169
	* @return mixed un tableau d'objets FraisKm s'il y en a plusieurs, l'objet FraisKm s'il y en a 1 seul sinon false.
170
	*/
171
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
172
	{
173
		switch ($cmd) {
174
			case FraisKm::GFK_ID:
175
				$requete = 	'SELECT * '.
176
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_frais_km '.
177
							'WHERE gfk_id_frais_km = #0 ';
178
				break;
179
			case FraisKm::GFK_ID_MAX:
180
				$requete =	'SELECT MAX(gfk_id_frais_km) '.
181
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_frais_km ';
182
				break;
183
			default :
184
				$message = 'Commande '.$cmd.'inconnue!';
185
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
186
    			trigger_error($e, E_USER_ERROR);
187
		}
188
		return parent::consulter($requete, $parametres, $instancier);
189
	}
190
}
191
 
192
/* +--Fin du code ----------------------------------------------------------------------------------------+
193
*
10 jpm 194
* $Log$
170 mathias 195
*
196
* +-- Fin du code ----------------------------------------------------------------------------------------+
197
*/
10 jpm 198
?>