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
"app/git@sites.upe.br:walter.felipe/submeta.git" did not exist on "95b8bea6519f601400e139d2b987bebd5731a6ca"
Commit
0500e1bd
authored
Mar 16, 2022
by
Guilherme Silva
Browse files
Paginação na exibição das propostas
parent
d3febbe6
Changes
2
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
0500e1bd
...
...
@@ -2,6 +2,7 @@
namespace
App\Http\Controllers
;
use
App\Notificacao
;
use
App\Substituicao
;
use
Illuminate\Http\Request
;
use
App\Administrador
;
...
...
@@ -16,6 +17,7 @@ use App\GrandeArea;
use
App\Natureza
;
use
App\Trabalho
;
use
App\FuncaoParticipantes
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Str
;
use
Illuminate\Support\Facades\Hash
;
use
App\Evento
;
...
...
@@ -26,6 +28,9 @@ use Illuminate\Support\Facades\Mail;
use
App\Mail\EventoCriado
;
use
Illuminate\Support\Facades\Storage
;
use
App\Http\Controllers\Response
;
use
Illuminate\Pagination\Paginator
;
use
Illuminate\Support\Collection
;
use
Illuminate\Pagination\LengthAwarePaginator
;
class
AdministradorController
extends
Controller
{
...
...
@@ -54,9 +59,9 @@ class AdministradorController extends Controller
public
function
pareceres
(
Request
$request
){
$evento
=
Evento
::
where
(
'id'
,
$request
->
evento_id
)
->
first
();
$trabalhos
Submetidos
=
$evento
->
trabalhos
->
where
(
'status'
,
'
submetid
o'
);
$trabalhosAvaliados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'avaliado'
);
$trabalhos
=
$trabalhosSubmetidos
->
merge
(
$trabalhosAvaliados
);
$trabalhos
=
$evento
->
trabalhos
->
where
NotIn
(
'status'
,
'
rascunh
o'
);
//
$trabalhosAvaliados = $evento->trabalhos->Where('status', 'avaliado');
//
$trabalhos = $trabalhosSubmetidos->merge($trabalhosAvaliados);
return
view
(
'administrador.projetos'
)
->
with
([
'trabalhos'
=>
$trabalhos
,
'evento'
=>
$evento
]);
}
...
...
@@ -68,9 +73,12 @@ class AdministradorController extends Controller
$trabalhosAprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'aprovado'
);
$trabalhosReprovados
=
$evento
->
trabalhos
->
Where
(
'status'
,
'reprovado'
);
$trabalhosCorrigidos
=
$evento
->
trabalhos
->
Where
(
'status'
,
'corrigido'
);
$trabalhos
=
$trabalhosSubmetidos
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
);
$trabalhos
=
$this
->
paginate
(
$trabalhosSubmetidos
->
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
();
// $participantes = Participante::where('trabalho_id', $id)->get();
...
...
@@ -80,6 +88,15 @@ class AdministradorController extends Controller
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
){
$trabalho
=
Trabalho
::
where
(
'id'
,
$request
->
id
)
->
first
();
...
...
resources/views/administrador/analisar.blade.php
View file @
0500e1bd
...
...
@@ -2,10 +2,10 @@
@
section
(
'content'
)
<
div
class
=
"
row justify-content-center"
style
=
"margin-top: 100px;
"
>
<
div
class
=
"
col-md-10
"
>
<
div
class
=
"c
ard"
style
=
"border-radius: 5px
"
>
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 100px; overflow-x: hidden;overflow-y:hidden"
>
<
div
class
=
"
col-md-11
"
>
<
div
class
=
"
row
"
>
<
div
class
=
"c
ol-sm-7
"
>
<
div
class
=
"card-body"
style
=
"padding-top: 0.2rem;"
>
<
div
class
=
"container"
>
<
div
class
=
"form-row mt-3"
>
...
...
@@ -13,57 +13,84 @@
<
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
>
<
hr
>
<
div
class
=
"container"
>
<
div
class
=
"
row
"
>
@
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
<
/
div
>
</
div
>
<
div
class
=
"
col-sm-5"
style
=
"top: 40px; text-align: end
"
>
<
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
>
<
h6
style
=
"color: #234B8B; font-weight: bold;font-size: 13px;"
>
Data
:
{{
date
(
'd/m/Y'
,
strtotime
(
$trabalho
->
created_at
))
}}
</
h6
>
</
div
>
</
div
>
</
div
>
</
div
>
@
foreach
(
$trabalhos
as
$trabalho
)
<!--
Informações
Proponente
-->
<
div
class
=
"row justify-content-center"
style
=
"margin-top: 20px;"
>
<
br
>
<
div
class
=
"col-md-11"
onclick
=
"myFunc(
{
{$trabalho->id}
}
)"
>
<
a
href
=
"
{
{route('admin.analisarProposta',['id'=>$trabalho->id])}
}
"
id
=
"vizuProposta
{
{$trabalho->id}
}
"
hidden
></
a
>
<
div
class
=
"card"
style
=
"border-radius: 5px;"
>
<
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:
60
%;margin: auto;display: flex;margin-top:
5
px;justify-content: center;align-items: center;"
alt
=
""
>
<
img
src
=
"
{
{asset('img/icons/aprovado.png')}
}
"
style
=
"width:
23
%;margin: auto;display: flex;margin-top:
0
px;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:
6
0%;margin: auto;display: flex;
margin-top: 5px;
justify-content: center;align-items: center;"
alt
=
""
>
<
img
src
=
"
{
{asset('img/icons/pendente.png')}
}
"
style
=
"width:
2
0%;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
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
>
@
endforeach
<
div
class
=
"row justify-content-center"
>
<
div
class
=
"col-md-11"
>
<
br
>
{{
$trabalhos
->
links
()
}}
</
div
>
</
div
>
...
...
@@ -77,3 +104,8 @@
}
</
script
>
@
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