Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/04/2005, 10:58
pepeitor
 
Fecha de Ingreso: abril-2005
Mensajes: 3
Antigüedad: 19 años
Puntos: 0
Problema Resuelto

sE RESOLVIÓ DE FORMA SENCILLA:

Verlo en www.redautocarlos.com



<?php
define('FPDF_FONTPATH','font/');
require('WriteHTML.php');

if ($precio==0) {$precio="Consultar";}
//Cabecera de página
class PDF extends FPDF
{

function muestrafoto(){
$ref=($_POST['ref']);
require('../catalogo/db.php');
$con=mysql_connect($myHostName,$myUserName,$myPass word);
mysql_select_db($myDatabase,$con);
$qry = "SELECT foto FROM autosweb WHERE ref='".$ref."'";
$res = mysql_query($qry);
$foto = mysql_result($res,0,'foto');


if ($foto){
header("Content-type: $foto");
$foto = ImageCreateFromString($foto);
$temp = 'IMG'.time().'.jpg';
ImageJPEG($foto,$temp,75);
$this->Image($temp,65,50,80);
unlink($temp);
ImageDestroy($foto);
}else{
$this->Image('no.jpg',60,50,80);
}
}

function Header()
{
//Logo
$this->Image('logo.JPG',15,15,180);
//Arial bold 15 y salto de línea.
$this->Ln(32);
$this->SetFont('Arial','B',15);
//Movernos a la derecha 8 cm
$this->Cell(80);
$this->Cell(30,10,'DATOS DEL VEHÍCULO',0,2,'C');
//Título
$this->Ln(10);
$this->muestrafoto();
$this->Ln(60);

}


function Footer()
{
//Go to 1.5 cm from bottom
$this->SetY(-15);
//Select Arial italic 8
$this->SetFont('Arial','I',8);
//Print centered page number
$this->Cell(0,10,'Página '.$this->PageNo(),0,0,'C');
}

function _convert($s) {
if ($this->useiconv)
return iconv($this->from,$this->to,$s);
else
return $s;
}

function _iso2ascii($s) {
$iso="áèïéìíåµòóø¹»úùý¾äëöüÁÈÏÉÌÍÅ¥ÒÓØ©«ÚÙÝ®ÄËÖÜ";
$asc="acdeeillnorstuuyzaeouACDEEILLNORSTUUYZAEOU";
return strtr($s,$iso,$asc);
}
}


$pdf=new PDF();
$pdf->AddPage();
$pdf->SetFont('Times','',14);
$pdf->SetTextColor(0,0,0);

$pdf->SetFont('Times','',12);
$pdf->SetTextColor(123,32,98);
$pdf->Ln(3);
$pdf->Cell(20,5,'REF: '.$refweb,0,1);
$pdf->Cell(20,5,''.$marca." ".$modelo ,0,1);
$pdf->Cell(20,5,''.$motor,0,1);
$pdf->Cell(20,5,''.$color,0,1);
$pdf->Cell(20,5,'AÑO: ' .$ano,0,1);
$pdf->Cell(20,5,'KMS: ' .$kms." kms",0,1);
$pdf->Cell(20,5,'GARANTÍA: ' .$garantia." meses",0,1);
$pdf->Cell(20,5,'PRECIO: ' .$precio." €",0,1);
$pdf->Ln(3);
$pdf->MultiCell(0,5,'EXTRAS: '.$extras,0,1);
$pdf->Ln(1);
$pdf->MultiCell(0,5,'INFO: '.$info,0,1);
$pdf->Ln(3);

//$pdf->ShowFicha();

$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Times','',10);
$pdf->Cell(20,10,'' .$fecha,0,1);

$pdf->SetAuthor('PEPEITOR');
$pdf->SetCreator('FPDF BY PEPEITOR');
$pdf->SetDisplayMode('real');
$pdf->SetKeywords('pepeitor');
$pdf->SetTitle('FICHA PARA CLIENTE');
$pdf->Output($ref." ".$marca." ".$modelo." ".'ficha.pdf','D');

?>