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
| class PDF extends FPDF
{
//En-tête
function Header()
{
$tournee = $_POST['tournee'];
setlocale (LC_TIME, 'fr_FR','fra');
$aujourdhui = strftime("%A %d %B %Y %T");
$this->SetXY(10,5);
$this->SetFont('Arial','B',12);
$this->SetTextColor(35);
$this->Cell(60,7,'Bordereau de livraison','C');
$this->SetXY(10,15);
$this->SetFont('Arial','',8);
$this->Cell(20,7,'Edité le '.$aujourdhui,'C');
//Tournée
$this->SetXY(10,30);
$this->SetFont('Arial','B',14);
$this->MultiCell(40, 10, "Tournée ".$tournee."", 1, "L", 0);
}
//Pied de page
function Footer()
{
$this->SetY(-20);
$this->SetFont('Arial','',10);
$this->Cell(70,7,'Opération : valeur');
$this->SetXY(130,-20);
$this->SetFont('Arial','',10);
$this->Cell(80,7,"valeur");
//Positionnement à 1,5 cm du bas
$this->SetY(-15);
//Police Arial italique 8
$this->SetFont('Arial','I',8);
//Numéro de page centré
$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//BON DE LIVRAISON
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(isset($_POST['editer_un_bord'])){
$dimension=array(270,210);
$pdf=new PDF('L','mm',$dimension);
$pdf->AliasNbPages();
$pdf->SetFont('Arial','B',10); //Police, gras, taille
$a = mysql_query("select tournee, ordre, unite, site, adresse_livraison, tel_livraison, quantite, qte_carton, qte_palette, id_article, designation from commande where date_cmd = '".$date."' and tournee = '".$tournee."' group by site order by ordre");
$ab = mysql_num_rows($a);
if($ab){
for($i=0; $i<$ab; $i++)
while($re = mysql_fetch_array($a)){
$pdf->AddPage();
$pdf->SetXY(10,50);
$pdf->SetFont('Arial','',9);
$pdf->SetFillColor(204,204,255);
$pdf->MultiCell(100, 5, $re['site']."\n".$re['adresse_livraison'], 1, "L", 1);
$pdf->SetXY(10,70);
$pdf->SetFont('Arial','',8);
$pdf->Cell(90,4,"Tel : ".$re['tel_livraison']);
$pdf->SetXY(100,70);
$pdf->SetFont('Arial','',8);
$pdf->Cell(100,4,$re['unite']);
}
}
}
$pdf->output();
?> |
Partager