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

Diff of /trunk/app/pdf_instruction.php

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

revision 212 by jbastide, Tue Oct 18 09:24:17 2011 UTC revision 469 by nhaye, Wed Oct 3 16:09:03 2012 UTC
# Line 31  $f = new utils("nohtml"); Line 31  $f = new utils("nohtml");
31   */   */
32    
33    
34  $sql_courrier="select * from instruction where instruction=".$idx;  $sql_courrier="select * from ".DB_PREFIXE."instruction where instruction=".$idx;
35  $res = $f->db->query($sql_courrier);  $res = $f->db->query($sql_courrier);
36  $f->isDatabaseError($res);  $f->isDatabaseError($res);
37  while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){  while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
38      $obj=$row['lettretype'];      $obj=$row['lettretype'];
39      //if(CHARSET=='UTF8'){      //if(DBCHARSET=='UTF8'){
40      //    $titre= utf8_decode($lettretype["titre"]);      //    $titre= utf8_decode($lettretype["titre"]);
41      $destinataire=$row['destinataire'];  // ***      $destinataire=$row['destinataire'];  // ***
42      $datecourrier=$row['datecourrier'];      $datecourrier=$row['datecourrier'];
# Line 63  while ($row=& $res->fetchRow(DB_FETCHMOD Line 63  while ($row=& $res->fetchRow(DB_FETCHMOD
63  //$complement="<-Ici le complement->";  //$complement="<-Ici le complement->";
64  // =============================================================================================  // =============================================================================================
65    
66  /* format a voir  // format date courrier en francais
67  if ($f->formatDate=="AAAA-MM-JJ"){  if ($f->formatdate=="AAAA-MM-JJ"){
68      $valTemp=explode("-",$datecourrier);      $valTemp=explode("-",$datecourrier);
69      $datecourrier = $valTemp[2]."/".$valTemp[1]."/".$valTemp[0];      $datecourrier = $valTemp[2]."/".$valTemp[1]."/".$valTemp[0];
70  }  }
71  */  
72    
73  /**  /**
74   *  acces table om_lettretype   *  acces table om_lettretype
# Line 76  if ($f->formatDate=="AAAA-MM-JJ"){ Line 76  if ($f->formatDate=="AAAA-MM-JJ"){
76  $niveau='';  $niveau='';
77  // requete SQL  // requete SQL
78  $sql= "select * from ".DB_PREFIXE."om_lettretype where id='".$obj."'"; // select obj  $sql= "select * from ".DB_PREFIXE."om_lettretype where id='".$obj."'"; // select obj
79  $sql.= " and actif ='Oui'";  $sql.= " and actif IS TRUE";
80  $sql.= " and om_collectivite ='".$_SESSION['collectivite']."'";  $sql.= " and om_collectivite ='".$_SESSION['collectivite']."'";
81  $res1 = $f->db->query($sql);  $res1 = $f->db->query($sql);
82  $f->isDatabaseError($res1);  $f->isDatabaseError($res1);
# Line 85  if ($res1->numrows()==0){ Line 85  if ($res1->numrows()==0){
85      $niveau=$f->db->getOne($sql);      $niveau=$f->db->getOne($sql);
86      //$res1->free();      //$res1->free();
87      $sql= "select * from ".DB_PREFIXE."om_lettretype where id='".$obj."'"; // select obj      $sql= "select * from ".DB_PREFIXE."om_lettretype where id='".$obj."'"; // select obj
88      $sql.= " and actif ='Oui'";      $sql.= " and actif IS TRUE";
89      $sql.= " and om_collectivite ='".$niveau."'";      $sql.= " and om_collectivite ='".$niveau."'";
90      $res1 = $f->db->query($sql);      $res1 = $f->db->query($sql);
91      $f->isDatabaseError($res1);      $f->isDatabaseError($res1);
# Line 158  while ($lettretype =& $res1->fetchRow(DB Line 158  while ($lettretype =& $res1->fetchRow(DB
158      //           5 =     0 fd transparent      //           5 =     0 fd transparent
159      //                   1 couleur (parametre � rajouter)      //                   1 couleur (parametre � rajouter)
160      // ==============================================================      // ==============================================================
161      $pdf->Image($f->getPathFolderTrs().$lettretype["logo"],      if(file_exists($f->getPathFolderTrs().$lettretype["logo"])) {
162                  $lettretype["logoleft"],        $pdf->Image($f->getPathFolderTrs().$lettretype["logo"],
163                  $lettretype["logotop"],                    $lettretype["logoleft"],
164                  0,                    $lettretype["logotop"],
165                  0,                    0,
166                  '',                    0,
167                  '');                    '',
168                      '');
169        }
170      // variables statiques      // variables statiques
171      $sql = $lettretype['om_sql'];      $sql = $lettretype['om_sql'];
172      $titre= $lettretype["titre"];      $titre= $lettretype["titre"];
# Line 190  while ($lettretype =& $res1->fetchRow(DB Line 192  while ($lettretype =& $res1->fetchRow(DB
192         //************************************************         //************************************************
193         $pos_t="";         $pos_t="";
194         $pos_t = strpos($titre, "<b>");         $pos_t = strpos($titre, "<b>");
195          if(CHARSET=='UTF8')          if(DBCHARSET=='UTF8')
196              $titre= utf8_decode($titre);              $titre= utf8_decode($titre);
197         if ($pos_t === false) {         if ($pos_t === false) {
198         // compatibilite :aucun attribut affichage <b> dans corps         // compatibilite :aucun attribut affichage <b> dans corps
# Line 414  while ($lettretype =& $res1->fetchRow(DB Line 416  while ($lettretype =& $res1->fetchRow(DB
416              //************************************************              //************************************************
417              $pos="";              $pos="";
418              $pos = strpos($corps, "<b>");              $pos = strpos($corps, "<b>");
419               if(CHARSET=='UTF8')               if(DBCHARSET=='UTF8')
420                       $corps= utf8_decode($corps);                       $corps= utf8_decode($corps);
421              if ($pos === false) {              if ($pos === false) {
422              // compatibilite :aucun attribut affichage dans corps              // compatibilite :aucun attribut affichage dans corps
# Line 486  while ($lettretype =& $res1->fetchRow(DB Line 488  while ($lettretype =& $res1->fetchRow(DB
488               }               }
489          } //18/11/2011 fin de 'pas de \p'          } //18/11/2011 fin de 'pas de \p'
490         // fermeture pdf         // fermeture pdf
491         $pdf->Output();         $pdf->Output($obj.date("dmY").".pdf","D");
492      }      }
493  }  }
494  ?>  ?>

Legend:
Removed from v.212  
changed lines
  Added in v.469

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26