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

<script>
findControl = function()
{
    concatValueStr();
}
concatValueStr = function()
{
    strFormSerialize = returnQueryStringForm();
    if(arguments[0])
    {
        strFormSerialize += '&'+arguments[0];
    }
    executeFind(strFormSerialize);
}
executeFind = function(str)
{
    url = "<?php echo buildUrl('hpt/grid', "block=006") ?>";
    cargandoImagenSerch();
    new Ajax.Updater
    (
        'resultGrid', 
        url,
        {
            method      : 'get',
            parameters  : str,
            evalScripts    : true,
            onSuccess   : function(transport, json)
            {
                
            },
            onFailure  : function(transport)
            {
                alert("Error ("+transport.status+"): "+transport.statusText);
            },
            onComplete : function(transport)
            {
                
            }
        }
    );
}
returnQueryStringForm = function ()
{
    cadenaFormulario = $('form1').serialize();
    return(cadenaFormulario);
}
cargandoImagenSerch = function()
{
    //disabledWin.setPathImage('/images/common/progress.gif');
    disabledWin.show(true,true,'resultGrid');
}

cambiarEstadoCalidadAgua = function( i_Id, s_Estado )
{
    var x = confirm( "Esta seguro el Estado?" );
    if( x )
    {
        var url = '<?php echo buildUrl('ajax/requestHpt') ?>';
        var pars = 'block=001&sTypeRequest=cambiarEstadoCalidadAgua&s_Estado='+s_Estado+'&i_Id='+i_Id;
        ejecuarAjaxUpdater( url, 'elm_ResultAjax', pars );
    }
}
</script>

<table width="100%" cellspacing="0" cellpadding="0" border="0" style="margin-top: 5px; margin-bottom: 5px;">
    <tr>
        <td class="titleBody"><li>Credito con cronograma</li></td>
        <td align="right">
            &nbsp;
          <!--<input type="button" class="button" value="Nuevo" onclick="location.href='<?php echo buildUrl( 'hpt/addedit', 'block=006' )?>'" title="Nuevo"/>-->
        </td>
    </tr>
</table>
<?php
//Mercados
$o_ClienteSystemClass = new ClienteSystemClass(new TipoNegocioBean());
$a_Mercado = $o_ClienteSystemClass->LoadMercadoXRol();
?>
<form action="" method="post" name="form1" id="form1">
    <table width="100%" cellspacing="0" cellpadding="0" border="0" class="marco" style="padding-left: 10px;">
    
        <tr>
            <td width="25%" nowrap="nowrap">
                <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                    <tr>
                        <td width="35%" nowrap="nowrap"><div class="field-label"><label class="label" for="txtDni">DNI</label></td>
                        <td nowrap="nowrap">
                            <input type="text" class="text" name="txtDni" id="txtDni" />
                        </td>
                    </tr>
                </table>
            </td>
            <td width="25%" nowrap="nowrap">
                <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                    <tr>
                        <td width="35%" nowrap="nowrap"><label class="label" for="txtNombre">Nombres</label></td>
                        <td nowrap="nowrap">
                            <select name="cboTipoNombre" id="cboTipoNombre" type="text" class="combo" onchange=""/> 
                                <option value="AP" > - Apellido Paterno- </option>
                                <option value="AM" > - Apellido Materno- </option>
                                <option value="NO" > - Nombres- </option>
                            </select>
                            <input name="txtNombre" id="txtNombre" type="text"  size="35" class="text"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
        <tr>
            <td width="25%" nowrap="nowrap">
                <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                    <tr>
                        <td width="35%" nowrap="nowrap"><label class="label" for="txtMercado">Mercado</label></td>
                        <td nowrap="nowrap">
                            <select name="cboMercado" id="cboMercado" type="text" class="combo"/> 
                            <option value="" > - Seleccionar - </option>
                            <?php foreach ($a_Mercado as $iKey => $o_MercadoBean){ ?>
                            <option value="<?=$o_MercadoBean->getIdMercado()?>" <?php if($o_MercadoBean->getIdMercado() == 8) echo "selected='selected';"?>>
                            <?=$o_MercadoBean->getDescripcion()?>
                            </option>
                            <?php } ?> 
                            </select>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="25%" nowrap="nowrap">
                <table width="100%" cellspacing="1" cellpadding="0" border="0" class="SubCabecera">
                    <tr>
                        <td width="35%" nowrap="nowrap"><label class="label" for="txtNcliente">Nro Cliente</label></td>
                        <td nowrap="nowrap"><input type="text" name="txtNuemroCliente" id="txtNuemroCliente" class="text" /></td>
                    </tr>
                </table>
          </td>
        </tr>
        
        <tr>
            <td align="center" colspan="100"><input type="button" onclick="findControl();" value="Buscar" id="btn_frmFindFeaturesTpl" class="button"></td>
        </tr>
    
        <tr>
            <td colspan="2"><img width="1" height="4" src="/images/common/spacer.gif"></td>
        </tr>
    </table>
</form>

<div id="resultGrid"></div>

<div style="display:none;" id="elm_ResultAjax"></div>

<script>
findControl();
</script>