/[openfoncier]/trunk/obj/travaux.class.php
ViewVC logotype

Contents of /trunk/obj/travaux.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 926 - (show annotations)
Fri Nov 30 00:09:18 2012 UTC (12 years, 2 months ago) by fmichon
File size: 1278 byte(s)
Ajout de la constante DB_PREFIXE manquante

1 <?php
2 //$Id$
3 //gen openMairie le 10/02/2011 20:37
4 require_once ("../gen/obj/travaux.class.php");
5
6 class travaux extends travaux_gen {
7
8 function travaux($id,&$db,$debug) {
9 $this->constructeur($id,$db,$debug);
10 }// fin constructeur
11
12 function setType(&$form,$maj) {
13 parent::setType($form,$maj);
14 if ($maj < 2) { //ajouter et modifier
15 $form->setType('solde', 'select');
16 }
17 }
18
19
20
21 function setSelect(&$form, $maj,&$db,$debug) {
22 parent::setSelect($form, $maj,$db,$debug);
23 // solde
24 $contenu=array();
25 $contenu[0]=array('Non','Oui');
26 $contenu[1]=array(_('Non'),_('Oui'));
27 $form->setSelect("solde",$contenu);
28 }
29
30
31 function clesecondaire($id,$db,$val,$debug){
32 parent::cleSecondaire($id,$db,$val,$debug);
33 // controle de cle secondaire particulier
34 $sql = "select * from ".DB_PREFIXE."regle where id =".$id." and controle='travaux'";
35 $res = $db->query($sql);
36 if($debug==1) echo $sql;
37 if (database::isError($res))
38 die($res->getMessage(). " => Echec ".$sql);
39 else{
40 $nbligne=$res->numrows();
41 $this->msg = $this->msg."<br>"._('il_y_a')." ".$nbligne.
42 " "._('enregistrement').' '._('table')." \"regle\" ".
43 _('travaux')." [".
44 $id."]<br>";
45 if ($nbligne>0)
46 $this->correct=false;
47 }
48 }
49 } // fin class
50 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26