Ver Mensaje Individual
  #4 (permalink)  
Antiguo 24/07/2014, 07:23
Lenka19
 
Fecha de Ingreso: julio-2014
Mensajes: 8
Antigüedad: 9 años, 9 meses
Puntos: 0
Respuesta: fatal error con DOMPDF

hey gracias por contestar tan rapido y mi codigo es este:
Código PHP:
Ver original
  1. <?php
  2.     require_once("/dompdf/dompdf_config.inc.php");
  3.     include_once("php_conexion.php");
  4.     $nombreOrganizacion=$_SESSION['nombre'];
  5.     $clave=$_SESSION['clave'];
  6.     $pas=$_SESSION['pass'];
  7.     list($pas,$extencion1) = explode(".",$pas);
  8.     if(isset($_POST['almacenar1'])){
  9.         $rs = mysql_query("SELECT MAX(num) AS id FROM num");
  10.         if ($row = mysql_fetch_row($rs)) {
  11.             $id = trim($row[0]);
  12.             $id++;
  13.         }
  14.          
  15.          $sql = "INSERT INTO `num`(`num`) VALUES ($id)";
  16.         $query = mysql_query($sql);
  17.     }
  18.  /*function Footer()
  19.         {
  20.             //Posición: a 1,5 cm del final
  21.             $this->SetY(-15);
  22.             //Arial italic 8
  23.             $this->SetFont('Arial','I',8);
  24.             //Número de página
  25.             $this->Cell(0,10,'Pagina '.$this->PageNo().'/{nb}',0,0,'C');
  26.         }*/
  27.  
  28.  
  29.     $rs = mysql_query("SELECT MAX(num) AS id FROM num");
  30.     $row = mysql_fetch_assoc($rs);
  31.     $id = $row['id'];
  32.  
  33.     $sql="SELECT `carrito`.clave,`producto`.descripcion,`producto`.unidad,`producto`.precio,`carrito`.cantidad FROM `carrito` inner join `producto` on `carrito`.clave=`producto`.clave";
  34.      
  35.     $marca='Lovato';
  36.     $neto=0;
  37.    
  38.     $result = mysql_query($sql);
  39.  
  40.     $html = '<html><head></head>
  41.             <body  style="font-size:11px; font-family:Arial, Helvetica, sans-serif;">
  42.                 <div align="center" style=" margin-left:59px; position:absolute;left:60px;top:120px;width:400px;height:55px;z-index:8;"><i><h1 id="fuente1" style="color:#f55616; align:center;">Integra Control y seguridad</h1></i></div><br/>
  43.                 <h3>Numero de cotizacion <font size ="12px", color ="red">'.$id.'</font></h3>
  44.                 <h3>Cliente:'.$nombreOrganizacion.'</h3>
  45.                 <div align="center" style=" margin-top:20px; margin-left:15px;">
  46.                 <table>';
  47.     $html .= '<tr ><th bgcolor="#DCDCDC" >Clave</th><th bgcolor="#DCDCDC">Descripcion</th><th bgcolor="#DCDCDC">Unidad de Empaque</th><th bgcolor="#DCDCDC">Marca</th><th bgcolor="#DCDCDC">Existencias</th><th bgcolor="#DCDCDC">Precio</th><th bgcolor="#DCDCDC">Cantidad</th><th bgcolor="#DCDCDC">Subtotal</th>';
  48.  
  49.     $html .= '</tr>';
  50.  
  51.     while ($row = mysql_fetch_array($result)) {
  52.         $total=$row['precio']*$row['cantidad'];#cantidad * valor unitario
  53.         //$neto=$neto+$total;#acumulamos el neto
  54.         $marca="Lovato";
  55.         $totalito=$neto;
  56.         $clave=$row[0];
  57.         $bgcolor="";
  58.         if($extencion1=="D"){
  59.             //$precio=$row['precio']*0.95;
  60.              $neto=$neto+($total*0.90);
  61.              $numero= number_format($neto, 2, '.', '');
  62.         }
  63.         else{
  64.             if($extencion1=="F"){
  65.                  $neto=$neto+$total*1.00;#acumulamos el neto
  66.                  $numero= number_format($neto, 2, '.', '');
  67.             }
  68.             else {
  69.                 if($extencion1=="I"){
  70.                     $neto=$neto+$total*0.85;#acumulamos el neto
  71.                     $numero= number_format($neto, 2, '.', '');
  72.                 }
  73.                 else{
  74.                     if($extencion1=="R"){
  75.                         $neto=$neto+$total*0.95;#acumulamos el neto
  76.                         $numero= number_format($neto, 2, '.', '');                           
  77.                     }
  78.                     else{
  79.                         $neto=$neto+$total;#acumulamos el neto 
  80.                         $numero= number_format($neto, 2, '.', '');
  81.                     }
  82.                 }
  83.             }
  84.         }
  85.                
  86.                
  87.                
  88.         if($bgcolor == '#AFEEEE') $bgcolor = '#C2FF92';
  89.         else $bgcolor = '#AFEEEE';
  90.         $html .= '<tr bgcolor='.$bgcolor.'><td>'.$row['clave'].'</td><td>'.$row['descripcion'].' </td><td>'.$row['unidad'].'</td><td>'.$marca.'</td><td></td><td> $'.$row['precio'].'</td> <td>'.$row['cantidad'].'</td><td> $'.$total.'</td>';
  91.  
  92.         $html .= '</tr>';
  93.  
  94.     }
  95.     $html .='<tr align="center"><th  bgcolor="#DCDCDC">TOTAL</th>';
  96.     $html .='<tr align="center"><td bgcolor='.$bgcolor.'><font size ="3", color ="red">$'.$numero.'</font></td></tr>';
  97.     $html .= '</table> </div>
  98.  
  99.  
  100.             <div style="position:absolute; margin-top:410px;" >Senda de los Recuerdos No.485<br>Fracc. Milenio C.P. 76209</br> Queretaro, Qro, M&eacute;xico</br>Tel&eacute;fonos: (442) 1611587 </div>
  101.  
  102.             Copyright &copy; 2014 Todos los Derechos reservados
  103.  
  104.  
  105.         </body>
  106.  
  107.  
  108.  
  109.         </html>' ;
  110.  
  111.  
  112.  
  113.  
  114.  
  115.     $dompdf = new DOMPDF();
  116.     $dompdf->load_html($html);
  117.     $dompdf->render();
  118.     $nombre_archivo="Cotizacion";
  119.     //$secuenciadompdf-> ($nombre_archivo, array ('Anexo' => 0));
  120.     //$dompdf->output();
  121.     //$pdf=$dompdf->stream($nombre_archivo);//metodo para descargar pdf
  122.  
  123.     header('Content-type: application/pdf');
  124.     echo $dompdf->output(); // mandar a imprimir en pantalla el pdf
  125.  
  126. ?>