/[openfoncier]/trunk/app/dossier_modificatif.php
ViewVC logotype

Diff of /trunk/app/dossier_modificatif.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 164 by jbastide, Mon Oct 3 12:40:15 2011 UTC revision 242 by fraynaud, Wed Nov 23 19:39:04 2011 UTC
# Line 62  if($validation==0){ Line 62  if($validation==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");
# Line 90  if($validation==0){ Line 81  if($validation==0){
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)){
# Line 128  if($validation==0){ Line 119  if($validation==0){
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          // TEMP          // TEMP
126          $valF['temp1']=$row['temp1'];          $valF['temp1']=$row['temp1'];
127          $valF['temp2']=$row['temp2'];          $valF['temp2']=$row['temp2'];
# Line 190  if($validation==0){ Line 184  if($validation==0){
184        if(!is_numeric($val['architecte'])) $valF['architecte']= null;        if(!is_numeric($val['architecte'])) $valF['architecte']= null;
185        if(!is_numeric($val['travaux'])) $valF['travaux']= null;        if(!is_numeric($val['travaux'])) $valF['travaux']= null;
186        if(!is_numeric($val['demandeur_categorie'])) $valF['demandeur_categorie']= null;        if(!is_numeric($val['demandeur_categorie'])) $valF['demandeur_categorie']= null;
187          if(!is_numeric($val['parcelle_lot'])) $valF['parcelle_lot']= null;
188    
189          // cle secondaire alpha vide (contrainte integrite pgsql)
190          if($val['demandeur_civilite']=='') $valF['demandeur_civilite']= null;
191          if($val['delegataire_civilite']=='') $valF['delegataire_civilite']= null;
192    
193      // protection des numeriques      // protection des numeriques
194        if(!is_numeric($val['delai'])) unset ($valF['delai']);        if(!is_numeric($val['delai'])) unset ($valF['delai']);
195        if(!is_numeric($val['terrain_surface'])) unset ($valF['terrain_surface']);        if(!is_numeric($val['terrain_surface'])) unset ($valF['terrain_surface']);
# Line 202  if($validation==0){ Line 202  if($validation==0){
202        if(!is_numeric($val['piece_nombre'])) unset ($valF['piece_nombre']);        if(!is_numeric($val['piece_nombre'])) unset ($valF['piece_nombre']);
203        if(!is_numeric($val['shon_calcul'])) unset ($valF['shon_calcul']);        if(!is_numeric($val['shon_calcul'])) unset ($valF['shon_calcul']);
204        if(!is_numeric($val['terrain_surface_calcul'])) unset ($valF['terrain_surface_calcul']);        if(!is_numeric($val['terrain_surface_calcul'])) unset ($valF['terrain_surface_calcul']);
205        // cle secondaire alpha vide (contrainte integrite pgsql)      $res4= $f -> db->autoExecute(DB_PREFIXE."dossier",$valF,DB_AUTOQUERY_INSERT);
       if($val['demandeur_civilite']=='') $valF['demandeur_civilite']= null;  
       if($val['delegataire_civilite']=='') $valF['delegataire_civilite']= null;  
     $res4= $f -> db->autoExecute("dossier",$valF,DB_AUTOQUERY_INSERT);  
206      $f->isDatabaseError($res4);      $f->isDatabaseError($res4);
207      echo  _("dossier")." ".$valF['dossier']." ".$row['demandeur_nom']." "._("ajoute").      echo  _("dossier")." ".$valF['dossier']." ".$row['demandeur_nom']." "._("ajoute").
208            " ".$f -> db->affectedRows()." "._("table")." dossier <br>" ;            " ".$f -> db->affectedRows()." "._("table")." dossier <br>" ;
209      }      }
210      // insertion des parcelles dans TERRAIN pour le nouveau dossier      // insertion des parcelles dans TERRAIN pour le nouveau dossier
211      $sql= "select * from terrain  where dossier ='".$idx."'";      $sql= "select * from ".DB_PREFIXE."terrain  where dossier ='".$idx."'";
212      $res5=$f -> db->query($sql);      $res5=$f -> db->query($sql);
213      $f->isDatabaseError($res5);      $f->isDatabaseError($res5);
214      $valG['dossier']=$valF['dossier'];      $valG['dossier']=$valF['dossier'];
215      while ($row5=& $res5->fetchRow(DB_FETCHMODE_ASSOC)){      while ($row5=& $res5->fetchRow(DB_FETCHMODE_ASSOC)){
216            $valG['parcelle']=$row5['parcelle'];            $valG['parcelle']=$row5['parcelle'];
217            $valG['terrain']=$f -> db->nextId('terrain');            $valG['terrain']=$f -> db->nextId(DB_PREFIXE.'terrain');
218            // insertion des terrains concernes            // insertion des terrains concernes
219            $res10= $f -> db->autoExecute("terrain",$valG,DB_AUTOQUERY_INSERT);            $res10= $f -> db->autoExecute(DB_PREFIXE."terrain",$valG,DB_AUTOQUERY_INSERT);
220            if (DB :: isError($res10))            $f->isDatabaseError($res10);
              echo $res10->getDebugInfo()." ".$res10->getMessage()."<br>";  
221            echo  _("terrain")." ".$valG['terrain']." "._("ajoute")." ".            echo  _("terrain")." ".$valG['terrain']." "._("ajoute")." ".
222            $f -> db->affectedRows()." "._("table")." terrain <br>" ;            $f -> db->affectedRows()." "._("table")." terrain <br>" ;
223      }      }
224      // transfert destination_shon      // transfert destination_shon
225      $valH=array();      $valH=array();
226      $sql= "select * from destination_shon  where dossier ='".$idx."'";      $sql= "select * from ".DB_PREFIXE."destination_shon  where dossier ='".$idx."'";
227      $res11 =$f -> db->query($sql);      $res11 =$f -> db->query($sql);
228      $f->isDatabaseError($res11);      $f->isDatabaseError($res11);
229      $valH['dossier']=$valF['dossier'];      $valH['dossier']=$valF['dossier'];
230      while ($row11=& $res11->fetchRow(DB_FETCHMODE_ASSOC)){      while ($row11=& $res11->fetchRow(DB_FETCHMODE_ASSOC)){
231            $valH['destination_shon']=$f -> db->nextId('destination_shon');           $valH['destination_shon']=$f -> db->nextId(DB_PREFIXE.'destination_shon');
232            $valH['destination']=$row11['destination'];           $valH['destination']=$row11['destination']; //*** 3.0.0
233            $valH['shon']=$row11['shon'];           if(is_numeric($row11['shon']))
234            $res12= $f -> db->autoExecute("destination_shon",$valH,DB_AUTOQUERY_INSERT);              $valH['shon']=$row11['shon'];
235            if (DB :: isError($res12))           if(is_numeric($row11['shon_anterieure']))
236               echo $res12->getDebugInfo()." ".$res12->getMessage()."<br>";              $valH['shon_anterieure']=$row11['shon_anterieure'];
237            echo  _("destination")." ".$valH['destination_shon']." "._("ajoute").           if(is_numeric($row11['shon_demolie']))
238            " ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ;              $valH['shon_demolie']=$row11['shon_demolie'];
239             if(is_numeric($row11['shon_anterieure_supprimee']))
240                $valH['shon_anterieure_supprimee']=$row11['shon_anterieure_supprimee'];
241             if(is_numeric($row11['shon_nouvelle_transformee']))
242                $valH['shon_nouvelle_transformee']=$row11['shon_nouvelle_transformee'];
243             if(is_numeric($row11['shon_nouvelle']))
244                $valH['shon_nouvelle']=$row11['shon_nouvelle'];
245             if(is_numeric($row11['shon_shob_transformee']))
246                $valH['shon_shob_transformee']=$row11['shon_shob_transformee'];
247             $res12= $f -> db->autoExecute(DB_PREFIXE."destination_shon",$valH,DB_AUTOQUERY_INSERT);
248             $f->isDatabaseError($res12);
249             echo  _("destination")." ".$valH['destination_shon']." "._("ajoute").
250             " ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ;
251      }      }
252      // bloc note      // bloc note
253      $valH=array();      $valH=array();
254      $sql= "select * from blocnote  where dossier ='".$idx."'";      $sql= "select * from ".DB_PREFIXE."blocnote  where dossier ='".$idx."'";
255      $res13 =$f -> db->query($sql);      $res13 =$f -> db->query($sql);
256      $f->isDatabaseError($res);      $f->isDatabaseError($res);
257      $valH['dossier']=$valF['dossier'];      $valH['dossier']=$valF['dossier'];
258      while ($row13=& $res13->fetchRow(DB_FETCHMODE_ASSOC)){      while ($row13=& $res13->fetchRow(DB_FETCHMODE_ASSOC)){
259            $valH['blocnote']=$f -> db->nextId('blocnote');            $valH['blocnote']=$f -> db->nextId(DB_PREFIXE.'blocnote');
260            $valH['note']=$row13['note'];            $valH['note']=$row13['note'];
261            $valH['categorie']=$row13['categorie'];            $valH['categorie']=$row13['categorie'];
262            $res14= $f -> db->autoExecute("blocnote",$valH,DB_AUTOQUERY_INSERT);            $res14= $f -> db->autoExecute(DB_PREFIXE."blocnote",$valH,DB_AUTOQUERY_INSERT);
263            if (DB :: isError($res14))            $f->isDatabaseError($res14);
              echo $res14->getDebugInfo()." ".$res14->getMessage()."<br>";  
264            echo  _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ".            echo  _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ".
265            $f -> db->affectedRows()." "._("table")." blocnote <br>" ;            $f -> db->affectedRows()." "._("table")." blocnote <br>" ;
266      }      }
267        // statistiques
268        $valH=array();
269        $sql= "select * from ".DB_PREFIXE."statistique  where dossier ='".$idx."'";
270        $res15 =$f -> db->query($sql);
271        $f->isDatabaseError($res15);
272        $valH['dossier']=$valF['dossier'];
273        while ($row15=& $res15->fetchRow(DB_FETCHMODE_ASSOC)){
274              $valH['statistique']=$f -> db->nextId(DB_PREFIXE.'statistique');
275              $valH['parametre']=$row15['parametre'];
276              $valH['valeur']=$row15['valeur'];
277              $res16= $f -> db->autoExecute(DB_PREFIXE."statistique",$valH,DB_AUTOQUERY_INSERT);
278              $f->isDatabaseError($res16);
279              echo  _("statistique")." ".$valH['statistique']." "._("ajoute")." ".
280              $f -> db->affectedRows()." "._("table")." statistique <br>" ;
281        }
282      // pas dinstruction et de consultation en transfert      // pas dinstruction et de consultation en transfert
283  // enregistrement $msg en /tmp  **********************  // enregistrement $msg en /tmp  **********************
284  /*  /*

Legend:
Removed from v.164  
changed lines
  Added in v.242

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26