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 ...@@ -73,19 +73,28 @@ class AdministradorController extends Controller
public function analisar(Request $request){ public function analisar(Request $request){
$evento = Evento::find($request->evento_id); $evento = Evento::find($request->evento_id);
$status = ['submetido', 'avaliado', 'aprovado', 'reprovado', 'corrigido']; $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) $trabalhos = Trabalho::where('evento_id', $evento->id)
->whereIn('status', $status) ->whereIn('status', $status)
->orderBy('titulo') ->orderBy('titulo')
->paginate(10); ->paginate(10);
$grandesAreas = GrandeArea::whereIn('id', $aux)->get();
$areas = Area::whereIn('id', $idArea)->get();
$funcaoParticipantes = FuncaoParticipantes::all(); $funcaoParticipantes = FuncaoParticipantes::all();
// $participantes = Participante::where('trabalho_id', $id)->get(); // $participantes = Participante::where('trabalho_id', $id)->get();
// $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get(); // $participantesUsersIds = Participante::where('trabalho_id', $id)->select('user_id')->get();
// $participantes = User::whereIn('id', $participantesUsersIds)->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 // Utilizado para paginação de Collection
......
...@@ -12,31 +12,31 @@ ...@@ -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"><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"><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="col-md-12">
<div class="btn-group dropup"> <select id="" class="form-control select-submeta" onchange="teste(this)" style="width: 200px;">
<button type="button" style="text-transform: capitalize;" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <option value="todos" selected>Todos</option>
Filtro @isset ($column) - {{$column}} @endisset <option value="aprovado">Recomendados</option>
</button> <option value="reprovado">Não Recomendados</option>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink"> <option value="submetido">Submetidos</option>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id])}}"> <option value="avaliado">Avaliados</option>
Todos <option value="corrigido">Parcialmente Recomendados</option>
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'aprovado'])}}">
Recomendados @foreach($grandesAreas as $grandeArea)
</a>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'reprovado'])}}"> <option value="{{$grandeArea->nome}}">
Não Recomendados Grande Área: {{ $grandeArea->nome }}
</a> </option>
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'submetido'])}}"> @foreach($areas as $area)
Submetidos @if($grandeArea->id == $area->grande_area_id)
</a> <option value="{{$area->nome}}">
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'avaliado'])}}"> &nbsp;&nbsp; - Área: {{ $area->nome }}
Avaliado </option>
</a> @endif
<a class="dropdown-item" href="{{route('admin.analisar', ['evento_id' => $evento->id, 'column' => 'corrigido'])}}"> @endforeach
Parcialmente Recomendados @endforeach
</a>
</div>
</div> </select>
</div> </div>
</div> </div>
</div> </div>
...@@ -65,18 +65,18 @@ ...@@ -65,18 +65,18 @@
</div> </div>
<div id="projetos"> <div id="projetos">
@foreach( $trabalhos as $trabalho ) @foreach( $trabalhos as $trabalho )
<!--Informações Proponente--> <!--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> <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> <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" 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="card-body" style="padding-top: 0.2rem; padding-left: 25px;padding-right: 25px;">
<div class="form-row mt-3"> <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"> <div class="col-md-2">
@if($trabalho->status == "aprovado") @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=""> <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 @@ ...@@ -135,23 +135,57 @@
document.getElementById("vizuProposta"+i).click(); document.getElementById("vizuProposta"+i).click();
} }
function buscar(input) { function buscar(input) {
let trabalhos = document.getElementById("projetos").children; let trabalhos = document.getElementById("projetos").children;
//console.log(trabalhos)
if(input.value.length > 2) { if(input.value.length > 2) {
for(let i = 0; i < trabalhos.length; i++){ for(let i = 0; i < trabalhos.length; i++){
let tituloProjeto = trabalhos[i].getElementsByClassName("tituloProj")[0].textContent if(trabalhos[i].classList.contains("apareceu")){
let nomeProponente = trabalhos[i].getElementsByClassName("proponenteProj")[0].textContent 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 = ""; 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 { }else {
for(let i = 0; i < trabalhos.length; i++) { for(let j = 0; j < todos.length; j++){
trabalhos[i].style.display = ""; 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