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

Sitio Web

Agregar usuario de sitio web

{{ Form::open(array('route' => 'SysWebSWebUsuariosAgregar', 'method' => 'post', 'class' => 'form-horizontal row-border', 'id' => 'frmAgregar', 'files' => true, 'target' => 'upload_iframe')) }}
{{ Form::text('nombre_de_usuario', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('correo_electronico', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('contrasenha', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('telefono', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('ciudad', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('postal', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::text('direccion', '', array('class' => 'form-control', 'placeholder' => '')) }}
{{ Form::button('Agregar', array('class' => 'btn btn-primary', 'id' => 'btnAgregar', 'type' => 'submit')) }} {{ HTML::linkRoute('SysWebSWebUsuarios', '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') }} {{ HTML::script('Intl-Tel-Input/17.0.3/js/intlTelInput-jquery17-0-16.min.js') }} @stop @section('JSOr') $('[name="telefono"]').intlTelInput({ utilsScript: "{{ asset('Intl-Tel-Input/17.0.3/js/utils17-0-16.min.js') }}" }); setTimeout(function(){ $('[name="country"]').selectpicker(); $('[name="estado"]').selectpicker(); },500) $('[name="country"]').change(function(){ setTimeout(function(){ $('[name="estado"]').selectpicker("refresh"); },500) }); $(".btn-alt-pass").on("click", function(){ $('[name="contrasenha"]').val(makeKey(8)); }); $('[name="telefono"]').intlTelInput("setCountry", "{{ $Cliente->pais }}"); $("#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('SysWebSWebUsuariosAgregar', array()) }}", 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('SysWebSWebUsuarios') }}"; }, 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" }); } }); }); @stop