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
34920dc5
Commit
34920dc5
authored
Aug 03, 2023
by
PedroLopesUPE
Browse files
Back-End do Anexo B
parent
bfe80c3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/UserPadController.php
View file @
34920dc5
...
@@ -6,6 +6,8 @@ use App\Models\Pad;
...
@@ -6,6 +6,8 @@ use App\Models\Pad;
use
App\Models\Curso
;
use
App\Models\Curso
;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\UserPad
;
use
App\Models\Anexo
;
use
App\Models\Unidade
;
use
App\Models\Util\Nivel
;
use
App\Models\Util\Nivel
;
use
App\Models\Util\Modalidade
;
use
App\Models\Util\Modalidade
;
use
App\Models\Util\Natureza
;
use
App\Models\Util\Natureza
;
...
@@ -123,23 +125,50 @@ class UserPadController extends Controller
...
@@ -123,23 +125,50 @@ class UserPadController extends Controller
ksort
(
$funcoes
);
ksort
(
$funcoes
);
$naturezas
=
Natureza
::
listNatureza
();
$naturezas
=
Natureza
::
listNatureza
();
$modalidades
=
Modalidade
::
listModalidade
();
$modalidades
=
Modalidade
::
listModalidade
();
$nomes_valores
=
[
'componente_curricular'
=>
'Componente Curricular'
,
$unidades_ensino
=
Unidade
::
listUnidades
();
'ch_semanal'
=>
'CH Semanal'
,
$cursos
=
Curso
::
whereId
(
5
)
->
first
()
->
toArray
();
'curso'
=>
'Curso'
,
$semestres
=
Anexo
::
listSemestre
();
'descricao'
=>
'Descrição'
,
$nomes_valores
=
'discente'
=>
'Discente'
,
[
'documento'
=>
'Documento'
,
'componente_curricular'
=>
'Componente Curricular'
,
'titulo_projeto'
=>
'Título do Projeto'
,
'ch_semanal'
=>
'CH Semanal'
,
'nome'
=>
'Nome'
,
'curso'
=>
'Curso'
,
'programa_extensao'
=>
'Programa de Extensão'
,
'descricao'
=>
'Descrição'
,
'linha_grupo_pesquisa'
=>
'Linha e Grupo de Pesquisa'
,
'discente'
=>
'Discente'
,
'atividade'
=>
'Atividade'
,
'documento'
=>
'Documento'
,
'cod_dimensao'
=>
'Cód Dimensão'
,
'titulo_projeto'
=>
'Título do Projeto'
,
'nivel'
=>
'Nível'
,
'nome'
=>
'Nome'
,
'modalidade'
=>
'Modalidade'
,
'programa_extensao'
=>
'Programa de Extensão'
,
'funcao'
=>
'Função'
,
'linha_grupo_pesquisa'
=>
'Linha e Grupo de Pesquisa'
,
'natureza'
=>
'Natureza'
'atividade'
=>
'Atividade'
,
];
'cod_dimensao'
=>
'Cód Dimensão'
,
'nivel'
=>
'Nível'
,
'modalidade'
=>
'Modalidade'
,
'funcao'
=>
'Função'
,
'natureza'
=>
'Natureza'
,
"campus_id"
=>
'UNIDADE DE EDUCAÇÃO/CAMPUS'
,
"curso_id"
=>
'CURSO'
,
"semestre"
=>
'PLANO DE ATIVIDADE DOCENTE - ANO'
,
"matricula"
=>
'MATRÍCULA'
,
"carga_horaria"
=>
'CARGA HORÁRIA'
,
"categoria_nivel"
=>
'CATEGORIA / NÍVEL'
,
"afastamento_total"
=>
'AFASTAMENTO TOTAL?'
,
"afastamento_total_desc"
=>
'PORTARIA DE AFASTAMENTO (TOTAL)'
,
"afastamento_parcial"
=>
'AFASTAMENTO PARCIAL?'
,
"afastamento_parcial_desc"
=>
'PORTARIA DE AFASTAMENTO (PARCIAL)'
,
"direcao_sindical"
=>
'EXERCE FUNÇÃO ADMINISTRATIVA?'
,
"licenca"
=>
'LICENÇA DE ACORDO COM A LEGISLAÇÃO VIGENTE. ESPECIFIQUE'
,
];
$valores_lista_negra
=
[
"id"
,
"user_pad_id"
,
"dimensao"
,
"cod_atividade"
,
"created_at"
,
"updated_at"
,
"deleted_at"
];
$ensinoTotalHoras
=
$ensinoTotalHoras
=
EnsinoAtendimentoDiscente
::
whereUserPadId
(
$user_pad_id
)
->
sum
(
'ch_semanal'
)
EnsinoAtendimentoDiscente
::
whereUserPadId
(
$user_pad_id
)
->
sum
(
'ch_semanal'
)
+
EnsinoAula
::
whereUserPadId
(
$user_pad_id
)
->
sum
(
'ch_semanal'
)
+
EnsinoAula
::
whereUserPadId
(
$user_pad_id
)
->
sum
(
'ch_semanal'
)
...
@@ -179,6 +208,7 @@ class UserPadController extends Controller
...
@@ -179,6 +208,7 @@ class UserPadController extends Controller
'PESQUISA'
=>
$pesquisaTotalHoras
'PESQUISA'
=>
$pesquisaTotalHoras
];
];
$anexoPad
=
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
->
toArray
();
$userPad
=
UserPad
::
whereId
(
$user_pad_id
)
->
first
();
$userPad
=
UserPad
::
whereId
(
$user_pad_id
)
->
first
();
$model
[
'ensino'
]
=
$model
[
'ensino'
]
=
[
PadTables
::
tablesEnsino
(
$user_pad_id
)[
0
][
'name'
]
=>
$userPad
->
ensinoAulas
->
toArray
(),
[
PadTables
::
tablesEnsino
(
$user_pad_id
)[
0
][
'name'
]
=>
$userPad
->
ensinoAulas
->
toArray
(),
...
@@ -243,19 +273,10 @@ class UserPadController extends Controller
...
@@ -243,19 +273,10 @@ class UserPadController extends Controller
{
{
$treated_model
[
$treated_nome_dimensao
][
$treated_nome_categoria
][
'Cód: '
.
$item
[
'cod_atividade'
]]
=
[];
$treated_model
[
$treated_nome_dimensao
][
$treated_nome_categoria
][
'Cód: '
.
$item
[
'cod_atividade'
]]
=
[];
$treated_tarefa_codigo
=
'Cód: '
.
$item
[
'cod_atividade'
];
$treated_tarefa_codigo
=
'Cód: '
.
$item
[
'cod_atividade'
];
// break;
}
}
else
else
{
{
if
(
$nome_valor
==
"id"
||
if
(
in_array
(
$nome_valor
,
$valores_lista_negra
))
$nome_valor
==
"user_pad_id"
||
$nome_valor
==
"dimensao"
||
$nome_valor
==
'cod_atividade'
||
$nome_valor
==
"created_at"
||
$nome_valor
==
"updated_at"
||
$nome_valor
==
"deleted_at"
)
{
{
continue
;
continue
;
}
}
...
@@ -289,6 +310,41 @@ class UserPadController extends Controller
...
@@ -289,6 +310,41 @@ class UserPadController extends Controller
}
}
}
}
}
}
$treated_anexo_pad
=
[];
$treated_anexo_item_valor
=
""
;
$treated_anexo_item_nome
=
""
;
foreach
(
$anexoPad
as
$nome_valor
=>
$valor
)
{
if
(
in_array
(
$nome_valor
,
$valores_lista_negra
))
{
continue
;
}
elseif
(
$nome_valor
==
'campus_id'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
strtoupper
(
$unidades_ensino
[
$valor
]);
}
elseif
(
$nome_valor
==
'curso_id'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
Curso
::
whereId
(
$valor
)
->
first
()
->
{
'name'
};
}
elseif
(
$nome_valor
==
'semestre'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
$semestres
[
$valor
];
}
elseif
(
$nome_valor
==
'afastamento_total'
||
$nome_valor
==
'afastamento_parcial'
||
$nome_valor
==
'direcao_sindical'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
$valor
==
1
?
'Sim'
:
'Não'
;
}
elseif
(
array_key_exists
(
$nome_valor
,
$nomes_valores
))
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
$valor
;
}
else
{
$treated_anexo_pad
[
$nome_valor
]
=
$valor
;
}
}
$model
[
'anexo'
]
=
$treated_anexo_pad
;
date_default_timezone_set
(
"America/Recife"
);
date_default_timezone_set
(
"America/Recife"
);
$dateTime
=
now
()
->
format
(
'd/m/Y (H:i:s)'
);
$dateTime
=
now
()
->
format
(
'd/m/Y (H:i:s)'
);
...
@@ -305,8 +361,10 @@ class UserPadController extends Controller
...
@@ -305,8 +361,10 @@ class UserPadController extends Controller
// dd(
// dd(
// // $userPad->pesquisaCoordenacoes->toArray(),
// // $userPad->pesquisaCoordenacoes->toArray(),
// $niveis[1],
// $anexoPad,
// $funcoes,
// $treated_anexo_pad,
// // $model['anexo'],
// $cursos,
// // ($model['extensao']['1. EXTENSÃO (COORDENAÇÃO DE ATIVIDADES DE EXTENSÃO HOMOLOGADA NA PROEC)']),
// // ($model['extensao']['1. EXTENSÃO (COORDENAÇÃO DE ATIVIDADES DE EXTENSÃO HOMOLOGADA NA PROEC)']),
// // public_path('\images\estado_pe_logo.png'),
// // public_path('\images\estado_pe_logo.png'),
// // url('images\estado_pe_logo.png'),
// // url('images\estado_pe_logo.png'),
...
...
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