@extends('BaseSistemaWeb') @section('CSS') {{ HTML::style('bootstrap-select/css/bootstrap-select.min.css') }} @stop @section('Contenido')

E-Mail Marketing

Editar plantilla de correo electrónico

{{ Form::open(array('route' => 'SysWebEmailMarketingListasSubscriptoresAgregar', 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true, 'target' => 'upload_iframe')) }}
{{ Form::text('nombre', $PlantillaCorreo->nombre, array('class' => 'form-control', 'placeholder' => '')) }}
@if( $PlantillaCorreo->rutaImagen != '' ) @else @endif

{{ Form::button('Editar', array('class' => 'btn btn-warning', 'id' => 'btnAgregar', 'type' => 'submit')) }} {{-- Cancelar --}} {{ HTML::linkRoute('SysWebEmailMarketingPlantillas', 'Cancelar', array(), array('class' => 'btn btn-default')) }}
{{ Form::close() }}
@stop @section('JS') {{ HTML::script('bootstrap-select/js/bootstrap-select.min.js') }} {{ HTML::script('bootstrap-select/js/i18n/defaults-es_CL.min.js') }} @stop @section('JSOr') $("#frmAgregar").submit(function(e){ $.isLoading({ text: "Cargando..." }); NProgress.start(); $("#btnAgregar").html(' Cargando').prop("disabled", true); e.preventDefault(); $("input[type='submit']").prop("disabled", true); var frmAgregar = new FormData(document.getElementById("frmAgregar")); $.ajax({ type: "POST", url: "{{ URL::route('SysWebEmailMarketingPlantillasEditar', array($PlantillaCorreo->id)) }}", data: frmAgregar, cache: false, contentType: false, processData: false, dataType: "json", timeout: 1800000, success: function(data){ $.isLoading("hide"); NProgress.done(); $("#btnAgregar").html("Guardar").prop("disabled", false); if(data.success){ new PNotify({ title: "Realizado", text: data.mensaje, type: "success" }); setTimeout( function(){ window.location.href = "{{ URL::route('SysWebEmailMarketingPlantillas', array()) }}"; }, 3000 ); if(typeof data.MensajeError != "undefined"){ $("#MensajeError2").html(data.MensajeError); $("#MensajeError2").show(); }else{ $("#MensajeError2").hide(); $("#MensajeError2").html(""); } } else{ if(typeof data.MensajeError != "undefined"){ $("#Errs").html(data.MensajeError); $("#MensajeError").show(); }else{ $("#MensajeError").hide(); $("#Errs").html(""); } if(data.mensaje != ""){ new PNotify({ title: "Error", text: data.mensaje, type: "error" }); } $.each(data.errMensajes, function(key, value){ if(value != ""){ $("#err"+key).html(value); } else{ $("#err"+key).html(""); } }); } }, error: function(jqXHR, textStatus, errorThrown){ //$("input[type='submit']").prop("disabled", false); new PNotify({ title: "Error", text: textStatus + " " + errorThrown, type: "error" }); } }); }); @stop