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

<script>
    ejecutarGuardar = function()
    {
        x = confirm( "Esta seguro de guardar los cambios?" )
        if( x )
        {
            blockContent('content_form');
            var strFormSerialize = $('form').serialize();
            executeAjaxJson
            (
                "<?php echo buildUrl( 'formapago/saveAddEdit' ) ?>",
                strFormSerialize,
                function (o_json)
                {
                    unBlockContent('content_buttons');
                    if (o_json.error)
                    {
                        showAlertBootStrap( 'content_alert', 'alert-danger', o_json.mensaje_error );
                        return false;
                    }

                    location.href = "<?=buildUrl( 'formapago/list' )?>";
                }
            );
        }

        return false;
    }
</script>

<div class="shadow-sm p-3 mb-2 bg-white rounded card card-body">
    <div class="row">
        <div class="col mb-1">
            <h4 class="text-info text-nowrap mb-0"><?=$s_Titulo?></h4>
        </div>
    </div>
</div>

<form id="form1" name="form1" method="POST" onsubmit="return ejecutarGuardar();"  enctype="multipart/form-data">
    <input type="hidden" name="s_TipoProc" id="s_TipoProc" value="<?=$s_TipoProc?>">
    <input type="hidden" name="TypeSub" id="TypeSub" value="0">
				

    <ul class="nav nav-tabs m-1" id="myTab" role="tablist" style="margin-bottom: 0px !important;">
    	<li class="nav-item">
    		<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true" onclick="location.href='<?=buildUrl( 'formapago/addedit', "s_TipoProc=$s_TipoProc&i_Id=".$i_Id )?>';">General</a>
    	</li>
    </ul>
 
                                        <?php include_partial
                                                (
                                                    "addedit", 
                                                    array
                                                    ( 
                                                        "o_DefaultBN"       => $o_DefaultBN,
                                                        "i_Id"              => $i_Id,
                                                        's_TipoProc'        => $s_TipoProc
                                                    )
                                                ); 
                                        ?>
                                        
                        	<div class="form-row mx-0">
                                <div class="col-md-6 mb-1">
                                    <button type="button" class="btn btn-danger btn-lg btn-block" onclick="location.href='<?php echo buildUrl( 'formapago/list' ) ?>'">CANCELAR</button>
                                </div>
                                <div class="col-md-6 mb-1">
                                    <button type="submit" class="btn btn-primary btn-lg btn-block" onclick="$( '#TypeSub' ).val( '1' );">GRABAR Y SALIR</button>
                                </div>
                        	</div>
                            <div id="s_ImagenLoad" style="display: none;"><img src="<?php echo Constantes::ROOT_DIR_APP ?>web/images/progress.gif" border="0"/>&nbsp;<label class="laber req">Grabando...</label></div>
                                        
                                       
                        
</form>
   

