8 |
/** |
/** |
9 |
* Classe utils () |
* Classe utils () |
10 |
*/ |
*/ |
11 |
$f = new utils(NULL, "traitement", _("dossier modicatif"), "ico_traitement.png", "traitement modificatif"); |
$f = new utils(NULL, "PC_modificatif", _("dossier modicatif"), "ico_traitement.png", "traitement modificatif"); |
12 |
$f->addHTMLHeadJs(array("../js/script.js")); |
$f->addHTMLHeadJs(array("../js/script.js")); |
13 |
// Param�trage =============================================================== |
// Param�trage =============================================================== |
14 |
$DEBUG=0; |
$DEBUG=0; |
62 |
} |
} |
63 |
|
|
64 |
if ($date_modificatif<>""){ |
if ($date_modificatif<>""){ |
65 |
if ($formatDate=="AAAA-MM-JJ"){ |
|
66 |
$date = explode("/", $date_modificatif); |
//formatDate=="AAAA-MM-JJ"){ |
67 |
// controle de date |
$date = explode("/", $date_modificatif); |
68 |
if (sizeof($date) == 3 and (checkdate($date[1],$date[0],$date[2]))) { |
// controle de date |
69 |
$date_modificatif = $date[2]."-".$date[1]."-".$date[0]; |
if (sizeof($date) == 3 and (checkdate($date[1],$date[0],$date[2]))) { |
70 |
}else{ |
$date_modificatif = $date[2]."-".$date[1]."-".$date[0]; |
71 |
$msg= $msg."<br>".$date_modificatif." "._("pas_date"); |
}else{ |
72 |
$correct=false; |
$msg= $msg."<br>".$date_modificatif." "._("pas_date"); |
73 |
|
$correct=false; |
74 |
} |
} |
75 |
} |
|
|
if ($formatDate=="JJ/MM/AAAA"){ |
|
|
$date = explode("/", $date_modificatif); |
|
|
// controle de date |
|
|
if (sizeof($date) == 3 and checkdate($date[1],$date[0],$date[2])){ |
|
|
$datemodificatif = $date[0]."/".$date[1]."/".$date[2]; |
|
|
}else{ |
|
|
$msg= $msg."<br>".$date_modificatif." "._("pas_date"); |
|
|
$correct=false; |
|
|
} |
|
|
} |
|
76 |
}else{ |
}else{ |
77 |
$correct=false; |
$correct=false; |
78 |
$msg= $msg."<br>"._("date_modificatif")." "._("obligatoire"); |
$msg= $msg."<br>"._("date_modificatif")." "._("obligatoire"); |
81 |
// traitement |
// traitement |
82 |
if ($correct==true){ |
if ($correct==true){ |
83 |
$valF=array(); |
$valF=array(); |
84 |
$sql= "select * from dossier where dossier ='".$idx."'"; |
$sql= "select * from ".DB_PREFIXE."dossier where dossier ='".$idx."'"; |
85 |
$res=$f -> db->query($sql); |
$res=$f -> db->query($sql); |
86 |
$f->isDatabaseError($res); |
$f->isDatabaseError($res); |
87 |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){ |
119 |
// |
// |
120 |
$valF['objet_dossier']=$row['objet_dossier']; |
$valF['objet_dossier']=$row['objet_dossier']; |
121 |
$valF['amenagement']=$row['amenagement']; |
$valF['amenagement']=$row['amenagement']; |
122 |
|
$valF['parcelle_lot']=$row['parcelle_lot']; //*** 3.0.0 |
123 |
|
$valF['parcelle_lot_lotissement']=$row['parcelle_lot_lotissement']; |
124 |
|
$valF['servitude']=$row['servitude']; |
125 |
|
$valF['description']=$row['description']; |
126 |
// TEMP |
// TEMP |
127 |
$valF['temp1']=$row['temp1']; |
$valF['temp1']=$row['temp1']; |
128 |
$valF['temp2']=$row['temp2']; |
$valF['temp2']=$row['temp2']; |
181 |
$valF['dossier']=$idx."01"; |
$valF['dossier']=$idx."01"; |
182 |
// insertion du dossier modificatif |
// insertion du dossier modificatif |
183 |
// protection cle secondaire numerique |
// protection cle secondaire numerique |
184 |
if(!is_numeric($val['instructeur'])) $valF['instructeur']= null; |
if(!is_numeric($valF['instructeur'])) $valF['instructeur']= null; |
185 |
if(!is_numeric($val['architecte'])) $valF['architecte']= null; |
if(!is_numeric($valF['architecte'])) $valF['architecte']= null; |
186 |
if(!is_numeric($val['travaux'])) $valF['travaux']= null; |
if(!is_numeric($valF['travaux'])) $valF['travaux']= null; |
187 |
if(!is_numeric($val['demandeur_categorie'])) $valF['demandeur_categorie']= null; |
if(!is_numeric($valF['demandeur_categorie'])) $valF['demandeur_categorie']= null; |
188 |
// protection des numeriques |
if(!is_numeric($valF['parcelle_lot'])) $valF['parcelle_lot']= null; |
189 |
if(!is_numeric($val['delai'])) unset ($valF['delai']); |
|
|
if(!is_numeric($val['terrain_surface'])) unset ($valF['terrain_surface']); |
|
|
if(!is_numeric($val['batiment_nombre'])) unset ($valF['batiment_nombre']); |
|
|
if(!is_numeric($val['logement_nombre'])) unset ($valF['logement_nombre']); |
|
|
if(!is_numeric($val['shon'])) unset ($valF['shon']); |
|
|
if(!is_numeric($val['shob'])) unset ($valF['shob']); |
|
|
if(!is_numeric($val['lot'])) unset ($valF['lot']); |
|
|
if(!is_numeric($val['hauteur'])) unset ($valF['hauteur']); |
|
|
if(!is_numeric($val['piece_nombre'])) unset ($valF['piece_nombre']); |
|
|
if(!is_numeric($val['shon_calcul'])) unset ($valF['shon_calcul']); |
|
|
if(!is_numeric($val['terrain_surface_calcul'])) unset ($valF['terrain_surface_calcul']); |
|
190 |
// cle secondaire alpha vide (contrainte integrite pgsql) |
// cle secondaire alpha vide (contrainte integrite pgsql) |
191 |
if($val['demandeur_civilite']=='') $valF['demandeur_civilite']= null; |
if($valF['demandeur_civilite']=='') $valF['demandeur_civilite']= null; |
192 |
if($val['delegataire_civilite']=='') $valF['delegataire_civilite']= null; |
if($valF['delegataire_civilite']=='') $valF['delegataire_civilite']= null; |
193 |
$res4= $f -> db->autoExecute("dossier",$valF,DB_AUTOQUERY_INSERT); |
|
194 |
|
// protection des numeriques |
195 |
|
if(!is_numeric($valF['delai'])) unset ($valF['delai']); |
196 |
|
if(!is_numeric($valF['terrain_surface'])) unset ($valF['terrain_surface']); |
197 |
|
if(!is_numeric($valF['batiment_nombre'])) unset ($valF['batiment_nombre']); |
198 |
|
if(!is_numeric($valF['logement_nombre'])) unset ($valF['logement_nombre']); |
199 |
|
if(!is_numeric($valF['shon'])) unset ($valF['shon']); |
200 |
|
if(!is_numeric($valF['shob'])) unset ($valF['shob']); |
201 |
|
if(!is_numeric($valF['lot'])) unset ($valF['lot']); |
202 |
|
if(!is_numeric($valF['hauteur'])) unset ($valF['hauteur']); |
203 |
|
if(!is_numeric($valF['piece_nombre'])) unset ($valF['piece_nombre']); |
204 |
|
if(!is_numeric($valF['shon_calcul'])) unset ($valF['shon_calcul']); |
205 |
|
if(!is_numeric($valF['terrain_surface_calcul'])) unset ($valF['terrain_surface_calcul']); |
206 |
|
$res4= $f -> db->autoExecute(DB_PREFIXE."dossier",$valF,DB_AUTOQUERY_INSERT); |
207 |
$f->isDatabaseError($res4); |
$f->isDatabaseError($res4); |
208 |
echo _("dossier")." ".$valF['dossier']." ".$row['demandeur_nom']." "._("ajoute"). |
echo _("dossier")." ".$valF['dossier']." ".$row['demandeur_nom']." "._("ajoute"). |
209 |
" ".$f -> db->affectedRows()." "._("table")." dossier <br>" ; |
" ".$f -> db->affectedRows()." "._("table")." dossier <br>" ; |
210 |
} |
} |
211 |
// insertion des parcelles dans TERRAIN pour le nouveau dossier |
// insertion des parcelles dans TERRAIN pour le nouveau dossier |
212 |
$sql= "select * from terrain where dossier ='".$idx."'"; |
$sql= "select * from ".DB_PREFIXE."terrain where dossier ='".$idx."'"; |
213 |
$res5=$f -> db->query($sql); |
$res5=$f -> db->query($sql); |
214 |
$f->isDatabaseError($res5); |
$f->isDatabaseError($res5); |
215 |
$valG['dossier']=$valF['dossier']; |
$valG['dossier']=$valF['dossier']; |
216 |
while ($row5=& $res5->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row5=& $res5->fetchRow(DB_FETCHMODE_ASSOC)){ |
217 |
$valG['parcelle']=$row5['parcelle']; |
$valG['parcelle']=$row5['parcelle']; |
218 |
$valG['terrain']=$f -> db->nextId('terrain'); |
$valG['terrain']=$f -> db->nextId(DB_PREFIXE.'terrain'); |
219 |
// insertion des terrains concernes |
// insertion des terrains concernes |
220 |
$res10= $f -> db->autoExecute("terrain",$valG,DB_AUTOQUERY_INSERT); |
$res10= $f -> db->autoExecute(DB_PREFIXE."terrain",$valG,DB_AUTOQUERY_INSERT); |
221 |
if (DB :: isError($res10)) |
$f->isDatabaseError($res10); |
|
echo $res10->getDebugInfo()." ".$res10->getMessage()."<br>"; |
|
222 |
echo _("terrain")." ".$valG['terrain']." "._("ajoute")." ". |
echo _("terrain")." ".$valG['terrain']." "._("ajoute")." ". |
223 |
$f -> db->affectedRows()." "._("table")." terrain <br>" ; |
$f -> db->affectedRows()." "._("table")." terrain <br>" ; |
224 |
} |
} |
225 |
// transfert destination_shon |
// transfert destination_shon |
226 |
$valH=array(); |
$valH=array(); |
227 |
$sql= "select * from destination_shon where dossier ='".$idx."'"; |
$sql= "select * from ".DB_PREFIXE."destination_shon where dossier ='".$idx."'"; |
228 |
$res11 =$f -> db->query($sql); |
$res11 =$f -> db->query($sql); |
229 |
$f->isDatabaseError($res11); |
$f->isDatabaseError($res11); |
230 |
$valH['dossier']=$valF['dossier']; |
$valH['dossier']=$valF['dossier']; |
231 |
while ($row11=& $res11->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row11=& $res11->fetchRow(DB_FETCHMODE_ASSOC)){ |
232 |
$valH['destination_shon']=$f -> db->nextId('destination_shon'); |
$valH['destination_shon']=$f -> db->nextId(DB_PREFIXE.'destination_shon'); |
233 |
$valH['destination']=$row11['destination']; |
$valH['destination']=$row11['destination']; //*** 3.0.0 |
234 |
$valH['shon']=$row11['shon']; |
if(is_numeric($row11['shon'])) |
235 |
$res12= $f -> db->autoExecute("destination_shon",$valH,DB_AUTOQUERY_INSERT); |
$valH['shon']=$row11['shon']; |
236 |
if (DB :: isError($res12)) |
if(is_numeric($row11['shon_anterieure'])) |
237 |
echo $res12->getDebugInfo()." ".$res12->getMessage()."<br>"; |
$valH['shon_anterieure']=$row11['shon_anterieure']; |
238 |
echo _("destination")." ".$valH['destination_shon']." "._("ajoute"). |
if(is_numeric($row11['shon_demolie'])) |
239 |
" ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ; |
$valH['shon_demolie']=$row11['shon_demolie']; |
240 |
|
if(is_numeric($row11['shon_anterieure_supprimee'])) |
241 |
|
$valH['shon_anterieure_supprimee']=$row11['shon_anterieure_supprimee']; |
242 |
|
if(is_numeric($row11['shon_nouvelle_transformee'])) |
243 |
|
$valH['shon_nouvelle_transformee']=$row11['shon_nouvelle_transformee']; |
244 |
|
if(is_numeric($row11['shon_nouvelle'])) |
245 |
|
$valH['shon_nouvelle']=$row11['shon_nouvelle']; |
246 |
|
if(is_numeric($row11['shon_shob_transformee'])) |
247 |
|
$valH['shon_shob_transformee']=$row11['shon_shob_transformee']; |
248 |
|
$res12= $f -> db->autoExecute(DB_PREFIXE."destination_shon",$valH,DB_AUTOQUERY_INSERT); |
249 |
|
$f->isDatabaseError($res12); |
250 |
|
echo _("destination")." ".$valH['destination_shon']." "._("ajoute"). |
251 |
|
" ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ; |
252 |
} |
} |
253 |
// bloc note |
// bloc note |
254 |
$valH=array(); |
$valH=array(); |
255 |
$sql= "select * from blocnote where dossier ='".$idx."'"; |
$sql= "select * from ".DB_PREFIXE."blocnote where dossier ='".$idx."'"; |
256 |
$res13 =$f -> db->query($sql); |
$res13 =$f -> db->query($sql); |
257 |
$f->isDatabaseError($res); |
$f->isDatabaseError($res); |
258 |
$valH['dossier']=$valF['dossier']; |
$valH['dossier']=$valF['dossier']; |
259 |
while ($row13=& $res13->fetchRow(DB_FETCHMODE_ASSOC)){ |
while ($row13=& $res13->fetchRow(DB_FETCHMODE_ASSOC)){ |
260 |
$valH['blocnote']=$f -> db->nextId('blocnote'); |
$valH['blocnote']=$f -> db->nextId(DB_PREFIXE.'blocnote'); |
261 |
$valH['note']=$row13['note']; |
$valH['note']=$row13['note']; |
262 |
$valH['categorie']=$row13['categorie']; |
$valH['categorie']=$row13['categorie']; |
263 |
$res14= $f -> db->autoExecute("blocnote",$valH,DB_AUTOQUERY_INSERT); |
$res14= $f -> db->autoExecute(DB_PREFIXE."blocnote",$valH,DB_AUTOQUERY_INSERT); |
264 |
if (DB :: isError($res14)) |
$f->isDatabaseError($res14); |
|
echo $res14->getDebugInfo()." ".$res14->getMessage()."<br>"; |
|
265 |
echo _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ". |
echo _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ". |
266 |
$f -> db->affectedRows()." "._("table")." blocnote <br>" ; |
$f -> db->affectedRows()." "._("table")." blocnote <br>" ; |
267 |
} |
} |
268 |
|
// statistiques |
269 |
|
$valH=array(); |
270 |
|
$sql= "select * from ".DB_PREFIXE."statistique where dossier ='".$idx."'"; |
271 |
|
$res15 =$f -> db->query($sql); |
272 |
|
$f->isDatabaseError($res15); |
273 |
|
$valH['dossier']=$valF['dossier']; |
274 |
|
while ($row15=& $res15->fetchRow(DB_FETCHMODE_ASSOC)){ |
275 |
|
$valH['statistique']=$f -> db->nextId(DB_PREFIXE.'statistique'); |
276 |
|
$valH['parametre']=$row15['parametre']; |
277 |
|
$valH['valeur']=$row15['valeur']; |
278 |
|
$res16= $f -> db->autoExecute(DB_PREFIXE."statistique",$valH,DB_AUTOQUERY_INSERT); |
279 |
|
$f->isDatabaseError($res16); |
280 |
|
echo _("statistique")." ".$valH['statistique']." "._("ajoute")." ". |
281 |
|
$f -> db->affectedRows()." "._("table")." statistique <br>" ; |
282 |
|
} |
283 |
// pas dinstruction et de consultation en transfert |
// pas dinstruction et de consultation en transfert |
284 |
// enregistrement $msg en /tmp ********************** |
// enregistrement $msg en /tmp ********************** |
285 |
/* |
/* |