Tema: de PHP a PDF
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/08/2011, 10:50
Anna Carolina
 
Fecha de Ingreso: febrero-2007
Ubicación: Caracas
Mensajes: 148
Antigüedad: 18 años
Puntos: 6
de PHP a PDF

Buenas , no se si ustedes saben como puedo generar mi pdf,

Ya tengo algo adelantado , la misma persona que hace login en mi pagina, realiza una cotizacion en linea, selecciona productos, y luego ve su cotizacion, despues genero mi cotizacion.pdf

Este es mi codigo, pero me tranque en: donde llamo a
Código:
<div><?php include($_SERVER[DOCUMENT_ROOT] . '/site/vercarrito.php'); ?></div>
Código PHP:
<?php
require_once("dompdf/dompdf_config.inc.php");
session_start();
$data_root $_SERVER[DOCUMENT_ROOT];
include (
$data_root "/site/sec/funciones.php");
$menu_links "";
if (isset(
$_SESSION['id'])) {
    
$userid $_SESSION['id'];
    
$usuario $_SESSION['usuario'];
    
//CREACION DEL MENU AUTOMATICO
    //MENU USUARIOS REGISTRADOS
    
$menu_links '<a href="cuenta.php?id=' $userid '">' $usuario '</a> &bull; <a href="logout.php">Fin Sesion</a>';
} else {
    
//MENU USUARIOS NO REGISTRADOS
    
$menu_links '<a href="registro.php">Registrarse</a> &bull; <a href="login.php">Inicio de Sesion</a>';
    
header("location: cuenta.php");
    exit();
}

$menu_links2 "";
$sql mysql_query("SELECT * FROM registro WHERE id='$userid'");
if(
$row mysql_fetch_array($sql)){
    
$nombres $row["nombres"];
    
$apellidos $row["apellidos"];
    
$email $row["email"];
    
$telefonos $row["telefono"];
    
$nick$row["nick"];
    
$password$row["password"];
    
$estado$row["estado"];
    
$zona$row["zona"];
}

 
  
$fecha date("d-m-Y");
$html=
"<html>
  
 <body  bgcolor='#FFFFFF'>
<div id='contenido'><div class='header'>
<table width='700' border='0'>
<tr> 
<td height='108' align='left'><img src='img/logo.gif' border='0' /></td>
</tr>
</table>
</div>
<div class='principal' align='center'>
    <div class='cabeza' >Cotizaci&oacute;n de Productos</div>
    
<table width='601' align='center'>
<tr>
<td width='192' align='center'>Datos del Usuario</td>
<td align='right'>Fecha de Cotizaci&oacute;n $fecha</td>
</tr>
<tr>
<td align='center'>Nombre</td><td width='397'>$nombres</td>
</tr>
<tr>
<td align='center'>Apellidos</td>
<td>$apellidos></td>
</tr>
<tr>
<td align='center'>Telefono</td>
<td>$telefonos</td>
</tr>
<tr>
<td colspan='2'></td>
</tr>
</table>
<br />
<div><?php include($_SERVER[DOCUMENT_ROOT] . '/site/vercarrito.php'); ?></div></div>
</div>
</body>
</html>
"
;
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("cotizacion.pdf");
?>
Ya veo del PDF el Logo , Nombres , Apellidos, Telefonos, y la fecha actual.
mas no los productos.