%PDF- %PDF-
Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/ |
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-creer_pdf_part.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/session.php"); include_once("inc/init.php"); verif_co_admin(); ini_set("memory_limit","126M"); require('fpdf/fpdf.php'); /**************************************************************************************************************************************** variables à recup dans la base*********************************************************************************************************** ****************************************************************************************************************************************/ if($_POST['partenaire']!=0){ $partenaires[0]['id']=$_POST['partenaire']; } else{ $query="SELECT s.* FROM section s "; $join=""; $rule=""; if($_POST['edition']!=0){ $join=" LEFT JOIN section_edition se ON s.id=se.section "; $rule.=" AND se.valide=1 AND se.edition=".$_POST['edition']; } if($_POST['profil']!=0){ $rule.=" AND s.`type`=".$_POST['profil']; } if($_POST['pays']!=0){ $rule.=" AND s.pays=".$_POST['pays']; } /*if($_POST['type']!=0){ $rule.=" AND s.pays=".$_POST['pays']; }*/ $query=$query.$join." LEFT JOIN section_lang sl ON sl.section=s.id LEFT JOIN country_lang cl ON cl.country=s.pays WHERE cl.lang=2 AND sl.lang=2 ".$rule." ORDER BY cl.name,sl.titre"; $partenaires=$db->select_arrays($query); } /**************************************************************************************************************************************** fin des variables à recup dans la base*************************************************************************************************** ****************************************************************************************************************************************/ //function hex2dec //returns an associative array (keys: R,G,B) from //a hex html code (e.g. #3FE5AA) function hex2dec($couleur = "#000000"){ $R = substr($couleur, 1, 2); $rouge = hexdec($R); $V = substr($couleur, 3, 2); $vert = hexdec($V); $B = substr($couleur, 5, 2); $bleu = hexdec($B); $tbl_couleur = array(); $tbl_couleur['R']=$rouge; $tbl_couleur['V']=$vert; $tbl_couleur['B']=$bleu; return $tbl_couleur; } //conversion pixel -> millimeter at 72 dpi function px2mm($px){ return $px*25.4/72; } function txtentities($html){ $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip($trans); return strtr($html, $trans); } //////////////////////////////////// class PDF extends FPDF { var $pays=null; var $B; var $I; var $U; var $HREF; var $fontList; var $issetfont; var $issetcolor; // Colonne courante var $col = 0; // Ordonnée du début des colonnes var $y0; var $taille_texte=9; var $espacement_texte=4; var $taille_titre=10; var $super_taille_titre=12; var $sommaire=array(); function PDF($orientation='P', $unit='mm', $format='A4') { //Call parent constructor $this->FPDF($orientation,$unit,$format); //Initialization $this->B=0; $this->I=0; $this->U=0; $this->HREF=''; $this->fontlist=array('arial', 'times', 'courier', 'helvetica', 'symbol'); $this->issetfont=false; $this->issetcolor=false; } function WriteHTML($html) { //HTML parser $html=strip_tags($html,"<b><u><i><a><img><p><br><strong><em><font><tr><blockquote>"); //supprime tous les tags sauf ceux reconnus $html=str_replace("\n",' ',$html); //remplace retour à la ligne par un espace $a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //éclate la chaîne avec les balises foreach($a as $i=>$e) { if($i%2==0) { //Text if($this->HREF) $this->PutLink($this->HREF,$e); else $this->Write(5,stripslashes(txtentities($e))); } else { //Tag if($e[0]=='/') $this->CloseTag(strtoupper(substr($e,1))); else { //Extract attributes $a2=explode(' ',$e); $tag=strtoupper(array_shift($a2)); $attr=array(); foreach($a2 as $v) { if(preg_match('/([^=]*)=["\']?([^"\']*)/',$v,$a3)) $attr[strtoupper($a3[1])]=$a3[2]; } $this->OpenTag($tag,$attr); } } } } function OpenTag($tag, $attr) { //Opening tag switch($tag){ case 'STRONG': $this->SetStyle('B',true); break; case 'EM': $this->SetStyle('I',true); break; case 'B': case 'I': case 'U': $this->SetStyle($tag,true); break; case 'A': $this->HREF=$attr['HREF']; break; case 'IMG': if(isset($attr['SRC']) && (isset($attr['WIDTH']) || isset($attr['HEIGHT']))) { if(!isset($attr['WIDTH'])) $attr['WIDTH'] = 0; if(!isset($attr['HEIGHT'])) $attr['HEIGHT'] = 0; $this->Image($attr['SRC'], $this->GetX(), $this->GetY(), px2mm($attr['WIDTH']), px2mm($attr['HEIGHT'])); } break; case 'TR': case 'BLOCKQUOTE': case 'BR': $this->Ln(5); break; case 'P': $this->Ln(10); break; case 'FONT': if (isset($attr['COLOR']) && $attr['COLOR']!='') { $coul=hex2dec($attr['COLOR']); $this->SetTextColor($coul['R'],$coul['V'],$coul['B']); $this->issetcolor=true; } if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) { $this->SetFont(strtolower($attr['FACE'])); $this->issetfont=true; } break; } } function CloseTag($tag) { //Closing tag if($tag=='STRONG') $tag='B'; if($tag=='EM') $tag='I'; if($tag=='B' || $tag=='I' || $tag=='U') $this->SetStyle($tag,false); if($tag=='A') $this->HREF=''; if($tag=='FONT'){ if ($this->issetcolor==true) { $this->SetTextColor(0); } if ($this->issetfont) { $this->SetFont('arial'); $this->issetfont=false; } } } function SetStyle($tag, $enable) { //Modify style and select corresponding font $this->$tag+=($enable ? 1 : -1); $style=''; foreach(array('B','I','U') as $s) { if($this->$s>0) $style.=$s; } $this->SetFont('',$style); } function PutLink($URL, $txt) { //Put a hyperlink $this->SetTextColor(0,0,255); $this->SetStyle('U',true); $this->Write(5,$txt,$URL); $this->SetStyle('U',false); $this->SetTextColor(0); } function Header() { // En-tête global $titre; $this->SetFont('Arial','',10); /*$w = $this->GetStringWidth($titre)+6; $this->SetX((210-$w)/2); $this->SetDrawColor(0,80,180); $this->SetFillColor(230,230,0); $this->SetTextColor(220,50,50); $this->SetLineWidth(1); $this->Cell($w,9,$titre,1,1,'C',true); $this->Ln(10);*/ // Sauvegarde de l'ordonnée $this->y0 = $this->GetY(); } function Footer() { // Pied de page $this->SetY(-15); $this->SetFont('Arial','I',8); $this->SetTextColor(128); $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C'); } /*public function addPage() { //on génère la page en appelant la méthode //parente addPage() parent::addPage(); }*/ function SetCol($col) { // Positionnement sur une colonne $this->col = $col; $x = 10+$col*65; $this->SetLeftMargin($x); $this->SetX($x); } function AcceptPageBreak() { // Méthode autorisant ou non le saut de page automatique /*if($this->col<2) { // Passage à la colonne suivante $this->SetCol($this->col+1); // Ordonnée en haut $this->SetY($this->y0); // On reste sur la page return false; } else {*/ // Retour en première colonne $this->SetCol(0); // Saut de page return true; //} } function TitreChapitre($num, $libelle) { // Titre $this->SetFont('Arial','',$this->taille_titre); $this->SetFillColor(200,220,255); $this->Cell(0,6,"Chapitre $num : $libelle",0,1,'L',true); $this->Ln(4); // Sauvegarde de l'ordonnée $this->y0 = $this->GetY(); } function CorpsChapitre($fichier) { // Lecture du fichier texte $txt = file_get_contents($fichier); // Police $this->SetFont('Times','',10); // Sortie du texte sur 6 cm de largeur $this->MultiCell(60,5,$txt); $this->Ln(); // Mention $this->SetFont('','I'); $this->Cell(0,5,"(fin de l'extrait)"); // Retour en première colonne $this->SetCol(0); } function AjouterChapitre($num, $titre, $fichier) { // Ajout du chapitre $this->AddPage(); $this->TitreChapitre($num,$titre); $this->CorpsChapitre($fichier); } //titre function ajouterTitre($titre){ $entree_sommaire=array(); $entree_sommaire["num_page"]=$this->pageNo(); $entree_sommaire["titre_page"]=$this->cleanText($titre); $entree_sommaire["type"]="titre"; $this->sommaire[]=$entree_sommaire; $this->SetFont('Arial','B',$this->taille_titre+1); $titre=$this->cleanText($titre); $this->Cell(0, $this->espacement_texte,$titre,0,1); $this->Ln(10); } //titre function ajouterSousTitre($titre){ $entree_sommaire=array(); $entree_sommaire["num_page"]=$this->pageNo(); $entree_sommaire["titre_page"]=$this->cleanText($titre); $this->sommaire[]=$entree_sommaire; $this->Ln(5); $this->SetFont('Arial','B',$this->taille_titre); $titre=$this->cleanText($titre); $this->Cell(0, $this->espacement_texte,$titre,0,1); $this->Ln(5); } //pays function ajouterPays($id_pays,$id_lang){ $pays = new Pays; $unpays=$pays->getUnPays($id_pays,$id_lang); $entree_sommaire=array(); $entree_sommaire["num_page"]=$this->pageNo(); $entree_sommaire["titre_page"]=$this->cleanText($unpays['name']); $entree_sommaire["code_iso"]=strtolower($unpays['code_iso']); $this->sommaire[]=$entree_sommaire; $y_before=$this->GetY(); $this->Image("images/icons/".strtolower($unpays['code_iso']).".png",null,null,12,10); $y_after=$this->GetY(); if($this->GetY()>$y_before){ $this->SetY($y_before+3); } else{ $this->SetY($this->GetY()-7); } $this->SetX(25); $this->SetFont('Arial','B',$this->super_taille_titre); $unpays['name']=mb_strtoupper($this->cleanText($unpays['name'])); $this->Cell(0, $this->espacement_texte,$unpays['name']); if($this->GetY()<$y_after || $y_after<$y_before){ $this->SetY($y_after); } $this->SetCol(0); $this->Ln(5); } //ville function ajouterSection($id_section,$id_lang,$edition){ // recup de la section $section = new Section; $admtext = new Admtext; $sec = $section->getSection($id_section,$id_lang); if($this->pays==null || $this->pays!=$sec['pays']){ if($this->pays!=$sec['pays'] && $this->pays!=null){ $this->WriteHTML('<br><br>'); } $this->pays=$sec['pays']; $objPays=new Pays; $unpays=$objPays->getUnPays($this->pays,2); $this->SetFont('Arial','B',$this->super_taille_titre); $unpays['name']=$this->cleanText(utf8_decode($unpays['name'])); $this->Cell(0,5,mb_strtoupper($unpays['name']),0,1,'',false); } $this->SetFont('Arial','B',$this->taille_titre); $sec['titre']=$this->cleanText(utf8_decode($sec['titre'])); $this->WriteHTML('<br>'); $this->Cell(0,5,mb_strtoupper($sec['titre']),0,1,'',false); $this->SetFont('Arial',''); $text='<a href="fr/'.$sec['id'].'-'.$sec['permalien'].'/">Page de la section</a><br>'; $text.=$this->cleanText($sec['adresse'])."<br>".$sec['codepostal'].' '.$this->cleanText($sec['ville']); if($sec['site']!=""){ $text.='<br><a href="'.$sec['site'].'">'.$sec['site'].'</a>'; } $query="SELECT * FROM user WHERE section=".$sec['id']; if($_POST["reponses"]=="non"){ $text.='<br><br><b>Contact</b>'; $contacts=$db->select_arrays($query); foreach($contacts as $uncontact){ $text.='<br>'.$uncontact['prenom'].' '.$uncontact['nom'].'<br>'. 'Email : <a href="mailto:'.$uncontact['email_contact'].'">'.$uncontact['email_contact'].'</a><br>'. 'Fonction : '.$uncontact['fonction'].'<br>'. 'Tel : '.$uncontact['telephone']; if($uncontact['service']!=""){ $text.='<br>'.utf8_decode('Service chargé des activités : ').$this->cleanText($uncontact['service']).'<br/>'; } } } if($_POST["reponses"]=="oui"){ if($sec['type']==2){ $query="SELECT * FROM `campagne` c LEFT JOIN `campagne_lang` cl ON cl.campagne=c.id WHERE cl.lang=".$id_lang." AND valide=1 AND c.edition=".$edition." AND c.section=".$id_section; $campagne=$db->select_array($query); if($campagne!=""){ $text.='<br><br>'. '<b>Campagne de communication : </b><br>'.$this->cleanText($campagne['texte']). '<br><b>Budget : </b><br>'.$this->cleanText($campagne['budget']). '<br><b>'.utf8_decode("Nombre d'activités en lien avec le thème de l'année").' : </b><br>'.$this->cleanText($campagne['nb_activites']). '<br><b>'.utf8_decode("Implication de différents groupes de citoyens").' : </b><br>'.$this->cleanText($campagne['citoyens']). '<br><b>'.utf8_decode("Organiser un événement de dimension européenne").' : </b><br>'.$this->cleanText($campagne['event_europ']); } } } $this->WriteHTML($text); if($sec['texte']!=""){ $this->Ln(2); /*if($sec['photo1']!=""){ $y_before=$this->GetY(); $this->Image("uploads/".$sec['photo1'],null,null,50,40); if($this->GetY()<$y_before){ $y_before=$this->GetY()-40; } $y_after=$this->GetY(); $this->SetY($y_before); $this->SetX(65); $sec['texte']=substrwords( $sec['texte'],600,"...\n"); $this->MultiCell(0, $this->espacement_texte,$sec['texte']); $this->SetX(65); if($id_lang==1 && strlen($sec['texte'])>600){ $this->WriteHTML($admtext->getText("read_more_pdf",$id_lang).' <a href="www.coe.int/demoweek-events/fr">www.coe.int/demoweek-events/fr</a> )'); } elseif(strlen($sec['texte'])>600){ $this->WriteHTML($admtext->getText("read_more_pdf",$id_lang).' <a href="www.coe.int/demoweek-events">www.coe.int/demoweek-events</a> )'); } if($this->GetY()<$y_after){ if($y_before<$this->GetY()){ $this->SetY($y_after); } } $this->SetCol(0); } else{ $sec['texte']=substrwords( $sec['texte'],600,"...\n".$admtext->getText("read_more_pdf",$id_lang)); $this->MultiCell(0, $this->espacement_texte,$sec['texte']); }*/ } $this->Ln(5); } // titre d'une partie activité function ajouterPartieActivite($id_lang){ $admtext = new Admtext; $this->SetFont('Arial','B',$this->taille_texte); $this->Cell(0,$this->espacement_texte,utf8_decode($admtext->getText("activites_pdf",$id_lang)),0,1); $this->Ln(5); } // fonction d'affichage d'une activité function ajouterActivite($id_activite,$id_lang){ $admtext = new Admtext; // recup de la page $this_page = $page->infos_page($id_activite,$id_lang); // recup des blocs $this_blocs = $page->liste_blocs($id_activite,$id_lang); // titre $this->SetFont('Arial','B',$this->taille_texte); $this->Cell(0,$this->espacement_texte,$this->cleanText($this_page['titre']),0,1); // blocs $this->SetFont('Arial',''); if(count($this_blocs)>0){ foreach($this_blocs as $unbloc){ if($unbloc['type']==1 || $unbloc['type']==2 || $unbloc['type']==3 || $unbloc['type']==7){ $unbloc['texte']=$this->cleanText($unbloc['texte']); $this->MultiCell(0, $this->espacement_texte,$unbloc['texte']); } } } // infos générales if($this_page['lieu']!=""){ $this->SetFont('Arial','B'); $this->Cell($this->GetStringWidth($admtext->getText("pdf_place",$id_lang)." "),$this->espacement_texte,$admtext->getText("pdf_place",$id_lang)." ",0,0); $this->SetFont('Arial',''); $this->Cell(0,$this->espacement_texte,$this->cleanText($this_page['lieu']),0,1); } if($this_page['date_debut']!="0000-00-00"){ $this->SetFont('Arial','B'); $this->Cell($this->GetStringWidth($admtext->getText("pdf_date",$id_lang)." "),$this->espacement_texte,$admtext->getText("pdf_date",$id_lang)." ",0,0); $this->SetFont('Arial',''); if($this_page['date_fin']=="0000-00-00"){ $this->Cell(0,$this->espacement_texte,dateFr($this_page['date_debut']),0,1); } else{ $this->Cell(0,$this->espacement_texte,$admtext->getText("date_du",$id_lang)." ".dateFr($this_page['date_debut'])." ".$admtext->getText("date_au",$id_lang)." ".dateFr($this_page['date_fin']),0,1); } } $this->Ln(5); } function cleanText($texte){ //$texte=htmlentities($texte); $texte = mb_ereg_replace("Œ", "Œ", $texte); $texte = mb_ereg_replace("œ", "œ", $texte); $texte=str_replace("	", "",$texte); $texte=str_replace("ă", "a",$texte); $texte=str_replace("\t", "",$texte); $texte=str_replace("’", "'",$texte); $texte=str_replace("\r\n", "",$texte); $texte=str_replace("\n", "",$texte); $texte=str_replace('</li>', "\n",$texte); $texte=str_replace('</p> ', "\n",$texte); $texte=str_replace('</p>', "\n",$texte); $texte=str_replace("chr(133)", "...",$texte); $texte=str_replace("…", "...",$texte); $texte=strip_tags($texte); $texte=trim($texte); $texte=utf8_decode($texte); $texte=html_entity_decode($texte); $texte=str_replace("'", "'",$texte); $texte=str_replace("Š", "S",$texte); $texte=str_replace("ˇ", "s",$texte); $texte=str_replace("„", '"',$texte); $texte=str_replace("“", '"',$texte); $texte=str_replace("’", "'",$texte); $texte=str_replace(" ", " ",$texte); $texte=str_replace("…", "...",$texte); $texte=str_replace("…", "...",$texte); $texte=str_replace("œ", chr(156),$texte); $texte=str_replace("œ", chr(156),$texte); $texte=strip_tags($texte); $texte=trim($texte); /*echo "<pre>"; print_r($texte); echo "</pre>";*/ return $texte; } function getArrayPlat($id_pdf){ $tab_retour=array(); $sql='SELECT * FROM pdf_elem WHERE id_pdf='.$id_pdf.' AND parent=0 AND `actif`=1 ORDER BY `order`'; $niveau1_items=$bd->select_arrays($sql); foreach($niveau1_items as $niveau1_item){ $tab_retour[]=$niveau1_item; $sql='SELECT * FROM pdf_elem WHERE id_pdf='.$id_pdf.' AND parent='.$niveau1_item['id'].' AND `actif`=1 ORDER BY `order`'; $niveau2_items=$bd->select_arrays($sql); if($niveau2_items!=null){ foreach($niveau2_items as $niveau2_item){ $tab_retour[]=$niveau2_item; $sql='SELECT * FROM pdf_elem WHERE id_pdf='.$id_pdf.' AND parent='.$niveau2_item['id'].' AND `actif`=1 ORDER BY `order`'; $niveau3_items=$bd->select_arrays($sql); if($niveau3_items!=null){ foreach($niveau3_items as $niveau3_item){ $tab_retour[]=$niveau3_item; } } } } } return $tab_retour; } function traiteArray($elems,$id_lang,$edition,$sommaire=""){ foreach($elems as $key=>$elem){ switch ($elem['type']){ case "pays": $this->ajouterPays($elem['id_elem'],$id_lang); break; case "section": $this->ajouterSection($elem['id_elem'],$id_lang,$edition); break; case "activite": if($elems[$key-1]['type']=="section"){ $this->ajouterPartieActivite($id_lang); } $this->ajouterActivite($elem['id_elem'],$id_lang); break; case "sommaire": if($sommaire!=""){ $this->outputSommaire($sommaire,$id_lang,2); } break; case "page": $this->AddPage(); break; case "texte": $this->WriteHTML($elem['texte']); break; case "titre": $this->ajouterTitre($elem['texte']); break; case "soustitre": $this->ajouterSousTitre($elem['texte']); break; } } } function outputSommaire($sommaires=null,$id_lang,$decalage=0){ $admtext = new Admtext; if($sommaires==null){ $sommaires=$this->sommaire; } foreach($sommaires as $key=>$ligne_sommaire){ if(isset($ligne_sommaire['code_iso'])){ /*if($key==0 || !isset($sommaires[$key-1]['code_iso'])){ // si le précédent n'est pas un pays ou que c'est le début du tableau if($key!=0){ $this->Ln(5); } $this->SetFont('Arial','B',$this->taille_titre); $this_ligne=mb_strtoupper($this->cleanText($admtext->getText("event_pays",$id_lang))); $this->Cell($this->GetStringWidth($this_ligne), $this->espacement_texte,$this_ligne,0,0); $this->Ln(5); $this->SetX(185); $this->SetFont('Arial','',$this->taille_titre); $this->Cell(10, $this->espacement_texte,((int)$ligne_sommaire['num_page']+$decalage),0,1,'R'); }*/ $y_before=$this->GetY(); $this->Image("images/icons/".strtolower($ligne_sommaire['code_iso']).".png",null,null,12,10); $y_after=$this->GetY(); if($this->GetY()>$y_before){ $this->SetY($y_before+5); } else{ $this->SetY($this->GetY()-5); } $this->SetX(25); $this->SetFont('Arial','',$this->super_taille_titre); $this->Cell($this->GetStringWidth(mb_strtoupper($ligne_sommaire['titre_page'])), $this->espacement_texte,mb_strtoupper($ligne_sommaire['titre_page']),0,0); $this->SetX(185); $this->SetFont('Arial','',$this->taille_titre); $this->Cell(10, $this->espacement_texte,((int)$ligne_sommaire['num_page']+$decalage),0,1,'R'); if($this->GetY()<$y_after || $y_after<$y_before){ $this->SetY($y_after); } $this->SetCol(0); } else{ if(isset($ligne_sommaire['type']) && $ligne_sommaire['type']=="titre"){ $this->Ln(5); $this->SetFont('Arial','B',$this->taille_titre); $ligne_sommaire['titre_page']=mb_strtoupper($ligne_sommaire['titre_page']); $this->Cell($this->GetStringWidth($ligne_sommaire['titre_page']), $this->espacement_texte,$ligne_sommaire['titre_page'],0,0); $this->SetX(185); $this->SetFont('Arial','',$this->taille_titre); $this->Cell(10, $this->espacement_texte,((int)$ligne_sommaire['num_page']+$decalage),0,1,'R'); $this->Ln(5); } else{ $this->SetX(10); $this->SetFont('Arial','',$this->taille_titre); $this->Cell($this->GetStringWidth($ligne_sommaire['titre_page']), $this->espacement_texte,$ligne_sommaire['titre_page'],0,0); $this->SetX(185); $this->SetFont('Arial','',$this->taille_titre); $this->Cell(10, $this->espacement_texte,((int)$ligne_sommaire['num_page']+$decalage),0,1,'R'); } $this->SetCol(0); } } $this->AddPage(); } function returnSommaire(){ return $this->sommaire; } } header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // any date in the past $pdf = new PDF(); $pdf->AddPage(); $titre = 'SEDL'; $pdf->SetTitle($titre); $pdf->SetAuthor('Moi'); /*$datas=$pdf->getArrayPlat($id_pdf); $pdf->traiteArray($datas,$id_lang,$edition); $sommaire=$pdf->returnSommaire();*/ /*$pdf->ajouterPays(1,$id_lang); $pdf->ajouterSection(22,$id_lang); $pdf->ajouterPartieActivite($id_lang); $pdf->ajouterActivite($id_activite,$id_lang); $pdf->ajouterActivite(25,$id_lang); $pdf->ajouterActivite(27,$id_lang); $pdf->ajouterActivite(28,$id_lang);*/ //print_r($sommaire); $pdf = new PDF(); $pdf->AddPage(); $titre = 'SEDL'; $pdf->SetTitle($titre); $pdf->SetAuthor('Moi'); foreach($partenaires as $unpartenaire){ $pdf->ajouterSection($unpartenaire['id'],2,$_POST['edition']); } //$pdf->WriteHTML($text); //$pdf->outputSommaire($sommaire,2); //$pdf->AddPage(); /*$datas=$pdf->getArrayPlat($id_pdf); $pdf->traiteArray($datas,$id_lang,$edition,$sommaire); while($pdf->pageNo()%4!=0){ $pdf->AddPage(); }*/ $pdf->Output("rapportsedl_".time().'.pdf',"I"); ?>