<?php use_helper('UrlFunctions'); ?>
<?php
  header("Content-Type: text/html; charset=iso-8859-1");
  $o_RolBean = new RolBean();
  if($txtNombre!=""){ $o_RolBean->setDescripcion($txtNombre); }
  if($txtRolId!=""){ $o_RolBean->setRolId($txtRolId); }
  if($txtFecIni!=""){ $o_RolBean->setDateBegin($txtFecIni); }
  if($txtFecFin!=""){ $o_RolBean->setDateEnd($txtFecFin); }

  $o_RolBL = new RolBL();
  $a_ObjectBeans = $o_RolBL->getRol($o_RolBean);
  if(is_object($a_ObjectBeans)){
    $tmp = $a_ObjectBeans;
    $a_ObjectBeans = array();
    $a_ObjectBeans[] = $tmp;
  }
  
  ViewResponse::getInstance()->setMethodAjax();
?>
      <table class="marco" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td height="17" align="right" class="pager">
            <table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td>&nbsp;</td>
                <td nowrap><label class="control_des" onClick=""><img src="/images/common/buttons/ctrl_r1_c1.gif" alt="Ir al Primero" width="11" height="10" border="0" align="absbottom" class="control">&nbsp;Start&nbsp;&nbsp;</td>
                <td width="6">&nbsp;</td>
                <td nowrap><label class="control_des" onClick=""><img src="/images/common/buttons/ctrl_r1_c2.gif" alt="Ir al Anterior" width="11" height="10" border="0" align="absbottom" class="control">&nbsp;Previous&nbsp;&nbsp;</td>
                <td nowrap class="control" align="center">(1 - <?=count($a_ObjectBeans)?> of <?=count($a_ObjectBeans)?>)</td>
                <td width="6">&nbsp;</td>
                <!--<td nowrap><label class="control_act" onClick="goto_next();">&nbsp;&nbsp;Next&nbsp;<img src="/images/common/buttons/ctrl_r1_c3.gif" alt="Ir al Siguiente" width="11" height="10" border="0"  align="absbottom" class="control"></td>-->
                <td nowrap><label class="control_des" onClick="">&nbsp;&nbsp;Next&nbsp;<img src="/images/common/buttons/ctrl_r2_c3.gif" alt="Ir al Siguiente" width="11" height="10" border="0"  align="absbottom" class="control"></td>
                <td width="6">&nbsp;</td>
                <td nowrap><label class="control_des" onClick="">&nbsp;&nbsp;End&nbsp;<img src="/images/common/buttons/ctrl_r2_c4.gif" alt="Ir al Ultimo" width="11" height="10" border="0"  align="absbottom" class="control">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table class="grid" width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr height="23">
                <th width="5%" nowrap="nowrap">Nro</th>
                <th width="10%" nowrap="nowrap">RolId</th>
                <th width="10%" nowrap="nowrap">Descripción</th>
                <th width="10%" nowrap="nowrap">Acceso</th>
                <th width="10%" nowrap="nowrap">Fecha</th>
                <th width="10%" nowrap="nowrap">Opciones</th>
              </tr>
              <? if(count($a_ObjectBeans)>0){ ?>
              <? foreach ($a_ObjectBeans as $iKey => $o_objBean){ ?>
              <tr onClick="TR_click(this);">
                <td class="chk"><?=$iKey+1?></td>
                <td align="center"><?=$o_objBean->getRolId()?></td>
                <td><?=$o_objBean->getDescripcion()?></td>
                <td align="center"><?=$o_objBean->getAccesoGlobal()?></td>
                <td align="center"><?=substr($o_objBean->getFechaCreacion(),0,10)?></td>
                <td align="center" valign="top">
                  <img src="/images/common/buttons/btnReview.gif" style="cursor:pointer;" onclick="parent.objMainTab.modalDialog('<?=buildUrl('rol/edit')?>/block/<?=$block?>/RolId/<?=$o_objBean->getRolId()?>',{title:'Edit',width:600,height:250})">&nbsp;
                  <!--<input type="image" name="Eliminar22" src="/images/common/buttons/btnDelete.gif">-->
                </td>
              </tr>
              <? } ?>
              <? }else{ ?>
              <tr>
                <td colspan="7" align="center">No se produjo resultado</td>
              </tr>
              <? } ?>
            </table>
          </td>
        </tr>
        <tr>
          <td>Total Registros: <?=count($a_ObjectBeans)?></td>
        </tr>
      </table>