<?php

require_once 'bs_info.php';
require_once '../../../../app/model/bs_info_col.php';

require_once("../../../../dompdf/dompdf_config.inc.php");
require_once "../../../../dompdf/www/functions.inc.php";


$ob=new InfoCol();
$arr=$obj->proceso();
$row=$obj->proceso2();
$obj->disconnect();

$ob1=new Con1();
$arr1=$ob1->proceso();

$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>Tipos de Faltas</title>

</head>

<body>";

$html.="<br><br><center><table width='90%' border='0' align='center'>";

$html.="<tr>";
$html.="<td align='right' rowspan='3'><img src='../../../../fotografias/".$arr[1]."' width='70' height='70'></td>";
$html.="<td style='font-size: 14px; text-align:center;'>".$arr[2]."</td></tr>";

$html.="<tr><td  style='font-size: 17px; text-align:center;'><b>".$arr[0]."</b></td></tr>";
$html.="<tr><td style='font-size: 14px; text-align:center;' >".$arr[5]."</td></tr>";

$html.="</table></center><br>";

$html.="<center><b>DESCRIPCI&Oacute;N DE FALTAS</b></center><br>";

   $cadena="select * from tipo_falta order by orden";
   $cadena=$obj->consulta($cadena);

   $s='';

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

           $cadena1="select * from faltas where tipo_falta='".$row['codigo']."' order by orden";
           $cadena1=$obj->consulta($cadena1);

           $s.="<BR><BR><CENTER>FALTAS ".$row['descripcion']."</CENTER>";

           $s.="<BR><table align='center' border='1' cellspacing='0' width='90%'>";
           $s.="</tr>";
           $s.="<tr ALIGN='CENTER' > <td width='10%'><b>CODIGO</b></td> <td  width='90%'><b>DESCRIPCI&Oacute;N</b></td> </tr>";

           while($row1 = $obj->fetch_assoc($cadena1)){

                $s.="<tr>";

                $s.="<td align='center' style='font-size: 12px'>".$row1['codigo']."</td>";
                $s.="<td style='font-size: 12px;'>&nbsp;". ($row1['descripcion'])."</td>";
                $s.="</tr>";

           }
           
           $s.="</table>";
    }




$obj->disconnect();

$html.=$s."</body></html>";


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

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

?>