Commit 3586a829 authored by unknown's avatar unknown
Browse files

Correção do filtro e adição de novas opções de filtraram(GrandeÁrea e Area)

parent f62b6952
......@@ -73,19 +73,28 @@ class AdministradorController extends Controller
public function analisar(Request $request){
$evento = Evento::find($request->evento_id);
$status = ['submetido', 'avaliado', 'aprovado', 'reprovado', 'corrigido'];
$aux = Trabalho::where('evento_id', $evento->id)
->whereIn('status', $status)
->pluck('grande_area_id');
$idArea = Trabalho::where('evento_id', $evento->id)
->whereIn('status', $status)
->pluck('area_id');
$trabalhos = Trabalho::where('evento_id', $evento->id)
->whereIn('status', $status)
->orderBy('titulo')
->paginate(10);
$grandesAreas = GrandeArea::whereIn('id', $aux)->get();
$areas = Area::whereIn('id', $idArea)->get();
$funcaoParticipantes = FuncaoParticipantes::all();
// $participantes = Participante::where('trabalho_id', $id)->get();
// $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get();
// $participantes = User::whereIn('id', $participantesUsersIds)->get();
return view('administrador.analisar')->with(['trabalhos' => $trabalhos, 'evento' => $evento, 'funcaoParticipantes' => $funcaoParticipantes, 'column' => $request->column]);
return view('administrador.analisar')->with(['trabalhos' => $trabalhos, 'evento' => $evento, 'funcaoParticipantes' => $funcaoParticipantes, 'column' => $request->column, 'grandesAreas' => $grandesAreas, 'areas' => $areas]);
}
// Utilizado para paginação de Collection
......
......@@ -12,31 +12,31 @@
<div class="col-md-12"><h5 style="color: #1492E6; font-size: 20px;">Edital - {{$evento->nome}}</h5></div>
<div class="col-md-12"><h6 style="color: #234B8B; margin-bottom:-0.4rem; font-weight: bold; font-size: 14px;">Propostas Submetidas</h6><br></div>
<div class="col-md-12">
<div class="btn-group dropup">
<button type="button" style="text-transform: capitalize;" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Filtro @isset ($column) - {{$column}} @endisset
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id])}}">
Todos
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'aprovado'])}}">
Recomendados
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'reprovado'])}}">
Não Recomendados
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'submetido'])}}">
Submetidos
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'avaliado'])}}">
Avaliado
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'corrigido'])}}">
Parcialmente Recomendados
</a>
</div>
</div>
<select id="" class="form-control select-submeta" onchange="teste(this)" style="width: 200px;">
<option value="todos" selected>Todos</option>
<option value="aprovado">Recomendados</option>
<option value="reprovado">Não Recomendados</option>
<option value="submetido">Submetidos</option>
<option value="avaliado">Avaliados</option>
<option value="corrigido">Parcialmente Recomendados</option>
@foreach($grandesAreas as $grandeArea)
<option value="{{$grandeArea->nome}}">
Grande Área: {{ $grandeArea->nome }}
</option>
@foreach($areas as $area)
@if($grandeArea->id == $area->grande_area_id)
<option value="{{$area->nome}}">
&nbsp;&nbsp; - Área: {{ $area->nome }}
</option>
@endif
@endforeach
@endforeach
</select>
</div>
</div>
</div>
......@@ -65,18 +65,18 @@
</div>
<div id="projetos">
@foreach( $trabalhos as $trabalho )
<!--Informações Proponente-->
<div class="row justify-content-center" style="margin-top: 20px;">
<div class="row justify-content-center allTrab apareceu {{$trabalho->status}} {{$trabalho->grandeArea->nome}} {{$trabalho->area->nome}}" style="margin-top: 20px;" >
<br>
<div class="col-md-11 " onclick="myFunc({{$trabalho->id}})">
<div class="col-md-11" onclick="myFunc({{$trabalho->id}})">
<a href="{{route('admin.analisarProposta',['id'=>$trabalho->id])}}" id="vizuProposta{{$trabalho->id}}" hidden></a>
<div class="card" style="border-radius: 5px;margin-left: 25px;margin-right: 25 px">
<div class="card-body" style="padding-top: 0.2rem; padding-left: 25px;padding-right: 25px;">
<div class="form-row mt-3">
<div class="col-md-10 tituloProj"><h5 style="color: #234B8B; font-weight: bold">Título: {{ $trabalho->titulo }}</h5></div>
<div class="col-md-10 tituloProj"><h5 style="color: #234B8B; font-weight: bold; margin-top: 15px;">Título: {{ $trabalho->titulo }}</h5></div>
<div class="col-md-2">
@if($trabalho->status == "aprovado")
<img src="{{asset('img/icons/aprovado.png')}}" style="width: 23%;margin: auto;display: flex;margin-top: 0px;justify-content: center;align-items: center;" alt="">
......@@ -135,23 +135,57 @@
document.getElementById("vizuProposta"+i).click();
}
function buscar(input) {
let trabalhos = document.getElementById("projetos").children;
if(input.value.length > 2) {
//console.log(trabalhos)
if(input.value.length > 2) {
for(let i = 0; i < trabalhos.length; i++){
let tituloProjeto = trabalhos[i].getElementsByClassName("tituloProj")[0].textContent
let nomeProponente = trabalhos[i].getElementsByClassName("proponenteProj")[0].textContent
if(trabalhos[i].classList.contains("apareceu")){
let tituloProjeto = trabalhos[i].getElementsByClassName("tituloProj")[0].textContent
let nomeProponente = trabalhos[i].getElementsByClassName("proponenteProj")[0].textContent
if(tituloProjeto.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0 || nomeProponente.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0) {
trabalhos[i].style.display = "";
}else {
trabalhos[i].style.display = "none";
}
}
if(tituloProjeto.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0 || nomeProponente.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0) {
}
}else {
for(let i = 0; i < trabalhos.length; i++) {
if(trabalhos[i].classList.contains("apareceu")){
trabalhos[i].style.display = "";
}else {
trabalhos[i].style.display = "none";
}
}
}
}
function teste(select) {
let todos = document.getElementsByClassName("allTrab");
let selecionados = document.getElementsByClassName(select.value);
if(select.value == "todos"){
for(let i = 0; i < todos.length; i++){
todos[i].style.display = ""
if(!todos[i].classList.contains("apareceu")){
todos[i].classList.add("apareceu");
}
}
}else {
for(let i = 0; i < trabalhos.length; i++) {
trabalhos[i].style.display = "";
for(let j = 0; j < todos.length; j++){
todos[j].style.display = "none";
todos[j].classList.remove("apareceu");
}
for(let k = 0; k < selecionados.length; k++){
selecionados[k].style.display = "";
selecionados[k].classList.add("apareceu");
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment