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
|
<?
include ("definition.php");
session_start();
$base=mysql_connect("localhost","root","admin");
mysql_select_db("bd", $base);
$date = date("Y/m/d ");
$idclient = $_SESSION['idclient'];
echo $idclient."id client<br>";
require('fpdf.php');
class PDF extends FPDF
{
//En-tête
function Header()
{
//Police Arial gras 15
$this->SetFont('Courier','B',15);
//Décalage à droite
$this->Cell(60);
//Titre
$this->Cell(70,10,'Votre facture',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('Courier','I',8);
//Numéro de page
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
//Instanciation de la classe dérivée
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Courier','B',12);
$pdf->Cell(0,10, 'Date : ' $date , 0, 1);
$pdf->Output();
?> |
Partager