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

Páginas de captura

Editar dominio o subdominio de carga automática de páginas de aterrizaje

{{ Form::open(array('route' => 'SysWebPAterrizajeDominiosYSubDominiosCAEditar', 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true, 'target' => 'upload_iframe')) }}
{{ Form::text('dominio', $DominioCargaAutomatica->dominio, array('class' => 'form-control', 'placeholder' => '')) }}
tipo != 'FTP' ) style="display: none;" @endif >
{{ Form::text('usuarioFTP', $DominioCargaAutomatica->usuarioFTP, array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('contrasenhaFTP', $DominioCargaAutomatica->contrasenhaFTP, array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('hostFTP', $DominioCargaAutomatica->hostFTP, array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('puertoFTP', $DominioCargaAutomatica->puertoFTP, array('class' => 'form-control', 'placeholder' => '')) }}
tipo == 'FTP' ) style="display: none;" @endif >
@if( $DominioCargaAutomatica->tipo == 'FTP' ) @else @endif {{ Form::button('Editar', array('class' => 'btn btn-warning', 'id' => 'btnAgregar', 'type' => 'submit', 'disabled' => true)) }} {{ HTML::linkRoute('SysWebPAterrizajeDominiosYSubDominiosCA', 'Cancelar', array(), array('class' => 'btn btn-default')) }}
{{ Form::close() }}
@stop @section('JS') {{-- HTML::script('WebPro/plugins/ckeditor-new/ckeditor.js') --}} {{ HTML::script('Alphanum/jquery.alphanum.min.js') }} {{ HTML::script('bootstrap-select/js/bootstrap-select.min.js') }} {{ HTML::script('bootstrap-select/js/i18n/defaults-es_CL.min.js') }} @stop @section('JSOr') @if(isset($_GET["cargarhtml"])) $(".sdCarga").removeClass("hide"); @endif $('[name="tipo"]').on("changed.bs.select", function(e, clickedIndex, isSelected, previousValue){ $("#btnAgregar").prop("disabled", true); if( $(this).selectpicker("val") == "FTP" ){ $("#dvDatosFTP").show("slow"); $("#dvDatosDNS").hide("slow"); $('[name="accion"]').val("verificarFTP"); } else{ $("#dvDatosFTP").hide("slow"); $("#dvDatosDNS").show("slow"); $('[name="accion"]').val("verificarDNS"); } }); $('[name="remitente"]').alphanum({ allow: ".|", disallow: "", allowSpace: true, allowNewline: false, allowNumeric: true, allowLatin: true, allowOtherCharSets: true, maxLength: 35 }); $("#frmAgregar").submit(function(e){ $.isLoading({ text: "Cargando..." }); NProgress.start(); $("#btnAgregar").html(' Cargando').prop("disabled", true); e.preventDefault(); $(this).find("input").each(function(){ $(this).val($(this).val().trim()); }); var frmAgregar = new FormData(document.getElementById("frmAgregar")); $.ajax({ type: "POST", url: "{{ URL::route('SysWebPAterrizajeDominiosYSubDominiosCAEditar', array($DominioCargaAutomatica->id)) }}", data: frmAgregar, cache: false, contentType: false, processData: false, dataType: "json", 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('SysWebPAterrizajeDominiosYSubDominiosCA') }}"; }, 3000 ); } else{ 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){ new PNotify({ title: "Error", text: textStatus + " " + errorThrown, type: "error" }); } }); }); $("#btnVerificar").click(function(e){ $.isLoading({ text: "Cargando..." }); NProgress.start(); $("#dvErrorFTP, #dvErrorDNS").removeClass("alert-success alert-danger").html("").hide("slow"); $.post( "{{ URL::route('SysWebPAterrizajeDominiosYSubDominiosCAVerificarFTPyDNS', array()) }}", $("#frmAgregar").serialize(), function(data){ $.isLoading("hide"); NProgress.done(); if(data.success){ $("#btnAgregar").prop("disabled", false); if( $('[name="tipo"]').selectpicker("val") == "FTP" ){ $("#dvErrorFTP").addClass("alert-success").html("Genial, ahora puedes dar clic en el botón Agregar para poder comenzar a subir tus páginas de aterrizaje automáticamente al publicarlas").show("slow"); } else{ $("#dvErrorDNS").addClass("alert-success").html(data.mensaje).show("slow"); } } else{ $("#btnAgregar").prop("disabled", true); if( $('[name="tipo"]').selectpicker("val") == "FTP" ){ $("#dvErrorFTP").addClass("alert-danger").html(data.mensaje).show("slow"); } else{ $("#dvErrorDNS").addClass("alert-danger").html(data.mensaje).show("slow"); } } }, "json" ); }); @stop