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
pad-upe
Commits
d5c5c125
Unverified
Commit
d5c5c125
authored
May 28, 2023
by
Alisson Albuquerque
Committed by
GitHub
May 28, 2023
Browse files
Merge pull request #13 from yuriresendematias/main
Corrigindo erro no paginate e adicionando coluna de carga horária corrigida
parents
784b7095
ca6df521
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/PadController.php
View file @
d5c5c125
...
...
@@ -339,6 +339,7 @@ class PadController extends Controller
}
$professor
->
ch
=
$this
->
get_carga_horaria_total
(
$avaliacoes
);
$professor
->
ch_corrigida
=
$this
->
get_carga_horaria_corrigida
(
$avaliacoes_ensino
,
$avaliacoes_pesquisa
,
$avaliacoes_extensao
,
$avaliacoes_gestao
);
}
return
view
(
"pad.avaliacao.professores"
,
compact
(
'professores'
,
'pad'
,
'index_menu'
));
...
...
@@ -811,6 +812,45 @@ class PadController extends Controller
}
private
function
get_carga_horaria_corrigida
(
$ensino
,
$pesquisa
,
$extensao
,
$gestao
)
{
$ch
=
0
;
if
(
$ensino
)
{
for
(
$i
=
0
;
$i
<
count
(
$ensino
->
all
());
$i
++
){
if
(
$ensino
[
$i
]
->
status
!=
Status
::
REPROVADO
){
$ch
+=
$ensino
[
$i
]
->
tarefa
()
->
first
()
->
ch_semanal
;
}
}
}
if
(
$pesquisa
)
{
for
(
$i
=
0
;
$i
<
count
(
$pesquisa
->
all
());
$i
++
){
if
(
$pesquisa
[
$i
]
->
status
!=
Status
::
REPROVADO
){
$ch
+=
$pesquisa
[
$i
]
->
tarefa
()
->
first
()
->
ch_semanal
;
}
}
}
if
(
$extensao
)
{
for
(
$i
=
0
;
$i
<
count
(
$extensao
->
all
());
$i
++
){
if
(
$extensao
[
$i
]
->
status
!=
Status
::
REPROVADO
){
$ch
+=
$extensao
[
$i
]
->
tarefa
()
->
first
()
->
ch_semanal
;
}
}
}
if
(
$gestao
)
{
for
(
$i
=
0
;
$i
<
count
(
$gestao
->
all
());
$i
++
){
if
(
$gestao
[
$i
]
->
status
!=
Status
::
REPROVADO
){
$ch
+=
$gestao
[
$i
]
->
tarefa
()
->
first
()
->
ch_semanal
;
}
}
}
return
$ch
;
}
public
function
relatorio
(
$id
){
$user
=
Auth
::
user
();
$pad
=
Pad
::
find
(
$id
);
...
...
app/Providers/AppServiceProvider.php
View file @
d5c5c125
...
...
@@ -4,6 +4,8 @@ namespace App\Providers;
use
Illuminate\Pagination\Paginator
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Support\Collection
;
use
Illuminate\Pagination\LengthAwarePaginator
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
@@ -26,5 +28,20 @@ class AppServiceProvider extends ServiceProvider
{
Paginator
::
useBootstrap
();
Collection
::
macro
(
'paginate'
,
function
(
$perPage
,
$total
=
null
,
$page
=
null
,
$pageName
=
'page'
):
LengthAwarePaginator
{
$page
=
$page
?:
LengthAwarePaginator
::
resolveCurrentPage
(
$pageName
);
return
new
LengthAwarePaginator
(
$this
->
forPage
(
$page
,
$perPage
)
->
values
(),
$total
?:
$this
->
count
(),
$perPage
,
$page
,
[
'path'
=>
LengthAwarePaginator
::
resolveCurrentPath
(),
'pageName'
=>
$pageName
,
]
);
});
}
}
resources/views/pad/avaliacao/professores.blade.php
View file @
d5c5c125
...
...
@@ -25,6 +25,7 @@
<
th
scope
=
"col"
>
Professor
</
th
>
<
th
scope
=
"col"
>
Status
</
th
>
<
th
scope
=
"col"
>
CH
</
th
>
<
th
scope
=
"col"
>
CH
Corrigida
</
th
>
<
th
scope
=
"col"
>
Opções
</
th
>
</
tr
>
</
thead
>
...
...
@@ -39,6 +40,7 @@
<
td
style
=
"color:green;"
>
{{
$professor
->
status
}}
</
td
>
@
endif
<
td
>@
if
(
$professor
->
ch
>
0
)
{{
$professor
->
ch
}}
H
@
endif
</
td
>
<
td
>@
if
(
$professor
->
ch_corrigida
>
0
&&
$professor
->
ch
!=
$professor
->
ch_corrigida
)
{{
$professor
->
ch_corrigida
}}
H
@
endif
</
td
>
<
td
>
@
include
(
'components.buttons.btn-avaliar'
,
[
...
...
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