Image('logosaarvie.jpg',10,8,30,15); //Police Arial gras 15ilicolog2.jpg $this->SetFont('Arial','B',12); //Décalage à droite // $this->Cell(40); //Titre // $this->Cell(110,6,'A S S U R A N C E V I E',0,0,'C'); // $this->Cell(40); // $this->Ln(5); // $this->SetFont('Arial','B',7); // $this->Cell(110,6,'PREVOYANCE - RETRAITE - PERTE D\'EMPLOI - EDUCATION SCOLAIRE - DECES - PLACEMENT',0,0,'C'); //Saut de ligne $this->Ln(15); $this->Cell(200,6,'TABLEAU D\'AMORTISSEMENT',0,0,'C'); //Saut de ligne $this->Ln(8); } //Pied de page function Footer() { //Positionnement à 1,5 cm du bas //$this->Ln(50); $this->SetY(-40); $this->SetFont('Arial','B',6); $this->SetTextColor(0,0,80); $this->Cell(26,5,'Je soussigné .................................................., titulaire de la police d\'assurance dont références ci-dessus,',0,0,'L'); $this->Ln(3); $this->Cell(26,5,'* reconnaîs avoir reçu au titre d\'avance sur police la somme de ................................ FCFA remboursable en ........... mensualités.',0,0,'L'); $this->Ln(3); $this->Cell(26,5,'* accepte qu\'aucun autre prêt ne pourra m\'être consenti tant que celui qui est en cours n\'est pas soldé. ',0,0,'L'); $this->Ln(5); $this->Cell(285,5,'Fait à Dakar en 2 exemplaires ',0,0,'C'); $this->Ln(3); $this->Cell(285,5,'Signature de l\'assuré',0,0,'C'); $this->Ln(3); $this->Cell(285,5,'précédé de la mention',0,0,'C'); $this->Ln(3); $this->Cell(285,5,'"Lu et approuvé"',0,0,'C'); $this->SetY(-25); $this->SetFont('Arial','B',6); $this->SetTextColor(0,0,80); $this->Cell(26,5,'LA DIRECTION',0,0,'C'); // $this->Ln(5); // $this->Ln(10); // $this->Cell(265,5,'LE SOUSCRIPTEUR',0,0,'C'); $this->SetY(-10); //Police Arial italique 8 $this->SetFont('Arial','I',8); $this->SetTextColor(255,255,255); $this->SetFillColor(120,0,0); $this->Cell(0,5,'Société anonyme au capital de 1 500 000 000 FCA - Entreprise régie par le Code CIMA',0,0,'C',true); $this->SetY(-6); $this->Ln(0); $this->Cell(0,5,'16, rue de Thiong X Moussé DIOP - BP 1359 Dakar - Tel. +221 33 889 87 87 / 33 889 87 88 - Fax: +221 33 842 76 71 - E-mail: saarvie@saarvie.sn',0,0,'C',true); // $this->Ln(0); // $this->SetY(-10); //Numéro de page // $this->Cell(0,5,'Page '.$this->PageNo().'/{nb}',0,0,'C'); } //Chargement des données function LoadData($file) { //Lecture des lignes du fichier $lines=file($file); $data=array(); foreach($lines as $line) $data[]=explode(';',chop($line)); return $data; } //Tableau simple function BasicTable($header,$data) { //En-tête //foreach($header as $col) //$this->Cell(15,5,$header[0],1); //$this->Cell(18,5,$header[1],1); //$this->Cell(18,5,$header[2],1); //$this->Cell(18,5,$header[3],1); //$this->Cell(19,5,$header[4],1); //$this->Cell(20,5,$header[5],1); //$this->Cell(60,5,$header[6],1); /*$this->Cell(20,5,$header[7],1); $this->Cell(48,5,$header[8],1);*/ $this->Ln(); //Données foreach($data as $row) { //foreach($row as $col) if($row[0] == "e"){ if($row[2] == "PRET"){ $this->SetTextColor(0,0,80); $this->SetFont('Arial','B',8); //$this->Cell(15,5,$row[0],1); //$this->Cell(18,5,$row[1],1); $this->Cell(48,4,$row[2],1); //$this->Cell(0.1,5,$row[3],0); //$this->Cell(0.1,5,$row[4],0,0,'R'); //$this->Cell(35,5,$row[5],1,0,'R'); $this->Ln(); } else{ $this->SetTextColor(0,0,80); $this->SetFont('Arial','B',8); //$this->Cell(15,5,$row[0],1); //$this->Cell(18,5,$row[1],1); $this->Cell(48,4,$row[2],1); $this->Cell(0.1,4,$row[3],0); $this->Cell(0.1,4,$row[4],0,0,'R'); $this->Cell(35,4,$row[5],1,0,'R'); $this->Ln(); } //$this->Cell(60,5,$row[6],1,0,'L'); /*$this->Cell(20,5,$row[7],1,0,'R'); $this->Cell(48,5,$row[8],1);*/ //$this->Ln(); } else if($row[0] == "TOTAL"){ $this->SetTextColor(255,0,0); $this->SetFont('Arial','B',9); $this->Cell(20,5,$row[0],1); $this->Cell(20,5,$row[1],1,0,'C'); $this->Cell(23,5,$row[2],1,0,'R'); $this->Cell(25,5,$row[3],1,0,'R'); $this->Cell(18,5,$row[4],1,0,'R'); $this->Cell(26,5,$row[5],1,0,'R'); $this->Cell(38,5,$row[6],1,0,'R'); /*$this->Cell(20,5,$row[7],1,0,'R'); $this->Cell(48,5,$row[8],1);*/ } else { if($row[0] == "s"){ $this->Ln(); } else{ $this->SetTextColor(0); $this->SetFont('Arial','',9); $this->Cell(20,4,$row[0],1,0,'C'); $this->Cell(20,4,$row[1],1,0,'C'); $this->Cell(23,4,$row[2],1,0,'R'); $this->Cell(25,4,$row[3],1,0,'R'); $this->Cell(18,4,$row[4],1,0,'R'); $this->Cell(26,4,$row[5],1,0,'R'); $this->Cell(38,4,$row[6],1,0,'R'); /*$this->Cell(20,5,$row[7],1,0,'R'); $this->Cell(48,5,$row[8],1);*/ $this->Ln(); } } } } } $pdf=new PDF(); $pdf->Open(); $pdf->AliasNbPages(); //Titres des colonnes //$header=array('N°Police','Effet','Expiration','Pay TO','Prime','C A','Prénom Nom'); //Chargement des données $data=$pdf->LoadData($fichier); $pdf->SetFont('Arial','B',8); $pdf->AddPage(); $pdf->BasicTable($header,$data); $pdf->Output(); ?>