Неправильный PDF с DOMPDF

Я пытаюсь создать файл .pdf. но я не могу объединить свой текст:
Это мой код:

<?php
include('conexion.php');
$con = conexion();
$sql="select * from [my table] where [condition] ";
$res=mysql_query($sql,$con);

$concli=conexion();
$sqlcli="select *  from [my table] where [condition]";

$rescli=mysql_query($sqlcli,$concli);
$datocli=mysql_fetch_array($rescli);
$codigoHTML='
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>PDF</title>
</head>
<body>

<form>
<div align="left">
<img src="http://web-answers.org/wp-content/uploads/2019/03/logo.jpg" width="186" height="88" alt="playss.net"/> </div><br/>
<hr />
<div >
<pre>
Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
echo $datocli['nomempresacli'];
$codigoHTML='
">
Nombre del Vendedor  <input type="text" value="">
Proyecto:            <input type="text" >
Fecha:               <input type="text" >
</pre>
<table width="95%" height="100%" border="1">
<tr height="40">
<td>#</td>
<td >Id Producto</td>
<td >Parte</td>
<td >Descripci&oacute;n</td>
<td >Cantidad</td>
<td >Precio</td>
<td >Subtotal</td>
<td >Descuento</td>
<td >total</td>
</tr>';
require_once("dompdf/dompdf_config.inc.php");

$contador=1;

while ($dato=mysql_fetch_array($res))
{
$codigoHTML.='
<tr>
<td>'.$contador.'</td>
<td>'.$dato['idproducto'].'</td>
<td>'.$dato['parte'].'</td>
<td>'.$dato['descripcion'].'</td>
<td>'.$dato['cantidad'].'</td>
<td>'.$dato['precio'].'</td>
<td>'.$dato['subtotal'].'</td>
<td>'.$dato['descuento'].'</td>
<td>'.$dato['total'].'</td>
</tr>';
$contador++;
}
$codigoHTML.='
</table>
</div>
<pre>
<div align="right">
Total Final:  <input type="text" >
</div>
</pre>
<br/>
<hr/></form>

</body>
</html>
';

$codigoHTML=utf8_decode($codigoHTML);
$dompdf=new DOMPDF();
$dompdf->load_html($codigoHTML);

ini_set("memory_limit","128M");
$dompdf->render();
$dompdf->stream("cotizacion.pdf");
?>

IMG

Я думаю, что ошибка у меня в следующих строках:

Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
echo $datocli['nomempresacli'];
$codigoHTML='
">

Я должен добавить больше строк, как этот, но если он не работает в одном, он не будет работать в большем количестве

кто-нибудь может мне помочь?

0

Решение

Ошибка в том, что вы не связываетесь с окончательным результатом HTML должным образом:

Используйте как это:

Nombre del cliente:  <input type="text" value="'; //HERE I'M TRYING TO CONCATENATE
$codigoHTML.= $datocli['nomempresacli'];
$codigoHTML.= '
">
Nombre del Vendedor  <input type="text" value="">
Proyecto:            <input
0

Другие решения

Других решений пока нет …