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

<style type="text/css">
.table td, .table th {
    padding: .2rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}
</style>

<div id="resultContent" style=""></div>

<form action="" method="post" name="form1" id="form1" onsubmit="return false;">
    <input type="hidden" name="moneda_cod" id="moneda_cod" value="<?=$moneda_cod?>" >
    <input type="hidden" name="IdAlmacen" id="IdAlmacen" value="<?=$IdAlmacen?>" >

    <div class="form-row mx-0 mb-1">

        <!-- <div class="col-sm-10 mb-1"> -->

            <div class="table-responsive">
                <table  class="table table-borderless border" style="margin-bottom: 0;">
                    <tr>
                    	<!-- <td  nowrap="nowrap" align="right" scope="row">C&oacute;digo :</td>
                        <td nowrap="nowrap"><input type="text" class="form-control form-control-sm" name="IdItem" id="IdItem"  style="width: 70px;" onfocus="this.select();" autocomplete="off"></td>-->
                        <td nowrap="nowrap" align="" scope="row"><label for="DescripcionCompleta">Descripci&oacute;n :</label></td>
                        <td nowrap="nowrap" align="left"><input type="text" class="form-control form-control-sm" name="DescripcionCompleta" id="DescripcionCompleta" style="width: 150px;" onfocus="this.select();" autocomplete="off"></td>
                        <!-- <td nowrap="nowrap" align="right" scope="row"> <label for="ConStock">Con Stock:</label></td>
                        <td nowrap="nowrap"> <input class="" type="checkbox" name="ConStock" id="ConStock" value="1" onclick="findControl();" > </td> -->
                    </tr>
                </table>
            </div>
        <!-- </div> -->
        <!-- <div class="col-sm-2 mb-1 ">
            <button type="button" class="btn btn-primary btn-block" onclick="findControl();">Buscar</button>
            <button type="button" class="btn btn-primary btn-block" onclick="location.reload();">Recargar</button>
        </div>-->
    </div>

</form>

<!--<input type="button" onclick="findControl();" value="Buscar" class="button">
<input type="button" onclick="location.reload();" value="Actualizar" class="button">-->


<?php include_partial( "gridServices", array( "i_Id" => $i_Id, "IdAlmacen" => $IdAlmacen, "moneda_cod" => $moneda_cod, "module" => $module ) ); ?>

<script>
$( "#DescripcionCompleta" ).keyup
(
	function( e ) 
    {
		//pr( e.which );
		//pr( $( this ).val().length );
		findControl();
		/*if( $( this ).val().length > 2 )
		{
			
		}*/
    }
);
</script>
<script>
//ESCAPE, DETECTA EL F5, CTRL+F5
$( document ).bind
(
    'keyup', 
    function( e ) 
    {
    	//pr( e.which );
        if( e.which === 13 ) 
        {
            findControl();
        }
        if( e.which === 27 ) //ESCAPE
        {
            parent.closeWindow();
        }
    }
);
</script>