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
0c0a5479
Commit
0c0a5479
authored
Mar 28, 2022
by
Guilherme Silva
Browse files
Montagem de ranking na página de resultados
parent
038a1251
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
0c0a5479
...
...
@@ -130,6 +130,24 @@ class AdministradorController extends Controller
public
function
showResultados
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
=
$evento
->
trabalhos
;
//foreach($trabalho->avaliadors as $avaliador)
foreach
(
$trabalhos
as
$trabalho
){
$trabalho
->
pontuacao
=
0
;
foreach
(
$trabalho
->
avaliadors
as
$avaliador
){
if
(
$avaliador
->
tipo
==
"Interno"
){
$parecerInterno
=
ParecerInterno
::
where
([[
'avaliador_id'
,
$avaliador
->
id
],[
'trabalho_id'
,
$trabalho
->
id
]])
->
first
();
if
(
$parecerInterno
!=
null
){
$trabalho
->
pontuacao
+=
$parecerInterno
->
statusAnexoPlanilhaPontuacao
;
}
}
}
}
$trabalhos
=
$trabalhos
->
sort
(
function
(
$item
,
$next
)
{
return
$item
->
pontuacao
>=
$next
->
pontuacao
?
-
1
:
1
;
});
$trabalhos
=
$this
->
paginate
(
$trabalhos
)
->
withPath
(
'/usuarios/showResultados?evento_id='
.
$evento
->
id
);;
return
view
(
'administrador.resultadosProjetos'
)
->
with
([
'evento'
=>
$evento
,
'trabalhos'
=>
$trabalhos
]);
}
...
...
resources/views/administrador/resultadosProjetos.blade.php
View file @
0c0a5479
...
...
@@ -33,17 +33,21 @@
<
table
class
=
"table table-bordered"
style
=
"display: block; white-space: nowrap; border-radius:10px; margin-bottom:0px"
>
<
thead
>
<
tr
>
<
th
scope
=
"col"
>
Pontuação
</
th
>
<
th
scope
=
"col"
style
=
"width: 100%;"
>
Nome
do
projeto
</
th
>
<
th
scope
=
"col"
>
Proponente
</
th
>
<
th
scope
=
"col"
>
Área
</
th
>
<
th
scope
=
"col"
>
N
.
Planos
</
th
>
<
th
scope
=
"col"
>
Avaliador
Externo
</
th
>
<
th
scope
=
"col"
>
Avaliador
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
Bolsas
</
th
>
</
tr
>
</
thead
>
<
tbody
id
=
"projetos"
>
@
foreach
(
$trabalhos
as
$trabalho
)
@
if
(
$trabalho
->
status
==
'aprovado'
)
<
tr
>
<
td
>
{{
$trabalho
->
pontuacao
}}
</
td
>
<
td
style
=
"max-width:100px; overflow-x:hidden; text-overflow:ellipsis"
>
{{
$trabalho
->
titulo
}}
</
td
>
...
...
@@ -61,22 +65,138 @@
@
foreach
(
$trabalho
->
avaliadors
as
$avaliador
)
{{
$avaliador
->
user
->
name
}}
<
br
>
@
endforeach
@
else
Sem
Atribuição
@
endif
</
td
>
@
if
(
$trabalho
->
avaliadors
->
count
()
>
0
)
<
td
>
@
foreach
(
$trabalho
->
avaliadors
as
$avaliador
)
{{
$avaliador
->
pivot
->
recomendacao
}}
<
br
>
@
if
(
$avaliador
->
tipo
==
"Externo"
)
{{
$avaliador
->
pivot
->
recomendacao
}}
<
br
>
@
php
$parecer
=
App\ParecerInterno
::
where
([[
'avaliador_id'
,
$avaliador
->
id
],[
'trabalho_id'
,
$trabalho
->
id
]])
->
first
();
@
endphp
@
if
(
$parecer
!=
null
&&
$parecer
->
statusParecer
!=
null
){{
$parecer
->
statusParecer
}}
@
else
Pendente
@
endif
@
endif
@
endforeach
</
td
>
@
else
<
td
>
Pendente
</
td
>
@
endif
<
td
>
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
toggle
=
"modal"
data
-
target
=
"#modalConfirmTrab
{
{$trabalho->id}
}
"
>
Definir
</
button
>
</
td
>
</
tr
>
@
endif
@
endforeach
</
tbody
>
</
table
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-md-12"
>
<
br
>
{{
$trabalhos
->
links
()
}}
</
div
>
</
div
>
</
div
>
{{
--
Janelas
--
}}
@
foreach
(
$trabalhos
as
$trabalho
)
<
div
class
=
"modal fade"
id
=
"modalConfirmTrab
{
{$trabalho->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalConfirmLabel"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-md modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h4
class
=
"modal-title"
id
=
"modalConfirmLabel"
align
=
"center"
title
=
"Participantes do
{
{$trabalho->titulo}
}
"
>
Projeto
{{
$trabalho
->
titulo
}}
</
h4
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
style
=
"color: rgb(182, 182, 182)"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
@
foreach
(
$trabalho
->
participantes
as
$participante
)
<
div
class
=
"row modal-header-submeta"
>
<
div
class
=
"col-sm-8"
>
<
p
style
=
"font-size: 22px"
>
Discente
:
{{
$participante
->
user
->
name
}}
</
p
>
</
div
>
<
div
class
=
"col-sm-4"
align
=
"left"
style
=
"padding-left: 0px"
>
<
button
type
=
"button"
class
=
"btn btn-primary"
data
-
dismiss
=
"modal"
data
-
toggle
=
"modal"
data
-
target
=
"#modalConfirm
{
{$participante->id}
}
"
onclick
=
"myFunction(
{
{$trabalho->id}
}
)"
>
@
if
(
$participante
->
tipoBolsa
==
null
)
Não
Definida
@
elseif
(
$participante
->
tipoBolsa
==
"Voluntario"
)
Voluntário
@
else
{{
$participante
->
tipoBolsa
}}
@
endif
</
button
>
</
div
>
</
div
>
<
br
>
@
endforeach
</
div
>
</
div
>
</
div
>
</
div
>
@
foreach
(
$trabalho
->
participantes
as
$participante
)
{{
--
Janela
de
alocação
de
bolsa
--
}}
<
div
class
=
"modal fade"
id
=
"modalConfirm
{
{$participante->id}
}
"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"modalConfirmLabel"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
>
<
h4
class
=
"modal-title"
id
=
"modalConfirmLabel"
align
=
"center"
>
Confirmar
alteração
do
tipo
de
bolsa
?</
h4
>
</
div
>
@
if
(
$participante
->
tipoBolsa
!=
null
)
<
div
class
=
"modal-body"
>
<
h5
class
=
"modal-title"
id
=
"modalConfirmLabel"
align
=
"center"
>
@
if
(
$participante
->
tipoBolsa
==
'Voluntario'
)
O
discente
{{
$participante
->
user
->
name
}}
será
definido
como
bolsista
@
else
O
discente
{{
$participante
->
user
->
name
}}
será
definido
como
voluntário
@
endif
</
h5
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-danger"
data
-
dismiss
=
"modal"
>
Não
</
button
>
<
a
type
=
"button"
href
=
"{{ route('bolsa.alterar',['id'=>
$participante->id
, 'tipo'=>1]) }}"
id
=
"btnSubmit"
class
=
"btn btn-info"
>
Sim
</
a
>
</
div
>
@
else
<
div
class
=
"modal-body"
>
<
div
class
=
"row"
>
<
div
class
=
"col-6"
>
<
a
style
=
"float: right;"
type
=
"button"
href
=
"{{ route('bolsa.alterar',['id'=>
$participante->id
, 'tipo'=>1]) }}"
id
=
"btnSubmit"
class
=
"btn btn-info"
>
Voluntário
</
a
>
</
div
>
<
div
class
=
"col-6"
>
<
a
style
=
"float: left;"
type
=
"button"
href
=
"{{ route('bolsa.alterar',['id'=>
$participante->id
, 'tipo'=>2]) }}"
id
=
"btnSubmit"
class
=
"btn btn-info"
>
Bolsista
</
a
>
</
div
>
</
div
>
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-danger"
data
-
dismiss
=
"modal"
>
Cancelar
</
button
>
</
div
>
@
endif
</
div
>
</
div
>
</
div
>
@
endforeach
@
endforeach
@
endsection
...
...
@@ -99,5 +219,9 @@
}
}
}
function
myFunction
(
data
){
document
.
getElementById
(
'modalConfirmTrab'
+
data
)
.
modal
(
'hide'
);
}
</
script
>
@
endsection
\ No newline at end of file
routes/web.php
View file @
0c0a5479
...
...
@@ -210,7 +210,7 @@ Route::prefix('usuarios')->name('admin.')->group(function(){
Route
::
get
(
'/analisarProjetos'
,
'AdministradorController@analisar'
)
->
name
(
'analisar'
);
Route
::
get
(
'/analisarProposta'
,
'AdministradorController@analisarProposta'
)
->
name
(
'analisarProposta'
);
Route
::
get
(
'/showProjetos'
,
'AdministradorController@showProjetos'
)
->
name
(
'showProjetos'
);
Route
::
get
(
'/showResultados'
,
'AdministradorController@showResultados'
)
->
name
(
'showResultados'
);
Route
::
get
(
'/showResultados'
,
'AdministradorController@showResultados'
)
->
name
(
'showResultados'
)
->
middleware
([
'auth'
,
'verified'
])
;
});
Route
::
prefix
(
'naturezas'
)
->
group
(
function
(){
...
...
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