1 |
fraynaud |
11 |
<?php |
2 |
|
|
/* $Id: PC.class.php,v 1.19 2010-08-22 21:40:11 fraynaud Exp $ |
3 |
|
|
*/ |
4 |
|
|
require_once ("dossier.class.php"); |
5 |
|
|
require_once ($path_om."formulairedyn.class.php"); |
6 |
|
|
|
7 |
|
|
class PC extends dossier{ |
8 |
|
|
|
9 |
|
|
var $nature="PC"; |
10 |
|
|
|
11 |
|
|
function PC($id,&$db,$DEBUG) { |
12 |
|
|
$this->constructeur($id,$db,$DEBUG); |
13 |
|
|
|
14 |
|
|
} // fin constructeur |
15 |
|
|
|
16 |
|
|
function setvalF($val){ |
17 |
|
|
parent::setvalF($val); |
18 |
|
|
// compatibilite pgsql |
19 |
|
|
if($val['batiment_nombre']!="") |
20 |
|
|
$this->valF['batiment_nombre'] = $val['batiment_nombre']; |
21 |
|
|
if($val['logement_nombre']!="") |
22 |
|
|
$this->valF['logement_nombre'] = $val['logement_nombre']; |
23 |
|
|
if($val['hauteur']!="") |
24 |
|
|
$this->valF['hauteur'] = $val['hauteur']; |
25 |
|
|
if($val['piece_nombre']!="") |
26 |
|
|
$this->valF['piece_nombre'] = $val['piece_nombre']; |
27 |
|
|
if($val['shon']!="") |
28 |
|
|
$this->valF['shon'] = $val['shon']; |
29 |
|
|
if($val['shob']!="") |
30 |
|
|
$this->valF['shob'] = $val['shob']; |
31 |
|
|
if($val['shon_calcul']!="") |
32 |
|
|
$this->valF['shon_calcul'] = $val['shon_calcul']; |
33 |
|
|
$this->valF['objet_dossier'] = $val['objet_dossier']; |
34 |
|
|
$this->valF['amenagement'] = $val['amenagement']; |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
function setType(&$form,$maj) { |
38 |
|
|
parent::setType($form,$maj); |
39 |
|
|
// terrain |
40 |
|
|
if($maj<2){ |
41 |
|
|
$form->setType('batiment_nombre','text'); |
42 |
|
|
$form->setType('logement_nombre','text'); |
43 |
|
|
$form->setType('shon','text'); |
44 |
|
|
$form->setType('shob','text'); |
45 |
|
|
$form->setType('shon_calcul','hiddenstatic'); |
46 |
|
|
$form->setType('hauteur','text'); |
47 |
|
|
$form->setType('piece_nombre','text'); |
48 |
|
|
$form->setType('objet_dossier','select'); |
49 |
|
|
$form->setType('amenagement','select'); |
50 |
|
|
} |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
function setLib(&$form,$maj) { |
54 |
|
|
parent::setLib($form,$maj); |
55 |
|
|
$form->setLib('batiment_nombre',' '.$this->lang('batiment_nombre').' : '); |
56 |
|
|
$form->setLib('logement_nombre',' '.$this->lang('logement_nombre').' : '); |
57 |
|
|
$form->setLib('hauteur',' '.$this->lang('hauteur').' : '); |
58 |
|
|
$form->setLib('piece_nombre',' '.$this->lang('piece_nombre').' : '); |
59 |
|
|
$form->setLib('shon',' '.$this->lang('shon').' : '); |
60 |
|
|
$form->setLib('shon_calcul',' '.$this->lang('shon_calcul').' : '); |
61 |
|
|
$form->setLib('shob',' '.$this->lang('shob').' : '); |
62 |
|
|
$form->setLib('amenagement',' '.$this->lang('amenagement').' : '); |
63 |
|
|
} |
64 |
|
|
function setTaille(&$form,$maj){ |
65 |
|
|
parent::setTaille($form,$maj); |
66 |
|
|
$form->setTaille('hauteur','3'); |
67 |
|
|
} |
68 |
|
|
function setVal(&$form,$maj,$validation){ |
69 |
|
|
parent::setVal($form,$maj,$validation); |
70 |
|
|
if ($validation==0) { |
71 |
|
|
if ($maj == 0){ |
72 |
|
|
$form->setVal('delai','1'); |
73 |
|
|
$form->setVal('types', 'Initial'); |
74 |
|
|
}}} |
75 |
|
|
|
76 |
|
|
function setSelect(&$form, $maj,$db,$debug) { |
77 |
|
|
parent::setSelect($form, $maj,$db,$debug); |
78 |
|
|
include ("../dyn/connexion.php"); |
79 |
|
|
include ("../sql/".$dsn['phptype']."/".$this->table.".form.inc"); |
80 |
|
|
if($maj<2){ |
81 |
|
|
$contenu=array(); |
82 |
|
|
$contenu[0]=array('A','B'); |
83 |
|
|
$contenu[1]=array($this->lang('maison_individuelle'), |
84 |
|
|
$this->lang('autre_construction')); |
85 |
|
|
$form->setSelect("objet_dossier",$contenu); |
86 |
|
|
// amenagement |
87 |
|
|
$contenu=array(); |
88 |
|
|
$res = $db->query($sql_amenagement); |
89 |
|
|
if (DB :: isError($res)) |
90 |
|
|
die($res->getMessage().$sql_amenagement); |
91 |
|
|
else{ |
92 |
|
|
if ($debug == 1) |
93 |
|
|
echo " la requete ".$sql_amenagement." est executee<br>"; |
94 |
|
|
$contenu[0][0]=""; |
95 |
|
|
$contenu[1][0]=$this->lang('choisir')." ".$this->lang('amenagement'); |
96 |
|
|
$k=1; |
97 |
|
|
while ($row=& $res->fetchRow()){ |
98 |
|
|
$contenu[0][$k]=$row[0]; |
99 |
|
|
$contenu[1][$k]=$row[1]; |
100 |
|
|
$k++; |
101 |
|
|
} |
102 |
|
|
$form->setSelect("amenagement",$contenu); |
103 |
|
|
} |
104 |
|
|
} |
105 |
|
|
} |
106 |
|
|
|
107 |
|
|
function setGroupe(&$form,$maj){ |
108 |
|
|
parent::setGroupe($form,$maj); |
109 |
|
|
|
110 |
|
|
$form->setGroupe('batiment_nombre','D'); |
111 |
|
|
$form->setGroupe('logement_nombre','G'); |
112 |
|
|
$form->setGroupe('hauteur','G'); |
113 |
|
|
$form->setGroupe('piece_nombre','F'); |
114 |
|
|
|
115 |
|
|
$form->setGroupe('shon','D'); |
116 |
|
|
$form->setGroupe('shon_calcul','G'); |
117 |
|
|
$form->setGroupe('shob','G'); |
118 |
|
|
$form->setGroupe('amenagement','F'); |
119 |
|
|
|
120 |
|
|
$form->setGroupe('objet_dossier','D'); |
121 |
|
|
$form->setGroupe('architecte','G'); |
122 |
|
|
$form->setGroupe('architecte_nom','G'); |
123 |
|
|
$form->setGroupe('architecte_nom','G'); |
124 |
|
|
$form->setGroupe('saisie_architecte','G'); |
125 |
|
|
$form->setGroupe('travaux','F'); |
126 |
|
|
} |
127 |
|
|
|
128 |
|
|
function setRegroupe(&$form,$maj){ |
129 |
|
|
parent::setRegroupe($form,$maj); |
130 |
|
|
|
131 |
|
|
$form->setRegroupe('batiment_nombre','D',$this->lang('description')); |
132 |
|
|
$form->setRegroupe('logement_nombre','G',''); |
133 |
|
|
$form->setRegroupe('hauteur','G',''); |
134 |
|
|
$form->setRegroupe('piece_nombre','G',''); |
135 |
|
|
|
136 |
|
|
$form->setRegroupe('shon','G',''); |
137 |
|
|
$form->setRegroupe('shon_calcul','G',''); |
138 |
|
|
$form->setRegroupe('shob','G',''); |
139 |
|
|
$form->setRegroupe('amenagement','F',''); |
140 |
|
|
|
141 |
|
|
$form->setRegroupe('objet_dossier','D',''); |
142 |
|
|
$form->setRegroupe('architecte','G',''); |
143 |
|
|
$form->setRegroupe('architecte_nom','G',''); |
144 |
|
|
$form->setRegroupe('saisie_architecte','G',''); |
145 |
|
|
$form->setRegroupe('travaux','F',''); |
146 |
|
|
|
147 |
|
|
$form->setRegroupe('parcelle','D',$this->lang('localisation')); |
148 |
|
|
$form->setRegroupe('pos','G',''); |
149 |
|
|
$form->setRegroupe('sig','G',''); |
150 |
|
|
$form->setRegroupe('siglien','F',''); |
151 |
|
|
} |
152 |
|
|
|
153 |
|
|
|
154 |
|
|
}// fin de classe |
155 |
|
|
?> |