You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

88 lines
4.6 KiB

<x-app-layout>
<div class="py-8 px-8">
@if(session('status'))
<div class="w-full p-5 bg-blue-600 mb-5 text-white rounded uppercase font-bold text-lg">
{{session('status')}}
</div>
@endif
<div class="header flex flex-col items-center gap-4 ">
<div class="flex justify-between items-center w-full mb-5">
<h1 class=" text-gray-900 dark:text-gray-100 text-3xl font-bold text-center">
Filas
</h1>
<button class="bg-blue-500 hover:bg-opacity-90 transition-all text-white py-2 px-6 rounded text-base overflow-hidden" @click="modal = !modal" type="button">Cadastrar Fila</button>
</div>
<form action="{{route('filas')}}" method="GET" class="flex w-full gap-3 flex-col lg:flex-row ">
<div class="search bg-white dark:bg-gray-800 rounded px-3 py-1 overflow-hidden">
<i class="fas fa-search dark:text-gray-100"></i>
<input type="text" name="pesquisa" class="border-none bg-transparent focus:ring-transparent placeholder:text-gray-800 dark:placeholder:text-gray-100 dark:text-gray-100 " placeholder="Pesquise filas">
</div>
<select class="border-none rounded overflow-hidden dark:bg-gray-800 dark:text-gray-100" name="status">
@if($selected->isSelected)
@if($selected->isAtivo == 'ativo')
<option value="ativo" selected>Ativos</option>
<option value="desativado">Desativados</option>
@else
<option value="ativo">Ativos</option>
<option value="desativado" selected>Desativados</option>
@endif
@else
<option value="ativo">Ativos</option>
<option value="desativado">Desativados</option>
@endif
</select>
<button class="lg:ml-auto ml-0 bg-blue-900 hover:bg-opacity-90 transition-all text-white py-2 px-6 rounded text-lg overflow-hidden">Pesquisar</button>
</form>
</div>
<div class="body mt-4 overflow-auto rounded-lg shadow">
<table class="w-full">
<thead class="bg-gray-50 dark:bg-gray-700 dark:text-gray-100">
<tr>
<th class="p-3 text-sm font-semibold tracking-wide text-left">ID</th>
<th class="p-3 text-sm font-semibold tracking-wide text-left">Nome</th>
<th class="p-3 text-sm font-semibold tracking-wide text-left">Status</th>
<th class="p-3 text-sm font-semibold tracking-wide text-left">Ações</th>
</tr>
</thead>
<tbody>
@foreach($filas as $fila)
<tr class="bg-white dark:bg-gray-800 dark:border-gray-600 border-b-2">
<td class="p-3 text-sm text-gray-700 dark:text-gray-100">{{$fila->id}}</td>
<td class="p-3 text-sm text-gray-700 dark:text-gray-100">{{$fila->nome}}</td>
@if($fila->is_ativa)
<td class="p-3 text-sm text-green-500 font-bold">ATIVO</td>
@else
<td class="p-3 text-sm text-red-500 font-bold">DESATIVADO</td>
@endif
<td class="p-3 text-sm font-bold w-28">
<button class="bg-blue-600 text-white p-2 rounded text-lg text-center w-full mb-2" onclick="atualizarFila(<?= $fila->id ?>)"><i class="fas fa-edit"></i></button>
@if($fila->is_ativa)
<form method="POST" action="filas/deletar/{{$fila->id}}" title="desativar fila?" onclick="javascript: if(!confirm('Deseja desativar essa fila?')) return false;">
@csrf
@method('delete')
<button class="bg-red-600 dark:bg-red-700 text-white p-2 rounded text-lg w-full">
<i class="fas fa-ban"></i>
</button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<script src="{{ asset('js/views/fila/atualizaFila.js') }}"></script>
<x-modal.insert.modalFila></x-modalFila>
<x-modal.edit.modalEditFila></x-modalEditFila>
</x-app-layout>