Commit 4fe99ac7 authored by PedroLopesUPE's avatar PedroLopesUPE
Browse files

Merge branch 'main' into dev-joao-pdf_generator

parents 18f985d5 5e2a0494
...@@ -609,10 +609,65 @@ class PadController extends Controller ...@@ -609,10 +609,65 @@ class PadController extends Controller
return $ch; return $ch;
} }
public function relatorio($id){ public function relatorio($id){
$menu = MenuItemsAvaliador::REPORT; $user = Auth::user();
$pad = Pad::find($id); $pad = Pad::find($id);
return view('pad.relatorio.relatorio', ['pad' => $pad, 'index_menu' => $menu]); $index_menu = MenuItemsAvaliador::REPORT;
$professores = User::join('user_pad', 'user_pad.user_id', '=', 'users.id')
->join('pad', 'user_pad.pad_id', '=', 'pad.id')
->where(function ($query) use ($user, $id) {
$query->where('pad.status', '=', Status::ATIVO);
$query->where('users.campus_id', '=', $user->campus_id);
$query->where('users.id', '!=', $user->id);
$query->where('pad.id', '=', $id);
})
->select('users.id', 'users.name', 'users.curso_id', 'users.campus_id')
->orderBy('name')
->get();
//Informando se o PAD foi enviado ou não
$avaliador_pad = AvaliadorPad::where(function ($query) use ($pad, $user) {
$query->where('user_id', '=', $user->id);
$query->where('pad_id', '=', $pad->id);
})->first();
foreach ($professores as $professor){
$professor->status = "Pendente";
$userPad = $professor->userPads()->where('pad_id', '=', $pad->id)->first();
$avaliacoes = $this->get_avaliacoes($userPad, $avaliador_pad);
$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( $professor->ch_ensino > 0 ||
$professor->ch_pesquisa > 0 ||
$professor->ch_extensao > 0 ||
$professor->ch_gestao > 0){
$professor->status = "Enviado";
}
}
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;
} }
} }
<header class="navbar p-0"> <header class="navbar p-0">
<div class="header-left-side"> <div class="header-left-side">
<a class="navbar-brand p-3" href="#"> <a class="navbar-brand p-3" href="#">
<img src="http://www.avaliacaodocente.upe.br/assets/img/logo-upe.png" class="img-fluid mr-3" width="128" {{-- <img src="http://www.avaliacaodocente.upe.br/assets/img/logo-upe.png" class="img-fluid mr-3" width="128"
height="93" alt="" /> height="93" alt="" />
<img src="https://www.gestaododesempenho.pe.gov.br/AvaliacaoDesempenho/public/resources/images/logos-direita.png" <img src="https://www.gestaododesempenho.pe.gov.br/AvaliacaoDesempenho/public/resources/images/logos-direita.png"
class="img-fluid" width="268" height="100" alt="" /> class="img-fluid" width="268" height="100" alt="" /> --}}
<img src="{{url('images/estado_pe_logo.png')}}" alt="Logo do Estado" class="img-fluid" width="300" height="100" alt="" />
</a> </a>
</div> </div>
<div class="header-divider"></div> <div class="header-divider"></div>
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -188,3 +188,15 @@ ...@@ -188,3 +188,15 @@
</div> </div>
@endsection @endsection
<script>
function setaDadosModalAvaliacao(tarefa_id, professor_id, status, atividade_type, avaliacao_id){
console.log(document.getElementById('avaliacao_id_reprovar'));
document.getElementById('tarefa_id').value = tarefa_id;
document.getElementById('professor_id').value = professor_id;
document.getElementById('status').value = status;
document.getElementById('atividade_type').value = atividade_type;
document.getElementById('avaliacao_id_reprovar').value = avaliacao_id;
console.log(document.getElementById('avaliacao_id_reprovar'));
}
</script>
\ No newline at end of file
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -190,3 +190,15 @@ ...@@ -190,3 +190,15 @@
</div> </div>
@endsection @endsection
<script>
function setaDadosModalAvaliacao(tarefa_id, professor_id, status, atividade_type, avaliacao_id){
console.log(document.getElementById('avaliacao_id_reprovar'));
document.getElementById('tarefa_id').value = tarefa_id;
document.getElementById('professor_id').value = professor_id;
document.getElementById('status').value = status;
document.getElementById('atividade_type').value = atividade_type;
document.getElementById('avaliacao_id_reprovar').value = avaliacao_id;
console.log(document.getElementById('avaliacao_id_reprovar'));
}
</script>
\ No newline at end of file
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -190,3 +190,15 @@ ...@@ -190,3 +190,15 @@
</div> </div>
@endsection @endsection
<script>
function setaDadosModalAvaliacao(tarefa_id, professor_id, status, atividade_type, avaliacao_id){
console.log(document.getElementById('avaliacao_id_reprovar'));
document.getElementById('tarefa_id').value = tarefa_id;
document.getElementById('professor_id').value = professor_id;
document.getElementById('status').value = status;
document.getElementById('atividade_type').value = atividade_type;
document.getElementById('avaliacao_id_reprovar').value = avaliacao_id;
console.log(document.getElementById('avaliacao_id_reprovar'));
}
</script>
\ No newline at end of file
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -190,3 +190,15 @@ ...@@ -190,3 +190,15 @@
</div> </div>
@endsection @endsection
<script>
function setaDadosModalAvaliacao(tarefa_id, professor_id, status, atividade_type, avaliacao_id){
console.log(document.getElementById('avaliacao_id_reprovar'));
document.getElementById('tarefa_id').value = tarefa_id;
document.getElementById('professor_id').value = professor_id;
document.getElementById('status').value = status;
document.getElementById('atividade_type').value = atividade_type;
document.getElementById('avaliacao_id_reprovar').value = avaliacao_id;
console.log(document.getElementById('avaliacao_id_reprovar'));
}
</script>
\ No newline at end of file
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
data-bs-toggle="modal" data-bs-toggle="modal"
data-bs-target="#modal_avaliacao" data-bs-target="#modal_avaliacao"
style="height: 38px;" style="height: 38px;"
onclick=" setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') "> onclick="setaDadosModalAvaliacao('{{$avaliacao->tarefa->id}}', '{{$avaliacao->tarefa->userPad->user->id}}', '6', '{{$avaliacao->type}}', '{{$avaliacao->id}}') ">
Reprovar Reprovar
</button> </button>
...@@ -427,6 +427,5 @@ ...@@ -427,6 +427,5 @@
document.getElementById('atividade_type').value = atividade_type; document.getElementById('atividade_type').value = atividade_type;
document.getElementById('avaliacao_id_reprovar').value = avaliacao_id; document.getElementById('avaliacao_id_reprovar').value = avaliacao_id;
console.log(document.getElementById('avaliacao_id_reprovar')); console.log(document.getElementById('avaliacao_id_reprovar'));
} }
</script> </script>
...@@ -11,44 +11,97 @@ ...@@ -11,44 +11,97 @@
@endsection @endsection
@section('title', 'Relatórios') @section('title', 'Relatórios')
@section('body') @section('body')
<div class="tab-content">
<div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3">
<h1 class="h2">Relatórios</h1> <h3>
</div> <i class="bi bi-exclamation-octagon-fill"></i>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3"> Relatório pad {{$pad->nome}}
<h3> </h3>
<i class="bi bi-exclamation-octagon-fill"></i> </div>
Relatório pad {{$pad->nome}} <div class="card d-flex">
</h3> <div class="card-head d-flex justify-content-center" style="background-color:#dfdfdf; padding-top:10px;">
</div> <h6 class="card-title" style="font-weight:bold;">PROFESSORES QUE NÃO ENVIARAM O PAD</h6>
</div>
<table class="table"> <div class="card-body">
<table class="table table-hover table-striped table-striped table-sm">
<thead> <thead>
<tr>
<th scope='col'></th>
<th scope='col'>Professor</th> <th scope='col'>Professor</th>
<th scope='col'>Ch Ensino</th>
<th scope='col'>Ch Pesqiosa</th>
<th scope='col'>Ch Extensão</th>
<th scope='col'>Ch Gestão</th>
<th scope='col'>Curso</th> <th scope='col'>Curso</th>
<th scope='col'>Campus</th>
</tr>
</thead> </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->curso}}</td>
<td>{{$professor->campus}}</td>
</tr>
@php $index += 1 @endphp
@endif
@endforeach
</tbody>
</table>
</div>
</div>
<td></td> <div class="card d-flex" style='margin-top:20px;'>
<td></td> <div class="card-head d-flex justify-content-center" style="background-color:#dfdfdf; padding-top:10px;">
<td></td> <h6 class="card-title" style="font-weight:bold;">RELAÇÃO DOS PROFESSORES QUE ENVIARAM O PAD</h6>
<td></td> </div>
<td></td> <div class="card-body">
<td></td>
<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> <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> </tbody>
</table> </table>
</div>
</div> </div>
</div>
@endsection @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