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

Diff of /trunk/app/sitadel.php

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

revision 190 by fraynaud, Wed Oct 12 10:33:29 2011 UTC revision 1197 by nhaye, Wed Jan 9 15:56:01 2013 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: export_sitadel.php,v 1.20 2010-11-15 14:50:40 fraynaud Exp $  // $Id$
3  /*  /*
4  transfert de dossier � SITADEL  transfert de dossier � SITADEL
5  realis� ville arles par fr+jlb  realis� ville arles par fr+jlb
6  voir parametrage trt/sitadel.inc  voir parametrage trt/sitadel.inc
7  */  */
8  require_once "../obj/utils.class.php";  require_once "../obj/utils.class.php";
# Line 10  require_once "../app/sitadel.class.php"; Line 10  require_once "../app/sitadel.class.php";
10  require_once "../dyn/locales.inc.php";  require_once "../dyn/locales.inc.php";
11  require_once "../dyn/version.inc.php";  require_once "../dyn/version.inc.php";
12  require_once "sitadel.inc";  require_once "sitadel.inc";
13  $f = new utils(NULL, "export", _("export SITADEL"), "ico_reqmo.png", "export");  $f = new utils(NULL, "export_sitadel", _("export SITADEL"), "ico_reqmo.png", "export");
14  $f->addHTMLHeadJs(array("../js/script.js"));  $f->addHTMLHeadJs(array("../js/script.js"));
15  // GET  // GET
16  if (isset ($_GET['validation'])){  if (isset ($_GET['validation'])){
# Line 25  $description = _("Cette page vous permet Line 25  $description = _("Cette page vous permet
25  $f->displayDescription($description);  $f->displayDescription($description);
26  //controle  //controle
27  $DEBUG=1;  $DEBUG=1;
28    $t10 = "||||||||||"; // 10 |
29    
30  // parametres collectivite  // parametres collectivite
   
31  // =============================================================================  // =============================================================================
32  // validation = 0  // validation = 0
33  // =============================================================================  // =============================================================================
# Line 49  if($validation==0){ Line 49  if($validation==0){
49      echo "<br><br></form>";      echo "<br><br></form>";
50  }else{   // ===================== extraction =================================  }else{   // ===================== extraction =================================
51      $correct=true;      $correct=true;
52      $longueurenregistrement= 0 ; // a calculer      $longueurenregistrement= 0 ;
53      //$nombreenregistrement=1; // l entete est compt�e dans le nombre enregistrement      $t10 = "||||||||||"; // 10 |
54        $datedebut ='';
55        $datefin='';
56      if($_POST["datedebut"]=="")      if($_POST["datedebut"]=="")
57          $correct=false;          $correct=false;
58      else      else
# Line 63  if($validation==0){ Line 65  if($validation==0){
65          $datefin = substr($_POST["datefin"],6,4).          $datefin = substr($_POST["datefin"],6,4).
66                      "-".substr($_POST["datefin"],3,2)."-".                      "-".substr($_POST["datefin"],3,2)."-".
67                      substr($_POST["datefin"],0,2);                      substr($_POST["datefin"],0,2);
     //$correct=true; // a enlever apres test  
68      if ($correct==true){ // ***      if ($correct==true){ // ***
69          // dossiers concern�s          // dossiers concern�s
70          $sql= "select * from dossier";          $sql= "select * from ".DB_PREFIXE."dossier";
71          $sql.= " where (nature='PC' or nature = 'PD' or nature = 'PA' or nature = 'DP')";          $sql.= " INNER JOIN ".DB_PREFIXE."dossier_autorisation
72                            ON dossier.dossier_autorisation=dossier_autorisation.dossier_autorisation
73                        INNER JOIN ".DB_PREFIXE."dossier_autorisation_type_detaille
74                            ON dossier_autorisation.dossier_autorisation_type_detaille
75                            = dossier_autorisation_type_detaille.dossier_autorisation_type_detaille";
76            $sql.= " where (dossier_autorisation_type_detaille.code='PCI'
77                    or dossier_autorisation_type_detaille.code='PCA'
78                    or dossier_autorisation_type_detaille.code = 'PD'
79                    or dossier_autorisation_type_detaille.code = 'PA'
80                    or dossier_autorisation_type_detaille.code = 'DP')";
81          $sql.= " AND ((date_depot >='".$datedebut."' AND date_depot<='".$datefin."')";          $sql.= " AND ((date_depot >='".$datedebut."' AND date_depot<='".$datefin."')";
82          $sql.= " OR (date_decision>='".$datedebut."' AND date_decision<='".$datefin."')";          $sql.= " OR (date_decision>='".$datedebut."' AND date_decision<='".$datefin."')";
83          $sql.= " OR (date_chantier>='".$datedebut."' AND date_chantier<='".$datefin."'))";          $sql.= " OR (date_chantier>='".$datedebut."' AND date_chantier<='".$datefin."'))";
84          $sql.= " order by date_depot";          $sql.= " order by date_depot";
         //$sql.= " and dossier = 'PC11R000402'";  
85          $res = $f->db -> query ($sql);          $res = $f->db -> query ($sql);
86          $f->isDatabaseError($res);          $f->isDatabaseError($res);
87          $export="";          $export="";
# Line 83  if($validation==0){ Line 92  if($validation==0){
92              // sitadel              // sitadel
93              $g->val=$val;              $g->val=$val;
94              // parametre              // parametre
95              $sql = "select parametre, valeur from statistique where dossier ='".$row['dossier']."'";              $sql = "select parametre, valeur from ".DB_PREFIXE."statistique where dossier ='".$row['dossier']."'";
96              $res1 = $f->db -> query ($sql);              $res1 = $f->db -> query ($sql);
97              $f->isDatabaseError($res1);              $f->isDatabaseError($res1);
98              while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){              while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){
# Line 100  if($validation==0){ Line 109  if($validation==0){
109                  and $row['date_depot']<=$datefin)                  and $row['date_depot']<=$datefin)
110                  or  ($row['date_decision'] >= $datedebut                  or  ($row['date_decision'] >= $datedebut
111                  and $row['date_decision']<=$datefin))){                  and $row['date_decision']<=$datefin))){
112                  $depot.=$g->entete("DEPOT",$departement,$commune);                  $depot.=$g->entete("DEPOT",$departement,$commune,$pf_departement);
113                  $depot.=$g->etatcivil();                  $depot.=$g->etatcivil();
114                  $depot.=$g->adresse();                  $depot.=$g->adresse();
115                  $depot.=$g->delegataire();                  $depot.=$g->delegataire();
# Line 137  if($validation==0){ Line 146  if($validation==0){
146              if($row['types']=='Transfert'              if($row['types']=='Transfert'
147                  and $row['date_depot'] >= $datedebut                  and $row['date_depot'] >= $datedebut
148                  and $row['date_depot']<=$datefin){                  and $row['date_depot']<=$datefin){
149                  $transfert.=$g->entete("TRANSFERT",$departement,$commune);                  $transfert.=$g->entete("TRANSFERT",$departement,$commune,$pf_departement);
150                  $transfert.=$g->etatcivil();                  $transfert.=$g->etatcivil();
151                  $transfert.=$g->adresse();                  $transfert.=$g->adresse();
152                  $transfert.=$g->meltel($row['types']);                  $transfert.=$g->meltel($row['types']);
# Line 148  if($validation==0){ Line 157  if($validation==0){
157              //decision              //decision
158              // type different de modificatif              // type different de modificatif
159              $decision="";              $decision="";
160              if($row['types']!='Modificatif' and $row['types']!='Transfert'){              if($row['types']!='Modificatif'
161                    and $row['types']!='Transfert'
162                    and (($row['date_depot'] >= $datedebut and $row['date_depot']<=$datefin)
163                    or  ($row['date_decision'] >= $datedebut and $row['date_decision']<=$datefin))){
164                  $avis_sitadel="";                  $avis_sitadel="";
165                  $avis_sitadel_motif="";                  $avis_sitadel_motif="";
166                  // enregistrement decision dans tous les cas                  // enregistrement decision dans tous les cas
167                  $decision.=$g->entete("DECISION",$departement,$commune);                  $decision.=$g->entete("DECISION",$departement,$commune,$pf_departement);
168                  //if ($row['date_decision']== '0000-00-00'                  //if ($row['date_decision']== '0000-00-00'
169                  //    or !isset($row['date_decision'])){                  //    or !isset($row['date_decision'])){
170                  //if(isset($row['date_decision']) and $row['date_decision']!=""){                  //if(isset($row['date_decision']) and $row['date_decision']!=""){
171                      // avis_sitadel et avis_sitadel_motif                      // avis_sitadel et avis_sitadel_motif
172                      if($row['avis']!=''){                      if($row['avis_decision']!=''){
173                          $avis_sitadel = "0";                          $avis_sitadel = "0";
174                          $avis_sitadel_motif="0" ;                          $avis_sitadel_motif="0" ;
175                          $sql="select sitadel, sitadel_motif from avis where avis ='".                          $sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis_decision where avis_decision ='".
176                                  $row['avis']."'";                                  $row['avis_decision']."'";
177                          $res1 = $f->db -> query ($sql);                          $res1 = $f->db -> query ($sql);
178                          $f->isDatabaseError($res1);                          $f->isDatabaseError($res1);
179                          while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){                          while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){
180                              $avis_sitadel = $row1['sitadel'];                              $avis_sitadel = $row1['sitadel'];
181                              $avis_sitadel_motif = $row1['sitadel_motif'];                              $avis_sitadel_motif = $row1['sitadel_motif'];
182                          }                          }
183                          $decision.= $g->decision_groupe1($avis_sitadel,$avis_sitadel_motif);                          $decision.= $g->decision_groupe1($avis_sitadel,$avis_sitadel_motif,$structure);
184                      }else                      }else{
185                          $decision.= $g->decision_groupe1("0",""); // pas d avis                          $decision.= $g->decision_groupe1("0","",$structure); // pas d avis
186                            //$decision.= "***".$t10.$t10.$t10.$t10.$t10.$t10.$t10.$t10."|||"; //83
187                        }
188                      // si la decision est favorable, envoi des informations statistiques                      // si la decision est favorable, envoi des informations statistiques
189                      if($avis_sitadel==2  or $avis_sitadel==4                      if($avis_sitadel==2  or $avis_sitadel==4
190                             or $avis_sitadel==5){                             or $avis_sitadel==5){
# Line 179  if($validation==0){ Line 193  if($validation==0){
193                          $decision.= $g->amenagement();                          $decision.= $g->amenagement();
194                          if($row['travaux']!=''){                          if($row['travaux']!=''){
195                              $sql= "select codelascot,libelle                              $sql= "select codelascot,libelle
196                                  from travaux where travaux=".$row['travaux'];                                  from ".DB_PREFIXE."travaux where travaux=".$row['travaux'];
197                              $res2 = $f->db -> query ($sql);                              $res2 = $f->db -> query ($sql);
198                              $f->isDatabaseError($res2);                              $f->isDatabaseError($res2);
199                                $temp=$row['description'];
200                                // enlever les RC
201                                $temp = str_replace( chr(10), " ", $temp);
202                                $temp = str_replace( chr(13), " ", $temp);
203                              while ($row2=& $res2->fetchRow(DB_FETCHMODE_ASSOC)){                              while ($row2=& $res2->fetchRow(DB_FETCHMODE_ASSOC)){
204                                  $travaux = $row2['libelle'];                                  $travaux = $row2['libelle']." "; // ***
205                                  $lascot = $row2['codelascot'];                                  $lascot = $row2['codelascot'];
206                              }                              }
207                                $travaux.=" ".$temp;
208                              $decision.= $g->travaux($travaux,$lascot, $row['types']);                              $decision.= $g->travaux($travaux,$lascot, $row['types']);
209                          }                          }
210                          $sql3="select * from destination_shon where dossier = '".                          $sql3="select * from ".DB_PREFIXE."destination_shon where dossier = '".
211                                  $row['dossier']."' order by destination";                                  $row['dossier']."' order by destination";
212                          $res3 = $f->db -> query ($sql3);                          $res3 = $f->db -> query ($sql3);
213                          $f->isDatabaseError($res3);                          $f->isDatabaseError($res3);
214                          $temp = array();                 // ***
215                          while ($row3=& $res3->fetchRow(DB_FETCHMODE_ASSOC)){                 $temp = array();
216                              $shonant[$row3['destination']]=$row3["shon_anterieure"];                 $shonant = array();
217                              $shondem[$row3['destination']]=$row3["shon_demolie"];                 $shondem = array();
218                              $shonanttr[$row3['destination']]=$row3["shon_anterieure_supprimee"];                 $shonanttr = array();
219                              $shonprojtr[$row3['destination']]=$row3["shon_nouvelle_transformee"];                 $shonprojtr = array();
220                              $shoncr1[$row3['destination']]=$row3["shon_nouvelle"];                 $shoncr1 = array();
221                              $shoncr2[$row3['destination']]=$row3["shon_shob_transformee"];                 $shoncr2 = array();
222                          }                 while ($row3=& $res3->fetchRow(DB_FETCHMODE_ASSOC)){
223                          $decision.= $g->destination($shonant);                       // round(8.5, 0, PHP_ROUND_HALF_DOWN);    
224                          $decision.= $g->destination($shondem);                      if(isset($row3["shon_anterieure"]))
225                          $decision.= $g->destination($shonanttr);                                       $shonant[$row3['destination']]=round($row3["shon_anterieure"], 0);
226                          $decision.= $g->destination($shonprojtr);                      else
227                          $decision.= $g->destination($shoncr1);                         $shonant[$row3['destination']]=0;
228                          $decision.= $g->destination($shoncr2);                      if(isset($row3["shon_demolie"]))    
229                           $shondem[$row3['destination']]=round($row3["shon_demolie"], 0);
230                        else
231                           $shondem[$row3['destination']]=0;
232                        if(isset($row3["shon_anterieure_supprimee"]))              
233                           $shonanttr[$row3['destination']]=round($row3["shon_anterieure_supprimee"], 0);
234                        else
235                           $shonanttr[$row3['destination']]=0;
236                        if(isset($row3["shon_nouvelle_transformee"]))      
237                           $shonprojtr[$row3['destination']]=round($row3["shon_nouvelle_transformee"], 0);
238                        else
239                           $shonprojtr[$row3['destination']]=0;
240                        if(isset($row3["shon_nouvelle"]))          
241                           $shoncr1[$row3['destination']]=round($row3["shon_nouvelle"], 0);
242                        else
243                           $shoncr1[$row3['destination']]=0;
244                        if(isset($row3["shon_shob_transformee"]))          
245                           $shoncr2[$row3['destination']]=round($row3["shon_shob_transformee"], 0);
246                        else
247                           $shoncr2[$row3['destination']]=0;
248          
249                        //$shonant[$row3['destination']]=$row3["shon_anterieure"];
250                        //$shondem[$row3['destination']]=$row3["shon_demolie"];
251                        //$shonanttr[$row3['destination']]=$row3["shon_anterieure_supprimee"];
252                        //$shonprojtr[$row3['destination']]=$row3["shon_nouvelle_transformee"];
253                        //$shoncr1[$row3['destination']]=$row3["shon_nouvelle"];
254                        //$shoncr2[$row3['destination']]=$row3["shon_shob_transformee"];
255    
256                   }
257                         $decision.= $g->destination($shonant);
258                         $decision.= $g->destination($shondem);
259                         $decision.= $g->destination($shonanttr);
260                         $decision.= $g->destination($shonprojtr);
261                         $decision.= $g->destination($shoncr1);
262                         $decision.= $g->destination($shoncr2);
263                                                    
264                          $decision.= $g->descriptif($row['types']);                         $decision.= $g->descriptif($row['types']);  
265                      }                      }else // decision defavorable ou pas de decision
266                  //}else                          $decision.= $t10.$t10.$t10.$t10.$t10.$t10.$t10.$t10."|||"; //83 | + 12 | = 95 | pour 96 zones
                 //    $decison.= "|0***"; // avis = 0 si pas de decision        
267              $decision.="\n";              $decision.="\n";
268              }              }
269            
# Line 220  if($validation==0){ Line 272  if($validation==0){
272              if($row['types']=='Modificatif'              if($row['types']=='Modificatif'
273                  and $row['date_depot'] >= $datedebut                  and $row['date_depot'] >= $datedebut
274                  and $row['date_depot']<=$datefin){                    and $row['date_depot']<=$datefin){  
275                  $modificatif.=$g->entete("MODIFICATIF",$departement,$commune);                  $modificatif.=$g->entete("MODIFICATIF",$departement,$commune,$pf_departement);
276                  if(isset($row['date_decision']) or $row['date_decision']==""){                  if(isset($row['date_decision']) or $row['date_decision']==""){
277                      // avis_sitadel et avis_sitadel_motif                      // avis_sitadel et avis_sitadel_motif
278                      if($row['avis']!=''){                      if($row['avis_decision']!=''){
279                          $avis_sitadel = 0;                          $avis_sitadel = 0;
280                          $avis_sitadel_motif=0 ;                          $avis_sitadel_motif=0 ;
281                          $sql="select sitadel, sitadel_motif from avis where avis ='".                          $sql="select sitadel, sitadel_motif from ".DB_PREFIXE."avis_decision where avis_decision ='".
282                                  $row['avis']."'";                                  $row['avis_decision']."'";
283                          $res1 = $f->db -> query ($sql);                          $res1 = $f->db -> query ($sql);
284                          $f->isDatabaseError($res1);                          $f->isDatabaseError($res1);
285                          while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){                          while ($row1=& $res1->fetchRow(DB_FETCHMODE_ASSOC)){
286                              $avis_sitadel = $row1['sitadel'];                              $avis_sitadel = $row1['sitadel'];
287                              $avis_sitadel_motif = $row1['sitadel_motif'];                              $avis_sitadel_motif = $row1['sitadel_motif'];
288                          }                          }
289                          $modificatif.= $g->decision_groupe1($avis_sitadel,$avis_sitadel_motif);                          $modificatif.= $g->decision_groupe1($avis_sitadel,$avis_sitadel_motif,$structure);
290                      }                      }
291                      // si la decision est favorable, envoi des informations statistiques                      // si la decision est favorable, envoi des informations statistiques
292                      if($avis_sitadel==2  or $avis_sitadel==4                      if($avis_sitadel==2  or $avis_sitadel==4
# Line 243  if($validation==0){ Line 295  if($validation==0){
295                          $modificatif.=$g->adresse_terrain();    //***                          $modificatif.=$g->adresse_terrain();    //***
296                          $modificatif.=$g->parcelle();    //***                          $modificatif.=$g->parcelle();    //***
297                          $modificatif.=$g->terrain();    //***                          $modificatif.=$g->terrain();    //***
298                            // enlever les RC
299                            $temp=$row['description'];
300                            $temp = str_replace( chr(10), " ", $temp);
301                            $temp = str_replace( chr(13), " ", $temp);
302                          if($row['travaux']!=''){                          if($row['travaux']!=''){
303                              $sql= "select codelascot,libelle                              $sql= "select codelascot,libelle
304                                  from travaux where travaux=".$row['travaux'];                                  from ".DB_PREFIXE."travaux where travaux=".$row['travaux'];
305                              $res2 = $f->db -> query ($sql);                              $res2 = $f->db -> query ($sql);
306                              $f->isDatabaseError($res2);                              $f->isDatabaseError($res2);
307                              while ($row2=& $res2->fetchRow(DB_FETCHMODE_ASSOC)){                              while ($row2=& $res2->fetchRow(DB_FETCHMODE_ASSOC)){
308                                  $travaux = $row2['libelle'];                                  $travaux = $row2['libelle']." ".$row['description']; // ***;
309                                  $lascot = $row2['codelascot'];                                  $lascot = $row2['codelascot'];
310                              }                              }
311                                $travaux.=" ".$temp;
312                              $modificatif.= $g->travaux($travaux,$lascot, $row['types']);                              $modificatif.= $g->travaux($travaux,$lascot, $row['types']);
313                          }                          }
314                          $sql3="select * from destination_shon where dossier = '".                          $sql3="select * from ".DB_PREFIXE."destination_shon where dossier = '".
315                                  $row['dossier']."' order by destination";                                  $row['dossier']."' order by destination";
316                          $res3 = $f->db -> query ($sql3);                          $res3 = $f->db -> query ($sql3);
317                          $f->isDatabaseError($res3);                          $f->isDatabaseError($res3);
# Line 280  if($validation==0){ Line 337  if($validation==0){
337                  }                    }  
338              }              }
339                            
340              // suivi DOC              // suivi DOC
341              $suivi1="";              $suivi1="";
342              if($row['date_chantier'] >= $datedebut and $row['date_chantier']<=$datefin){                if($row['date_chantier'] >= $datedebut and $row['date_chantier']<=$datefin){  
343                  $suivi1.=$g->entete("SUIVI",$departement,$commune);                  $suivi1.=$g->entete("SUIVI",$departement,$commune,$pf_departement);
344                  $suivi1.=$g->chantier();                  $suivi1.=$g->chantier();
345                  $suivi1.="\n";                  $suivi1.="\n";
346              }              }
347              // suivi DAT              // suivi DAT
348              $suivi2="";              $suivi2="";
349              if($row['date_achevement'] >= $datedebut and $row['date_achevement']<=$datefin){                if($row['date_achevement'] >= $datedebut and $row['date_achevement']<=$datefin){  
350                  $suivi2.=$g->entete("SUIVI",$departement,$commune);                  $suivi2.=$g->entete("SUIVI",$departement,$commune,$pf_departement);
351                  $suivi2.=$g->achevement();                  $suivi2.=$g->achevement();
352                  $suivi2.="\n";                  $suivi2.="\n";
353              }              }
# Line 301  if($validation==0){ Line 358  if($validation==0){
358          // entete de l enregistrement page 8 et 9          // entete de l enregistrement page 8 et 9
359          // ***************************************            // ***************************************  
360          // numero          // numero
361          // $numero= $db -> nextId('sitadel');                  // $numero= $db -> nextId('sitadel');
362            $departement =$f->collectivite["departement"];
363            $commune =$f->collectivite["commune"];
364            $region =$f->collectivite["region"];
365          $numero=$_POST["numero"];          $numero=$_POST["numero"];
366          $fichiertransmis = date('ymj').$departement.$commune;          $fichiertransmis = date('ymj').$pf_departement.$departement.$commune;
367          $longueurenregistrement= 0 ; // a calculer ***  enregistrement le plus long          $longueurenregistrement= 0 ; // a calculer ***  enregistrement le plus long
368          $entete = "SITADEL|".$departement."|".$commune."|".$region."|".$fichiertransmis."|".$numero."|";          $entete = "SITADEL|".$pf_departement.$departement."|".$commune."|".$region."|".$fichiertransmis."|".$numero."|";
369          // calcul enregistrement le plus long                // calcul enregistrement le plus long      
370          if(CHARSET=='UTF8'){          if(DBCHARSET=='UTF8'){
371              $export=utf8_decode($export);              $export=utf8_decode($export);
372          }          }
373          // nombreenrgistremment et longueurenregistrement          // nombreenrgistremment et longueurenregistrement
# Line 316  if($validation==0){ Line 376  if($validation==0){
376          $cpt=0;          $cpt=0;
377          for($i=0;$i<sizeof($nbenr);$i++){          for($i=0;$i<sizeof($nbenr);$i++){
378                // mb_strlen( variable,encoding) PHP 4 >= 4.0.6, PHP 5                // mb_strlen( variable,encoding) PHP 4 >= 4.0.6, PHP 5
379                // Le param�tre encoding est l'encodage des caract�res.                // Le param�tre encoding est l'encodage des caract�res.
380                // S'il est omis, l'encodage de caracteres interne sera utilis�.                // S'il est omis, l'encodage de caracteres interne sera utilis�.
381                $tmp[$i] = strlen($nbenr[$i]);                $tmp[$i] = strlen($nbenr[$i]);
382                //echo strlen($nbenr[$i])." ".$nbenr[$i]."<br>";                //echo strlen($nbenr[$i])." ".$nbenr[$i]."<br>";
383                $cpt++;                $cpt++;
# Line 328  if($validation==0){ Line 388  if($validation==0){
388          $datemodification = date('y').str_pad (DATE('m'), 2, "0", STR_PAD_LEFT).str_pad (DATE('j'), 2, "0", STR_PAD_LEFT);          $datemodification = date('y').str_pad (DATE('m'), 2, "0", STR_PAD_LEFT).str_pad (DATE('j'), 2, "0", STR_PAD_LEFT);
389          // export          // export
390          $version = substr($version,0,8);          $version = substr($version,0,8);
391          $entete.= $longueurenregistrement."|".$datemodification."|".$nombreenregistrement."|openFoncier|".$version."\n";          $entete.= $longueurenregistrement."|".$datemodification."|".
392                        $nombreenregistrement."|openFoncier|".$version."\n";
393          $export=$entete.$export;          $export=$entete.$export;
394          //$str = htmlentities($str, ENT_QUOTES);          // $str = htmlentities($str, ENT_QUOTES);
395          // ecriture des fichiers en tmp          // ecriture des fichiers en tmp
396          $fichier = "../tmp/SITADEL".substr($_POST["datedebut"],3,2).          $fichier = "../tmp/SITADEL".substr($_POST["datedebut"],3,2).
397                 "".substr($_POST["datedebut"],8,4)."_test";                 "".substr($_POST["datedebut"],8,4)."";
398          $inf = fopen($fichier,"w");          $inf = fopen($fichier,"w");
         //$export=substr($export,0,strlen($export)-1); // un \n en trop  
399          fwrite($inf,$export);          fwrite($inf,$export);
400          fclose($inf);          fclose($inf);
401          echo "<br>Fichier ".$fichier." sauvegarde<br><br><br>";          echo "<br>"._("Fichier")." ".$fichier." "._("sauvegarde")."<br /><br /><br />";
   
402          // affichage          // affichage
403          echo "<br /><br />Pour telecharger le fichier, cliquer ici : <a href=\"".$fichier."\" target=\"_blank\">";          echo "<br /><br />Pour telecharger le fichier, cliquer ici : <a href=\"".$fichier."\" target=\"_blank\">";
404          echo "<img src=\"../app/img/ico_trace.png\" alt=\"Telecharger le fichier CNEN\" title=\"Telecharger le fichier CNEN\" />";          echo "<img src=\"../app/img/ico_trace.png\" alt=\"Telecharger le fichier CNEN\" title=\"Telecharger le fichier Sitadel\" />";
405          echo "</a> avec le bouton droit et enregistrer la cible du lien sous. <br /><br />";          echo "</a>"._("avec le bouton droit et enregistrer la cible du lien sous.")."<br /><br />";
           
406          if($DEBUG==1){          if($DEBUG==1){
407              $affiche="";              $affiche="";
408              $affiche= str_replace("\n","<br>",$export);              $affiche= str_replace("\n","<br>",$export);
409              echo $affiche;              echo $affiche;
410          }                        }              
   
   
411      }else // correct = false      }else // correct = false
412          echo "remplissez les 2 dates";          echo _("remplissez les 2 dates");
413  }//validation  }//validation
 ?>  
414    ?>

Legend:
Removed from v.190  
changed lines
  Added in v.1197

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26