/[openfoncier]/trunk/app/sitadel.class.php
ViewVC logotype

Diff of /trunk/app/sitadel.class.php

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

revision 1797 by nhaye, Fri Apr 26 18:08:38 2013 UTC revision 1809 by vpihour, Thu May 2 12:55:08 2013 UTC
# Line 10  Line 10 
10    
11  class sitadel {  class sitadel {
12            
13      var $dossier; // identifiant du dossier à insérer dans l'export      private $dossier; // identifiant du dossier à insérer dans l'export
14      var $row; // Valeurs du dossier      private $row; // Valeurs du dossier
15      var $val; // parametre par defaut      private $val; // parametre par defaut
16      var $parametre; //parametre dossier      private $parametre; //parametre dossier
17      var $DEBUG=0; // 1 = valeur      private $DEBUG=0; // 1 = valeur
18    
19      /**      /**
20       * Constructeur, initialisation de l'attribut dossier       * Constructeur, initialisation de l'attribut dossier
# Line 24  class sitadel { Line 24  class sitadel {
24      function sitadel($dossier) {      function sitadel($dossier) {
25          $this->dossier=$dossier;          $this->dossier=$dossier;
26      }// fin constructeur      }// fin constructeur
27        
28        /**
29         * Mutateur pour le tableau de données du dossier
30         *
31         * @param   $row    Le tableau de données du dossier
32         * @return  void
33         * */
34        public function setRow($row){
35            $this->row = $row;
36        }
37        
38        /**
39         * Mutateur pour le paramètre par défaut
40         *
41         * @param   $val    Le paramètre par défaut
42         * @return  void
43         * */
44        public function setVal($val){
45            $this->val = $val;
46        }
47        
48      /**      /**
49       * Permet de mettre en forme le début de chaque la ligne       * Permet de mettre en forme le début de chaque la ligne
50       *       *
# Line 68  class sitadel { Line 88  class sitadel {
88              $etatcivil.= $this->maj(substr($this->row['civilite_pp'],0,8))."|";              $etatcivil.= $this->maj(substr($this->row['civilite_pp'],0,8))."|";
89              $etatcivil.= $this->maj(substr($this->row['pp_particulier_prenom'],0,30))."|";              $etatcivil.= $this->maj(substr($this->row['pp_particulier_prenom'],0,30))."|";
90    
91              $etatcivil.= $this->maj(substr($this->row['pp_particulier_nom'],0,30))."||||||||";              $etatcivil.= $this->maj(substr($this->row['pp_particulier_nom'],0,30))."|Vm|Vm|Vm|Vm|Vm|Vm|Vm|";
92          } else {          } else {
93             //denopm|*rspm*|*siret*|*catjur*|*civrep*|*prenomrep*|nomrep|                     //denopm|*rspm*|*siret*|*catjur*|*civrep*|*prenomrep*|nomrep|        
94             $etatcivil.="|||"; // codemo=1             $etatcivil.="Vm|Vm|Vm|"; // codemo=1
95             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_denomination'],0,50))."|";             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_denomination'],0,50))."|";
96             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_raison_sociale'],0,30))."|";             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_raison_sociale'],0,30))."|";
97             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_siret'],0,14))."|";             $etatcivil.=$this->maj(substr($this->row['pp_personne_morale_siret'],0,14))."|";
# Line 126  class sitadel { Line 146  class sitadel {
146      }      }
147            
148      function meltel($mouvement){      function meltel($mouvement){
149          // sitadel : telmo|melmo|          // openfoncier telephone_fixe (14/20), courriel(40, 50) pas de suivi
150            // sitadel : telmo|melmo|suivi
151          $meltel="";          $meltel="";
152          if($mouvement != "Transfert")          if($mouvement != "Transfert")
153              $meltel.=$this->maj(substr($this->row['pp_telephone_fixe'],0,5))."|";              $meltel.=$this->maj($this->row['pp_telephone_fixe'])."|";
154          $meltel.= $this->maj(substr($this->row['pp_courriel'],0,5))."|";          $meltel.= $this->maj($this->row['pp_courriel'])."|";
155          // suivi electronique          // suivi electronique
156          // Il n'y a pas de notification par mail gérée dans l'appli          // Il n'y a pas de notification par mail gérée dans l'appli
157          /*if($this->row['delegataire']=='Oui'){          $meltel.= "0";
158             $meltel.= "1";  
         }else{  
            $meltel.= "0";  
         }*/  
159          // suivi -> fin enr pour transfert (sans |)          // suivi -> fin enr pour transfert (sans |)
160          if($mouvement != "Transfert")          if($mouvement != "Transfert")
161              $meltel.= "|";              $meltel.= "|";
# Line 160  class sitadel { Line 178  class sitadel {
178    
179          return $adresse;          return $adresse;
180      }      }
181        
182        /**
183         * Formalise la parcelle à partir de la référence cadastrale
184         *
185         * @return string la chaine formatée
186         */
187      function parcelle(){      function parcelle(){
188          // ========          // ========
189          // parcelle          // parcelle
# Line 169  class sitadel { Line 192  class sitadel {
192          // openfoncier = 1 seule parcelle (6/3+5)          // openfoncier = 1 seule parcelle (6/3+5)
193          // sitadel : scadastre1|ncadastre1|*scadastre2*|*ncadastre2*|*scadastre3*|*ncadastre3*|          // sitadel : scadastre1|ncadastre1|*scadastre2*|*ncadastre2*|*scadastre3*|*ncadastre3*|
194          $parcelle = "";          $parcelle = "";
         $numero = "";  
195          if ($this->row['dossier_terrain_references_cadastrales'] != "" ) {          if ($this->row['dossier_terrain_references_cadastrales'] != "" ) {
196              $tab_parcelles = $this->parseParcelles($this->row['dossier_terrain_references_cadastrales']);              $tab_parcelles = $this->parseParcelles($this->row['dossier_terrain_references_cadastrales']);
197                
198                $parcelle .= ( isset($tab_parcelles[0]) && count($tab_parcelles[0]) == 3 )
199                    ? $this->maj(substr($tab_parcelles[0]['section'],0,3))."|".
200                      $this->maj(substr($tab_parcelles[0]['parcelle'],0,5))."|"
201                    : "Vm|Vm|";
202                $parcelle .= ( isset($tab_parcelles[1]) && count($tab_parcelles[1]) == 3 )
203                    ? $this->maj(substr($tab_parcelles[1]['section'],0,3))."|".
204                      $this->maj(substr($tab_parcelles[1]['parcelle'],0,5))."|"
205                    : "Vm|Vm|";
206                $parcelle .= ( isset($tab_parcelles[2]) && count($tab_parcelles[2]) == 3 )
207                    ? $this->maj(substr($tab_parcelles[2]['section'],0,3))."|".
208                      $this->maj(substr($tab_parcelles[2]['parcelle'],0,5))."|"
209                    : "Vm|Vm|";
210          } else {          } else {
211              $parcelle.= $this->p('scadastre1')."|".$this->p('ncadastre1')."|";              $parcelle= "Vm|Vm|Vm|Vm|Vm|Vm|";
212          }          }
213            
         $parcelle.= $this->p('scadastre2')."|".$this->p('ncadastre2')."|";  
         $parcelle.= $this->p('scadastre3')."|".$this->p('ncadastre3')."|";  
214          return $parcelle;          return $parcelle;
215      }      }
216    
# Line 188  class sitadel { Line 221  class sitadel {
221       * @return array (array(quartier, section, parcelle), ...)       * @return array (array(quartier, section, parcelle), ...)
222       */       */
223      function parseParcelles($strParcelles) {      function parseParcelles($strParcelles) {
224            
225          // Séparation des lignes          // Séparation des lignes
226          $references = explode(";", $strParcelles);          $references = explode(";", $strParcelles);
227          $liste_parcelles = array();          $liste_parcelles = array();
228            
229          // On boucle sur chaque ligne pour ajouter la liste des parcelles de chaque ligne          // On boucle sur chaque ligne pour ajouter la liste des parcelles de chaque ligne
230          foreach ($references as $parcelles) {          foreach ($references as $parcelles) {
231                
232              // On transforme la chaîne de la ligne de parcelles en tableau              // On transforme la chaîne de la ligne de parcelles en tableau
233              $ref = str_split($parcelles);              $ref = str_split($parcelles);
234              // Les 1er caractères sont numériques              // Les 1er caractères sont numériques
235              $num = true;              $num = true;
236                
237              // Tableau des champs de la ligne de références cadastrales              // Tableau des champs de la ligne de références cadastrales
238              $reference_tab = array();              $reference_tab = array();
239              $temp = "";              $temp = "";
240              foreach ($ref as $carac) {              foreach ($ref as $carac) {
241                    
242                  // Permet de tester si le caractère courant est de même type que le précédent                  // Permet de tester si le caractère courant est de même type que le précédent
243                  if(is_numeric($carac) === $num) {                  if(is_numeric($carac) === $num) {
244                      $temp .= $carac;                      $temp .= $carac;
# Line 215  class sitadel { Line 253  class sitadel {
253              }              }
254              // Stockage du dernier champ sur lequel il n'y a pas eu de bascule              // Stockage du dernier champ sur lequel il n'y a pas eu de bascule
255              $reference_tab[] = $temp;              $reference_tab[] = $temp;
   
256              // Calcul des parcelles              // Calcul des parcelles
257              $quartier = $reference_tab[0];              $quartier = $reference_tab[0];
258              $sect = $reference_tab[1];              $sect = $reference_tab[1];
259    
260                $ancien_ref_parc = "";
261              for ($i=2; $i < count($reference_tab); $i+=2) {              for ($i=2; $i < count($reference_tab); $i+=2) {
262                  $parc["quartier"] = $quartier;                  $parc["quartier"] = $quartier;
263                  $parc["section"] = $sect;                  $parc["section"] = $sect;
264                  if(!isset($ancien_ref_parc) OR $reference_tab[$i-1] == "/") {                  if( $ancien_ref_parc == "" OR $reference_tab[$i-1] == "/") {
265                      // 1ere parcelle ou parcelle individuelle                      // 1ere parcelle ou parcelle individuelle
266                      $parc["parcelle"] = $reference_tab[$i];                      $parc["parcelle"] = $reference_tab[$i];
267                      // Ajout d'une parcelle à la liste                      // Ajout d'une parcelle à la liste
# Line 236  class sitadel { Line 274  class sitadel {
274                          $liste_parcelles[] = $parc;                          $liste_parcelles[] = $parc;
275                      }                      }
276                  }                  }
277                    //Gestion des erreurs
278                    else{
279                        
280                        echo _("Une erreur de formattage a ete detecte dans la reference cadastrale du dossier ").$this->row['dossier'];
281                    }
282                  // Sauvegarde de la référence courante de parcelle                  // Sauvegarde de la référence courante de parcelle
283                  $ancien_ref_parc = $reference_tab[$i];                  $ancien_ref_parc = $reference_tab[$i];
284              }              }
285          }          }
286    
287          return $liste_parcelles;          return $liste_parcelles;
288      }      }
289    
290      function decision_groupe1($avis_sitadel, $avis_sitadel_motif,$structure){      /**
291          $decision=  $structure.'|'; // au nom de la commune       * Données pour le groupe 1 du mouvement décision
292          $decision.= $avis_sitadel."|";       *  
293         * @return  string  la chaine de données du groupe 1
294         */
295        function decision_groupe1(){
296            // openfoncier autorite_competente (integer/1), sitadel(integer, 1)
297            //             date_limite (date, 8)| date_notification_delai (date, 8),
298            //             sitadel_motif (integer, 1)
299            // sitadel : collectivite|natdec|datredec|motifann
300            
301            $decision = $this->maj(substr($this->row['autorite_competente'],0,1))."|";
302            $decision.= $this->maj(substr($this->row['sitadel'],0,1))."|";
303            
304            $datredec = "";
305            //Choix de la date
306            if ( $this->row['sitadel'] == 1 || $this->row['sitadel'] == 2 || $this->row['sitadel'] == 3 ){
307                
308                $datredec = $this->row['date_limite'];
309            }
310            elseif( $this->row['sitadel'] != "" ){
311                
312                $datredec = $this->row['date_notification_delai'];
313            }
314          // date au format francais 8 caracteres          // date au format francais 8 caracteres
315          $decision.= substr($this->row['date_decision'],8,2).''.          $decision.= $this->maj(substr($datredec,8,2).''.
316                      substr($this->row['date_decision'],5,2)."".                          substr($datredec,5,2)."".
317                      substr($this->row['date_decision'],0,4)."|";                                      substr($datredec,0,4))."|";
318          $decision.= $avis_sitadel_motif."|";                      
319            $decision.= $this->maj(substr($this->row['sitadel_motif'],0,1));
320            $decision.= ($this->row['sitadel'] == 2 ||
321                $this->row['sitadel'] == 4 ||
322                $this->row['sitadel'] == 5) ? "|" : "";
323            
324          return $decision;          return $decision;
325      }      }
326            
327      function terrain(){      /**
328          $contenu="";       * Données pour le groupe 2 du mouvement décision concernant les aménagements et
329          $contenu= floor($this->row['terrain_surface'])."|";       * le terrain
330          return $contenu;       *  
331         * @return  string  la chaine de données du groupe 2
332         */
333        function amenagement_terrain(){
334            // openfoncier am_terr_surf (numeric/7) am_lotiss (bool/1) terr_juri_afu (20/1)
335            //             co_cstr_nouv (20/1) co_cstr_exist (text/1000) co_modif_aspect (bool/1)
336            //             co_modif_struct (bool/1) co_cloture (bool/1) co_trx_exten (bool/1)
337            //             co_trx_surelev (bool/1) co_trx_nivsup (bool/1) co_trx_amgt (bool/1)
338            //             co_anx_pisc (bool/1) co_anx_gara (bool/1) co_anx_veran (bool/1)
339            //             co_anx_abri (bool/1) co_anx_autr (bool/1) co_bat_niv_nb (integer/3)
340            // sitadel :   terrain|lotissement|ZAC|AFU|libnattrav|natproj|natdp|nattrav|
341            //             annexe|nivmax
342            $amenagement_terrain="";
343            
344            //Terrain
345            $amenagement_terrain .= $this->maj(substr($this->row['am_terr_surf'],0,7))."|";
346            
347            //Lotissement
348            $amenagement_terrain .= ((isset($this->row['am_lotiss']) && $this->maj($this->row['am_lotiss']) == 't') ? 1 : 0)."|";
349            //ZAC
350            $amenagement_terrain .= ((isset($this->row['terr_juri_zac']) && $this->maj($this->row['terr_juri_zac']) != '') ? 1 : 0)."|";
351            //AFU
352            $amenagement_terrain .= ((isset($this->row['terr_juri_afu']) && $this->maj($this->row['terr_juri_afu']) != '') ? 1 : 0)."|";
353            //Libnattrav
354            $amenagement_terrain .= (isset($this->row['terr_desc'])) ? $this->maj(substr($this->row['terr_desc'],0,1000))."|" : "Vm|";
355            
356            // Nouvelle co,nstruction et travaux sur construction
357            //natproj
358            if ( isset($this->row['co_cstr_nouv']) && isset($this->row['co_cstr_exist']) &&
359                $this->maj($this->row['co_cstr_nouv']) == 't' &&
360                $this->maj($this->row['co_cstr_exist']) == 't' ){
361                
362                $amenagement_terrain .= "3|";
363            }
364            //Nouvelle construction
365            elseif ( isset($this->row['co_cstr_nouv']) && $this->maj($this->row['co_cstr_nouv']) == 't' ) {
366                
367                $amenagement_terrain .= "1|";
368            }
369            //Travaux sur construction existante
370            elseif ( isset($this->row['co_cstr_exist']) && $this->maj($this->row['co_cstr_exist']) == 't' ) {
371                
372                $amenagement_terrain .= "2|";
373            }
374            //Sinon
375            else{
376                
377                $amenagement_terrain .= "Vm|";
378            }
379    
380            //Nature du projet dans le cas d'un DP
381            //natdp
382            if ( $this->row['code'] == "DP" ){
383                
384                $amenagement_terrain .= ((isset($this->row['co_cstr_nouv']) && $this->maj($this->row['co_cstr_nouv']) == 't') ? 1 : 0);
385                $amenagement_terrain .= ((isset($this->row['co_cstr_exist']) && $this->maj($this->row['co_cstr_exist']) == 't') ? 1 : 0);
386                $amenagement_terrain .= ((isset($this->row['co_modif_aspect']) && $this->maj($this->row['co_modif_aspect']) == 't') ? 1 : 0);
387                $amenagement_terrain .= ((isset($this->row['co_modif_struct']) && $this->maj($this->row['co_modif_struct']) == 't') ? 1 : 0);
388                $amenagement_terrain .= ((isset($this->row['co_cloture']) && $this->maj($this->row['co_cloture']) == 't') ? 1 : 0)."|";
389            }
390            else {
391                
392                $amenagement_terrain .= "Vm|";
393            }
394            
395            //Nature des travaux sur construction existante
396            //nattrav
397            $amenagement_terrain .= ((isset($this->row['co_trx_exten']) && $this->maj($this->row['co_trx_exten']) == 't') ? 1 : 0);
398            $amenagement_terrain .= ((isset($this->row['co_trx_surelev']) && $this->maj($this->row['co_trx_surelev']) == 't') ? 1 : 0);
399            $amenagement_terrain .= ((isset($this->row['co_trx_niv_sup']) && $this->maj($this->row['co_trx_niv_sup']) == 't') ? 1 : 0);
400            $amenagement_terrain .= ((isset($this->row['co_trx_amgt']) && $this->maj($this->row['co_trx_amgt']) == 't') ? 1 : 0)."|";
401            
402            //Annexe
403            $amenagement_terrain .= ((isset($this->row['co_anx_pisc']) && $this->maj($this->row['co_anx_pisc']) == 't') ? 1 : 0);
404            $amenagement_terrain .= ((isset($this->row['co_anx_gara']) && $this->maj($this->row['co_anx_gara']) == 't') ? 1 : 0);
405            $amenagement_terrain .= ((isset($this->row['co_anxveran']) && $this->maj($this->row['co_anxveran']) == 't') ? 1 : 0);
406            $amenagement_terrain .= ((isset($this->row['co_anx_abri']) && $this->maj($this->row['co_anx_abri']) == 't') ? 1 : 0);
407            $amenagement_terrain .= ((isset($this->row['co_anx_autr']) && $this->maj($this->row['co_anx_autr']) == 't') ? 1 : 0)."|";
408            
409            //nivmax
410            $amenagement_terrain .= isset($this->row['co_bat_niv_nb']) && $this->maj(substr($this->row['co_bat_niv_nb'],0,3))."|";
411    
412            return $amenagement_terrain;
413      }      }
414            
415      function amenagement(){      /**
416          // renseignement du groupe 2 ***       * Données pour le groupe 2 du mouvement décision concernant les SHON
417          // lotissement|zac|afu|               *  
418          $contenu="";       * @return  string  la chaine de données du groupe 2
419          if($this->row['amenagement']!='')       */
420                 $contenu.= "1|";      function shon($nom){
421          else          // openfoncier  (numeric/7)
422                 $contenu.= "0|";          
423          $contenu.= $this->p('zac')."|".$this->p('afu')."|";          $shon = "";
424          return $contenu;          
425            $shon .= ((isset($this->row[$nom.'1']))?$this->maj(substr(floor($this->row[$nom.'1']),0,7)):0)."|";
426            $shon .= ((isset($this->row[$nom.'2']))?$this->maj(substr(floor($this->row[$nom.'2']),0,7)):0)."|";
427            $shon .= ((isset($this->row[$nom.'3']))?$this->maj(substr(floor($this->row[$nom.'3']),0,7)):0)."|";
428            $shon .= ((isset($this->row[$nom.'4']))?$this->maj(substr(floor($this->row[$nom.'4']),0,7)):0)."|";
429            $shon .= ((isset($this->row[$nom.'5']))?$this->maj(substr(floor($this->row[$nom.'5']),0,7)):0)."|";
430            $shon .= ((isset($this->row[$nom.'6']))?$this->maj(substr(floor($this->row[$nom.'6']),0,7)):0)."|";
431            $shon .= ((isset($this->row[$nom.'7']))?$this->maj(substr(floor($this->row[$nom.'7']),0,7)):0)."|";
432            $shon .= ((isset($this->row[$nom.'8']))?$this->maj(substr(floor($this->row[$nom.'8']),0,7)):0)."|";
433            $shon .= ((isset($this->row[$nom.'9']))?$this->maj(substr(floor($this->row[$nom.'9']),0,7)):0)."|";
434            
435            return $shon;
436      }      }
437            
438      function travaux($travaux, $lascot,$mouvement){      function travaux($travaux, $lascot,$mouvement){
# Line 306  class sitadel { Line 469  class sitadel {
469          return $contenu;          return $contenu;
470      }      }
471    
472      function destination($shon){      /**
473          $contenu="";       * Données pour le groupe 2 du mouvement décision concernant les destinations
474          for($i=1;$i<=9;$i++){       *  
475              if(!isset($shon[$i])) $shon[$i]=0;       * @return  string  la chaine de données du groupe 2
476              $contenu.=$shon[$i].'|';       */
477                        function destination(){
478          }          
479          return $contenu;          $destination = "";
480            
481            $destination .= ((isset($this->row['co_sp_transport']) && $this->maj($this->row['co_anx_pisc']) == 't') ? 1 : 0);
482            $destination .= ((isset($this->row['co_sp_enseign']) && $this->maj($this->row['co_sp_enseign']) == 't') ? 1 : 0);
483            $destination .= ((isset($this->row['co_sp_sante']) && $this->maj($this->row['co_sp_sante']) == 't') ? 1 : 0);
484            $destination .= ((isset($this->row['co_sp_act_soc']) && $this->maj($this->row['co_sp_act_soc']) == 't') ? 1 : 0);
485            $destination .= ((isset($this->row['co_sp_ouvr_spe']) && $this->maj($this->row['co_sp_ouvr_spe']) == 't') ? 1 : 0);
486            $destination .= ((isset($this->row['co_sp_culture']) && $this->maj($this->row['co_sp_culture']) == 't') ? 1 : 0)."|";
487            
488            $destination .= ((isset($this->row['dm_tot_log_nb']) && $this->maj($this->row['dm_tot_log_nb']) == 't') ? 1 : 0)."|";
489            $destination .= ((isset($this->row['co_tot_ind_nb']) && $this->maj($this->row['co_tot_ind_nb']) == 't') ? 1 : 0)."|";
490            $destination .= ((isset($this->row['co_tot_coll_nb']) && $this->maj($this->row['co_tot_coll_nb']) == 't') ? 1 : 0)."|";
491            $destination .= ((isset($this->row['co_tot_log_nb']) && $this->maj($this->row['co_tot_log_nb']) == 't') ? 1 : 0)."|";
492            
493            $destination .= ((isset($this->row['co_resid_agees']) && $this->maj($this->row['co_resid_agees']) == 't') ? 1 : 0);
494            $destination .= ((isset($this->row['co_resid_etud']) && $this->maj($this->row['co_resid_etud']) == 't') ? 1 : 0);
495            $destination .= ((isset($this->row['co_resid_tourism']) && $this->maj($this->row['co_resid_tourism']) == 't') ? 1 : 0);
496            $destination .= ((isset($this->row['co_resid_hot_soc']) && $this->maj($this->row['co_resid_hot_soc']) == 't') ? 1 : 0);
497            $destination .= ((isset($this->row['co_resid_soc']) && $this->maj($this->row['co_resid_soc']) == 't') ? 1 : 0);
498            $destination .= ((isset($this->row['co_resid_hand']) && $this->maj($this->row['co_resid_hand']) == 't') ? 1 : 0);
499            $destination .= ((isset($this->row['co_resid_autr']) && $this->maj($this->row['co_resid_autr']) == 't') ? 1 : 0)."|";
500            
501            $destination .= ((isset($this->row['co_resid_autr_desc']) && $this->maj($this->row['co_resid_autr_desc']) == 't') ? 1 : 0)."|";
502            
503            $destination .= ((isset($this->row['co_uti_pers']) && $this->maj($this->row['co_uti_pers']) == 't') ? 1 : 0);
504            $destination .= ((isset($this->row['co_uti_princ']) && $this->maj($this->row['co_uti_princ']) == 't') ? 1 : 0);
505            $destination .= ((isset($this->row['co_uti_secon']) && $this->maj($this->row['co_uti_secon']) == 't') ? 1 : 0);
506            $destination .= ((isset($this->row['co_uti_vente']) && $this->maj($this->row['co_uti_vente']) == 't') ? 1 : 0);
507            $destination .= ((isset($this->row['co_uti_loc']) && $this->maj($this->row['co_uti_loc']) == 't') ? 1 : 0)."|";
508            
509            $destination .= ((isset($this->row['co_foyer_chamb_nb']) && $this->maj($this->row['co_foyer_chamb_nb']) == 't') ? 1 : 0)."|";
510            
511            return $destination;
512        }
513    
514        /**
515         * Données pour le groupe 2 du mouvement décision concernant la répartition des
516         * logements créées par type de financement
517         *  
518         * @return  string  la chaine de données du groupe 2
519         */
520        function repartitionFinan(){
521            
522            $repartitionFinan = "";
523            
524            $repartitionFinan .= ((isset($this->row['co_fin_lls_nb']) && $this->maj($this->row['co_fin_lls_nb']) == 't') ? 1 : 0)."|";
525            $repartitionFinan .= ((isset($this->row['co_fin_aa_nb']) && $this->maj($this->row['co_fin_aa_nb']) == 't') ? 1 : 0)."|";
526            $repartitionFinan .= ((isset($this->row['co_fin_ptz_nb']) && $this->maj($this->row['co_fin_ptz_nb']) == 't') ? 1 : 0)."|";
527            $repartitionFinan .= ((isset($this->row['co_fin_autr_nb']) && $this->maj($this->row['co_fin_autr_nb']) == 't') ? 1 : 0)."|";
528    
529            return $repartitionFinan;
530        }
531    
532        /**
533         * Données pour le groupe 2 du mouvement décision concernant la répartition des
534         * logements créées par nombre de pièces
535         *  
536         * @return  string  la chaine de données du groupe 2
537         */
538        function repartitionNbPiece(){
539            
540            $repartitionFinan = "";
541            
542            $repartitionFinan .= ((isset($this->row['co_mais_piece_nb']) && $this->maj($this->row['co_mais_piece_nb']) == 't') ? 1 : 0)."|";
543            $repartitionFinan .= ((isset($this->row['co_log_1p_nb']) && $this->maj($this->row['co_log_1p_nb']) == 't') ? 1 : 0)."|";
544            $repartitionFinan .= ((isset($this->row['co_log_2p_nb']) && $this->maj($this->row['co_log_2p_nb']) == 't') ? 1 : 0)."|";
545            $repartitionFinan .= ((isset($this->row['co_log_3p_nb']) && $this->maj($this->row['co_log_3p_nb']) == 't') ? 1 : 0)."|";
546            $repartitionFinan .= ((isset($this->row['co_log_4p_nb']) && $this->maj($this->row['co_log_4p_nb']) == 't') ? 1 : 0)."|";
547            $repartitionFinan .= ((isset($this->row['co_log_5p_nb']) && $this->maj($this->row['co_log_5p_nb']) == 't') ? 1 : 0)."|";
548            $repartitionFinan .= ((isset($this->row['co_log_6p_nb']) && $this->maj($this->row['co_log_6p_nb']) == 't') ? 1 : 0);
549    
550            return $repartitionFinan;
551      }      }
552    
553      function descriptif($mouvement){      function descriptif($mouvement){
# Line 417  class sitadel { Line 651  class sitadel {
651              return $this->val[$champ];              return $this->val[$champ];
652      }      }
653            
654        /**
655         * Normalise la chaine de caractère ou renvoit "valeur manquant".
656         *
657         * @param   $val    La valeur du champ
658         * @return  string  la chaine formatée ou "vm"
659         */
660      function maj($val) {      function maj($val) {
661              $val = strtoupper($val);          $val = strtoupper($val);
662              $val=str_replace(chr(195), "", $val);       // supprime le premier code des accents en UTF-8          $val=str_replace(chr(195), "", $val);   // supprime le premier code des accents en UTF-8
663              $s = array('/[âàäÀ]/', '/[éêèëÉÈ]/', '/[îï]/', '/[ôöÔ]/', '/[ûùü]/', '/[çÇ]/', '/\'|\"|^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\-\s\r/');          $s = array('/[âàäÀ]/', '/[éêèëÉÈ]/', '/[îï]/', '/[ôöÔ]/', '/[ûùü]/', '/[çÇ]/', '/\'|\"|^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\-\s\r/');
664              $r = array('A', 'E', 'I', 'O', 'U', 'C', ' ');          $r = array('A', 'E', 'I', 'O', 'U', 'C', ' ');
665              $val = preg_replace($s , $r, $val);          $val = preg_replace($s , $r, $val);
666              // Formatage des valeurs manquantes          // Formatage des valeurs manquantes
667              return $this->testVM($val);          return $this->testVM($val);
668      }      }
669    
670      /**      /**

Legend:
Removed from v.1797  
changed lines
  Added in v.1809

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26