Commit 7d486e98 authored by Yuri Resende's avatar Yuri Resende
Browse files

Relatório dos professores com a CH de ensino, pesquisa, extensão e gestão

parent 9345e016
......@@ -638,25 +638,36 @@ class PadController extends Controller
$userPad = $professor->userPads()->where('pad_id', '=', $pad->id)->first();
$avaliacoes = $this->get_avaliacoes($userPad, $avaliador_pad);
$avaliacoes_ensino = $avaliacoes['ensino']->get();
$avaliacoes_pesquisa = $avaliacoes['pesquisa']->get();
$avaliacoes_extensao = $avaliacoes['extensao']->get();
$avaliacoes_gestao = $avaliacoes['gestao']->get();
$professor->ch_ensino = $this->get_carga_horaria($avaliacoes['ensino']->get());
$professor->ch_pesquisa = $this->get_carga_horaria($avaliacoes['pesquisa']->get());
$professor->ch_extensao = $this->get_carga_horaria($avaliacoes['extensao']->get());
$professor->ch_gestao = $this->get_carga_horaria($avaliacoes['gestao']->get());
if( $avaliacoes_ensino->all() != null ||
$avaliacoes_pesquisa->all() != null ||
$avaliacoes_extensao->all() != null ||
$avaliacoes_gestao->all() != null){
if( $professor->ch_ensino > 0 ||
$professor->ch_pesquisa > 0 ||
$professor->ch_extensao > 0 ||
$professor->ch_gestao > 0){
$professor->status = "Enviado";
}
}
// dd($professores[1]->status);
return view('pad.relatorio.relatorio', [
'pad' => $pad,
'index_menu' => $index_menu,
'professores' => $professores]);
}
private function get_carga_horaria($avaliacoes){
$ch = 0;
foreach ($avaliacoes as $avaliacao){
$ch += $avaliacao->tarefa->ch_semanal;
}
return $ch;
}
}
......@@ -26,7 +26,7 @@
</div>
<div class="card-body">
<table class="table table-hover table-striped table-striped">
<table class="table table-hover table-striped table-striped table-sm">
<thead>
<tr>
<th scope='col'></th>
......@@ -58,6 +58,50 @@
<div class="card d-flex" style='margin-top:20px;'>
<div class="card-head d-flex justify-content-center" style="background-color:#dfdfdf; padding-top:10px;">
<h6 class="card-title" style="font-weight:bold;">RELAÇÃO DOS PROFESSORES QUE ENVIARAM O PAD</h6>
</div>
<div class="card-body">
<table class="table table-hover table-striped table-striped table-sm">
<thead>
<tr>
<th scope='col'></th>
<th scope='col'>Professor</th>
<th scope='col'>CH Ensino</th>
<th scope='col'>CH Pesquisa</th>
<th scope='col'>CH Extensão</th>
<th scope='col'>CH Gestão</th>
<th scope='col'>Campus</th>
</tr>
</thead>
<tbody>
@php $index = 1; @endphp
@foreach($professores as $professor)
@if($professor->status != "Pendente")
<tr scope='row'>
<td>{{$index}}</td>
<td>{{$professor->name}}</td>
<td>{{$professor->ch_ensino}}</td>
<td>{{$professor->ch_pesquisa}}</td>
<td>{{$professor->ch_extensao}}</td>
<td>{{$professor->ch_gestao}}</td>
<td>{{$professor->campus}}</td>
</tr>
@php $index += 1 @endphp
@endif
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
\ No newline at end of file
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