/[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 88 by fraynaud, Thu Aug 25 09:59:07 2011 UTC revision 196 by fraynaud, Sat Oct 15 21:07:29 2011 UTC
# Line 29  if (isset ($_GET['idx'])){ Line 29  if (isset ($_GET['idx'])){
29  // =============================================================================  // =============================================================================
30  if($validation==0){  if($validation==0){
31      $validation=1;      $validation=1;
32      echo "<br>"._("dossier")." ".$idx."<br></td></tr>";      echo "<br>"._("dossier")." ".$idx."<br><br></td></tr>";
33      echo "<form method=\"POST\" action=\"dossier_modificatif.php?validation=".$validation.      echo "<form method=\"POST\" action=\"dossier_modificatif.php?validation=".$validation.
34      "&idx=".$idx."\" name=f1>";      "&idx=".$idx."\" name=f1>";
35      // date du modificatif      // date du modificatif
36      echo _("Date")." "._("modicatif");      echo _("Date")." "._("modicatif");
37      echo "<input type='text' name='date_modificatif' id=\"datedebut\" value=\"";      echo "&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='date_modificatif' id=\"datedebut\" value=\"";
38      echo "\" size=\"15\" class=\"champFormulaire datepicker\" onchange='fdate(this)'  onkeyup=\"\" onclick=\"\" />";      echo "\" size=\"15\" class=\"champFormulaire datepicker\" onchange='fdate(this)'  onkeyup=\"\" onclick=\"\" />";
39      echo "<br>"._("module")." : ";      echo "<br><br>"._("module")." : ";
40      echo "<td><select name='module' size=1>";      echo "<td>&nbsp;&nbsp;&nbsp;&nbsp;<select name='module' size=1>";
41      echo "<option value='modificatif'>"._("modificatif")."</option>";      echo "<option value='modificatif'>"._("modificatif")."</option>";
42      echo "<option value='transfert'>"._("transfert")."</option>";      echo "<option value='transfert'>"._("transfert")."</option>";
43      echo "</select>";      echo "</select>";
44      echo "<input type='submit' value='"._("transfert")." / ".      echo "<br><br><input type='submit' value='"._("transfert")." / ".
45      _("modificatif")." "._("dossier")." ".$idx."'>";      _("modificatif")." "._("dossier")." ".$idx."'>";
46  }else {   // ===================== mise a jour =================================  }else {   // ===================== mise a jour =================================
47      // debut de transaction      // debut de transaction
# 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 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']);
       // cle secondaire alpha vide (contrainte integrite pgsql)  
       if($val['demandeur_civilite']=='') $valF['demandeur_civilite']= null;  
       if($val['delegataire_civilite']=='') $valF['delegataire_civilite']= null;  
205      $res4= $f -> db->autoExecute("dossier",$valF,DB_AUTOQUERY_INSERT);      $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").
# Line 220  if($validation==0){ Line 217  if($validation==0){
217            $valG['terrain']=$f -> db->nextId('terrain');            $valG['terrain']=$f -> db->nextId('terrain');
218            // insertion des terrains concernes            // insertion des terrains concernes
219            $res10= $f -> db->autoExecute("terrain",$valG,DB_AUTOQUERY_INSERT);            $res10= $f -> db->autoExecute("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      }      }
# Line 233  if($validation==0){ Line 229  if($validation==0){
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('destination_shon');
232            $valH['destination']=$row11['destination'];            $valH['destination']=$row11['destination']; //*** 3.0.0
233            $valH['shon']=$row11['shon'];            $valH['shon_anterieure']=$row11['shon_anterieure'];
234              $valH['shon_demolie']=$row11['shon_demolie'];
235              $valH['shon_anterieure_supprimee']=$row11['shon_anterieure_supprimee'];
236              $valH['shon_nouvelle_transformee']=$row11['shon_nouvelle_transformee'];
237              $valH['shon_nouvelle']=$row11['shon_nouvelle'];
238              $valH['shon_shob_transformee']=$row11['shon_shob_transformee'];
239            $res12= $f -> db->autoExecute("destination_shon",$valH,DB_AUTOQUERY_INSERT);            $res12= $f -> db->autoExecute("destination_shon",$valH,DB_AUTOQUERY_INSERT);
240            if (DB :: isError($res12))            $f->isDatabaseError($res12);
              echo $res12->getDebugInfo()." ".$res12->getMessage()."<br>";  
241            echo  _("destination")." ".$valH['destination_shon']." "._("ajoute").            echo  _("destination")." ".$valH['destination_shon']." "._("ajoute").
242            " ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ;            " ".$f -> db->affectedRows()." "._("table")." destination_shon <br>" ;
243      }      }
# Line 252  if($validation==0){ Line 252  if($validation==0){
252            $valH['note']=$row13['note'];            $valH['note']=$row13['note'];
253            $valH['categorie']=$row13['categorie'];            $valH['categorie']=$row13['categorie'];
254            $res14= $f -> db->autoExecute("blocnote",$valH,DB_AUTOQUERY_INSERT);            $res14= $f -> db->autoExecute("blocnote",$valH,DB_AUTOQUERY_INSERT);
255            if (DB :: isError($res14))            $f->isDatabaseError($res14);
              echo $res14->getDebugInfo()." ".$res14->getMessage()."<br>";  
256            echo  _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ".            echo  _("blocnote")." ".$valH['blocnote']." "._("ajoute")." ".
257            $f -> db->affectedRows()." "._("table")." blocnote <br>" ;            $f -> db->affectedRows()." "._("table")." blocnote <br>" ;
258      }      }
259        // statistiques
260            // bloc note
261        $valH=array();
262        $sql= "select * from statistique  where dossier ='".$idx."'";
263        $res15 =$f -> db->query($sql);
264        $f->isDatabaseError($res15);
265        $valH['dossier']=$valF['dossier'];
266        while ($row15=& $res15->fetchRow(DB_FETCHMODE_ASSOC)){
267              $valH['statistique']=$f -> db->nextId('statistique');
268              $valH['parametre']=$row15['parametre'];
269              $valH['valeur']=$row15['valeur'];
270              $res16= $f -> db->autoExecute("statistique",$valH,DB_AUTOQUERY_INSERT);
271              $f->isDatabaseError($res16);
272              echo  _("statistique")." ".$valH['statistique']." "._("ajoute")." ".
273              $f -> db->affectedRows()." "._("table")." statistique <br>" ;
274        }
275      // pas dinstruction et de consultation en transfert      // pas dinstruction et de consultation en transfert
276  // enregistrement $msg en /tmp  **********************  // enregistrement $msg en /tmp  **********************
277  /*  /*

Legend:
Removed from v.88  
changed lines
  Added in v.196

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26