<table width="100%"  border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
		  <tr>	
		  <th align='center' class="tit" bgcolor="#999999" >Plan Operativo Institucional&nbsp;<?php 
echo axo($_SESSION["inrena_4"][2]);
?>
  </th>  
		  </tr>
		  <tr><td align="center">Formato NÂș4 </td></tr>
		  <tr>
		    <td align="center">Ficha: Programacion al Nivel de Indicador</td>
		  </tr>
</table>
<br>
<?php 
$quin = axo_quinq($_SESSION["inrena_4"][2]);
$sql = "SELECT * FROM anp_objetivo_estrategico aoe,objetivo_estrategico oe \r\n\t\t\tWHERE oe.id_objetivo_estrategico=aoe.id_objetivo_estrategico \r\n\t\t\t\tAND id_anp='" . $idanp . "' AND id_quinquenio='" . $quin[id] . "'";
$sql_ = new Consulta($sql);
$array_obj = array();
while ($r_ = $sql_->ConsultaVerRegistro()) {
    $array_obj[] = $r_[id_anp_objetivo_estrategico];
}
if ($_GET[id_obj]) {
    $sql = "SELECT * FROM anp_objetivo_estrategico aoe,objetivo_estrategico oe \r\n\t\t\tWHERE oe.id_objetivo_estrategico=aoe.id_objetivo_estrategico \r\n\t\t\t\tAND id_anp_objetivo_estrategico='" . $_GET[id_obj] . "'";
} else {
    $sql = "SELECT * FROM anp_objetivo_estrategico aoe,objetivo_estrategico oe \r\n\t\t\tWHERE oe.id_objetivo_estrategico=aoe.id_objetivo_estrategico \r\n\t\t\t\tAND id_anp_objetivo_estrategico='" . $array_obj[0] . "'";
}
$sql = new Consulta($sql);
$r = $sql->ConsultaVerRegistro();
//print_r($r);
?>
echo axo($_SESSION[inrena_4][2]);
?>
 - <?php 
echo anp($_SESSION['anp']['idanp']);
?>
</strong></th>
      </tr>
    </table><br>
<?php 
if ($_GET[pdf] != 'ok') {
    $fondo = "";
    $sql = $sql . " LIMIT {$reg1},{$tam_pag}";
} else {
    $fondo = "bgcolor='#EEEEEE'";
}
$sql = "SELECT * FROM anp_objetivo_estrategico aoe,objetivo_estrategico oe, anp_objetivo_estrategico_meta m \r\n\t\t\tWHERE aoe.id_objetivo_estrategico=oe.id_objetivo_estrategico \r\n\t\t\t\tAND m.id_anp_objetivo_estrategico=aoe.id_anp_objetivo_estrategico\r\n\t\t\t\tAND id_anp='" . $_SESSION['anp']['idanp'] . "' AND id_axo_poa='" . $_SESSION['inrena_4']['2'] . "'\r\n\t\t\t\tAND id_quinquenio='" . axo_quinq($_SESSION['inrena_4']['2'], '', 'id') . "'\r\n\t\t\tORDER BY codigo_objetivo_estrategico  ";
$Q = new Consulta($sql);
?>
<table border=0 align='center' bgcolor='#FFFFFF' id=listado width='90%' >	
<tr>
<td class=subtitulo>Codigo</td><td class=subtitulo>Objetivo Estratégico</td>
<td class=subtitulo>Indicador</td>
	<td class=subtitulo>Unidad de Medida</td>
	<td class=subtitulo>Meta</td></tr>
<?php 
while ($row = $Q->ConsultaVerRegistro()) {
    $id = $row[id_anp_objetivo_estrategico];
    ?>
<tr class='reg2'>
	<td><?php 
    echo $row[codigo_objetivo_estrategico];
    function reporte_d_prg_an_p()
    {
        /*$sqlprg = "SELECT * FROM anp_objetivo_estrategico aoe,objetivo_estrategico oe, anp_objetivo_estrategico_meta m 
        		WHERE aoe.id_objetivo_estrategico=oe.id_objetivo_estrategico 
        			AND m.id_anp_objetivo_estrategico=aoe.id_anp_objetivo_estrategico
        			AND id_anp='".$_SESSION['anp']['idanp']."' AND id_axo_poa='".$_SESSION['inrena_4']['2']."'
        			AND id_quinquenio='".axo_quinq($_SESSION['inrena_4']['2'],'','id')."'
        		ORDER BY codigo_objetivo_estrategico  ";*/
        $sqlprg = "SELECT * FROM tarea Inner Join asignacion_anp_objetivos \r\n\t\t\t\t\t\t\tON tarea.id_tarea = asignacion_anp_objetivos.id_tarea\r\n\t\t\t\t\t\tInner Join anp_objetivo_especifico aoe \r\n\t\t\t\t\t\t\tON aoe.id_anp_objetivo_especifico=asignacion_anp_objetivos.id_anp_objetivo_especifico\r\n\t\t\t\t\t\tINNER JOIN anp_objetivo_estrategico\taoet\r\n\t\t\t\t\t\t\tON aoet.id_anp_objetivo_estrategico=aoe.id_anp_objetivo_estrategico\r\n\t\t\t\t\t\tINNER JOIN objetivo_estrategico oe \r\n\t\t\t\t\t\t\tON\taoet.id_objetivo_estrategico=oe.id_objetivo_estrategico\r\n\t\t\t\t\t\tINNER JOIN anp_objetivo_estrategico_meta m\r\n\t\t\t\t\t\t\tON m.id_anp_objetivo_estrategico=aoe.id_anp_objetivo_estrategico\t\r\n\t\t\t\t  WHERE\tasignacion_anp_objetivos.id_axo_poa =  '" . $_SESSION['inrena_4']['2'] . "' AND\r\n\t\t\t\t\t\tasignacion_anp_objetivos .id_anp =  '" . $_SESSION['anp']['idanp'] . "' AND id_quinquenio='" . axo_quinq($_SESSION['inrena_4']['2'], '', 'id') . "'" . " GROUP BY aoet.id_anp_objetivo_estrategico ORDER BY codigo_objetivo_estrategico";
        //echo $sqlprg." - ";
        $queryprg = new Consulta($sqlprg);
        $nregs = $queryprg->numregistros();
        /*if ($nregs=='0'){
        			 echo("<strong>El reporte no contiene datos</strong>");
        			 return false;
        		}*/
        //$rowprg=$queryprg->ConsultaVerRegistro();
        while ($rowprg = $queryprg->ConsultaVerRegistro()) {
            $id_programa = $rowprg[id_programa];
            ?>
				<table width="100%" border="0" cellpadding="0" cellspacing="0" 
				bordercolor="#666666" id="programa">
				<tr bgcolor="#CCCCCC">
				<td class="altn" width="5%"><strong><?php 
            echo $rowprg[codigo_objetivo_estrategico] . ".";
            ?>
</strong></td>
				<td width="95%" class="altn"><strong><?php 
            echo ' ' . $rowprg[nombre_objetivo_estrategico];
            ?>
</strong></td>
				</tr>
				  <!--<tr>
					<td colspan="2"><?php 
            echo "<strong>Indicador:&nbsp;&nbsp;</strong>" . $rowprg[indicador_objetivo_estrategico] . "<br><strong>Unidad de Medida:&nbsp;&nbsp;</strong>" . $rowprg[id_unidad_medida];
            ?>
</td>
				  </tr>-->
				</table>			
				<hr />
				<?php 
            $this->reporte_d_prg_an_sp($rowprg);
            ?>
				<br /><?php 
        }
    }