How do I print data in an orderly pdf if I am using FPDF through a mysql query?

0
<?php
require('fpdf/fpdf.php');

$consulta= mysqli_query($consulta, "
SELECT ventas.nrofactura, fecha, cliente, rfc, ccresponsable, nombre, precioventa, cantidad, direccion FROM detalleventas INNER JOIN productos INNER JOIN ventas WHERE ventas.nrofactura = 25 and detalleventas.idproducto = productos.id and detalleventas.nrofactura = ventas.nrofactura");

while ($registros=mysqli_fetch_array($consulta)){


class PDF extends FPDF
{
    function Header()
    {
        //logo del documento
        $this->Image('img/logo.png',10,8,33);
        //arial
        $this->SetFont('Arial','B',15);
        //Mover a la derecha
        $this->Cell(80);

        //Espacio para el informacion de la distribuidora
        $this->SetXY(60, 10);
        $this->setFont("arial",'',12);
        $this->MultiCell(65, 5, utf8_decode('Distribuidora de frutas y verduras Alex "Mayoreo y menudeo todo el año" Dulce Karina Garcia Acevedo RFC: GAAD98041MPLRCL03 Calle Kukulan Norte Manzana 2 Lote 1 CP. 77780 Tulum, Quintana Roo'), 0, 'C');

        //espacio para tabla info
        $this->SetXY(140, 10);
        $this->Cell(50,5, 'Remision',1,1,'C');
        $this->SetXY(140, 15);
        $this->SetXY(155, 20);
        $this->Cell(20,5, 'Fecha:',1,0,'C');
        $this->Cell(30,5, ' ',1,1,'C');
        $this->SetXY(155, 20);
        $this->Cell(20,5, 'Cel. 9841601082',0,1,'C');
        $this->SetXY(155, 25);
        $this->Cell(20,5, 'Tel. 2231103721',0,1,'C');
        $this->SetXY(155, 30);
        $this->Cell(20,5, utf8_decode('Correo Electrónico'),0,1,'C');
        $this->SetXY(155, 35);
        $this->Cell(20,5, utf8_decode('[email protected]'),0,1,'C');

        $this->Ln(20);
    }

    function Footer()
    {
        //posicion: a 1.5 cm de el final
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial','I',8);
        //numero de pagina
        $this->Cell(0,10,'Pagina',0,0,'C');
    }
}
}
?>
    
asked by Ángel 11.05.2018 в 02:46
source

0 answers