<?php
require_once '../../../app/model/db.class.php';
require_once("../../../dompdf/dompdf_config.inc.php");
require_once "../../../dompdf/www/functions.inc.php";


   $obj = new database();
   $obj->conectar(); $obj->consulta("set names 'utf8'");

    
    $cadena="select cedula, nombres, direccion, telefono from profesores order by nombres";
  
   $cadena=$obj->consulta($cadena);



    $s="<BR><table border='1' class='normal' cellspacing='0' cellpadding='6' align='center' id='font' >";
    $s.="</tr>";
    $s.="<tr ALIGN='CENTER' > <td><b>No.</b></td> <td><b>CODIGO</b></td> <td  width='200'><b>APELLIDOS Y NOMBRES</b></td><td width='38'>DIRECCION</td><td width='38'>TELEFONO</td> </tr>";

    $i=1;

    while($row = $obj->fetch_assoc($cadena)){                 

        $s.="<tr>";

        $s.="<td align='center' width='5'>".$i."</td>";
        $s.="<td align='center' width='5' style='font-size: 12px'>".$row['cedula']."</td>";
        $s.="<td width='25%' style='font-size: 12px;'>&nbsp;". ($row['nombres'])."</td>";
        $s.="<td>".$row['direccion']."</td>";
        $s.="<td>".$row['telefono']."</td>";
     
        $s.="</tr>";
       
        $i++;
    }
  
    $s.="</table>";

     
     $html="<html>
<head><meta http-equiv='expires' content='0'><meta http-equiv='Cache-Control' content='no-cache'><meta http-equiv='Pragma' CONTENT='no-cache'>
<title>Evaluaci&oacute;n</title>

<style>
  
       .normal {

          border: 1px solid #000;
          border-collapse: collapse;
        }
        .normal th, .normal td {
          border: 1px solid #000;
        }
        
       #font{
            font-size:11px;
        }
        
        .font2{
            font-size:12px;
        }
        
        
</style>
</head>
<body>
<!--<table width='100%'>
<tr>
<td width='79%'><img src='../../../imagenes/encabezado.jpg' width='500' height='50'></td>
<td><img src='../../../imagenes/escudo.png' width='50' height='50'></td>

</tr>
</table>-->

<center>
<table align='center' border='0' >

<tr>
  <td colspan='8' bgcolor=#808080><center><font color='#ffffff' size='4' ><b>LISTADO DE DOCENTES</b></font></center></td>
</tr>

</table>
</center>
<br>
".$s."
</body>
</html>";
//     ".$s."
     
//    echo $html;
 //echo $mostrar;

  $obj->disconnect();


 $dompdf = new DOMPDF();     
$dompdf->load_html($html);
$dompdf->set_paper('A4', 'portrait');
$dompdf->render();

$dompdf->stream("listado.pdf", array("Attachment" => false));

//$dompdf = new DOMPDF();     
//$dompdf->load_html($html);
//$dompdf->set_paper("letter", $orientation = "landscape");
//$dompdf->render();
//
//
//$dompdf->stream("listado_".$descurso['descripcion'].".pdf", array("Attachment" => false));



?>