<?php use_helper('UrlFunctions'); ?>
<?php

if(isset($control)){

  $o_RolBean = new RolBean();
  $o_RolBean->setRolId($txtRolId);
  $o_RolBean->setDescripcion($txtDesc);
  $o_RolBean->setAccesoGlobal($cmbAcceso);
  
  $o_RolBL = new RolBL();
  $o_RolBL->modificarEstadoRol($o_RolBean);
  
  if($o_RolBean){
  ?>
  <script>
  <? if($o_RolBean->getError()){ ?>
    parent.document.getElementById('contentResultxx').contentWindow.elementLoad.show(undefined,'&nbsp;&nbsp;&nbsp;<?=$o_RolBean->getMensaje()?>');
    parent.document.getElementById('contentResultxx').contentWindow.setTimeout('elementLoad.hide()',5000);
    parent.objMainTab.windowsCloseAll();
  <? }else{ ?>
    parent.document.getElementById('contentResultxx').contentDocument.getElementById('txtRolId').value = "<?=$o_RolBean->getRolId()?>";
    parent.document.getElementById('contentResultxx').contentWindow.elementLoad.show(undefined,'&nbsp;&nbsp;&nbsp;Se Ingreso el Rol : <?=$o_RolBean->getRolId()?>');
    parent.document.getElementById('contentResultxx').contentWindow.setTimeout('elementLoad.hide()',5000);
    parent.document.getElementById('contentResultxx').contentWindow.findControl();
    parent.objMainTab.windowsCloseAll();
  <? } ?>
  </script>
  <?php
  }

}

$o_RolBean = new RolBean();
$o_RolBean->setRolId($RolId);

$o_RolBL = new RolBL();
$o_RolBean = $o_RolBL->getRol($o_RolBean);

?>

<img src="/images/common/spacer.gif" width="10">
<table class="cuerpo" width="98%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="0">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td class="titleBody">
            <li>Rol</li><span class="subtitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:::&nbsp;Ficha Rol (Edición)</span></td>
          <td align="right" valign="baseline">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top">
      <form id="form1" name="form1" method="POST" onsubmit="validatePass();">
        <input type="hidden" name="control" value="1">
      <table hspace="20px" class="marco" width="100%">
        <tr>
          <td valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="50%" valign="top">
                  <table class="SubCabecera" width="100%" border="0" cellpadding="0" cellspacing="2">
                    <tr>
                      <td nowrap="nowrap" width="14%"><label class="label req" for="txtRolId">Rol Id : </label></td>
                      <td nowrap="nowrap" width="86%"><input class="text required" name="txtRolId" id="txtRolId" type="text" maxlength="16" size="16" value="<?=$o_RolBean->getRolId()?>"></td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap"><label class="label req" for="txtDesc">Descripción : </label></td>
                      <td nowrap="nowrap"><input class="text required" name="txtDesc" id="txtDesc" type="text" maxlength="30" size="40"  value="<?=$o_RolBean->getDescripcion()?>"></td>
                    </tr>
                  </table>
                </td>
                <td width="50%" valign="top">
                  <table class="SubCabecera" width="100%" border="0" cellpadding="0" cellspacing="2">
                    <tr>
                      <td width="14%" nowrap="nowrap"><label class="label req" for="cmbAcceso">Acceso : </label></td>
                      <td width="86%" nowrap="nowrap">
                        <select name="cmbAcceso" id="cmbAcceso" class="validate-selection">
                          <option value=""> - Seleccione - </option>
                          <option value="Y" <? if($o_RolBean->getAccesoGlobal()=="Y"){echo "selected";} ?> >Global</option>
                          <option value="N" <? if($o_RolBean->getAccesoGlobal()=="N"){echo "selected";} ?> >Restrictivo</option>
                        </select>
                      </td>
                    </tr>
                    <tr>
                      <td nowrap="nowrap"><label class="label0" for="">&nbsp;</label></td>
                      <td nowrap="nowrap">&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td width="50%" valign="top">&nbsp;

                </td>
                <td width="50%" valign="top">&nbsp;
                </td>
              </tr>
            </table>
        
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td><img src="/images/common/spacer.gif" width="10"></td></tr>
              <tr>
                <td align="center">
                  <input class="button" type="submit" value="Actualizar">
                  <input class="button" type="button" value="Cancelar" onclick="parent.objMainTab.windowsCloseAll();"/>
                </td>
              </tr>
            </table>
            <tr><td><img src="/images/common/spacer.gif" width="10"></td></tr>
          </td>
        </tr>
      </table>
      </form>
			<script type="text/javascript">
				function formCallback(result, form) {
					window.status = "valiation callback for form '" + form.id + "': result = " + result;
				}
				var valid = new Validation('form1', {immediate : true});
			</script>
    </td>
  </tr>
  
</table>