<?php
require_once(__DIR__ . '/vendor/autoload.php');

use Fpdf\Fpdf;

class ENTETE_CLIENT extends Fpdf
{
  var $colonnes;
  var $format;
  var $angle = 0;

  function addEntete($Nom, $Prenom, $DateNaissance, $Adresse, $NoPostal, $Localite, $Pays, $Telephone, $Email)
  {
    $initx = 10;
    $endx = 200;
    $inity = 48;
    $y = $inity;
    $dy = 8;
    $dy2 = 1;
    $font = 10;
    $fonth = 5;
    $this->SetLineWidth(0.05);
    $this->Line($initx, $y, $endx, $y);
    $this->SetXY(10, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(20, $fonth, iconv('UTF-8', 'windows-1252', "Nom :"), 0, 0, "L");
    $this->SetXY(30, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(75, $fonth, iconv('UTF-8', 'windows-1252', $Nom), 0, 0, "L");
    $this->Line(105, $y, 105, $y + $dy);
    $this->SetXY(105, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(20, $fonth, iconv('UTF-8', 'windows-1252', "Prénom :"), 0, 0, "L");
    $this->SetXY(125, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(75, $fonth, iconv('UTF-8', 'windows-1252', $Prenom), 0, 0, "L");

    $y = $y + $dy;
    $this->Line($initx, $y, $endx, $y);

    $this->SetXY(10, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(35, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Date de naissance :"), 0, 0, "L");
    $this->SetXY(45, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(70, $fonth, iconv('UTF-8', 'windows-1252', $DateNaissance), 0, 0, "L");
    $this->Line(105, $y, 105, $y + $dy);
    $this->SetXY(105, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(25, $fonth, iconv('UTF-8', 'windows-1252', "Etat civil :"), 0, 0, "L");

    $y = $y + $dy;
    $this->Line($initx, $y, $endx, $y);

    $this->SetXY(10, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(20, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Adresse :"), 0, 0, "L");
    $this->SetXY(30, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(160, $fonth, iconv('UTF-8', 'windows-1252', $Adresse), 0, 0, "L");

    $y = $y + $dy;
    $this->Line($initx, $y, $endx, $y);

    $this->SetXY(10, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(25, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Code Postal :"), 0, 0, "L");
    $this->SetXY(35, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(15, $fonth, iconv('UTF-8', 'windows-1252', $NoPostal), 0, 0, "L");
    $this->Line(50, $y, 50, $y + $dy);
    $this->SetXY(50, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(20, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Ville :"), 0, 0, "L");
    $this->SetXY(70, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(60, $fonth, iconv('UTF-8', 'windows-1252', $Localite), 0, 0, "L");
    $this->Line(130, $y, 130, $y + $dy);
    $this->SetXY(130, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(15, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Pays :"), 0, 0, "L");
    $this->SetXY(145, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(55, $fonth, iconv('UTF-8', 'windows-1252', $Pays), 0, 0, "L");

    $y = $y + $dy;
    $this->Line($initx, $y, $endx, $y);

    $this->SetXY(10, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(25, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Téléphone :"), 0, 0, "L");
    $this->SetXY(35, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(70, $fonth, iconv('UTF-8', 'windows-1252', $Telephone), 0, 0, "L");
    $this->Line(105, $y, 105, $y + $dy);
    $this->SetXY(105, $y);
    $this->SetFont("Helvetica", "B", $font);
    $this->Cell(20, $fonth, $tel = iconv('UTF-8', 'windows-1252', "Email :"), 0, 0, "L");
    $this->SetXY(125, $y + $dy2);
    $this->SetFont("Helvetica", "", $font);
    $this->Cell(175, $fonth, iconv('UTF-8', 'windows-1252', $Email), 0, 0, "L");

    $y = $y + $dy;
    $this->Line($initx, $y, $endx, $y);

    /* $this->SetXY(10, $y );
  $this->SetFont( "Helvetica", "B", $font);
  $this->Cell(45,$fonth, $tel = iconv('UTF-8', 'windows-1252', "N° permis de conduire :"), 0, 0, "L");
  $this->Line(105, $y, 105, $y + $dy + 3);
  $this->SetXY(105, $y );
  $this->SetFont( "Helvetica", "B", $font);
  $this->Cell(35,$fonth, $tel = iconv('UTF-8', 'windows-1252', "N° pièce d'identité :"), 0, 0, "L");

  $y = $y + $dy + 3;
  $this->Line($initx, $y, $endx, $y);
*/
    $this->Line($initx, $inity, $initx, $y);
    $this->Line($endx, $inity, $endx, $y);
  }
}
