<?php use_helper('UrlFunctions');?>
<script>
$.ajaxSetup({ cache: false });

findControl = function()
{  
  concatValueStr();
}
concatValueStr = function()
{
  strFormSerialize = $('form').serialize();
  //alert(strFormSerialize)
  if(arguments[0]){
    strFormSerialize += '&'+arguments[0];
  }
  executeFind(strFormSerialize);
}
executeFind = function(str)
{ 
  url = "<?=buildUrl('entidad/grid', "block=".$block)?>";
    
  $o_elm = $( "#resultGrtid" );
  $o_elm.load(
                url, 
                str, 
                function(response, status, xhr)
                {
                  if (status == "error") 
                  {
                    var msg = "Sorry but there was an error: ";
                    alert(msg + xhr.status + " " + xhr.statusText);
                  }
                }
             );
}
cargandoImagenSerch = function()
{
	//disabledWin.setPathImage('/images/common/progress.gif');
	//disabledWin.show(true,true,'resultGrtid');
}
</script>
<script>

deleteRegistro = function(id){
  //buildUrl('aldia/delete/id/'block=001'
  if(confirm("¿Esta seguro de eliminar la ficha Tema con Id : "+id+ " ?")){
      //objMainTab.reqBody('<? //=buildUrl('aldia/add')?>','block=001&delete=1&id='+id);   
      parent.objMainTab.reqBody('<?=buildUrl('entidad/delete')?>','&delete=1&cod=jj&id='+id);
  }
  
}

</script>

<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 5px; margin-bottom: 5px;">
  <tr>
    <td class="titleBody"><li>Lista de Entidades</li></td>
     <div id="message"></div>
    <td align="right">
      <img src="/images/common/iconos/adicionar.png" title="Nueva Entidad" onclick="objMainTab.modalDialog('<?php echo buildUrl('entidad/add','block=001')?>',{title:'Nueva Entidad',width:490,height:320,nameOtherWindow:'ov'})" title="Nueva Entidad"/>&nbsp;
    </td>
  </tr>
</table>

<form action="" method="post" name="form1" id="form1">
  <input type="hidden" name="rand" value="<?=rand(0,99999)?>">
  <table width="100%" cellspacing="0" cellpadding="0" border="0" class="marco" style="padding-left: 10px;">
    <tr>
      <td colspan="2"><img width="1" height="4" src="/images/common/spacer.gif"></td>
    </tr>
    
    <tr>
      <td width="100%" nowrap="nowrap">
         <table width="30%" cellspacing="4" cellpadding="0" border="0" class="SubCabecera">
          <tr>
            <td nowrap="nowrap"><div class="field-label"><label for="sRuc" class="label">Ruc:</label></div></td>
            <td nowrap="nowrap"><input type="text" class="text" name="rucdni" id="rucdni" maxlength="11"/></td>
       
            <td><div class="field-label"><label for="sNombre" class="label">Nombre:</label></div></td>
            <td nowrap="nowrap"><input type="text" class="text" name="nombrecompleto" id="nombrecompleto"/></td>
         
            <td nowrap="nowrap"><div class="field-label"><label for="sRuc" class="label">Estado:</label></div></td>
             <td nowrap="nowrap"><select name="estado" id="estado" type="text" class="combo"/> 
			      <option value="" >Seleccione</option>
			      <option value="A">Activo</option>
			      <option value="I">Inactivo</option> 
			 </select>
		   </td> 
		   <td>
		   <!--<input type="button" onclick="findControl();" value="Buscar" id="btn_frmFindFeaturesTpl" class="button">-->
		   <img src="/images/common/iconos/buscar.png" title="Buscar" onclick="findControl();">
		   </td>
		   
          </tr>
        </table>
      </td>
    </tr>
   
    <tr>
      <td colspan="2"><img width="1" height="4" src="/images/common/spacer.gif"></td>
    </tr>
  </table>
</form>
<div id="resultGrtid">
</div>
<?if($msg){?>
 <script>
    $('#message').html("<?=$msg?>").show('slow');
    setTimeout("$('#message').hide(1000)",3000);
  </script>
<? }?>
<script>
	findControl();
</script>
