<?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->consulta_sucursal($opciones);


?>
<link href="../shared/css/catalogos.css" rel="stylesheet" type="text/css">
<?php 
$ancho[1] = 60;
$ancho[2] = 330;
$ancho[3] = 60;
$ancho[4] = 30;
$ancho_total = array_sum($ancho);
$clave=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[1]; ?>"><div align="center">COD</div></td>
     <td width="<?php echo $ancho[2]; ?>"><div align="center">NOMBRE</div></td>
     <td width="<?php echo $ancho[3]; ?>"><div align="center">SIGLAS</div></td>
     <td width="<?php echo $ancho[4]; ?>"><div align="center">MATRIZ</div></td>    
  </tr>
  <?php foreach($resultado['rs'] as $fila) { ?>
          <?php
		  	$seguridad = true;	
			if($seguridad){	
			$clave++;
			
			$objcxc->codintper = $fila['codsuc'];		
			if(!$objcxc->obtSegCxc()){continue;}
			
			$aceptar="aceptar('".$fila['codsuc']."','".								 
								 $fila['sucmatriz']."','".
								 $fila['sigsuc']."','".
								 $fila['codseriesuc']."','".
								 $fila['nrocontinisuc']."','".
								 $clave."')";
		   ?>    
                  <tr id="consulta">
                    <td width="<?php echo $ancho[1]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['codsuc'];?></a></div></td>
                    <td width="<?php echo $ancho[2]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['nomsuc'];?></a></div></td>
                    <td width="<?php echo $ancho[3]; ?>"><div align="left"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['sigsuc'];?></a></div></td>
                    <td width="<?php echo $ancho[4]; ?>"><div align="center"><a href="#" onClick="<?php echo $aceptar; ?>"><?php echo $fila['sucmatriz'];?></a></div></td>
                  </tr>
                  <tr>
                    <td height="1" bgcolor="#BBBBBB" colspan="3">
                    			<input name="hnomsuc<?php echo $clave;?>" type="hidden" id="hnomsuc<?php echo $clave;?>"  value="<?php echo $fila['nomsuc'] ?>"/>
                     	</td>
                  </tr>
          <?php } ?>
  <?php }  ?>
</table>