1 |
<?php |
<?php |
2 |
//$Id$ |
//$Id$ |
3 |
//gen openMairie le 11/03/2013 16:56 |
//gen openMairie le 16/02/2015 10:29 |
4 |
|
|
5 |
require_once ("../obj/om_dbform.class.php"); |
require_once "../obj/om_dbform.class.php"; |
6 |
|
|
7 |
class architecte_gen extends om_dbform { |
class architecte_gen extends om_dbform { |
8 |
var $table="architecte"; |
|
9 |
var $clePrimaire="architecte"; |
var $table = "architecte"; |
10 |
var $typeCle="N"; |
var $clePrimaire = "architecte"; |
11 |
var $required_field=array( |
var $typeCle = "N"; |
12 |
|
var $required_field = array( |
13 |
"architecte", |
"architecte", |
14 |
"nom" |
"nom" |
15 |
); |
); |
16 |
var $retourformulaire; |
|
17 |
|
var $foreign_keys_extended = array( |
18 |
|
); |
19 |
|
|
20 |
|
|
21 |
|
|
22 |
function setvalF($val) { |
function setvalF($val) { |
23 |
//affectation valeur formulaire |
//affectation valeur formulaire |
78 |
$this->valF['email'] = $val['email']; |
$this->valF['email'] = $val['email']; |
79 |
} |
} |
80 |
$this->valF['note'] = $val['note']; |
$this->valF['note'] = $val['note']; |
81 |
|
if ($val['frequent'] == 1 || $val['frequent'] == "t" || $val['frequent'] == "Oui") { |
82 |
|
$this->valF['frequent'] = true; |
83 |
|
} else { |
84 |
|
$this->valF['frequent'] = false; |
85 |
|
} |
86 |
|
if ($val['nom_cabinet'] == "") { |
87 |
|
$this->valF['nom_cabinet'] = NULL; |
88 |
|
} else { |
89 |
|
$this->valF['nom_cabinet'] = $val['nom_cabinet']; |
90 |
|
} |
91 |
|
if ($val['conseil_regional'] == "") { |
92 |
|
$this->valF['conseil_regional'] = NULL; |
93 |
|
} else { |
94 |
|
$this->valF['conseil_regional'] = $val['conseil_regional']; |
95 |
|
} |
96 |
} |
} |
97 |
|
|
98 |
//================================================= |
//================================================= |
99 |
//cle primaire automatique [automatic primary key] |
//cle primaire automatique [automatic primary key] |
100 |
//================================================== |
//================================================== |
101 |
|
|
102 |
function setId(&$db) { |
function setId(&$dnu1 = null) { |
103 |
//numero automatique |
//numero automatique |
104 |
$this->valF[$this->clePrimaire] = $db->nextId(DB_PREFIXE.$this->table); |
$this->valF[$this->clePrimaire] = $this->f->db->nextId(DB_PREFIXE.$this->table); |
105 |
} |
} |
106 |
|
|
107 |
function setValFAjout($val) { |
function setValFAjout($val) { |
115 |
//========================== |
//========================== |
116 |
// Formulaire [form] |
// Formulaire [form] |
117 |
//========================== |
//========================== |
118 |
|
/** |
119 |
|
* |
120 |
|
*/ |
121 |
|
function setType(&$form, $maj) { |
122 |
|
|
123 |
|
// MODE AJOUTER |
124 |
|
if ($maj == 0) { |
125 |
|
$form->setType("architecte", "hidden"); |
126 |
|
$form->setType("nom", "text"); |
127 |
|
$form->setType("prenom", "text"); |
128 |
|
$form->setType("adresse1", "text"); |
129 |
|
$form->setType("adresse2", "text"); |
130 |
|
$form->setType("cp", "text"); |
131 |
|
$form->setType("ville", "text"); |
132 |
|
$form->setType("pays", "text"); |
133 |
|
$form->setType("inscription", "text"); |
134 |
|
$form->setType("telephone", "text"); |
135 |
|
$form->setType("fax", "text"); |
136 |
|
$form->setType("email", "text"); |
137 |
|
$form->setType("note", "textarea"); |
138 |
|
$form->setType("frequent", "checkbox"); |
139 |
|
$form->setType("nom_cabinet", "text"); |
140 |
|
$form->setType("conseil_regional", "text"); |
141 |
|
} |
142 |
|
|
143 |
|
// MDOE MODIFIER |
144 |
|
if ($maj == 1) { |
145 |
|
$form->setType("architecte", "hiddenstatic"); |
146 |
|
$form->setType("nom", "text"); |
147 |
|
$form->setType("prenom", "text"); |
148 |
|
$form->setType("adresse1", "text"); |
149 |
|
$form->setType("adresse2", "text"); |
150 |
|
$form->setType("cp", "text"); |
151 |
|
$form->setType("ville", "text"); |
152 |
|
$form->setType("pays", "text"); |
153 |
|
$form->setType("inscription", "text"); |
154 |
|
$form->setType("telephone", "text"); |
155 |
|
$form->setType("fax", "text"); |
156 |
|
$form->setType("email", "text"); |
157 |
|
$form->setType("note", "textarea"); |
158 |
|
$form->setType("frequent", "checkbox"); |
159 |
|
$form->setType("nom_cabinet", "text"); |
160 |
|
$form->setType("conseil_regional", "text"); |
161 |
|
} |
162 |
|
|
163 |
|
// MODE SUPPRIMER |
164 |
|
if ($maj == 2) { |
165 |
|
$form->setType("architecte", "hiddenstatic"); |
166 |
|
$form->setType("nom", "hiddenstatic"); |
167 |
|
$form->setType("prenom", "hiddenstatic"); |
168 |
|
$form->setType("adresse1", "hiddenstatic"); |
169 |
|
$form->setType("adresse2", "hiddenstatic"); |
170 |
|
$form->setType("cp", "hiddenstatic"); |
171 |
|
$form->setType("ville", "hiddenstatic"); |
172 |
|
$form->setType("pays", "hiddenstatic"); |
173 |
|
$form->setType("inscription", "hiddenstatic"); |
174 |
|
$form->setType("telephone", "hiddenstatic"); |
175 |
|
$form->setType("fax", "hiddenstatic"); |
176 |
|
$form->setType("email", "hiddenstatic"); |
177 |
|
$form->setType("note", "hiddenstatic"); |
178 |
|
$form->setType("frequent", "hiddenstatic"); |
179 |
|
$form->setType("nom_cabinet", "hiddenstatic"); |
180 |
|
$form->setType("conseil_regional", "hiddenstatic"); |
181 |
|
} |
182 |
|
|
183 |
|
// MODE CONSULTER |
184 |
|
if ($maj == 3) { |
185 |
|
$form->setType("architecte", "static"); |
186 |
|
$form->setType("nom", "static"); |
187 |
|
$form->setType("prenom", "static"); |
188 |
|
$form->setType("adresse1", "static"); |
189 |
|
$form->setType("adresse2", "static"); |
190 |
|
$form->setType("cp", "static"); |
191 |
|
$form->setType("ville", "static"); |
192 |
|
$form->setType("pays", "static"); |
193 |
|
$form->setType("inscription", "static"); |
194 |
|
$form->setType("telephone", "static"); |
195 |
|
$form->setType("fax", "static"); |
196 |
|
$form->setType("email", "static"); |
197 |
|
$form->setType("note", "textareastatic"); |
198 |
|
$form->setType("frequent", "checkboxstatic"); |
199 |
|
$form->setType("nom_cabinet", "static"); |
200 |
|
$form->setType("conseil_regional", "static"); |
201 |
|
} |
202 |
|
|
|
function setType(&$form,$maj) { |
|
|
//type |
|
|
if ($maj==0){ //ajout |
|
|
$form->setType('architecte','hidden');// cle automatique |
|
|
$form->setType('nom','text'); |
|
|
$form->setType('prenom','text'); |
|
|
$form->setType('adresse1','text'); |
|
|
$form->setType('adresse2','text'); |
|
|
$form->setType('cp','text'); |
|
|
$form->setType('ville','text'); |
|
|
$form->setType('pays','text'); |
|
|
$form->setType('inscription','text'); |
|
|
$form->setType('telephone','text'); |
|
|
$form->setType('fax','text'); |
|
|
$form->setType('email','text'); |
|
|
$form->setType('note','textarea'); |
|
|
}// fin ajout |
|
|
if ($maj==1){ //modifier |
|
|
$form->setType('architecte','hiddenstatic'); |
|
|
$form->setType('nom','text'); |
|
|
$form->setType('prenom','text'); |
|
|
$form->setType('adresse1','text'); |
|
|
$form->setType('adresse2','text'); |
|
|
$form->setType('cp','text'); |
|
|
$form->setType('ville','text'); |
|
|
$form->setType('pays','text'); |
|
|
$form->setType('inscription','text'); |
|
|
$form->setType('telephone','text'); |
|
|
$form->setType('fax','text'); |
|
|
$form->setType('email','text'); |
|
|
$form->setType('note','textarea'); |
|
|
}// fin modifier |
|
|
if ($maj==2){ //supprimer |
|
|
$form->setType('architecte','hiddenstatic'); |
|
|
$form->setType('nom','hiddenstatic'); |
|
|
$form->setType('prenom','hiddenstatic'); |
|
|
$form->setType('adresse1','hiddenstatic'); |
|
|
$form->setType('adresse2','hiddenstatic'); |
|
|
$form->setType('cp','hiddenstatic'); |
|
|
$form->setType('ville','hiddenstatic'); |
|
|
$form->setType('pays','hiddenstatic'); |
|
|
$form->setType('inscription','hiddenstatic'); |
|
|
$form->setType('telephone','hiddenstatic'); |
|
|
$form->setType('fax','hiddenstatic'); |
|
|
$form->setType('email','hiddenstatic'); |
|
|
$form->setType('note','hiddenstatic'); |
|
|
}//fin supprimer |
|
|
if ($maj==3){ //consulter |
|
|
$form->setType('architecte','static'); |
|
|
$form->setType('nom','static'); |
|
|
$form->setType('prenom','static'); |
|
|
$form->setType('adresse1','static'); |
|
|
$form->setType('adresse2','static'); |
|
|
$form->setType('cp','static'); |
|
|
$form->setType('ville','static'); |
|
|
$form->setType('pays','static'); |
|
|
$form->setType('inscription','static'); |
|
|
$form->setType('telephone','static'); |
|
|
$form->setType('fax','static'); |
|
|
$form->setType('email','static'); |
|
|
$form->setType('note','textareastatic'); |
|
|
}//fin consulter |
|
203 |
} |
} |
204 |
|
|
205 |
function setOnchange(&$form,$maj) { |
|
206 |
|
function setOnchange(&$form, $maj) { |
207 |
//javascript controle client |
//javascript controle client |
208 |
$form->setOnchange('architecte','VerifNum(this)'); |
$form->setOnchange('architecte','VerifNum(this)'); |
209 |
} |
} |
220 |
$form->setTaille("ville", 30); |
$form->setTaille("ville", 30); |
221 |
$form->setTaille("pays", 30); |
$form->setTaille("pays", 30); |
222 |
$form->setTaille("inscription", 20); |
$form->setTaille("inscription", 20); |
223 |
$form->setTaille("telephone", 14); |
$form->setTaille("telephone", 20); |
224 |
$form->setTaille("fax", 14); |
$form->setTaille("fax", 14); |
225 |
$form->setTaille("email", 30); |
$form->setTaille("email", 30); |
226 |
$form->setTaille("note", 80); |
$form->setTaille("note", 80); |
227 |
|
$form->setTaille("frequent", 1); |
228 |
|
$form->setTaille("nom_cabinet", 30); |
229 |
|
$form->setTaille("conseil_regional", 30); |
230 |
} |
} |
231 |
|
|
232 |
/** |
/** |
234 |
*/ |
*/ |
235 |
function setMax(&$form, $maj) { |
function setMax(&$form, $maj) { |
236 |
$form->setMax("architecte", 11); |
$form->setMax("architecte", 11); |
237 |
$form->setMax("nom", 40); |
$form->setMax("nom", 50); |
238 |
$form->setMax("prenom", 40); |
$form->setMax("prenom", 50); |
239 |
$form->setMax("adresse1", 40); |
$form->setMax("adresse1", 50); |
240 |
$form->setMax("adresse2", 40); |
$form->setMax("adresse2", 50); |
241 |
$form->setMax("cp", 5); |
$form->setMax("cp", 5); |
242 |
$form->setMax("ville", 40); |
$form->setMax("ville", 50); |
243 |
$form->setMax("pays", 40); |
$form->setMax("pays", 40); |
244 |
$form->setMax("inscription", 20); |
$form->setMax("inscription", 20); |
245 |
$form->setMax("telephone", 14); |
$form->setMax("telephone", 20); |
246 |
$form->setMax("fax", 14); |
$form->setMax("fax", 14); |
247 |
$form->setMax("email", 40); |
$form->setMax("email", 60); |
248 |
$form->setMax("note", 6); |
$form->setMax("note", 6); |
249 |
|
$form->setMax("frequent", 1); |
250 |
|
$form->setMax("nom_cabinet", 100); |
251 |
|
$form->setMax("conseil_regional", 100); |
252 |
} |
} |
253 |
|
|
254 |
|
|
255 |
function setLib(&$form,$maj) { |
function setLib(&$form, $maj) { |
256 |
//libelle des champs |
//libelle des champs |
257 |
$form->setLib('architecte',_('architecte')); |
$form->setLib('architecte',_('architecte')); |
258 |
$form->setLib('nom',_('nom')); |
$form->setLib('nom',_('nom')); |
267 |
$form->setLib('fax',_('fax')); |
$form->setLib('fax',_('fax')); |
268 |
$form->setLib('email',_('email')); |
$form->setLib('email',_('email')); |
269 |
$form->setLib('note',_('note')); |
$form->setLib('note',_('note')); |
270 |
|
$form->setLib('frequent',_('frequent')); |
271 |
|
$form->setLib('nom_cabinet',_('nom_cabinet')); |
272 |
|
$form->setLib('conseil_regional',_('conseil_regional')); |
273 |
|
} |
274 |
|
/** |
275 |
|
* |
276 |
|
*/ |
277 |
|
function setSelect(&$form, $maj, &$dnu1 = null, $dnu2 = null) { |
278 |
|
|
279 |
|
// Inclusion du fichier de requĂȘtes |
280 |
|
if (file_exists("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php")) { |
281 |
|
include "../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php"; |
282 |
|
} elseif (file_exists("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc")) { |
283 |
|
include "../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc"; |
284 |
|
} |
285 |
|
|
286 |
} |
} |
287 |
|
|
288 |
|
|
289 |
//================================== |
//================================== |
290 |
// sous Formulaire [subform] |
// sous Formulaire |
291 |
//================================== |
//================================== |
292 |
|
|
293 |
|
|
294 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$dnu1 = null, $dnu2 = null) { |
295 |
$this->retourformulaire = $retourformulaire; |
$this->retourformulaire = $retourformulaire; |
296 |
|
$this->set_form_default_values($form, $maj, $validation); |
297 |
}// fin setValsousformulaire |
}// fin setValsousformulaire |
298 |
|
|
299 |
//================================== |
//================================== |
300 |
// cle secondaire [secondary key] |
// cle secondaire |
301 |
//================================== |
//================================== |
302 |
|
|
303 |
|
/** |
304 |
|
* Methode clesecondaire |
305 |
|
*/ |
306 |
|
function cleSecondaire($id, &$dnu1 = null, $val = array(), $dnu2 = null) { |
307 |
|
// On appelle la methode de la classe parent |
308 |
|
parent::cleSecondaire($id); |
309 |
|
// Verification de la cle secondaire : donnees_techniques |
310 |
|
$this->rechercheTable($this->f->db, "donnees_techniques", "architecte", $id); |
311 |
|
} |
312 |
|
|
313 |
|
|
314 |
|
} |
315 |
|
|
|
}// fin classe |
|
|
?> |
|
316 |
|
?> |