12 changed files with 560 additions and 80 deletions
			
			
		@ -0,0 +1,28 @@ | 
				
			|||||
 | 
					<?php | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					use Illuminate\Database\Migrations\Migration; | 
				
			||||
 | 
					use Illuminate\Database\Schema\Blueprint; | 
				
			||||
 | 
					use Illuminate\Support\Facades\Schema; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					return new class extends Migration | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    /** | 
				
			||||
 | 
					     * Run the migrations. | 
				
			||||
 | 
					     */ | 
				
			||||
 | 
					    public function up(): void | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            $table->enum('estado', ['pendiente', 'aceptado', 'rechazado'])->default('pendiente')->after('chofer'); | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    /** | 
				
			||||
 | 
					     * Reverse the migrations. | 
				
			||||
 | 
					     */ | 
				
			||||
 | 
					    public function down(): void | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            $table->dropColumn('estado'); | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					}; | 
				
			||||
@ -0,0 +1,28 @@ | 
				
			|||||
 | 
					<?php | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					use Illuminate\Database\Migrations\Migration; | 
				
			||||
 | 
					use Illuminate\Database\Schema\Blueprint; | 
				
			||||
 | 
					use Illuminate\Support\Facades\Schema; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					return new class extends Migration | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    /** | 
				
			||||
 | 
					     * Run the migrations. | 
				
			||||
 | 
					     */ | 
				
			||||
 | 
					    public function up(): void | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            // | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    /** | 
				
			||||
 | 
					     * Reverse the migrations. | 
				
			||||
 | 
					     */ | 
				
			||||
 | 
					    public function down(): void | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            // | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					}; | 
				
			||||
@ -0,0 +1,20 @@ | 
				
			|||||
 | 
					use Illuminate\Database\Migrations\Migration; | 
				
			||||
 | 
					use Illuminate\Database\Schema\Blueprint; | 
				
			||||
 | 
					use Illuminate\Support\Facades\Schema; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class AddFechaAceptacionToPrestamosTable extends Migration | 
				
			||||
 | 
					{ | 
				
			||||
 | 
					    public function up() | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            $table->timestamp('fecha_aceptacion')->nullable()->after('estado'); | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    public function down() | 
				
			||||
 | 
					    { | 
				
			||||
 | 
					        Schema::table('prestamos', function (Blueprint $table) { | 
				
			||||
 | 
					            $table->dropColumn('fecha_aceptacion'); | 
				
			||||
 | 
					        }); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,141 @@ | 
				
			|||||
 | 
					@extends('layouts.dashboard') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					@section('content') | 
				
			||||
 | 
					<div class="container mx-auto px-4 py-6"> | 
				
			||||
 | 
					    <!-- Mensajes de éxito/error --> | 
				
			||||
 | 
					    @if(session('success')) | 
				
			||||
 | 
					        <div id="success-message" class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4" role="alert"> | 
				
			||||
 | 
					            {{ session('success') }} | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    @endif | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @if(session('error')) | 
				
			||||
 | 
					        <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4" role="alert"> | 
				
			||||
 | 
					            <span class="block sm:inline">{{ session('error') }}</span> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    @endif | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    <div class="bg-white rounded-lg shadow-lg"> | 
				
			||||
 | 
					        <div class="p-4 border-b border-gray-200 flex justify-between items-center"> | 
				
			||||
 | 
					            <h2 class="text-2xl font-bold">Aceptar Prestamos</h2> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <!-- Barra de búsqueda --> | 
				
			||||
 | 
					        <div class="p-4 border-b border-gray-200 bg-gray-50"> | 
				
			||||
 | 
					            <form action="{{ route('prestamos.aceptados') }}" method="GET" class="flex gap-2"> | 
				
			||||
 | 
					                <div class="relative w-full sm:w-64"> | 
				
			||||
 | 
					                    <input type="text" | 
				
			||||
 | 
					                           name="busqueda" | 
				
			||||
 | 
					                           placeholder="Buscar préstamo..." | 
				
			||||
 | 
					                           value="{{ request('busqueda') }}" | 
				
			||||
 | 
					                           class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> | 
				
			||||
 | 
					                    <div class="absolute left-3 top-2.5 text-gray-400"> | 
				
			||||
 | 
					                        <i class="fas fa-search"></i> | 
				
			||||
 | 
					                    </div> | 
				
			||||
 | 
					                </div> | 
				
			||||
 | 
					                <button type="submit" class="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600"> | 
				
			||||
 | 
					                    Buscar | 
				
			||||
 | 
					                </button> | 
				
			||||
 | 
					                @if(request('busqueda')) | 
				
			||||
 | 
					                    <a href="{{ route('prestamos.aceptados') }}" class="px-4 py-2 bg-gray-500 text-white rounded-lg hover:bg-gray-600"> | 
				
			||||
 | 
					                        Limpiar | 
				
			||||
 | 
					                    </a> | 
				
			||||
 | 
					                @endif | 
				
			||||
 | 
					            </form> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <div class="overflow-x-auto"> | 
				
			||||
 | 
					            <table class="min-w-full divide-y divide-gray-200"> | 
				
			||||
 | 
					                <thead class="bg-gray-50"> | 
				
			||||
 | 
					                    <tr> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Número</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Solicitante</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Destino</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha Salida</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha Llegada</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Motivo</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Domicilio</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Personas</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Chofer</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th> | 
				
			||||
 | 
					                    </tr> | 
				
			||||
 | 
					                </thead> | 
				
			||||
 | 
					                <tbody class="bg-white divide-y divide-gray-200"> | 
				
			||||
 | 
					                    @foreach($prestamos as $prestamo) | 
				
			||||
 | 
					                    <tr class="hover:bg-gray-50"> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $prestamo->id }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> | 
				
			||||
 | 
					                            <i class="fas fa-user text-blue-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ $prestamo->nombre_solicitante }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-map-marker-alt text-red-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ $prestamo->destino }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-calendar text-green-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ \Carbon\Carbon::parse($prestamo->fecha_hora_salida)->format('d/m/Y H:i') }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-calendar-check text-yellow-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ \Carbon\Carbon::parse($prestamo->fecha_hora_llegada)->format('d/m/Y H:i') }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->motivo }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->domicilio }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-center">{{ $prestamo->numero_personas }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->chofer }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full | 
				
			||||
 | 
					                                {{ $prestamo->estado === 'pendiente' ? 'bg-yellow-100 text-yellow-800' : | 
				
			||||
 | 
					                                   ($prestamo->estado === 'aceptado' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800') }}"> | 
				
			||||
 | 
					                                {{ ucfirst($prestamo->estado) }} | 
				
			||||
 | 
					                            </span> | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <div class="flex gap-2"> | 
				
			||||
 | 
					                                @if($prestamo->estado === 'pendiente') | 
				
			||||
 | 
					                                    <form action="{{ route('prestamos.aceptar', $prestamo->id) }}" method="POST" class="inline"> | 
				
			||||
 | 
					                                        @csrf | 
				
			||||
 | 
					                                        <button type="submit" class="text-green-600 hover:text-green-900" title="Aceptar"> | 
				
			||||
 | 
					                                            <i class="fas fa-check"></i> | 
				
			||||
 | 
					                                        </button> | 
				
			||||
 | 
					                                    </form> | 
				
			||||
 | 
					                                    <form action="{{ route('prestamos.rechazar', $prestamo->id) }}" method="POST" class="inline"> | 
				
			||||
 | 
					                                        @csrf | 
				
			||||
 | 
					                                        <button type="submit" class="text-red-600 hover:text-red-900" title="Rechazar"> | 
				
			||||
 | 
					                                            <i class="fas fa-times"></i> | 
				
			||||
 | 
					                                        </button> | 
				
			||||
 | 
					                                    </form> | 
				
			||||
 | 
					                                @else | 
				
			||||
 | 
					                                    <span class="text-gray-400"> | 
				
			||||
 | 
					                                        <i class="fas fa-check-circle"></i> | 
				
			||||
 | 
					                                        Procesado | 
				
			||||
 | 
					                                    </span> | 
				
			||||
 | 
					                                @endif | 
				
			||||
 | 
					                            </div> | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                    </tr> | 
				
			||||
 | 
					                    @endforeach | 
				
			||||
 | 
					                </tbody> | 
				
			||||
 | 
					            </table> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<script> | 
				
			||||
 | 
					document.addEventListener('DOMContentLoaded', function() { | 
				
			||||
 | 
					    // Desaparecer mensaje de éxito | 
				
			||||
 | 
					    var message = document.getElementById('success-message'); | 
				
			||||
 | 
					    if (message) { | 
				
			||||
 | 
					        setTimeout(function() { | 
				
			||||
 | 
					            message.style.transition = 'opacity 0.5s ease'; | 
				
			||||
 | 
					            message.style.opacity = '0'; | 
				
			||||
 | 
					            setTimeout(function() { | 
				
			||||
 | 
					                message.remove(); | 
				
			||||
 | 
					            }, 500); | 
				
			||||
 | 
					        }, 3000); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					}); | 
				
			||||
 | 
					</script> | 
				
			||||
 | 
					@endsection | 
				
			||||
@ -0,0 +1,160 @@ | 
				
			|||||
 | 
					@extends('layouts.dashboard') | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					@section('content') | 
				
			||||
 | 
					<div class="container mx-auto px-4 py-6"> | 
				
			||||
 | 
					    <!-- Mensajes de éxito/error --> | 
				
			||||
 | 
					    @if(session('success')) | 
				
			||||
 | 
					        <div id="success-message" class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative mb-4" role="alert"> | 
				
			||||
 | 
					            {{ session('success') }} | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    @endif | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    @if(session('error')) | 
				
			||||
 | 
					        <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4" role="alert"> | 
				
			||||
 | 
					            <span class="block sm:inline">{{ session('error') }}</span> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    @endif | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					    <div class="bg-white rounded-lg shadow-lg"> | 
				
			||||
 | 
					        <div class="p-4 border-b border-gray-200 flex justify-between items-center"> | 
				
			||||
 | 
					            <h2 class="text-2xl font-bold">Historial de Préstamos</h2> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					            <!-- Botones de exportación --> | 
				
			||||
 | 
					            <div class="flex gap-2"> | 
				
			||||
 | 
					                <a href="{{ route('prestamos.export', ['format' => 'excel']) }}" class="text-gray-600 hover:text-green-700 p-2" title="Exportar a Excel"> | 
				
			||||
 | 
					                    <i class="fas fa-file-excel"></i> | 
				
			||||
 | 
					                </a> | 
				
			||||
 | 
					                <a href="{{ route('prestamos.export', ['format' => 'pdf']) }}" class="text-gray-600 hover:text-red-600 p-2" title="Exportar a PDF"> | 
				
			||||
 | 
					                    <i class="fas fa-file-pdf"></i> | 
				
			||||
 | 
					                </a> | 
				
			||||
 | 
					                <button onclick="window.print()" class="text-gray-600 hover:text-gray-800 p-2" title="Imprimir"> | 
				
			||||
 | 
					                    <i class="fas fa-print"></i> | 
				
			||||
 | 
					                </button> | 
				
			||||
 | 
					            </div> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <!-- Barra de búsqueda y filtros --> | 
				
			||||
 | 
					        <div class="p-4 border-b border-gray-200 bg-gray-50"> | 
				
			||||
 | 
					            <form action="{{ route('prestamos.historial') }}" method="GET" class="flex flex-wrap gap-4"> | 
				
			||||
 | 
					                <div class="relative flex-1 min-w-[200px]"> | 
				
			||||
 | 
					                    <input type="text" | 
				
			||||
 | 
					                           name="busqueda" | 
				
			||||
 | 
					                           placeholder="Buscar préstamo..." | 
				
			||||
 | 
					                           value="{{ request('busqueda') }}" | 
				
			||||
 | 
					                           class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> | 
				
			||||
 | 
					                    <div class="absolute left-3 top-2.5 text-gray-400"> | 
				
			||||
 | 
					                        <i class="fas fa-search"></i> | 
				
			||||
 | 
					                    </div> | 
				
			||||
 | 
					                </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                <!-- Filtro de estado --> | 
				
			||||
 | 
					                <select name="estado" class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500"> | 
				
			||||
 | 
					                    <option value="">Todos los estados</option> | 
				
			||||
 | 
					                    <option value="aceptado" {{ request('estado') === 'aceptado' ? 'selected' : '' }}>Aceptados</option> | 
				
			||||
 | 
					                    <option value="rechazado" {{ request('estado') === 'rechazado' ? 'selected' : '' }}>Rechazados</option> | 
				
			||||
 | 
					                </select> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                <!-- Filtro de fechas --> | 
				
			||||
 | 
					                <input type="date" | 
				
			||||
 | 
					                       name="fecha_desde" | 
				
			||||
 | 
					                       value="{{ request('fecha_desde') }}" | 
				
			||||
 | 
					                       class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500" | 
				
			||||
 | 
					                       placeholder="Fecha desde"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                <input type="date" | 
				
			||||
 | 
					                       name="fecha_hasta" | 
				
			||||
 | 
					                       value="{{ request('fecha_hasta') }}" | 
				
			||||
 | 
					                       class="border border-gray-300 rounded-lg px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:border-blue-500" | 
				
			||||
 | 
					                       placeholder="Fecha hasta"> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                <button type="submit" class="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600"> | 
				
			||||
 | 
					                    Filtrar | 
				
			||||
 | 
					                </button> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					                @if(request('busqueda') || request('estado') || request('fecha_desde') || request('fecha_hasta')) | 
				
			||||
 | 
					                    <a href="{{ route('prestamos.historial') }}" class="px-4 py-2 bg-gray-500 text-white rounded-lg hover:bg-gray-600"> | 
				
			||||
 | 
					                        Limpiar | 
				
			||||
 | 
					                    </a> | 
				
			||||
 | 
					                @endif | 
				
			||||
 | 
					            </form> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <div class="overflow-x-auto"> | 
				
			||||
 | 
					            <table class="min-w-full divide-y divide-gray-200"> | 
				
			||||
 | 
					                <thead class="bg-gray-50"> | 
				
			||||
 | 
					                    <tr> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Número</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Solicitante</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Destino</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha Salida</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha Llegada</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Motivo</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Domicilio</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Personas</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Chofer</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th> | 
				
			||||
 | 
					                        <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fecha Actualización</th> | 
				
			||||
 | 
					                    </tr> | 
				
			||||
 | 
					                </thead> | 
				
			||||
 | 
					                <tbody class="bg-white divide-y divide-gray-200"> | 
				
			||||
 | 
					                    @foreach($prestamos as $prestamo) | 
				
			||||
 | 
					                    <tr class="hover:bg-gray-50"> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ $prestamo->id }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"> | 
				
			||||
 | 
					                            <i class="fas fa-user text-blue-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ $prestamo->nombre_solicitante }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-map-marker-alt text-red-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ $prestamo->destino }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-calendar text-green-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ \Carbon\Carbon::parse($prestamo->fecha_hora_salida)->format('d/m/Y H:i') }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <i class="fas fa-calendar-check text-yellow-500 mr-2"></i> | 
				
			||||
 | 
					                            {{ \Carbon\Carbon::parse($prestamo->fecha_hora_llegada)->format('d/m/Y H:i') }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->motivo }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->domicilio }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-center">{{ $prestamo->numero_personas }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm">{{ $prestamo->chofer }}</td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm"> | 
				
			||||
 | 
					                            <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full | 
				
			||||
 | 
					                                {{ $prestamo->estado === 'aceptado' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800' }}"> | 
				
			||||
 | 
					                                {{ ucfirst($prestamo->estado) }} | 
				
			||||
 | 
					                            </span> | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"> | 
				
			||||
 | 
					                            {{ \Carbon\Carbon::parse($prestamo->updated_at)->format('d/m/Y H:i') }} | 
				
			||||
 | 
					                        </td> | 
				
			||||
 | 
					                    </tr> | 
				
			||||
 | 
					                    @endforeach | 
				
			||||
 | 
					                </tbody> | 
				
			||||
 | 
					            </table> | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					        <!-- Paginación --> | 
				
			||||
 | 
					        <div class="px-6 py-4 border-t border-gray-200"> | 
				
			||||
 | 
					            {{ $prestamos->links() }} | 
				
			||||
 | 
					        </div> | 
				
			||||
 | 
					    </div> | 
				
			||||
 | 
					</div> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					<script> | 
				
			||||
 | 
					document.addEventListener('DOMContentLoaded', function() { | 
				
			||||
 | 
					    // Desaparecer mensaje de éxito | 
				
			||||
 | 
					    var message = document.getElementById('success-message'); | 
				
			||||
 | 
					    if (message) { | 
				
			||||
 | 
					        setTimeout(function() { | 
				
			||||
 | 
					            message.style.transition = 'opacity 0.5s ease'; | 
				
			||||
 | 
					            message.style.opacity = '0'; | 
				
			||||
 | 
					            setTimeout(function() { | 
				
			||||
 | 
					                message.remove(); | 
				
			||||
 | 
					            }, 500); | 
				
			||||
 | 
					        }, 3000); | 
				
			||||
 | 
					    } | 
				
			||||
 | 
					}); | 
				
			||||
 | 
					</script> | 
				
			||||
 | 
					@endsection | 
				
			||||
					Loading…
					
					
				
		Reference in new issue