Commit 37e593a6 authored by Alfonso Rafael Solis Rangel's avatar Alfonso Rafael Solis Rangel
Browse files

Merge branch 'main' into 'exportar-datos'

# Conflicts:
#   app/Http/Controllers/ContactoController.php
parents 4346d7d5 0312644d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -649,9 +649,11 @@ public function upload(Request $request)
                    ]);
                }
            }
        }
    
            return redirect()->route('contacto.get')->with('success', 'Importación de contactos almacenada correctamente');
        } catch (\Throwable $th) {
            return redirect()->route('contacto.upload')->withErrors('Error al importar los datos, favor de revisar el formato.');
        }
    }

    public function obtenerEventos(Request $request){
+33 −0
Original line number Diff line number Diff line
@@ -26,4 +26,37 @@
            </form>
        </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <link rel="stylesheet" href="/assets/css/jquery.toast.css">
    <script src="/assets/js/jquery.toast.js"></script>

    <script>
        function showToast(message, heading, icon) {
            $.toast({
                heading: heading,
                text: message,
                showHideTransition: 'slide',
                icon: icon,
                position: 'top-right',
                loader: false,
                hideAfter: 10000, 
                allowToastClose: true,
                textColor: '#676767',
            });
        }

        document.addEventListener('DOMContentLoaded', function() {
            @if(session('success'))
            // Muestra el mensaje de éxito utilizando showMessage
                showToast("{{ session('success') }}", 'Exito.', 'success')
            @endif

            @if($errors->any())
                @foreach($errors->all() as $error)
                    showToast(`{{ $error }}`, 'Error.', 'error');
                @endforeach
            @endif
        });
    </script>
</x-layout.default>
 No newline at end of file