<?php use_helper( 'UrlFunctions' ); ?>
<?php use_helper( 'IncludePartial' ); ?>
<?php use_helper( 'UtilFunctions' ); ?>
<script>
ejecutarGuardar = function()
{
    x = confirm( "Esta Seguro de Anular el Documento?" );
    if( x )
    {
        blockContent( "form1" );
        mostrarCargaImg();
        var strFormSerialize = $( 'form' ).serialize();
        executeAjaxJson
        ( 
            "<?php echo buildUrl( 'pro/deleteRow' ) ?>", 
            strFormSerialize,
            function( o_json )
            {
                //console.log( o_json );
                unBlockContent( "form1" );
                ocultarCargaImg();
                if( o_json.error )
                {
                    mostrarMensajeError( o_json.mensaje_error );
                    return false;
                }
                alert( "Se anulo satisfactoriamente." );
                parent.findControl();
                parent.closeWindow();
            } 
        );
    }
}
</script>
<table class="cuerpo" width="98%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
            <form id="form1" name="form1" method="POST" onsubmit="return false;" enctype="multipart/form-data">
                <input type="hidden" name="i_Id" id="i_Id" value="<?=$i_Id?>">
                <input type="hidden" name="ControlSubmit" value="1">
                <table class="" width="100%">
                    <tr>
                        <td valign="top">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td class="marco marcoTitle">
                                        <table class="" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td width="100%" valign="top">
                                                    
<div id="resultContent" style=""></div>

<table width="100%">
    <tr>
        <td width="100%" valign="top" >
            <fieldset class="formGen" style="margin-top:0px">
                <table border="0" cellspacing="6" cellpadding="0" width="100%">
                    <tr>
                        <td nowrap="nowrap" class="cabecera"><label class="label req" for="" >Motivo de Anulaci&oacute;n:</label></td>
                    </tr>
                    <tr>
                        <td>
                            <textarea name="AnulacionComentario" class="required" rows="4" style="width: 100%"></textarea>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
    </tr>
</table>
                                                    
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <table width="100%" border="0" style="margin-top: 10px;">
                                            <tr>
                                                <td align="center">
                                                    <input type="button" class="button" value="Cancelar" onclick="parent.closeWindow();">
                                                    <input type="submit" class="button" value="Anular" onclick=""/>
                                                    
                                                    <div id="s_ImagenLoad" style="display: none;"><?=addImgButton( "progress.gif", array( "src"=>"common" ) )?>&nbsp;<label class="laber req">Procesando...</label></div>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </form>
        </td>
    </tr>
</table>
<script>
$.validator.setDefaults
(
    {
        submitHandler: function( form ) 
        {
            ejecutarGuardar();
        }
    }
);
$( "#form1" ).validate();
</script>