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 67 68 69 70 71 72 73 74 75 76 77 78 79
| <?php
//Variables récupérées
$prenom = $_POST['prenom'];
$nom = $_POST['nom'];
$site = $_POST['site'];
$centre = $_POST['centre'];
$matricule = $_POST['matricule'];
if ($site == "0060")
{
$site_footer = "Sarcelles";
}
else if ($site == "0061")
{
$site_footer = "Vitrolles";
}
else if ($site == "0062")
{
$site_footer = "Ligny en Barrois";
}
else if ($site == "0069")
{
$site_footer = "Kama";
}
//Photos:
//$photo = "home/httpd/mount/Badges/".$matricule.".JPG";
define('FPDF_FONTPATH','../_include/fpdf/font/');
require('../_include/fpdf/fpdf.php');
class PDF extends FPDF
{
//En-tête
function Header()
{
//Logo
$this->Image('_pics/Logo.jpg',21,2);
$this->SetFont('Arial','B',6);
$this->SetXY(0,11.5);
$this->SetTextColor(0,72,138);
$this->Cell(86,5,"Une entreprise du groupe DaimlerChrysler",0,1,'C');
}
//Pied de page
function Footer()
{
//Logo
$this->SetFont('Arial','',10);
$this->SetXY(0,49);
$this->SetDrawColor(0,72,138);
$this->SetFillColor(0,72,138);
$this->SetTextColor(255,255,255);
$this->Cell(86,5,"EvoBus France, Etablissement de ".$site_footer.".",0,0,'C',1);
}
}
//Instanciation de la classe dérivée
$dimension = array(86,54);
$pdf=new PDF('P', 'mm', $dimension);
$pdf->AddPage();
$pdf->SetAutoPageBreak(false,0);
$pdf->SetFont('Arial','',14);
$pdf->SetXY(3,24);
$pdf->SetTextColor(0,72,138);
$pdf->Cell(60,5,$nom.' '.$prenom);
$pdf->SetXY(3,30);
$pdf->Cell(60,5,$site.'-'.$centre.'-'.$matricule);
$pdf->Cell(65,20,"",0,0,'C',0,$pdf->Image('1085.JPG',65,20));
$pdf->Output();
exit;
?> |
Partager