html to PDF conversion libraries print BD php variables?

0

The question is self explanatory.

I have tested some libraries, but they are giving error. I believe it is because there is PHP in the code. Is it possible to print the page completely?

Below the code to be printed in pdf:

    <body>
   <?php 
    $query = $conect -> query ("SELECT * FROM os INNER JOIN problema INNER JOIN setor ON os.Id_problema = problema.id_problema and os.id_setor = setor.id_setor WHERE os.id_os = '{$_GET['id']}'"); 
        while ($temp = $query -> fetch_assoc()){?>
            <div id="cabecalho">
                <div id="c1"><img src="img/logo3.png" height="100%" border-right=""></div>
                <div id="c2">
                <B>ORDEM DE SERVIÇO<BR>Nº <?php echo str_pad($_GET['id'], 6,"0",STR_PAD_LEFT)?></B>
            </div>
            <div id="c3"><img src="img/lg.png" height="100%" align="right"></div>
        </div>
        <div class="campo">
            <div align="center" style="margin-bottom: 1%"><font size="5"><B>ATENDIMENTO</B></font></div>
            <div style="display: inline-block; border-right: 1px solid  #7C76F6; width: 48%; padding-left: 1%; vertical-align:top">
                <b>Setor:</b> <?PHP echo mb_convert_case($temp['nome'], MB_CASE_TITLE, 'UTF-8')?><br>
                <b>Funcionário solicitante:</b> <?PHP echo mb_convert_case($temp['requisitante'], MB_CASE_TITLE, 'UTF-8')?><br>
                <b>Data de abertura:</b> <?PHP echo date('d-m-Y', strtotime($temp['data_abertura']))?><br>
                <b>Hora de abertura:</b> <?PHP echo date('H:i', strtotime($temp['data_abertura']))?><br>
                <b>Contato:</b> <?PHP echo $temp['contato']?><br>
                <?php if ($temp['tecnico'] != null){ echo "<b>Técnico designado: </b>".mb_convert_case($temp['tecnico'], MB_CASE_TITLE, 'UTF-8')."<br>";} ?>                   
            </div>
            <div style="border-left: 1px solid #7C76F6;width: 48%; display: inline-block; padding-left: 1%; vertical-align:top">
                <b>Problema:</b> <?PHP echo $temp['problema']?><br>
                <b>Descrição:</b> <?PHP echo $temp['descricao']?><br>
            </div>
        </div>


        ?>   
            <a href="home.php";>
                <button  style="margin-right: 50%; margin-left: 5%" class="bt2" >Voltar</button>
            </a>
            <a href= "imprimir.php?id=<?php echo $_GET['id']?>">
                <button  class="bt2" >Imprimir</button>
            </a>
</body>
    
asked by anonymous 28.03.2018 / 19:22

0 answers