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
|
<?php
require('../../fpdf/phpToPDF.php');
//Connect to your database
include('../../param_conn.php');
//Select the Products you want to show in your PDF file
$rep_enfant = $bdd->prepare('select nom_item, num_exercice, nom_exercice from ime_constituer, ime_exercices, ime_items where num_exercice = num_exercice_C and num_item_C = num_item group by nom_item, num_exercice order by num_item, num_exercice');
$rep_enfant->execute(array());
//Create new pdf file
$pdf = new phpToPDF();
//print column titles
$pdf->SetFillColor(255,255,255);
$pdf->SetFont('Arial','',12);
$i = 10;
$pdf->AddPage();
$pdf->startPageNums();
while ($donnees = $rep_enfant->fetch())
{
if($i>=275)
{
$i=10;
$pdf->AddPage();
}
$pdf->SetY($i);
$pdf->SetX(25);
$pdf->Cell(50,6,$donnees['nom_item'],1,0,'L',1);
$pdf->Cell(10,6,$donnees['num_exercice'],1,0,'C',1);
$pdf->Cell(110,6,$donnees['nom_exercice'],1,0,'L',1);
$i = $i + 5;
}
$pdf->Output();
?> |
Partager