<?php
session_start();
require_once("clases/covensol_fop_c_formulacion.php");
$objfop=new covensol_fop_c_formulacion('');
$objfop->io_conexiones->decodificar_post();
$datos = $objfop->io_conexiones->asignar_post();

$resultado = $objfop->ConsultaEp3($datos);
?>
<link href="../shared/css/catalogos.css" rel="stylesheet" type="text/css">
<link href="../shared/css/ventanas.css" rel="stylesheet" type="text/css">
<link href="../shared/css/general.css" rel="stylesheet" type="text/css">
<link href="../shared/css/tablas.css" rel="stylesheet" type="text/css">
<?php
$ancho[0] = 40; 
$ancho[1] = 60;
$ancho[2] = 40;
$ancho[3] = 60;
$ancho[4] = 60;
$ancho[5] = 600;

$ancho_total = array_sum($ancho);
$nrofila=0;
?>

<table width="<?php echo $ancho_total; ?>" border="0" cellpadding="0" cellspacing="0"  class='fondo-tabla'>
  <tr class="titulo-celda">
     <td width="<?php echo $ancho[0]; ?>"><div align="center">AÑO</div></td>
     <td width="<?php echo $ancho[1]; ?>"><div align="center">COD. P/A</div></td>
     <td width="<?php echo $ancho[2]; ?>"><div align="center">TIPO</div></td>
    <td width="<?php echo $ancho[3]; ?>"><div align="center">COD. AE</div></td>
     <td width="<?php echo $ancho[4]; ?>"><div align="center">COD</div></td>   
	 <td width="<?php echo $ancho[5]; ?>"><div align="center">DENOMINACIÓN</div></td>  
  </tr>
  <?php foreach($resultado['rs'] as $fila) { ?>
          <?php
		  	$seguridad = true;	
			if($seguridad){	
				$dato = $objfop->FormatLonCodEstPro($fila);
				$aceptar="aceptar('".$fila['codestpro1']."','".$fila['estcla']."','".$fila['anopresup']."','".$fila['codplangob']."','".$nrofila."','".$fila['codestpro2']."','".$fila['codestpro3']."','".$dato['codestpro1']."','".$dato['codestpro2']."','".$dato['codestpro3']."')";			
				//$montotpry = number_format($dato['montotpry'],2,',','.');
		   ?>    
                  <tr id="consulta">
				    <td width="<?php echo $ancho[0]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['anopresup'];?></a></div></td>
                    <td width="<?php echo $ancho[1]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['codestpro1'];?></a></div></td>
                    <td width="<?php echo $ancho[2]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['estcla'];?></a></div></td>
                    <td width="<?php echo $ancho[3]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['codestpro2'];?></a></div></td>
					<td width="<?php echo $ancho[4]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['codestpro3'];?></a></div></td>
                    <td width="<?php echo $ancho[5]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $dato['denestpro1'].'<br>'.$dato['denestpro2'].'<br>'.$dato['denestpro3'];?></a></div></td>
                  </tr>
                  <tr>
                    <td height="1" bgcolor="#BBBBBB" colspan="4">
					  <input name="hdenestpro3<?php echo $nrofila;?>" type="hidden" id="hdenestpro3<?php echo $nrofila;?>"  value="<?php echo $dato['denestpro3']; ?>"/>
                   	</td>
                  </tr>
          <?php }
		 		$nrofila++; 
		  ?>
  <?php }  ?>
</table>
    