1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| $pdf->SetFont('Times','BIU',20);$pdf->AddPage();
// définit l'écriture pour le titre
$pdf->Cell(190,10,'Exportation de la liste des références en PDF',1,1,'C');
//Titres des colonnes
$header=array('Client','Nom du projet','Année début','Année fin','Agence');
$pdf->SetFont('Arial','B',10);
$pdf->SetFillColor(96,96,96);
$pdf->SetTextColor(255,255,255);
$resultat=$listref;
$pdf->SetXY(3,20);
$pdf->cell(60,10,$header[0],1,0,'C',1);
$pdf->cell(60,10,$header[1],1,0,'C',1);
$pdf->cell(25,10,$header[2],1,0,'C',1);
$pdf->cell(25,10,$header[3],1,0,'C',1);
$pdf->cell(30,10,$header[4],1,0,'C',1);
$pdf->SetFillColor(0xdd,0xdd,0xdd);
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(3,$pdf->GetY()+10);
$fond=0;
for($i=0;$i<$card;$i++)
{
$pdf->multicell(60,10,$resultat[$i]->client,1,0,'C',$fond);
$pdf->multicell(60,10,$resultat[$i]->nom_projet,1,0,'C',$fond);
$pdf->multicell(25,10,$resultat[$i]->debut_realisation,1,0,'C',$fond);
$pdf->multicell(25,10,$resultat[$i]->fin_realisation,1,0,'C',$fond);
$pdf->multicell(30,10,$resultat[$i]->ag_lib,1,0,'C',$fond);
$pdf->SetX(0,$pdf->GetY()+0.7);//echo("sec");
$fond=!$fond;
}
$pdf->Output('dock.pdf','I'); |
Partager