EVOLUTION-MANAGER
Edit File: index.blade.php
@extends('layouts.backend') @section('titulo') pregunta y respuesta @stop @section('style') <link rel="stylesheet" type="text/css" href="{{ asset('admin/frontend/css/sweetalert2.min.css') }}"> @stop @section('contenido') @include('alerts.success') @include('alerts.errors') <div ><strong>Email</strong></div> <div class="inputSwitch" > <?php $configuracion = App\configuracionModel::where('nombre','mail_contacto')->first(); $correo='<Ingrese email>'; if ($configuracion) { $correo = $configuracion->dato; } ?> <p id="p_email" style="margin-left: auto;text-transform: lowercase;font-size: 14px;">{{$correo}}</p> <input type="text" name="" id="input_email" value="{{$correo}}" style="display: none"> </div> <style type="text/css"> #input_email{ background: transparent; border: none; text-align: leç ; font-size: 14px; font-weight: 600; display: none; width: 100%; } </style> @if (count($mensajes)) <!-- <a class="btn btn-primary" href="{{ URL::route('mensajes.create') }}">Nuevo</a> --> <div class="table-responsive"> <table id="tbbuzon1" class="table table-striped table-bordered table-hover display" > <thead> <tr> <th>ID:</th> <th>Nombre:</th> <th>Email:</th> <th>Mensaje:</th> <th width="10%">Opciones</th> </tr> </thead> <tbody> @foreach ($mensajes as $mensaje) <tr> <td>{{$mensaje->id}}</td> <td>{{$mensaje->nombre}}</td> <td>{{$mensaje->email}}</td> <td>{{$mensaje->mensaje}}</td> <td > <!-- <button type="submit" class="btn btn-success bnt-lg" data-toggle="tooltip" title="Editar" style="display: inline-flex; float: right;"> <i class="fa fa-pencil-square-o"></i></button> --> <a class="btn btn-success bnt-lg" href="javascript:void(0);" data-toggle="tooltip" title="Ver" onclick="mensaje(`{{$mensaje->mensaje}}`)"> <i class="fa fa-pencil-square-o"></i></a> <button type="submit" class="btn btn-danger bnt-lg" onclick="SeguroEliminar({{$mensaje->id}})" data-toggle="tooltip" title="Eliminar"><i class="fa fa-trash"></i></button> </td> </tr> @endforeach </tbody> </table> </div> @else <!-- <a class="btn btn-primary" href="{{ URL::route('mensajes.create') }}">Nuevo</a><br> --> Aún no hay mensajes @endif @stop @section('script') <script src="{{ asset('admin/frontend/js/sweetalert2.min.js') }}"></script> <script> $(document).ready(function(){ $(".inline").colorbox(); // $(".add_usser").colorbox(); }); $(function () { $('[data-toggle="tooltip"]').tooltip('show') }) function SeguroEliminar(id) { $.colorbox({width:"auto",height:"auto", open:true, href:"seguro_eliminar/mensajes/"+id}); } </script> <script type="text/javascript"> var $p = $('#p_email'); var $input = $('#input_email'); $p.on("click", function() { var $this = $(this); if ($input.val() == '<Ingrese email>') { $input.val(''); } $this.hide(); $input.show().focus(); $this.text($input.val()); }); $input.on("blur", function() { var $this = $(this); if ($this.val()=='') {$this.val('<Ingrese email>')} else{ $.ajax({ url: "{{ url('email_configuracion') }}" , type: 'POST', data:{_token:"{{csrf_token()}}",email:$this.val()}, success: function (result) { if (result) { console.log(result); } } }); } $this.hide(); $p.text($this.val()).show(); }).on('keydown', function(e) { if (e.which == 9 || e.which == 13) { e.preventDefault(); var $this = $(this); $this.hide(); $p.text($this.val()).show(); } }).hide(); function mensaje(mensaje){ swal({ // type: 'info', title: 'Mensaje', text: mensaje, // buttonsStyling: false, // confirmButtonClass: 'btn btn-lg btn-warning' }); } </script> @stop