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
101e6281
Commit
101e6281
authored
Aug 08, 2023
by
alissonalbuquerque
Browse files
Merge branch 'dev-joao-pdf_generator'
parents
822ff0db
b9cf790c
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/PadController.php
View file @
101e6281
...
@@ -901,6 +901,7 @@ class PadController extends Controller
...
@@ -901,6 +901,7 @@ class PadController extends Controller
public
function
generatePDF
(
$id
){
public
function
generatePDF
(
$id
){
$user
=
Auth
::
user
();
$user
=
Auth
::
user
();
$pad
=
Pad
::
find
(
$id
);
$pad
=
Pad
::
find
(
$id
);
$userPadGeneratePDF
=
new
UserPadController
();
$professores
=
User
::
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
$professores
=
User
::
join
(
'user_pad'
,
'user_pad.user_id'
,
'='
,
'users.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
)
->
join
(
'pad'
,
'user_pad.pad_id'
,
'='
,
'pad.id'
)
->
where
(
function
(
$query
)
use
(
$user
,
$id
)
{
->
where
(
function
(
$query
)
use
(
$user
,
$id
)
{
...
@@ -932,7 +933,7 @@ class PadController extends Controller
...
@@ -932,7 +933,7 @@ class PadController extends Controller
$professor
->
ch_gestao
=
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
?
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
:
0
;
$professor
->
ch_gestao
=
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
?
$this
->
get_carga_horaria
(
$avaliacoes
[
'gestao'
])
:
0
;
if
(
$professor
->
ch_ensino
||
$professor
->
ch_pesquisa
||
$professor
->
ch_extensao
||
$professor
->
ch_gestao
)
{
if
(
$professor
->
ch_ensino
||
$professor
->
ch_pesquisa
||
$professor
->
ch_extensao
||
$professor
->
ch_gestao
)
{
U
serPad
Controller
::
generatePDF
(
$userPad
->
{
'id'
});
$u
serPad
GeneratePDF
->
generatePDF
(
$userPad
->
{
'id'
});
}
}
}
}
...
...
app/Http/Controllers/UserPadController.php
View file @
101e6281
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Models\Pad
;
use
App\Models\Pad
;
use
App\Models\Curso
;
use
App\Models\Curso
;
use
App\Models\Campus
;
use
App\Models\User
;
use
App\Models\User
;
use
App\Models\UserPad
;
use
App\Models\UserPad
;
use
App\Models\Anexo
;
use
App\Models\Anexo
;
...
@@ -207,8 +208,11 @@ class UserPadController extends Controller
...
@@ -207,8 +208,11 @@ class UserPadController extends Controller
'GESTAO'
=>
$gestaoTotalHoras
,
'GESTAO'
=>
$gestaoTotalHoras
,
'PESQUISA'
=>
$pesquisaTotalHoras
'PESQUISA'
=>
$pesquisaTotalHoras
];
];
if
(
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
!=
null
)
$anexoPad
=
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
->
toArray
();
{
$anexoPad
=
Anexo
::
whereUserPadId
(
$user_pad_id
)
->
first
()
->
toArray
();
}
else
{
$anexoPad
=
null
;
}
$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
(),
...
@@ -311,35 +315,39 @@ class UserPadController extends Controller
...
@@ -311,35 +315,39 @@ class UserPadController extends Controller
}
}
}
}
$treated_anexo_pad
=
[];
$treated_anexo_pad
=
[];
f
oreach
(
$anexoPad
as
$nome_valor
=>
$valor
)
i
f
(
$anexoPad
!=
null
)
{
{
if
(
in_array
(
$nome_valor
,
$valores_lista_negra
))
foreach
(
$anexoPad
as
$nome_valor
=>
$valor
)
{
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
;
if
(
in_array
(
$nome_valor
,
$valores_lista_negra
))
{
continue
;
}
elseif
(
$nome_valor
==
'campus_id'
)
{
$treated_anexo_pad
[
$nomes_valores
[
$nome_valor
]]
=
Campus
::
whereId
(
$valor
)
->
first
()
->
{
'name'
};
$treated_anexo_pad
[
$nomes_valores
[
'unidade'
]]
=
$unidades_ensino
[
Campus
::
whereId
(
$valor
)
->
first
()
->
{
'unidade_id'
}];
}
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
;
}
}
}
}
}
...
...
resources/views/pad/teacher/report_pdf.blade.php
View file @
101e6281
...
@@ -13,15 +13,17 @@
...
@@ -13,15 +13,17 @@
</header>
</header>
<div
style=
"display: flex; flex-direction: column; padding-left:5mm; gap: 10mm"
>
<div
style=
"display: flex; flex-direction: column; padding-left:5mm; gap: 10mm"
>
<h1
style=
"font-size: 16px; font-weight: bold; text-align: center"
>
@if ($data['anexo'] != null || $data['anexo'] != [])
ANEXO B
<h1
style=
"font-size: 16px; font-weight: bold; text-align: center"
>
</h1>
ANEXO B
@foreach ($data['anexo'] as $nome=>$valor)
</h1>
<h4
style=
"font-size: 12px; font-weight: normal; padding-bottom: 5px"
>
@foreach ($data['anexo'] as $nome=>$valor)
<b>
{{$nome}}
</b>
: {{$valor}}
<h4
style=
"font-size: 12px; font-weight: normal; padding-bottom: 5px"
>
</h4>
<b>
{{$nome}}
</b>
: {{$valor}}
@endforeach
</h4>
<hr>
@endforeach
<hr>
@endif
@foreach ($data['model'] as $nome_dimensao=>$dimensao)
@foreach ($data['model'] as $nome_dimensao=>$dimensao)
<h1
style=
"font-size: 16px; font-weight: bold"
>
<h1
style=
"font-size: 16px; font-weight: bold"
>
{{$nome_dimensao}}
{{$nome_dimensao}}
...
...
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