Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
2bec30d5
Commit
2bec30d5
authored
Apr 12, 2023
by
Yuri Resende
Browse files
Resolvendo conflitos
parent
ac403a6d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
2bec30d5
...
@@ -112,88 +112,87 @@ class AdministradorController extends Controller
...
@@ -112,88 +112,87 @@ class AdministradorController extends Controller
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'column'
=>
$request
->
column
,
'grandesAreas'
=>
$grandesAreas
,
'areas'
=>
$areas
]);
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'column'
=>
$request
->
column
,
'grandesAreas'
=>
$grandesAreas
,
'areas'
=>
$areas
]);
}
}
// Utilizado para paginação de Collection
//retorna a média das avaliações dos relatórios e apresentações,
//o número de avaliações pendentes e duas listas com as avaliações parciais
public
function
analisarProposta
(
Request
$request
)
//e finais respectivamente
{
protected
function
get_info_avaliacoes
(
$avals
){
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
id
)
->
first
();
$evento
=
Evento
::
where
(
'id'
,
$trabalho
->
evento_id
)
->
first
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$substituicoesPendentes
=
Substituicao
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
where
(
'status'
,
'Em Aguardo'
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$avalSelecionadosId
=
$trabalho
->
avaliadors
->
pluck
(
'id'
);
$avalProjeto
=
Avaliador
::
whereNotIn
(
'id'
,
$avalSelecionadosId
)
->
get
();
$trabalho
->
aval
=
$avalProjeto
;
// Usuarios que possuem avaliações de relatório
//$avaliacoesRelatorio = [];->join('users','users.id','=','candidatos.user_id')
$AvalRelatParcial
=
[];
$AvalRelatParcial
=
[];
$AvalRelatFinal
=
[];
$AvalRelatFinal
=
[];
$MediaAvalRelatParcial
=
0
;
$MediaAvalRelatParcial
=
0
;
$MediaApresentacaoParcial
=
0
;
$AvalRelatParcialPendentes
=
0
;
$AvalRelatParcialPendentes
=
0
;
$MediaAvalRelatFinal
=
0
;
$MediaAvalRelatFinal
=
0
;
$MediaApresentacaoFinal
=
0
;
$AvalRelatFinalPendentes
=
0
;
$AvalRelatFinalPendentes
=
0
;
if
(
$evento
->
numParticipantes
==
0
)
{
$arquivo
=
Arquivo
::
where
(
"trabalhoId"
,
$trabalho
->
id
)
->
first
();
if
(
isset
(
$arquivo
))
{
$avals
=
AvaliacaoRelatorio
::
where
(
'arquivo_id'
,
$arquivo
->
id
)
->
get
();
}
else
{
$avals
=
[];
}
foreach
(
$avals
as
$aval
)
{
foreach
(
$avals
as
$aval
)
{
if
(
$aval
->
tipo
==
'Parcial'
)
{
if
(
$aval
->
tipo
==
'Parcial'
)
{
array_push
(
$AvalRelatParcial
,
$aval
);
array_push
(
$AvalRelatParcial
,
$aval
);
$MediaAvalRelatParcial
+=
$aval
->
nota
;
$MediaAvalRelatParcial
+=
$aval
->
nota
;
$MediaApresentacaoParcial
+=
$aval
->
nota_apresentacao
;
if
(
$aval
->
nota
==
null
){
if
(
$aval
->
nota
==
null
){
$AvalRelatParcialPendentes
+=
1
;
$AvalRelatParcialPendentes
+=
1
;
}
}
else
{
array_push
(
$AvalRelatFinal
,
$aval
);
$MediaAvalRelatFinal
+=
$aval
->
nota
;
if
(
$aval
->
nota
==
null
){
$AvalRelatFinalPendentes
+=
1
;
}
}
}
}
}
foreach
(
$trabalho
->
participantes
as
$participante
)
{
if
(
isset
(
$participante
->
planoTrabalho
))
{
$avals
=
AvaliacaoRelatorio
::
where
(
'arquivo_id'
,
$participante
->
planoTrabalho
->
id
)
->
get
();
}
else
{
}
else
{
$avals
=
[];
array_push
(
$AvalRelatFinal
,
$aval
);
}
$MediaAvalRelatFinal
+=
$aval
->
nota
;
foreach
(
$avals
as
$aval
)
{
$MediaApresentacaoFinal
+=
$aval
->
nota_apresentacao
;
if
(
$aval
->
tipo
==
'Parcial'
)
{
array_push
(
$AvalRelatParcial
,
$aval
);
$MediaAvalRelatParcial
+=
$aval
->
nota
;
if
(
$aval
->
nota
==
null
){
if
(
$aval
->
nota
==
null
){
$AvalRelatParcialPendentes
+=
1
;
$AvalRelatFinalPendentes
+=
1
;
}
}
else
{
array_push
(
$AvalRelatFinal
,
$aval
);
$MediaAvalRelatFinal
+=
$aval
->
nota
;
if
(
$aval
->
nota
==
null
){
$AvalRelatFinalPendentes
+=
1
;
}
}
}
}
}
}
}
if
(
count
(
$AvalRelatParcial
)
>
0
){
if
(
count
(
$AvalRelatParcial
)
>
0
){
$MediaAvalRelatParcial
=
$MediaAvalRelatParcial
/
count
(
$AvalRelatParcial
);
$MediaAvalRelatParcial
=
$MediaAvalRelatParcial
/
count
(
$AvalRelatParcial
);
$MediaApresentacaoParcial
=
$MediaApresentacaoParcial
/
count
(
$AvalRelatParcial
);
}
}
if
(
count
(
$AvalRelatFinal
)
>
0
){
if
(
count
(
$AvalRelatFinal
)
>
0
){
$MediaAvalRelatFinal
=
$MediaAvalRelatFinal
/
count
(
$AvalRelatFinal
);
$MediaAvalRelatFinal
=
$MediaAvalRelatFinal
/
count
(
$AvalRelatFinal
);
$MediaApresentacaoFinal
=
$MediaApresentacaoFinal
/
count
(
$AvalRelatFinal
);
}
return
[
'relatorio_parcial'
=>
number_format
(
$MediaAvalRelatParcial
,
2
,
'.'
,
''
),
'apresentacao_parcial'
=>
number_format
(
$MediaApresentacaoParcial
,
2
,
'.'
,
''
),
'pendentes_parcial'
=>
$AvalRelatParcialPendentes
,
'relatorio_final'
=>
number_format
(
$MediaAvalRelatFinal
,
2
,
'.'
,
''
),
'apresentacao_final'
=>
number_format
(
$MediaApresentacaoFinal
,
2
,
'.'
,
''
),
'pendentes_final'
=>
$AvalRelatFinalPendentes
,
'avaliacoes_parciais'
=>
$AvalRelatParcial
,
'avaliacoes_finais'
=>
$AvalRelatFinal
];
}
// Utilizado para paginação de Collection
public
function
analisarProposta
(
Request
$request
)
{
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
id
)
->
first
();
$evento
=
Evento
::
where
(
'id'
,
$trabalho
->
evento_id
)
->
first
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$substituicoesPendentes
=
Substituicao
::
where
(
'trabalho_id'
,
$trabalho
->
id
)
->
where
(
'status'
,
'Em Aguardo'
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$avalSelecionadosId
=
$trabalho
->
avaliadors
->
pluck
(
'id'
);
$avalProjeto
=
Avaliador
::
whereNotIn
(
'id'
,
$avalSelecionadosId
)
->
get
();
$trabalho
->
aval
=
$avalProjeto
;
// Usuarios que possuem avaliações de relatório
//$avaliacoesRelatorio = [];->join('users','users.id','=','candidatos.user_id')
$arquivos
=
Arquivo
::
where
(
"trabalhoId"
,
$trabalho
->
id
)
->
get
();
$avals_projeto
=
[];
$media_avaliacoes
=
[];
if
(
isset
(
$arquivos
))
{
foreach
(
$arquivos
as
$arquivo
)
{
array_push
(
$avals_projeto
,
AvaliacaoRelatorio
::
where
(
'arquivo_id'
,
$arquivo
->
id
)
->
get
());
}
}
foreach
(
$avals_projeto
as
$avals
)
{
array_push
(
$media_avaliacoes
,
$this
->
get_info_avaliacoes
(
$avals
));
}
}
// Verficação de pendencia de substituição
// Verficação de pendencia de substituição
...
@@ -209,7 +208,7 @@ class AdministradorController extends Controller
...
@@ -209,7 +208,7 @@ class AdministradorController extends Controller
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
$hoje
->
toDateString
();
$hoje
=
$hoje
->
toDateString
();
//dd($media_avaliacoes, $arquivos);
return
view
(
'administrador.analisarProposta'
)
->
with
(
return
view
(
'administrador.analisarProposta'
)
->
with
(
[
'trabalho'
=>
$trabalho
,
[
'trabalho'
=>
$trabalho
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
...
@@ -217,15 +216,11 @@ class AdministradorController extends Controller
...
@@ -217,15 +216,11 @@ class AdministradorController extends Controller
'substituicoesPendentes'
=>
$substituicoesPendentes
,
'substituicoesPendentes'
=>
$substituicoesPendentes
,
'substituicoesProjeto'
=>
$substituicoesProjeto
,
'substituicoesProjeto'
=>
$substituicoesProjeto
,
'grandeAreas'
=>
$grandeAreas
,
'grandeAreas'
=>
$grandeAreas
,
'AvalRelatParcial'
=>
$AvalRelatParcial
,
'AvalRelatFinal'
=>
$AvalRelatFinal
,
'hoje'
=>
$hoje
,
'hoje'
=>
$hoje
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'flagSubstituicao'
=>
$flagSubstituicao
,
'areasTematicas'
=>
$areasTematicas
,
'areasTematicas'
=>
$areasTematicas
,
'MediaAvalRelatParcial'
=>
$MediaAvalRelatParcial
,
'mediaAval'
=>
$media_avaliacoes
,
'AvalRelatParcialPendentes'
=>
$AvalRelatParcialPendentes
,
'arquivos'
=>
$arquivos
,
'MediaAvalRelatFinal'
=>
$MediaAvalRelatFinal
,
'AvalRelatFinalPendentes'
=>
$AvalRelatFinalPendentes
,
]);
]);
}
}
...
@@ -1302,4 +1297,4 @@ class AdministradorController extends Controller
...
@@ -1302,4 +1297,4 @@ class AdministradorController extends Controller
return
$pdf
->
setPaper
(
'a4'
)
->
stream
(
'Resultados.pdf'
);
return
$pdf
->
setPaper
(
'a4'
)
->
stream
(
'Resultados.pdf'
);
}
}
}
}
\ No newline at end of file
resources/views/administrador/analisarProposta.blade.php
View file @
2bec30d5
This diff is collapsed.
Click to expand it.
resources/views/projeto/formularioVisualizar/relatorio.blade.php
View file @
2bec30d5
...
@@ -52,17 +52,24 @@
...
@@ -52,17 +52,24 @@
<thead>
<thead>
<tr>
<tr>
<th
style=
"color: black;"
>
Avaliador
</th>
<th
style=
"color: black;"
>
Avaliador
</th>
<th
style=
"color: black;"
>
Discente
</th>
<th
style=
"color: black;"
>
Relatório
</th>
<th
style=
"color: black;"
>
Relatório
</th>
<th
style=
"color: black;"
>
Nota
</th>
<th
style=
"color: black;"
>
Nota
</th>
<th
style=
"color: black;"
>
Apresentação
</th>
<th
style=
"color: black;"
>
Visualizar
</th>
<th
style=
"color: black;"
>
Visualizar
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
@foreach($AvalRelatParcial as $aval)
@foreach($AvalRelatParcial as $aval)
@php $arquivo = \App\Arquivo::find($aval->arquivo_id);@endphp
<tr>
<tr>
<th
style=
"color: black;"
>
{{$cont += 1}}
</th>
<th
style=
"color: black;"
>
{{$cont += 1}}
</th>
<td>
@if($arquivo->participanteId != null) {{\App\Participante::find($arquivo->participanteId)->user->name}}@endif
</td>
<td>
Parcial
</td>
<td>
Parcial
</td>
<td>
@if($aval->nota == null) Pendente @else {{$aval->nota}} @endif
</td>
<td>
@if($aval->nota == null) Pendente @else {{$aval->nota}} @endif
</td>
<td>
@if($aval->nota_apresentacao == null) Pendente @else {{$aval->nota}} @endif
</td>
<td><a
href=
""
data-toggle=
"modal"
data-target=
"#modalVizuRelatParcial{{$aval->id}}"
class=
"button"
>
Visualizar
</a></td>
<td><a
href=
""
data-toggle=
"modal"
data-target=
"#modalVizuRelatParcial{{$aval->id}}"
class=
"button"
>
Visualizar
</a></td>
</tr>
</tr>
...
@@ -87,10 +94,15 @@
...
@@ -87,10 +94,15 @@
</div>
</div>
@endforeach
@endforeach
@foreach($AvalRelatFinal as $aval)
@foreach($AvalRelatFinal as $aval)
@php $arquivo = \App\Arquivo::find($aval->arquivo_id);@endphp
<tr>
<tr>
<th
style=
"color: black;"
>
{{$cont += 1}}
</th>
<th
style=
"color: black;"
>
{{$cont += 1}}
</th>
<td>
@if($arquivo->participanteId != null) {{\App\Participante::find($arquivo->participanteId)->user->name}}@endif
</td>
<td>
Final
</td>
<td>
Final
</td>
<td>
@if($aval->nota == null) Pendente @else {{$aval->nota}} @endif
</td>
<td>
@if($aval->nota == null) Pendente @else {{$aval->nota}} @endif
</td>
<td>
@if($aval->nota_apresentacao == null) Pendente @else {{$aval->nota}} @endif
</td>
<td><a
href=
""
data-toggle=
"modal"
data-target=
"#modalVizuRelatFinal{{$aval->id}}"
class=
"button"
>
Visualizar
</a></td>
<td><a
href=
""
data-toggle=
"modal"
data-target=
"#modalVizuRelatFinal{{$aval->id}}"
class=
"button"
>
Visualizar
</a></td>
</tr>
</tr>
<!-- Modal visualizar informações participante -->
<!-- Modal visualizar informações participante -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment