<?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->ConsultaActividad($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[1] = 80;
$ancho[2] = 500;
$ancho[3] = 80;
$ancho[4] = 80;
$ancho[5] = 120;
$ancho[6] = 120;
$ancho[7] = 120;
$ancho[8] = 120;
$ancho_total = array_sum($ancho);
$clave=1;
?>

<table width="<?php echo $ancho_total; ?>" border="0" cellpadding="0" cellspacing="0"  class='fondo-tabla'>
  <tr class="titulo-celda">
     <td width="<?php echo $ancho[1]; ?>"><div align="center">COD</div></td>
     <td width="<?php echo $ancho[2]; ?>"><div align="center">DESCRIPCIÓN</div></td>
     <td width="<?php echo $ancho[3]; ?>"><div align="center">UNIDAD</div></td>
     <td width="<?php echo $ancho[4]; ?>"><div align="center">META</div></td>
     <td width="<?php echo $ancho[5]; ?>"><div align="center">UBIC.</div></td>
     <td width="<?php echo $ancho[6]; ?>"><div align="center">PAIS</div></td>
     <td width="<?php echo $ancho[7]; ?>"><div align="center">ESTADO</div></td>
     <td width="<?php echo $ancho[8]; ?>"><div align="center">CIUDAD</div></td>    
  </tr>
  <?php foreach($resultado['rs'] as $fila) { ?>
          <?php
		  	$seguridad = true;	
			if($seguridad){	
			
			$aceptar="aceptar('".$fila['codact']."','".
							     $fila['codunimedact']."','".
								 number_format($fila['metact'],2,',','.')."','".
								 $fila['codpaiact']."','".
								 $fila['codestact']."','".
								 $fila['codciuact']."','".								 
								 number_format($fila['pfs1'],2,',','.')."','".
								 number_format($fila['pfs2'],2,',','.')."','".
								 number_format($fila['pfs3'],2,',','.')."','".
								 number_format($fila['pfs4'],2,',','.')."','".								 
								 $clave."')";
 ?>    
                  <tr id="consulta">
                    <td width="<?php echo $ancho[1]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['codact'];?></a></div></td>
                    <td width="<?php echo $ancho[2]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['actividad'];?></a></div></td>
                    <td width="<?php echo $ancho[3]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['desunimed'];?></a></div></td>
                    <td width="<?php echo $ancho[4]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo  number_format($fila['metact'],2,',','.');?></a></div></td>
                    <td width="<?php echo $ancho[5]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['desubigeoact'];?></a></div></td>
                    <td width="<?php echo $ancho[6]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['despai'];?></a></div></td>
                    <td width="<?php echo $ancho[7]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['desest'];?></a></div></td>
                    <td width="<?php echo $ancho[8]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['desciu'];?></a></div></td>
                  </tr>
                  <tr>
                    <td height="1" bgcolor="#BBBBBB" colspan="3">
                    			<input name="hactividad<?php echo $clave;?>" type="hidden" id="hactividad<?php echo $clave;?>"  value="<?php echo $fila['actividad']; ?>"/>
                                <input name="hdesunimed<?php echo $clave;?>" type="hidden" id="hdesunimed<?php echo $clave;?>"  value="<?php echo $fila['desunimed']; ?>"/>
                                <input name="hdesubigeoact<?php echo $clave;?>" type="hidden" id="hdesubigeoact<?php echo $clave;?>"  value="<?php echo $fila['desubigeoact']; ?>"/>
                                <input name="hdespai<?php echo $clave;?>" type="hidden" id="hdespai<?php echo $clave;?>"  value="<?php echo $fila['despai']; ?>"/>
                                <input name="hdesest<?php echo $clave;?>" type="hidden" id="hdesest<?php echo $clave;?>"  value="<?php echo $fila['desest']; ?>"/>
                                <input name="hdesciu<?php echo $clave;?>" type="hidden" id="hdesciu<?php echo $clave;?>"  value="<?php echo $fila['desciu']; ?>"/>
                     	</td>
                  </tr>
          <?php } ?>
  <?php 
  	$clave++;
  }  
  ?>
</table>
    