|
|
@ -34,29 +34,25 @@ |
|
|
|
<div class="p-4 border-b border-gray-200 flex justify-between items-center"> |
|
|
|
<h2 class="text-2xl font-bold">Gestión de Préstamos</h2> |
|
|
|
<div class="flex items-center space-x-6"> |
|
|
|
<!-- Exportar a Excel --> |
|
|
|
<a href="{{ route('prestamos.excel') }}" |
|
|
|
class="text-green-600 hover:text-green-700 transition-colors duration-200" |
|
|
|
title="Exportar a Excel"> |
|
|
|
<i class="fas fa-file-excel text-xl"></i> |
|
|
|
</a> |
|
|
|
|
|
|
|
<!-- Íconos de exportación --> |
|
|
|
<div class="flex space-x-4"> |
|
|
|
<!-- Exportar a Excel --> |
|
|
|
<a href="{{ route('prestamos.excel') }}" |
|
|
|
class="text-green-600 hover:text-green-700 transition-colors duration-200" |
|
|
|
title="Exportar a Excel"> |
|
|
|
<i class="fas fa-file-excel text-xl"></i> |
|
|
|
</a> |
|
|
|
|
|
|
|
<!-- Exportar a PDF --> |
|
|
|
<a href="{{ route('prestamos.pdf') }}" |
|
|
|
class="text-red-600 hover:text-red-700 transition-colors duration-200" |
|
|
|
title="Exportar a PDF"> |
|
|
|
<i class="fas fa-file-pdf text-xl"></i> |
|
|
|
</a> |
|
|
|
<!-- Agregar nuevo préstamo --> |
|
|
|
<a href="{{ route('prestamos.create') }}" |
|
|
|
class="text-blue-500 hover:text-blue-600 transition-colors duration-200" |
|
|
|
title="Agregar nuevo préstamo"> |
|
|
|
<i class="fas fa-plus text-xl"></i> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
<!-- Exportar a PDF --> |
|
|
|
<a href="{{ route('prestamos.pdf') }}" |
|
|
|
class="text-red-600 hover:text-red-700 transition-colors duration-200" |
|
|
|
title="Exportar a PDF"> |
|
|
|
<i class="fas fa-file-pdf text-xl"></i> |
|
|
|
</a> |
|
|
|
<!-- Agregar nuevo préstamo --> |
|
|
|
<a href="{{ route('prestamos.create') }}" |
|
|
|
class="text-blue-500 hover:text-blue-600 transition-colors duration-200" |
|
|
|
title="Agregar nuevo préstamo"> |
|
|
|
<i class="fas fa-plus text-xl"></i> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
@ -165,28 +161,16 @@ |
|
|
|
</td> |
|
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium"> |
|
|
|
<div class="flex space-x-2"> |
|
|
|
<a href="{{ route('prestamos.edit', $prestamo->id) }}" class="text-blue-600 hover:text-blue-900"> |
|
|
|
<a href="{{ route('prestamos.edit', $prestamo->id) }}" class="text-yellow-600 hover:text-blue-900"> |
|
|
|
<i class="fas fa-edit"></i> |
|
|
|
</a> |
|
|
|
<form action="{{ route('prestamos.destroy', $prestamo->id) }}" method="POST" class="inline"> |
|
|
|
<form action="{{ route('prestamos.destroy', $prestamo->id) }}" method="POST" class="inline" onsubmit="return confirmarEliminacion(this);"> |
|
|
|
@csrf |
|
|
|
@method('DELETE') |
|
|
|
<button type="submit" class="text-red-600 hover:text-red-900" onclick="return confirm('¿Estás seguro de que deseas eliminar este préstamo?')"> |
|
|
|
<button type="submit" class="text-red-600 hover:text-red-900"> |
|
|
|
<i class="fas fa-trash"></i> |
|
|
|
</button> |
|
|
|
</form> |
|
|
|
<form action="{{ route('prestamos.aceptar', $prestamo->id) }}" method="POST" class="inline"> |
|
|
|
@csrf |
|
|
|
<button type="submit" class="text-green-600 hover:text-green-900" onclick="return confirm('¿Estás seguro de que deseas aceptar este préstamo?')"> |
|
|
|
<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-yellow-600 hover:text-yellow-900" onclick="return confirm('¿Estás seguro de que deseas rechazar este préstamo?')"> |
|
|
|
<i class="fas fa-times"></i> |
|
|
|
</button> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
@ -210,8 +194,8 @@ |
|
|
|
} |
|
|
|
}, 3000); |
|
|
|
|
|
|
|
function confirmarEliminacion(button) { |
|
|
|
Swal.fire({ |
|
|
|
function confirmarEliminacion(form) { |
|
|
|
return Swal.fire({ |
|
|
|
title: '¿Estás seguro?', |
|
|
|
text: "Esta acción no se puede deshacer", |
|
|
|
icon: 'warning', |
|
|
@ -222,8 +206,9 @@ |
|
|
|
cancelButtonText: 'Cancelar' |
|
|
|
}).then((result) => { |
|
|
|
if (result.isConfirmed) { |
|
|
|
button.closest('form').submit(); |
|
|
|
form.submit(); |
|
|
|
} |
|
|
|
return false; // Evitar el envío del formulario por defecto |
|
|
|
}); |
|
|
|
} |
|
|
|
</script> |
|
|
|