<?php
session_start();
require_once($ruta."clases/covensol_cxc_c_cuentasxcobrar.php");
$objcxc = new covensol_cxc_cuentasxcobrar();
$objcxc->io_conexiones->decodificar_post();
$opciones = $objcxc->io_conexiones->asignar_post();
$resultado = $objcxc->ConsultaServicios($opciones);
?>
<link href="../shared/css/catalogos.css" rel="stylesheet" type="text/css">
<?php 
$ancho[1] = 120;
$ancho[2] = 250;
$ancho[3] = 60;
$ancho[4] = 140;
$ancho[5] = 60;
$ancho[6] = 60;

$ancho_total = array_sum($ancho);

$nro = 1;

?>

<style type="text/css">
<!--
.Estilo2 {color: #000000}
-->
</style>
<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">Código Art.</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">Tipo</div></td> 
     <td width="<?php echo $ancho[5]; ?>"><div align="center">Precio</div></td> 
     <td width="<?php echo $ancho[6]; ?>"><div align="center">iva</div></td>              
  </tr>
    <?php foreach($resultado['rs'] as $fila){ ?>
          <?php
		  	$seguridad = true;	
			if($seguridad or $_SESSION['autent_administrador']){	 ?>
			   <?php 
                
                   $aceptar="aceptar('".$nro."',
                                     '".$fila['codser']."',
                                     '".number_format($fila['porcentaje_iva'],2,',','.')."',
                                     '".$fila['codunimed']."',
                                     '".number_format($fila['preser'],2,',','.')."')";
                    
               ?>    																										
                  <tr id="consulta">
                    <td width="<?php echo $ancho[1]; ?>" valign="top"><div align="left"><a href="#" onClick="<?php echo $aceptar;?>"><div style="color:#0066FF;"><?php echo $fila['codser'];?></div></a></div></td>
                  	<td width="<?php echo $ancho[2]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar;?>"><?php echo $fila['denser'];?></a></div></td>
                    <td width="<?php echo $ancho[3]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar;?>"><?php echo $fila['denunimed'];?></a></div></td>
                    <td width="<?php echo $ancho[4]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar;?>"><?php echo $fila['dentipser'];?></a></div></td>
                    <td width="<?php echo $ancho[5]; ?>"><div align="right"><a href="#" onClick="<?php echo $aceptar;?>"><?php echo number_format($fila['preser'],2,',','.');?></a></div></td>
                    <td width="<?php echo $ancho[6]; ?>"><div align="right"><a href="#" onClick="<?php echo $aceptar;?>"><?php echo number_format($fila['porcentaje_iva'],2,',','.');?></a></div></td>
                  </tr>
                  <tr>
                    <td height="1" bgcolor="#BBBBBB" colspan="3">
                    			<input name="hdenser<?php echo $nro;?>" type="hidden" id="hdenser<?php echo $nro;?>"  value="<?php echo $fila['denser']; ?>"/>
                                <input name="hdenunimed<?php echo $nro;?>" type="hidden" id="hdenunimed<?php echo $nro;?>"  value="<?php echo $fila['denunimed']; ?>"/>
                                <input name="hdentipser<?php echo $nro;?>" type="hidden" id="hdentipser<?php echo $nro;?>"  value="<?php echo $fila['dentipser']; ?>"/>
                  	</td>
                  </tr>
          <?php 
		  $nro++;
		  } ?>
  <?php } ?>
</table>
    