Commit ca6df521 authored by Yuri Resende's avatar Yuri Resende
Browse files

Adicionando uma coluna de carga horária corrigida na listagem dos professores

parent ef8c47f5
...@@ -339,6 +339,7 @@ class PadController extends Controller ...@@ -339,6 +339,7 @@ class PadController extends Controller
} }
$professor->ch = $this->get_carga_horaria_total($avaliacoes); $professor->ch = $this->get_carga_horaria_total($avaliacoes);
$professor->ch_corrigida = $this->get_carga_horaria_corrigida($avaliacoes_ensino, $avaliacoes_pesquisa, $avaliacoes_extensao, $avaliacoes_gestao);
} }
return view("pad.avaliacao.professores", compact('professores', 'pad', 'index_menu')); return view("pad.avaliacao.professores", compact('professores', 'pad', 'index_menu'));
...@@ -624,6 +625,45 @@ class PadController extends Controller ...@@ -624,6 +625,45 @@ class PadController extends Controller
} }
private function get_carga_horaria_corrigida($ensino, $pesquisa, $extensao, $gestao)
{
$ch = 0;
if($ensino) {
for ($i = 0; $i < count($ensino->all()); $i++){
if($ensino[$i]->status != Status::REPROVADO){
$ch += $ensino[$i]->tarefa()->first()->ch_semanal;
}
}
}
if($pesquisa) {
for ($i = 0; $i < count($pesquisa->all()); $i++){
if($pesquisa[$i]->status != Status::REPROVADO){
$ch += $pesquisa[$i]->tarefa()->first()->ch_semanal;
}
}
}
if($extensao) {
for ($i = 0; $i < count($extensao->all()); $i++){
if($extensao[$i]->status != Status::REPROVADO){
$ch += $extensao[$i]->tarefa()->first()->ch_semanal;
}
}
}
if($gestao) {
for ($i = 0; $i < count($gestao->all()); $i++){
if($gestao[$i]->status != Status::REPROVADO){
$ch += $gestao[$i]->tarefa()->first()->ch_semanal;
}
}
}
return $ch;
}
public function relatorio($id){ public function relatorio($id){
$user = Auth::user(); $user = Auth::user();
$pad = Pad::find($id); $pad = Pad::find($id);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<th scope="col">Professor</th> <th scope="col">Professor</th>
<th scope="col">Status</th> <th scope="col">Status</th>
<th scope="col">CH</th> <th scope="col">CH</th>
<th scope="col">CH Corrigida</th>
<th scope="col">Opções</th> <th scope="col">Opções</th>
</tr> </tr>
</thead> </thead>
...@@ -39,6 +40,7 @@ ...@@ -39,6 +40,7 @@
<td style="color:green;">{{$professor->status}}</td> <td style="color:green;">{{$professor->status}}</td>
@endif @endif
<td>@if($professor->ch > 0) {{$professor->ch}}H @endif</td> <td>@if($professor->ch > 0) {{$professor->ch}}H @endif</td>
<td>@if($professor->ch_corrigida > 0 && $professor->ch != $professor->ch_corrigida) {{$professor->ch_corrigida}}H @endif</td>
<td> <td>
@include('components.buttons.btn-avaliar', [ @include('components.buttons.btn-avaliar', [
......
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