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']; |
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 |
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); |
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); |
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"]; |
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 |
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 |
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 |
?> |
?> |