Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/05/2007, 07:00
Parliament
 
Fecha de Ingreso: noviembre-2003
Mensajes: 499
Antigüedad: 20 años, 5 meses
Puntos: 7
Re: Porque PHP hace esto ???

Código PHP:
<?php
//PDF USING MULTIPLE PAGES
//FILE CREATED BY: Carlos José Vásquez Sáez
//YOU CAN CONTACT ME: [email protected]
//FROM PUNTA ARENAS, MAGALLANES
//INOVO GROUP - http://www.inovo.cl

define('FPDF_FONTPATH','font/');
require(
'fpdf.php');

//Connect to your database
include("connect.php");

//Create new pdf file
$pdf=new FPDF();

//Open file
$pdf->Open();

//Disable automatic page break
$pdf->SetAutoPageBreak(false);

//Add first page
$pdf->AddPage();

//set initial y axis position per page
$y_axis_initial 25;

//print column titles for the actual page
$pdf->SetFillColor(232,232,232);
$pdf->SetFont('Arial','B',12);
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
//$pdf->Cell(30,6,'CODE',1,0,'L',1);
//$pdf->Cell(100,6,'NAME',1,0,'L',1);
//$pdf->Cell(30,6,'PRICE',1,0,'R',1);

$y_axis $y_axis $row_height;

//Select the Products you want to show in your PDF file
$result=mysql_query('select Dni_inqui, Sueldo_inqui, Nombre_inqui from alqui');

//initialize counter
$i 0;

//Set maximum rows per page
$max 25;

//Set Row Height
$row_height 6;

while(
$row mysql_fetch_array($result))
{
    
//If the current row is the last one, create new page and print column title
    
if ($i == $max)
    {
        
$pdf->AddPage();

        
//print column titles for the current page
        
$pdf->SetY($y_axis_initial);
        
$pdf->SetX(25);
        
//$pdf->Cell(30,6,'CODE',1,0,'L',1);
        //$pdf->Cell(100,6,'NAME',1,0,'L',1);
        //$pdf->Cell(30,6,'PRICE',1,0,'R',1);
        
        //Go to next row
        
$y_axis $y_axis $row_height;
        
        
//Set $i variable to 0 (first row)
        
$i 0;
    }
    
$Nombre_inqui $row['Nombre_inqui'];
    
$Dni_inqui $row['Dni_inqui'];
    
$Sueldo_inqui $row['Sueldo_inqui'];
    
//$name = $row['Code'];

    
$pdf->SetY($y_axis);
    
$pdf->SetX(25);
    
$pdf->Cell(30,6,$Nombre_inqui,1,0,'L',1);
    
$pdf->Cell(30,6,$Dni_inqui,1,0,'L',1);
    
$pdf->Cell(100,6,$Sueldo_inqui,1,0,'L',1);
    
//$pdf->Cell(30,6,$price,1,0,'R',1);
//________________-BARRAS-__________________
define('FPDF_FONTPATH','font/');
require(
'code39.php');
$pdf=new PDF_Code39();
$pdf->AddPage();
$pdf->Code39(6030$Dni_inqui$Sueldo_inqui);
$pdf->Output();
//_________________________________________
    //Go to next row
    
$y_axis $y_axis $row_height;
    
$i $i 1;
}

mysql_close();

//Create file
$pdf->Output();
?>