Problems with pdf when printing different records of a table

0

I only want that by means of a select you choose the id of the table and then through the library show your records in pdf

    <div class="formL">
             <form action="constancia.php" name="formulario" method="POST">

                 <select name="seleccion" id="selecion">
                         <option value="0"></option>
                          <?php

                             foreach ($eventos as $evento) {
                             echo '<option value="'.$evento['id_Eventos'].'">'.$evento['titulo'].'</option>';
                             }
                           ?>

                 <input class="loginF" name="buscar" id="btn" type="submit" value="Login">
             </form> 

</div>

    include('../pdf/mpdf.php');

  $query= "SELECT * FROM asistencia WHERE id_eventos = '$seleccion'";
  $prepare = $link->prepare($query);
  $prepare->execute();
  $resultSet = $prepare->get_result();
  while($asistencia[] = $resultSet->fetch_array());
  $resultSet->close();
  $prepare->close();
  $link->close();
   $html= '

aquí el php

    <?php

   $html= '
         <div class="main">
             <div class="publicaciones">
             <table>
             <thead>
                  <tr>
                              <td  class="td2"> ci </td> 
                              <td  class="td2"> nombre </td>
                              <td  class="td2"> apellido </td> 
                              <td  class="td2"> genero </td>
                              <td  class="td2"> mail </td>
                              <td  class="td2"> telefono </td>
                              <td  class="td2"> direccion </td>
                              <td  class="td2"> institucion</td>
                             </tr>
            </thead>
            <tbody>';



                 foreach ($asistencia as $publicacion):
                    $html.='




                            <tr>
                              <td class="td">'.$publicacion['ci'].'</td> 
                              <td class="td">'.$publicacion['nombre'].'</td>
                              <td class="td">'.$publicacion['apellido'].'</td> 
                              <td class="td">'.$publicacion['genero'].'</td>
                              <td class="td">'.$publicacion['mail'].'</td>
                              <td class="td">'.$publicacion['telefono'].'</td>
                              <td class="td">'.$publicacion['direccion'].'</td>
                              <td class="td">'.$publicacion['institucion_perteneciente'].'</td>
                             </tr>
                             ';
                    endforeach;



             $html.='</tbody> 
                         </table> 
                         </div>
             </div>
         </div>
     </body>';
   $mpdf = new mPDF('c','A4');
   $mpdf->writeHTML($html);
    $mpdf->output('reporte.pdf', 'I');
}else{

}
}
?>

is within a validation, I have also tried with inner join and I get an error or I may not know how to do it. As it looks, it loads the pdf but it does not show information. Maybe that's not the correct syntax to do it I think

    
asked by AZX 16.06.2018 в 19:19
source

0 answers