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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| <?php
require('fpdf/fpdf.php');
//Connect to your database
include("ConnexionBdd.php");
$id=$_GET[i];
$theme=$_GET[t];
//On récupère les données concernant le thème
$ReqSelec="select * from theme where titre_t='$theme' ORDER BY titre_t";
$Res=mysql_query($ReqSelec);
$Nb = mysql_num_rows($Res);
//on donne a chaque colonne son contenu
while($ligne = mysql_fetch_array($Res)){
$titre = $ligne[1];
$description =$ligne[2];
$objG = $ligne[3];
$objO=$ligne[4];
$affichage=$ligne[5];
}
class PDF extends FPDF{
//En-tête
function Header(){
//Logo
$this->Image('Logo.png',10,8,33);
//Police Arial gras 15
$this->SetFont('Arial','B',15);
//Décalage à droite
$this->Cell(80);
//Titre
$this->Cell(30,10,'Titre',1,0,'C');
//Saut de ligne
$this->Ln(20);
}
//Pied de page
function Footer(){
//Positionnement à 1,5 cm du bas
$this->SetY(-15);
//Police Arial italique 8
$this->SetFont('Arial','I',8);
//Numéro de page
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
$GdTitre="Informations sur le thème : ".$titre."\n";
$GdTitre2="Informations sur l'indicateur : \n";
//Create a new PDF file
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,$GdTitre);
$pdf->Ln(10);
$pdf->Cell(60,10,'Description : ');
$pdf->Cell(12,10,$description);
$pdf->Ln(10);
$pdf->Cell(60,10,'Objectif général : ');
$pdf->Cell(12,10,$objG);
$pdf->Ln(10);
$pdf->Cell(60,10,'Objectif opérationnel : ');
$pdf->Cell(12,10,$objO);
$pdf->Ln(10);
$pdf->Cell(40,10,$GdTitre2);
$pdf->Output();
?> |
Partager