Commit b9cf790c authored by PedroLopesUPE's avatar PedroLopesUPE
Browse files

Bug fix: erro de anexo b vazio

parent faf98b0c
...@@ -315,36 +315,39 @@ class UserPadController extends Controller ...@@ -315,36 +315,39 @@ class UserPadController extends Controller
} }
} }
$treated_anexo_pad = []; $treated_anexo_pad = [];
foreach ($anexoPad as $nome_valor=>$valor) if ($anexoPad != null)
{ {
if (in_array($nome_valor, $valores_lista_negra)) foreach ($anexoPad as $nome_valor=>$valor)
{ {
continue; if (in_array($nome_valor, $valores_lista_negra))
} {
elseif ($nome_valor == 'campus_id') continue;
{ }
$treated_anexo_pad[$nomes_valores[$nome_valor]] = Campus::whereId($valor)->first()->{'name'}; elseif ($nome_valor == 'campus_id')
$treated_anexo_pad[$nomes_valores['unidade']] = $unidades_ensino[Campus::whereId($valor)->first()->{'unidade_id'}]; {
} $treated_anexo_pad[$nomes_valores[$nome_valor]] = Campus::whereId($valor)->first()->{'name'};
elseif ($nome_valor == 'curso_id') $treated_anexo_pad[$nomes_valores['unidade']] = $unidades_ensino[Campus::whereId($valor)->first()->{'unidade_id'}];
{ }
$treated_anexo_pad[$nomes_valores[$nome_valor]] = Curso::whereId($valor)->first()->{'name'}; elseif ($nome_valor == 'curso_id')
} {
elseif ($nome_valor == 'semestre') $treated_anexo_pad[$nomes_valores[$nome_valor]] = Curso::whereId($valor)->first()->{'name'};
{ }
$treated_anexo_pad[$nomes_valores[$nome_valor]] = $semestres[$valor]; elseif ($nome_valor == 'semestre')
} {
elseif ($nome_valor == 'afastamento_total' || $nome_valor == 'afastamento_parcial' || $nome_valor == 'direcao_sindical') $treated_anexo_pad[$nomes_valores[$nome_valor]] = $semestres[$valor];
{ }
$treated_anexo_pad[$nomes_valores[$nome_valor]] = $valor == 1? 'Sim' : 'Não'; elseif ($nome_valor == 'afastamento_total' || $nome_valor == 'afastamento_parcial' || $nome_valor == 'direcao_sindical')
} {
elseif (array_key_exists($nome_valor, $nomes_valores)) $treated_anexo_pad[$nomes_valores[$nome_valor]] = $valor == 1? 'Sim' : 'Não';
{ }
$treated_anexo_pad[$nomes_valores[$nome_valor]] = $valor; elseif (array_key_exists($nome_valor, $nomes_valores))
} {
else $treated_anexo_pad[$nomes_valores[$nome_valor]] = $valor;
{ }
$treated_anexo_pad[$nome_valor] = $valor; else
{
$treated_anexo_pad[$nome_valor] = $valor;
}
} }
} }
......
...@@ -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}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment