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
4084cbe2
Commit
4084cbe2
authored
Dec 22, 2022
by
alissonalbuquerque
Browse files
correção de totalHoras
parent
aa62f4e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Models/Pad.php
View file @
4084cbe2
...
...
@@ -2,30 +2,6 @@
namespace
App\Models
;
use
App\Models\Tabelas\Ensino\EnsinoAtendimentoDiscente
;
use
App\Models\Tabelas\Ensino\EnsinoAula
;
use
App\Models\Tabelas\Ensino\EnsinoCoordenacaoRegencia
;
use
App\Models\Tabelas\Ensino\EnsinoMembroDocente
;
use
App\Models\Tabelas\Ensino\EnsinoOrientacao
;
use
App\Models\Tabelas\Ensino\EnsinoOutros
;
use
App\Models\Tabelas\Ensino\EnsinoParticipacao
;
use
App\Models\Tabelas\Ensino\EnsinoProjeto
;
use
App\Models\Tabelas\Ensino\EnsinoSupervisao
;
use
App\Models\Tabelas\Extensao\ExtensaoCoordenacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOrientacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoLaboratoriosDidaticos
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoProgramaInstitucional
;
use
App\Models\Tabelas\Gestao\GestaoMembroCamaras
;
use
App\Models\Tabelas\Gestao\GestaoMembroComissao
;
use
App\Models\Tabelas\Gestao\GestaoMembroConselho
;
use
App\Models\Tabelas\Gestao\GestaoMembroTitularConselho
;
use
App\Models\Tabelas\Gestao\GestaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoRepresentanteUnidadeEducacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaCoordenacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaLideranca
;
use
App\Models\Tabelas\Pesquisa\PesquisaOrientacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaOutros
;
use
App\Models\Util\Status
;
use
Carbon\Carbon
;
use
Illuminate\Database\Eloquent\Factories\HasFactory
;
...
...
@@ -53,44 +29,5 @@ class Pad extends Model
public
function
getDateFim
()
{
return
Carbon
::
parse
(
$this
->
data_fim
)
->
format
(
'd/m/Y'
);
}
public
function
totalHoras
()
{
$ensinoTotalHoras
=
EnsinoAtendimentoDiscente
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoAula
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoCoordenacaoRegencia
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoMembroDocente
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoParticipacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoProjeto
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoSupervisao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$gestaoTotalHoras
=
GestaoCoordenacaoLaboratoriosDidaticos
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoCoordenacaoProgramaInstitucional
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroCamaras
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroComissao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroConselho
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroTitularConselho
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoRepresentanteUnidadeEducacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$pesquisaTotalHoras
=
PesquisaCoordenacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaLideranca
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$extensaoTotalHoras
=
ExtensaoCoordenacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
ExtensaoOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
ExtensaoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$totalHoras
=
$ensinoTotalHoras
+
$gestaoTotalHoras
+
$pesquisaTotalHoras
+
$extensaoTotalHoras
;
return
$totalHoras
;
}
}
app/Models/UserPad.php
View file @
4084cbe2
...
...
@@ -2,6 +2,30 @@
namespace
App\Models
;
use
App\Models\Tabelas\Ensino\EnsinoAtendimentoDiscente
;
use
App\Models\Tabelas\Ensino\EnsinoAula
;
use
App\Models\Tabelas\Ensino\EnsinoCoordenacaoRegencia
;
use
App\Models\Tabelas\Ensino\EnsinoMembroDocente
;
use
App\Models\Tabelas\Ensino\EnsinoOrientacao
;
use
App\Models\Tabelas\Ensino\EnsinoOutros
;
use
App\Models\Tabelas\Ensino\EnsinoParticipacao
;
use
App\Models\Tabelas\Ensino\EnsinoProjeto
;
use
App\Models\Tabelas\Ensino\EnsinoSupervisao
;
use
App\Models\Tabelas\Extensao\ExtensaoCoordenacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOrientacao
;
use
App\Models\Tabelas\Extensao\ExtensaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoLaboratoriosDidaticos
;
use
App\Models\Tabelas\Gestao\GestaoCoordenacaoProgramaInstitucional
;
use
App\Models\Tabelas\Gestao\GestaoMembroCamaras
;
use
App\Models\Tabelas\Gestao\GestaoMembroComissao
;
use
App\Models\Tabelas\Gestao\GestaoMembroConselho
;
use
App\Models\Tabelas\Gestao\GestaoMembroTitularConselho
;
use
App\Models\Tabelas\Gestao\GestaoOutros
;
use
App\Models\Tabelas\Gestao\GestaoRepresentanteUnidadeEducacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaCoordenacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaLideranca
;
use
App\Models\Tabelas\Pesquisa\PesquisaOrientacao
;
use
App\Models\Tabelas\Pesquisa\PesquisaOutros
;
use
App\Queries\UserPadQuery
;
use
App\Models\Pad
;
use
App\Models\Util\Status
;
...
...
@@ -33,4 +57,43 @@ class UserPad extends Model
public
static
function
initQuery
()
{
return
new
UserPadQuery
(
get_called_class
());
}
public
function
totalHoras
()
{
$ensinoTotalHoras
=
EnsinoAtendimentoDiscente
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoAula
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoCoordenacaoRegencia
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoMembroDocente
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoParticipacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoProjeto
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
EnsinoSupervisao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$gestaoTotalHoras
=
GestaoCoordenacaoLaboratoriosDidaticos
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoCoordenacaoProgramaInstitucional
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroCamaras
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroComissao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroConselho
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoMembroTitularConselho
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
GestaoRepresentanteUnidadeEducacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$pesquisaTotalHoras
=
PesquisaCoordenacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaLideranca
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
PesquisaOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$extensaoTotalHoras
=
ExtensaoCoordenacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
ExtensaoOrientacao
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
)
+
ExtensaoOutros
::
whereUserPadId
(
$this
->
id
)
->
sum
(
'ch_semanal'
);
$totalHoras
=
$ensinoTotalHoras
+
$gestaoTotalHoras
+
$pesquisaTotalHoras
+
$extensaoTotalHoras
;
return
$totalHoras
;
}
}
resources/views/layouts/user-dashboard/dashboard_teacher.blade.php
View file @
4084cbe2
...
...
@@ -24,7 +24,7 @@
<
h1
class
=
"text-center"
>
<
i
class
=
"bi bi-book-half"
></
i
>
</
h1
>
<
h5
class
=
"text-center"
>
PAD
:
{{
$userPad
->
pad
->
nome
}}
</
h4
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
pad
->
totalHoras
()
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
totalHoras
()
}}
</
span
>
</
h4
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('pad_view', ['id' =>
$userPad->id
]) }}"
></
a
>
</
div
>
...
...
resources/views/pad/teacher/index.blade.php
View file @
4084cbe2
...
...
@@ -31,7 +31,7 @@
<
h1
class
=
"text-center"
>
<
i
class
=
"bi bi-book-half"
></
i
>
</
h1
>
<
h5
class
=
"text-center"
>
PAD
:
{{
$userPad
->
pad
->
nome
}}
</
h4
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
pad
->
totalHoras
()
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
totalHoras
()
}}
</
span
>
</
h4
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('pad_view', ['id' =>
$userPad->id
]) }}"
></
a
>
</
div
>
...
...
@@ -43,7 +43,7 @@
<
h1
class
=
"text-center"
>
<
i
class
=
"bi bi-journal-bookmark-fill"
></
i
>
</
h1
>
<
h5
class
=
"text-center"
>
PAD
:
{{
$userPad
->
pad
->
nome
}}
</
h4
>
<
div
class
=
"text-center"
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
pad
->
totalHoras
()
}}
</
span
>
</
h4
>
<
h4
class
=
"h5"
>
<
span
class
=
"badge bg-primary"
>
Horas
:
{{
$userPad
->
totalHoras
()
}}
</
span
>
</
h4
>
</
div
>
<
a
class
=
"stretched-link"
href
=
"{{ route('pad_view', ['id' =>
$userPad->id
]) }}"
></
a
>
</
div
>
...
...
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