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
0500e1bd
Commit
0500e1bd
authored
Mar 16, 2022
by
Guilherme Silva
Browse files
Paginação na exibição das propostas
parent
d3febbe6
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
0500e1bd
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Notificacao
;
use
App\Substituicao
;
use
App\Substituicao
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
App\Administrador
;
use
App\Administrador
;
...
@@ -16,6 +17,7 @@ use App\GrandeArea;
...
@@ -16,6 +17,7 @@ use App\GrandeArea;
use
App\Natureza
;
use
App\Natureza
;
use
App\Trabalho
;
use
App\Trabalho
;
use
App\FuncaoParticipantes
;
use
App\FuncaoParticipantes
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Facades\Hash
;
use
Illuminate\Support\Facades\Hash
;
use
App\Evento
;
use
App\Evento
;
...
@@ -26,6 +28,9 @@ use Illuminate\Support\Facades\Mail;
...
@@ -26,6 +28,9 @@ use Illuminate\Support\Facades\Mail;
use
App\Mail\EventoCriado
;
use
App\Mail\EventoCriado
;
use
Illuminate\Support\Facades\Storage
;
use
Illuminate\Support\Facades\Storage
;
use
App\Http\Controllers\Response
;
use
App\Http\Controllers\Response
;
use
Illuminate\Pagination\Paginator
;
use
Illuminate\Support\Collection
;
use
Illuminate\Pagination\LengthAwarePaginator
;
class
AdministradorController
extends
Controller
class
AdministradorController
extends
Controller
{
{
...
@@ -54,9 +59,9 @@ class AdministradorController extends Controller
...
@@ -54,9 +59,9 @@ class AdministradorController extends Controller
public
function
pareceres
(
Request
$request
){
public
function
pareceres
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
Submetidos
=
$evento
->
trabalhos
->
where
(
'status'
,
'
submetid
o'
);
$trabalhos
=
$evento
->
trabalhos
->
where
NotIn
(
'status'
,
'
rascunh
o'
);
$trabalhosAvaliados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'avaliado'
);
//
$trabalhosAvaliados = $evento->trabalhos->Where('status', 'avaliado');
$trabalhos
=
$trabalhosSubmetidos
->
merge
(
$trabalhosAvaliados
);
//
$trabalhos = $trabalhosSubmetidos->merge($trabalhosAvaliados);
return
view
(
'administrador.projetos'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
]);
return
view
(
'administrador.projetos'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
]);
}
}
...
@@ -68,9 +73,12 @@ class AdministradorController extends Controller
...
@@ -68,9 +73,12 @@ class AdministradorController extends Controller
$trabalhosAprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'aprovado'
);
$trabalhosAprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'aprovado'
);
$trabalhosReprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'reprovado'
);
$trabalhosReprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'reprovado'
);
$trabalhosCorrigidos
=
$evento
->
trabalhos
->
Where
(
'status'
,
'corrigido'
);
$trabalhosCorrigidos
=
$evento
->
trabalhos
->
Where
(
'status'
,
'corrigido'
);
$trabalhos
=
$trabalhosSubmetidos
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
);
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
->
merge
(
$trabalhosAvaliados
)
->
merge
(
$trabalhosAprovados
)
->
merge
(
$trabalhosAvaliados
)
->
merge
(
$trabalhosAprovados
)
->
merge
(
$trabalhosReprovados
)
->
merge
(
$trabalhosCorrigidos
)
->
sortBy
(
'titulo'
);
->
merge
(
$trabalhosReprovados
)
->
merge
(
$trabalhosCorrigidos
)
->
sortBy
(
'titulo'
))
->
withPath
(
'/usuarios/analisarProjetos?evento_id='
.
$evento
->
id
);
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
$funcaoParticipantes
=
FuncaoParticipantes
::
all
();
// $participantes = Participante::where('trabalho_id', $id)->get();
// $participantes = Participante::where('trabalho_id', $id)->get();
...
@@ -80,6 +88,15 @@ class AdministradorController extends Controller
...
@@ -80,6 +88,15 @@ class AdministradorController extends Controller
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
]);
return
view
(
'administrador.analisar'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
,
'funcaoParticipantes'
=>
$funcaoParticipantes
]);
}
}
// Utilizado para paginação de Collection
public
function
paginate
(
$items
,
$perPage
=
5
,
$page
=
null
,
$options
=
[])
{
$page
=
$page
?:
(
Paginator
::
resolveCurrentPage
()
?:
1
);
$items
=
$items
instanceof
Collection
?
$items
:
Collection
::
make
(
$items
);
return
new
LengthAwarePaginator
(
$items
->
forPage
(
$page
,
$perPage
),
$items
->
count
(),
$perPage
,
$page
,
$options
);
}
public
function
analisarProposta
(
Request
$request
){
public
function
analisarProposta
(
Request
$request
){
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
id
)
->
first
();
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
id
)
->
first
();
...
@@ -520,7 +537,7 @@ class AdministradorController extends Controller
...
@@ -520,7 +537,7 @@ class AdministradorController extends Controller
$trabalho
->
avaliadors
()
->
attach
(
$avaliadores
);
$trabalho
->
avaliadors
()
->
attach
(
$avaliadores
);
$evento
->
avaliadors
()
->
syncWithoutDetaching
(
$avaliadores
);
$evento
->
avaliadors
()
->
syncWithoutDetaching
(
$avaliadores
);
$trabalho
->
save
();
$trabalho
->
save
();
return
redirect
()
->
back
();
return
redirect
()
->
back
();
}
}
...
...
resources/views/administrador/analisar.blade.php
View file @
0500e1bd
...
@@ -2,69 +2,96 @@
...
@@ -2,69 +2,96 @@
@
section
(
'content'
)
@
section
(
'content'
)
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 100px; overflow-x: hidden;overflow-y:hidden"
>
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 100px;"
>
<
div
class
=
"col-md-11"
>
<
div
class
=
"col-md-10"
>
<
div
class
=
"row"
>
<
div
class
=
"card"
style
=
"border-radius: 5px"
>
<
div
class
=
"col-sm-7"
>
<
div
class
=
"card-body"
style
=
"padding-top: 0.2rem;"
>
<
div
class
=
"card-body"
style
=
"padding-top: 0.2rem;"
>
<
div
class
=
"container"
>
<
div
class
=
"container"
>
<
div
class
=
"form-row mt-3"
>
<
div
class
=
"form-row mt-3"
>
<
div
class
=
"col-md-12"
><
h5
style
=
"color: #1492E6; font-size: 20px;"
>
Edital
-
{{
$evento
->
nome
}}
</
h5
></
div
>
<
div
class
=
"col-md-12"
><
h5
style
=
"color: #1492E6; font-size: 20px;"
>
Edital
-
{{
$evento
->
nome
}}
</
h5
></
div
>
<
div
class
=
"col-md-12"
><
h6
style
=
"color: #234B8B; margin-bottom:-0.4rem; font-weight: bold; font-size: 14px;"
>
Propostas
Submetidas
</
h6
></
div
>
<
div
class
=
"col-md-12"
><
h6
style
=
"color: #234B8B; margin-bottom:-0.4rem; font-weight: bold; font-size: 14px;"
>
Propostas
Submetidas
</
h6
></
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
hr
>
</
div
>
<
div
class
=
"container"
>
<
div
class
=
"col-sm-5"
style
=
"top: 40px; text-align: end"
>
<
div
class
=
"row"
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px; text-align: right"
>
<
img
src
=
"
{
{asset('img/icons/pendente.png')}
}
"
style
=
"width: 22px"
/>
Proposta
Pendente
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width: 22px"
/>
Proposta
Aprovada
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width: 22px"
/>
Proposta
Negada
<
br
>
<
img
src
=
"
{
{asset('img/icons/parcialmenteAprovado.png')}
}
"
style
=
"width: 22px"
/>
Proposta
Parcialmente
Aprovada
</
h6
>
</
div
>
</
div
>
</
div
>
</
div
>
@
foreach
(
$trabalhos
as
$trabalho
)
@
foreach
(
$trabalhos
as
$trabalho
)
<
div
onclick
=
"myFunc(
{
{$trabalho->id}
}
)"
class
=
"col-md-6 card"
style
=
"border-color:#1492E6;border-radius: 10px; margin-top: 10px;"
>
<
a
href
=
"
{
{route('admin.analisarProposta',['id'=>$trabalho->id])}
}
"
id
=
"vizuProposta
{
{$trabalho->id}
}
"
hidden
>
teste
visual
de
proposta
</
a
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-10"
>
<
h6
style
=
"color: #1492E6; font-size: 16px;"
>
{{
$trabalho
->
titulo
}}
</
h6
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
Proponente
:
@
foreach
(
$trabalho
->
participantes
as
$participante
)
{{
$participante
->
user
->
name
}};
@
endforeach
</
h6
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
Data
:
{{
date
(
'd/m/Y'
,
strtotime
(
$trabalho
->
created_at
))
}}
</
h6
>
</
div
>
<
div
class
=
"col-md-2"
>
<!--
Informações
Proponente
-->
@
if
(
$trabalho
->
status
==
"aprovado"
)
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 20px;"
>
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width: 60%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
<
br
>
@
elseif
(
$trabalho
->
status
==
"reprovado"
)
<
div
class
=
"col-md-11"
onclick
=
"myFunc(
{
{$trabalho->id}
}
)"
>
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width: 60%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
<
a
href
=
"
{
{route('admin.analisarProposta',['id'=>$trabalho->id])}
}
"
id
=
"vizuProposta
{
{$trabalho->id}
}
"
hidden
></
a
>
@
else
<
img
src
=
"
{
{asset('img/icons/pendente.png')}
}
"
style
=
"width: 60%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
<
div
class
=
"card"
style
=
"border-radius: 5px;"
>
@
endif
<
div
class
=
"card-body"
style
=
"padding-top: 0.2rem;"
>
<
div
class
=
"container"
>
<
div
class
=
"form-row mt-3"
>
<
div
class
=
"col-md-10"
><
h5
style
=
"color: #234B8B; font-weight: bold"
>
Titulo
:
{{
$trabalho
->
titulo
}}
</
h5
></
div
>
<
div
class
=
"col-md-2"
>
@
if
(
$trabalho
->
status
==
"aprovado"
)
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width: 23%;margin: auto;display: flex;margin-top: 0px;justify-content: center;align-items: center;"
alt
=
""
>
@
elseif
(
$trabalho
->
status
==
"reprovado"
)
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width: 60%;margin: auto;display: flex;margin-top: 5px;justify-content: center;align-items: center;"
alt
=
""
>
@
elseif
(
$trabalho
->
status
==
"corrigido"
)
<
img
src
=
"
{
{asset('img/icons/parcialmenteAprovado.png')}
}
"
style
=
"width: 23%;margin: auto;display: flex;margin-top: 0px;justify-content: center;align-items: center;"
alt
=
""
>
@
else
<
img
src
=
"
{
{asset('img/icons/pendente.png')}
}
"
style
=
"width: 20%;margin: auto;display: flex;justify-content: center;align-items: center;"
alt
=
""
>
@
endif
</
div
>
</
div
>
<
hr
style
=
"border-top: 1px solid#1492E6"
>
<
div
class
=
"form-row mt-3"
>
<
div
class
=
"col-md-12"
>
<
p
style
=
"color: #4D4D4D; padding: 0px"
><
b
>
Proponente
:</
b
>
{{
App\Proponente
::
find
(
$trabalho
->
proponente_id
)
->
user
->
name
}}
</
p
>
</
div
>
<
div
class
=
"col-md-12"
>
<
p
style
=
"color: #4D4D4D; padding: 0px"
><
b
>
Discentes
:</
b
>
@
foreach
(
$trabalho
->
participantes
as
$participante
)
{{
$participante
->
user
->
name
}};
@
endforeach
</
div
>
<
div
class
=
"col-md-12"
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
Data
:
{{
date
(
'd/m/Y'
,
strtotime
(
$trabalho
->
created_at
))
}}
</
h6
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
@
endforeach
@
endforeach
</
div
>
</
div
>
</
div
>
<
div
class
=
"row justify-content-center"
>
</
div
>
<
div
class
=
"col-md-11"
>
</
div
>
<
br
>
</
div
>
{{
$trabalhos
->
links
()
}}
<
div
class
=
"container"
>
<
div
class
=
"row"
>
<
div
class
=
"col-sm-10"
>
<
br
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
<
img
src
=
"
{
{asset('img/icons/pendente.png')}
}
"
style
=
"width: 30px"
/>
Proposta
Pendente
</
h6
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width: 30px"
/>
Proposta
Aprovada
</
h6
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
<
img
src
=
"
{
{asset('img/icons/negado.png')}
}
"
style
=
"width: 30px"
/>
Proposta
Negada
</
h6
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
@@ -77,3 +104,8 @@
...
@@ -77,3 +104,8 @@
}
}
</
script
>
</
script
>
@
endsection
@
endsection
<
style
>
html
{
overflow
-
x
:
hidden
;
}
</
style
>
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