<?php
require_once("dompdf_config.inc.php");
require_once('../class_folder/dao/sigesp_spe_inteprogDao.php');
class Report
{
    public function ReporteIntegracion($data)
    {
        $html ="<html><body>";
        $html .="<table>";  
        while(!$data->EOF)
        {
            $html.= "
             <tr>
                <td>Estructura del Plan</td>
            </tr>
            <tr>
                    <td>C&oacute;digo</td>
                    <td>Denominaci&oacute;n</td>
                </tr>
                <tr>
                    <td>{$data->fields['codplan']}</td>
                    <td>{$data->fields['denplan']}</td>
                </tr>
                 <tr>
                <td>Estructura Presupuestaria</td>
            </tr>
            <tr>
                    <td>C&oacute;digo</td>
                    <td>Denominacion</td>
                </tr>
                <tr>
                    <td>{$data->fields['codigo']}</td>
                    <td>{$data->fields['descripcion']}</td>
                </tr>
             <tr>
                <td>Estructura Administrativa</td>
            </tr>
            <tr>
                    <td>C&oacute;digo</td>
                    <td>Denominacion</td>
                </tr>
                <tr>
                    <td>{$data->fields['coduac']}</td>
                    <td>{$data->fields['denuac']}</td>
                </tr>
                
            <tr>
                <td>Ubicaci&oacute;n Geogr&aacute;fica</td>
            </tr>
            <tr>
                    <td>C&oacute;digo</td>
                    <td>Denominacion</td>
                </tr>
                <tr>
                    <td>{$data->fields['codub']}</td>
                    <td>{$data->fields['denominacion']}</td>
                </tr>";
            
            $data->MoveNext();
        }
        $html.="</table>";
        $html.="</body></html>";     
        $this->MostrarReporte($html,"planpre2.pdf");
    }
    public function MostrarReporte($html,$nombrereporte)
    { 
        $dompdf = new DOMPDF();       
        $dompdf->load_html($html);
        $dompdf->render();
        $dompdf->stream($nombrereporte);   
    }
}
$r=new Report();
$oInte = new IntegracionPre();
$datos  = $oInte->LeerTodos();
$r->ReporteIntegracion($datos);
?>