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
submeta
Commits
e23b8acb
Commit
e23b8acb
authored
May 06, 2021
by
Carlos André
Browse files
ajustado o banco e os dados dos participantes
parent
a0427e97
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
e23b8acb
...
@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho;
...
@@ -33,6 +33,7 @@ use App\Mail\SubmissaoTrabalho;
use
App\Mail\EventoCriado
;
use
App\Mail\EventoCriado
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Validation\Rule
;
use
App\OutrasInfoParticipante
;
class
TrabalhoController
extends
Controller
class
TrabalhoController
extends
Controller
{
{
...
@@ -61,7 +62,8 @@ class TrabalhoController extends Controller
...
@@ -61,7 +62,8 @@ class TrabalhoController extends Controller
'edital'
=>
$edital
,
'edital'
=>
$edital
,
'grandeAreas'
=>
$grandeAreas
,
'grandeAreas'
=>
$grandeAreas
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'funcaoParticipantes'
=>
$funcaoParticipantes
,
'rascunho'
=>
$rascunho
'rascunho'
=>
$rascunho
,
'enum_turno'
=>
OutrasInfoParticipante
::
ENUM_TURNO
]);
]);
}
}
...
...
app/OutrasInfoParticipante.php
0 → 100644
View file @
e23b8acb
<?php
namespace
App
;
use
Illuminate\Database\Eloquent\Model
;
class
OutrasInfoParticipante
extends
Model
{
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
const
ENUM_TURNO
=
[
'Matutino'
,
'Vespertino'
,
'Noturno'
,
'Integral'
];
}
database/migrations/2021_05_05_161225_create_outras_info_participantes_table.php
0 → 100644
View file @
e23b8acb
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
use
App\OutrasInfoParticipante
;
class
CreateOutrasInfoParticipantesTable
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'outras_info_participantes'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
"rg"
);
$table
->
date
(
"data_de_nascimento"
);
$table
->
string
(
"curso"
);
$table
->
enum
(
"turno"
,
OutrasInfoParticipante
::
ENUM_TURNO
)
->
nullable
(
true
);
$table
->
integer
(
"ordem_prioridade"
)
->
nullable
(
true
);
$table
->
string
(
"periodo_atual"
)
->
nullable
(
true
);
$table
->
string
(
"total_periodos"
)
->
nullable
(
true
);
$table
->
double
(
"media_do_curso"
,
3
,
2
)
->
nullable
(
true
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'outras_info_participantes'
);
}
}
database/migrations/2021_05_05_163601_add_column_participante.php
0 → 100644
View file @
e23b8acb
<?php
use
Illuminate\Database\Migrations\Migration
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Support\Facades\Schema
;
class
AddColumnParticipante
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
table
(
'participantes'
,
function
(
Blueprint
$table
)
{
$table
->
unsignedBigInteger
(
'outras_info_participante_id'
)
->
nullable
(
true
);
$table
->
foreign
(
'outras_info_participante_id'
)
->
references
(
'id'
)
->
on
(
'outras_info_participantes'
);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
//
}
}
resources/views/evento/submeterTrabalho.blade.php
View file @
e23b8acb
...
@@ -323,10 +323,11 @@
...
@@ -323,10 +323,11 @@
<div id="
novoParticipante
" style="
display
:
block
;
">
<div id="
novoParticipante
" style="
display
:
block
;
">
<br>
<br>
<h4>Dados do participante</h4>
<h4>Dados do participante</h4>
<h6>Dados pessoais</h6>
<div class="
row
">
<div class="
row
">
<div class="
col
-
sm
-
5
">
<div class="
col
-
sm
-
5
">
<label>Nome Completo*</label>
<label>Nome Completo*</label>
<input type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomeParticipante'
)
is
-
invalid
@
enderror
" name="
nomeParticipante
[]
" placeholder="
Nome
" value="
{{
old
(
'nomeParticipante.'
.
$i
)}}
">
<input type="
text
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'nomeParticipante'
)
is
-
invalid
@
enderror
" name="
nomeParticipante
[]
" placeholder="
Nome
" value="
{{
old
(
'nomeParticipante.'
.
$i
)}}
"
required
>
@error('nomeParticipante.'.
$i
)
@error('nomeParticipante.'.
$i
)
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
<strong>{{
$message
}}</strong>
...
@@ -335,7 +336,7 @@
...
@@ -335,7 +336,7 @@
</div>
</div>
<div class="
col
-
sm
-
4
">
<div class="
col
-
sm
-
4
">
<label>E-mail*</label>
<label>E-mail*</label>
<input type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
email
" value="
{{
old
(
'emailParticipante.'
.
$i
)}}
">
<input type="
email
" style="
margin
-
bottom
:
10
px
" class="
form
-
control
@
error
(
'emailParticipante'
)
is
-
invalid
@
enderror
" name="
emailParticipante
[]
" placeholder="
email
" value="
{{
old
(
'emailParticipante.'
.
$i
)}}
"
required
>
@error('emailParticipante.'.
$i
)
@error('emailParticipante.'.
$i
)
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<span class="
invalid
-
feedback
" role="
alert
" style="
overflow
:
visible
;
display
:
block
">
<strong>{{
$message
}}</strong>
<strong>{{
$message
}}</strong>
...
@@ -344,7 +345,7 @@
...
@@ -344,7 +345,7 @@
</div>
</div>
<div class="
col
-
sm
-
3
">
<div class="
col
-
sm
-
3
">
<label>Função*:</label>
<label>Função*:</label>
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
" name="
funcaoParticipante
[]
" id="
funcaoParticipante
">
<select class="
form
-
control
@
error
(
'funcaoParticipante'
)
is
-
invalid
@
enderror
" name="
funcaoParticipante
[]
" id="
funcaoParticipante
"
required
>
<option value="" disabled selected hidden>-- Função --</option>
<option value="" disabled selected hidden>-- Função --</option>
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)
<option @if(old('funcaoParticipante.'.
$i
)==
$funcaoParticipante->id
) selected @endif value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
<option @if(old('funcaoParticipante.'.
$i
)==
$funcaoParticipante->id
) selected @endif value="
{{
$funcaoParticipante
->
id
}}
">
{
{$funcaoParticipante->nome}
}
</option>
...
@@ -357,6 +358,160 @@
...
@@ -357,6 +358,160 @@
@enderror
@enderror
</div>
</div>
</div>
</div>
<div id="
dados_complemento_1
">
<div class="
form
-
group
">
<div class="
row
">
<div class="
col
-
sm
-
4
">
<label for="">{{ __('CPF*') }}</label>
<input type="
text
" class="
form
-
control
cpf
" name="
cpf
[]
" required>
</div>
<div class="
col
-
sm
-
4
">
<label for="">{{ __('RG*') }}</label>
<input type="
text
" class="
form
-
control
rg
" name="
rg
[]
" required>
</div>
<div class="
col
-
sm
-
4
">
<label for="">{{ __('Celular*') }}</label>
<input type="
text
" class="
form
-
control
celular
" name="
celular
[]
" required>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
col
-
sm
-
4
">
<label for="">{{ __('Data de nascimento*') }}</label>
<input type="
date
" class="
form
-
control
cpf
" name="
data_de_nascimento
[]
" required>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
container
">
<h6>Endereço do participante</h6>
</div>
</div>
<div class="
row
">
<div class="
col
-
sm
-
3
">
<label for="">{{ __('CEP*') }}</label>
<input type="
text
" class="
form
-
control
" name="
cep
[]
" required>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
col
-
sm
-
6
">
<label for="">{{ __('Rua*') }}</label>
<input type="
text
" class="
form
-
control
" name="
rua
[]
" required>
</div>
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Número*') }}</label>
<input type="
text
" class="
form
-
control
" name="
numero
[]
" required>
</div>
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Bairro*') }}</label>
<input type="
text
" class="
form
-
control
" name="
bairro
[]
" required>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
col
-
sm
-
4
">
<label for="">{{ __('Cidade*') }}</label>
<input type="
text
" class="
form
-
control
" name="
cidade
[]
" required>
</div>
<div class="
col
-
sm
-
4
">
<label for="">{{ __('Complemento*') }}</label>
<input type="
text
" class="
form
-
control
" name="
complemento
[]
" required>
</div>
<div class="
col
-
sm
-
4
">
<label for="">{{ __('Estado*') }}</label>
<select name="
uf
" id="" class="
form
-
control
" name="
estado
[]
" required>
<option value="" disabled selected>-- UF --</option>
<option @if(old('uf') == 'AC') selected @endif value="
AC
">Acre</option>
<option @if(old('uf') == 'AL') selected @endif value="
AL
">Alagoas</option>
<option @if(old('uf') == 'AP') selected @endif value="
AP
">Amapá</option>
<option @if(old('uf') == 'AM') selected @endif value="
AM
">Amazonas</option>
<option @if(old('uf') == 'BA') selected @endif value="
BA
">Bahia</option>
<option @if(old('uf') == 'CE') selected @endif value="
CE
">Ceará</option>
<option @if(old('uf') == 'DF') selected @endif value="
DF
">Distrito Federal</option>
<option @if(old('uf') == 'ES') selected @endif value="
ES
">Espírito Santo</option>
<option @if(old('uf') == 'GO') selected @endif value="
GO
">Goiás</option>
<option @if(old('uf') == 'MA') selected @endif value="
MA
">Maranhão</option>
<option @if(old('uf') == 'MT') selected @endif value="
MT
">Mato Grosso</option>
<option @if(old('uf') == 'MS') selected @endif value="
MS
">Mato Grosso do Sul</option>
<option @if(old('uf') == 'MG') selected @endif value="
MG
">Minas Gerais</option>
<option @if(old('uf') == 'PA') selected @endif value="
PA
">Pará</option>
<option @if(old('uf') == 'PB') selected @endif value="
PB
">Paraíba</option>
<option @if(old('uf') == 'PR') selected @endif value="
PR
">Paraná</option>
<option @if(old('uf') == 'PE') selected @endif value="
PE
">Pernambuco</option>
<option @if(old('uf') == 'PI') selected @endif value="
PI
">Piauí</option>
<option @if(old('uf') == 'RJ') selected @endif value="
RJ
">Rio de Janeiro</option>
<option @if(old('uf') == 'RN') selected @endif value="
RN
">Rio Grande do Norte</option>
<option @if(old('uf') == 'RS') selected @endif value="
RS
">Rio Grande do Sul</option>
<option @if(old('uf') == 'RO') selected @endif value="
RO
">Rondônia</option>
<option @if(old('uf') == 'RR') selected @endif value="
RR
">Roraima</option>
<option @if(old('uf') == 'SC') selected @endif value="
SC
">Santa Catarina</option>
<option @if(old('uf') == 'SP') selected @endif value="
SP
">São Paulo</option>
<option @if(old('uf') == 'SE') selected @endif value="
SE
">Sergipe</option>
<option @if(old('uf') == 'TO') selected @endif value="
TO
">Tocantins</option>
</select>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
container
">
<h6>Dados do curso do participante</h6>
</div>
</div>
<div class="
row
">
<div class="
col
-
sm
-
6
">
<label for="">{{ __('Universidade*') }}</label>
<input type="
text
" class="
form
-
control
" name="
universidade
[]
" required>
</div>
<div class="
col
-
sm
-
6
">
<label for="">{{ __('Curso*') }}</label>
<input type="
text
" class="
form
-
control
" name="
curso
[]
" required>
</div>
</div>
</div>
<div class="
form
-
group
">
<div class="
row
">
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Turno*') }}</label>
<select id="" class="
form
-
control
" name="
turno
[]
" required>
<option value="" disabled selected>-- TURNO --</option>
@foreach (
$enum_turno
as
$turno
)
<option value="
{{
$turno
}}
">
{
{$turno}
}
</option>
@endforeach
</select>
</div>
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Total de periodos do curso*') }}</label>
<select name="
total_periodos
[]
" id="" class="
form
-
control
" onchange="
gerarPeriodos
(
this
)
" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option value="
6
">6</option>
<option value="
7
">7</option>
<option value="
8
">8</option>
<option value="
9
">9</option>
<option value="
10
">10</option>
<option value="
11
">11</option>
<option value="
12
">12</option>
</select>
</div>
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Periodo que está cursando*') }}</label>
<select name="
periodo_cursado
[]
" id="" class="
form
-
control
" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
</select>
</div>
<div class="
col
-
sm
-
3
">
<label for="">{{ __('Média geral do curso*') }}</label>
<input type="
number
" class="
form
-
control
media
" min="
0
" max="
10
" step="
0.01
" value="
00.00
" name="
media_geral_curso
[]
" required>
</div>
</div>
</div>
</div>
<h6 class="
mb
-
1
">Possui plano de trabalho?</h6>
<h6 class="
mb
-
1
">Possui plano de trabalho?</h6>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
simPlano
">Sim</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
simPlano
">Sim</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
naoPlano
">Não</button>
<button class="
btn
btn
-
primary
mt
-
2
mb
-
2
naoPlano
">Não</button>
...
@@ -603,88 +758,245 @@
...
@@ -603,88 +758,245 @@
function
montarLinhaInput
()
{
function
montarLinhaInput
()
{
return
"<div id="
+
"novoParticipante"
+
">"
+
return
`<hr><div id="novoParticipante" style="display: block;">
"<div class='row'>"
+
<br>
"<div class='col-sm-9'>"
+
<h4>Dados do participante</h4>
"<br><h4>Dados do participante</h4>"
+
<h6>Dados pessoais</h6>
"</div>"
+
<div class="row">
"<div class='col-sm-3'>"
+
<div class="col-sm-5">
<label>Nome Completo*</label>
"</div>"
+
<input type="text" style="margin-bottom:10px" class="form-control @error('nomeParticipante') is-invalid @enderror" name="nomeParticipante[]" placeholder="Nome" value="{{old('nomeParticipante.'.$i)}}" required>
"</div>"
+
@error('nomeParticipante.'.$i)
"<div class="
+
"row"
+
">"
+
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
"<div class="
+
"col-sm-5"
+
">"
+
<strong>{{ $message }}</strong>
"<label>Nome Completo*</label>"
+
</span>
"<input"
+
" type="
+
'text'
+
" style="
+
"margin-bottom:10px"
+
" class="
+
'form-control'
+
" @error('nomeParticipante') is-invalid @enderror"
+
"name="
+
'nomeParticipante[]'
+
" placeholder="
+
"Nome"
+
">"
+
@enderror
"@error('nomeParticipante')"
+
</div>
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
<div class="col-sm-4">
"<strong>{{
$message
}}</strong>"
+
<label>E-mail*</label>
"</span>"
+
<input type="email" style="margin-bottom:10px" class="form-control @error('emailParticipante') is-invalid @enderror" name="emailParticipante[]" placeholder="email" value="{{old('emailParticipante.'.$i)}}" required>
"@enderror"
+
@error('emailParticipante.'.$i)
"</div>"
+
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
"<div class="
+
"col-sm-4"
+
">"
+
<strong>{{ $message }}</strong>
"<label>E-mail*</label>"
+
</span>
"<input type='email'"
+
"style='margin-bottom:10px'"
+
"class="
+
"form-control @error('emailParticipante') is-invalid @enderror"
+
"name='emailParticipante[]'"
+
"placeholder='email' >"
+
@enderror
"@error('emailParticipante')"
+
</div>
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
<div class="col-sm-3">
"<strong>{{
$message
}}</strong>"
+
<label>Função*:</label>
"</span>"
+
<select class="form-control @error('funcaoParticipante') is-invalid @enderror" name="funcaoParticipante[]" id="funcaoParticipante" required>
"@enderror"
+
<option value="" disabled selected hidden>-- Função --</option>
"</div>"
+
@foreach($funcaoParticipantes as $funcaoParticipante)
"<div class='col-sm-3'>"
+
<option @if(old('funcaoParticipante.'.$i)==$funcaoParticipante->id ) selected @endif value="{{$funcaoParticipante->id}}">{{$funcaoParticipante->nome}}</option>
"<label>Função*:</label>"
+
@endforeach
"<select class="
+
"form-control @error('funcaoParticipante') is-invalid @enderror"
+
"name='funcaoParticipante[]'"
+
"id='funcaoParticipante'> "
+
</select>
"<option value='' disabled selected hidden> Função </option>"
+
@error('funcaoParticipante')
"@foreach(
$funcaoParticipantes
as
$funcaoParticipante
)"
+
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
"<option value='
{
{$funcaoParticipante->id}}'>{{$funcaoParticipante->nome}
}
</option>"
+
<strong>{{ $message }}</strong>
"@endforeach"
+
</span>
"@error('funcaoParticipante'.
$i
)"
+
@enderror
"<span class='invalid-feedback'"
+
" role='alert'"
+
" style='overflow: visible; display:block'>"
+
</div>
"<strong>{{
$message
}}</strong>"
+
</div>
"</span>"
+
<div id="dados_complemento_1">
"@enderror"
+
<div class="form-group">
"</select>"
+
<div class="row">
"</div>"
+
<div class="col-sm-4">
"</div>"
+
<label for="">{{ __('CPF*') }}</label>
"<h6 class='mb-1'>Possui plano de trabalho?</h6>"
+
<input type="text" class="form-control cpf" name="cpf[]" required>
"<button class="
+
"'btn btn-primary mt-2 mb-2 mr-1 simPlano'"
+
">Sim</button>"
+
</div>
"<button class="
+
"'btn btn-primary mt-2 mb-2 mr-1 naoPlano'"
+
">Não</button>"
+
<div class="col-sm-4">
"<div id="
+
"planoHabilitado"
+
" style="
+
"'display:none;'"
+
">"
+
<label for="">{{ __('RG*') }}</label>
"<h5>Dados do plano de trabalho</h5>"
+
<input type="text" class="form-control rg" name="rg[]" required>
"<div class="
+
"row"
+
">"
+
</div>
"<div class="
+
"col-sm-4"
+
">"
+
<div class="col-sm-4">
"<label>Titulo*</label>"
+
<label for="">{{ __('Celular*') }}</label>
"<input"
+
" type="
+
'text'
+
" style="
+
"margin-bottom:10px"
+
" class="
+
"form-control @error('nomePlanoTrabalho') is-invalid @enderror"
+
" name="
+
'nomePlanoTrabalho[]'
+
" placeholder="
+
"Nome"
+
">"
+
<input type="text" class="form-control celular" name="celular[]" required>
"@error('nomePlanoTrabalho')"
+
</div>
"<span class='invalid-feedback'"
+
"role='alert'"
+
"style='overflow: visible; display:block'>"
+
</div>
"<strong>{{
$message
}}</strong>"
+
</div>
"</span>"
+
<div class="form-group">
"@enderror"
+
<div class="row">
"</div>"
+
<div class="col-sm-4">
"<div class="
+
"col-sm-7"
+
">"
+
<label for="">{{ __('Data de nascimento*') }}</label>
"<label for="
+
"nomeTrabalho"
+
">Anexo* </label>"
+
<input type="date" class="form-control cpf" name="data_de_nascimento[]" required>
</div>
"<div class="
+
"input-group"
+
">"
+
</div>
"<div class='input-group-prepend'>"
+
</div>
"<span class='input-group-text' id='anexoPlanoTrabalho'>Selecione um arquivo:</span>"
+
<div class="form-group">
"</div>"
+
<div class="row">
"<div class='custom-file'>"
+
<div class="container">
"<input type='file' class='custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror"
+
"id='anexoPlanoTrabalho'"
+
<h6>Endereço do participante</h6>
" aria-describedby='anexoPlanoTrabalho' name='anexoPlanoTrabalho[]'>"
+
</div>
"<label class='custom-file-label' id='custom-file-label' for='inputGroupFile01'>O arquivo deve ser no formato PDF de até 2MB.</label>"
+
</div>
"</div>"
+
<div class="row">
"</div>"
+
<div class="col-sm-3">
"@error('anexoPlanoTrabalho')"
+
<label for="">{{ __('CEP*') }}</label>
"<span class='invalid-feedback' role='alert' style='overflow: visible; display:block'>"
+
<input type="text" class="form-control" name="cep[]" required>
"<strong>{{
$message
}}</strong>"
+
</div>
"</span>"
+
</div>
"@enderror"
+
</div>
"</div>"
+
<div class="form-group">
"</div>"
+
<div class="row">
"</div>"
+
<div class="col-sm-6">
<label for="">{{ __('Rua*') }}</label>
"<button href='#' class="
+
"'btn btn-danger mt-2 mb-2 delete'"
+
" style='width:100%;margin-top:10px'"
+
">Remover participante</button>"
+
<input type="text" class="form-control" name="rua[]" required>
"</div>"
;
</div>
<div class="col-sm-3">
<label for="">{{ __('Número*') }}</label>
<input type="text" class="form-control" name="numero[]" required>
</div>
<div class="col-sm-3">
<label for="">{{ __('Bairro*') }}</label>
<input type="text" class="form-control" name="bairro[]" required>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-4">
<label for="">{{ __('Cidade*') }}</label>
<input type="text" class="form-control " name="cidade[]" required>
</div>
<div class="col-sm-4">
<label for="">{{ __('Complemento*') }}</label>
<input type="text" class="form-control" name="complemento[]" required>
</div>
<div class="col-sm-4">
<label for="">{{ __('Estado*') }}</label>
<select name="uf" id="" class="form-control" name="estado[]" required>
<option value="" disabled selected>-- UF --</option>
<option @if(old('uf') == 'AC') selected @endif value="AC">Acre</option>
<option @if(old('uf') == 'AL') selected @endif value="AL">Alagoas</option>
<option @if(old('uf') == 'AP') selected @endif value="AP">Amapá</option>
<option @if(old('uf') == 'AM') selected @endif value="AM">Amazonas</option>
<option @if(old('uf') == 'BA') selected @endif value="BA">Bahia</option>
<option @if(old('uf') == 'CE') selected @endif value="CE">Ceará</option>
<option @if(old('uf') == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if(old('uf') == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if(old('uf') == 'GO') selected @endif value="GO">Goiás</option>
<option @if(old('uf') == 'MA') selected @endif value="MA">Maranhão</option>
<option @if(old('uf') == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if(old('uf') == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if(old('uf') == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if(old('uf') == 'PA') selected @endif value="PA">Pará</option>
<option @if(old('uf') == 'PB') selected @endif value="PB">Paraíba</option>
<option @if(old('uf') == 'PR') selected @endif value="PR">Paraná</option>
<option @if(old('uf') == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if(old('uf') == 'PI') selected @endif value="PI">Piauí</option>
<option @if(old('uf') == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if(old('uf') == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if(old('uf') == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if(old('uf') == 'RO') selected @endif value="RO">Rondônia</option>
<option @if(old('uf') == 'RR') selected @endif value="RR">Roraima</option>
<option @if(old('uf') == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if(old('uf') == 'SP') selected @endif value="SP">São Paulo</option>
<option @if(old('uf') == 'SE') selected @endif value="SE">Sergipe</option>
<option @if(old('uf') == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="container">
<h6>Dados do curso do participante</h6>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<label for="">{{ __('Universidade*') }}</label>
<input type="text" class="form-control" name="universidade[]" required>
</div>
<div class="col-sm-6">
<label for="">{{ __('Curso*') }}</label>
<input type="text" class="form-control" name="curso[]" required>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-3">
<label for="">{{ __('Turno*') }}</label>
<select id="" class="form-control" name="turno[]" required>
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="col-sm-3">
<label for="">{{ __('Total de periodos do curso*') }}</label>
<select name="total_periodos[]" id="" class="form-control" onchange="gerarPeriodos(this)" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
</div>
<div class="col-sm-3">
<label for="">{{ __('Periodo que está cursando*') }}</label>
<select name="periodo_cursado[]" id="" class="form-control" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
</select>
</div>
<div class="col-sm-3">
<label for="">{{ __('Média geral do curso*') }}</label>
<input type="number" class="form-control media" min="0" max="10" step="0.01" value="00.00" name="media_geral_curso[]" required>
</div>
</div>
</div>
</div>
<h6 class="mb-1">Possui plano de trabalho?</h6>
<button class="btn btn-primary mt-2 mb-2 simPlano">Sim</button>
<button class="btn btn-primary mt-2 mb-2 naoPlano">Não</button>
<div id="planoHabilitado" style="display:none;">
<h5>Dados do plano de trabalho</h5>
<div class="row">
<div class="col-sm-12">
<div id="planoTrabalho">
<div class="row">
<div class="col-sm-4">
<label>Titulo* </label>
<input type="text" style="margin-bottom:10px" class="form-control @error('nomePlanoTrabalho') is-invalid @enderror" name="nomePlanoTrabalho[]" placeholder="Nome" value="{{old('nomePlanoTrabalho.'.$i)}}">
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
{{-- Arquivo --}}
<div class="col-sm-7">
<label for="nomeTrabalho">Anexo*</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="anexoPlanoTrabalho">Selecione um arquivo:</span>
</div>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoTrabalho" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]">
<label class="custom-file-label" id="custom-file-label" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<button class="btn btn-danger mt-2 mb-2 delete" style='width:100%;margin-top:10px' disabled>Limite minimo de participantes</button>
</div>`
;
}
}
...
@@ -796,5 +1108,34 @@
...
@@ -796,5 +1108,34 @@
}
}
window
.
onload
=
areas
();
window
.
onload
=
areas
();
window
.
onload
=
habilitarBotao
();
window
.
onload
=
habilitarBotao
();
$
(
document
)
.
ready
(
function
(
$
)
{
$
(
'.cpf'
)
.
mask
(
'000.000.000-00'
);
var
SPMaskBehavior
=
function
(
val
)
{
return
val
.
replace
(
/
\
D
/
g
,
''
)
.
length
===
11
?
'(00) 00000-0000'
:
'(00) 0000-00009'
;
},
spOptions
=
{
onKeyPress
:
function
(
val
,
e
,
field
,
options
)
{
field
.
mask
(
SPMaskBehavior
.
apply
({},
arguments
),
options
);
}
};
$
(
'.celular'
)
.
mask
(
SPMaskBehavior
,
spOptions
);
$
(
'.rg'
)
.
mask
(
'99.999.999-9'
);
$
(
'.media'
)
.
mask
(
'00.00'
);
});
function
gerarPeriodos
(
select
)
{
var
div
=
select
.
parentElement
.
parentElement
;
var
selectPeriodos
=
div
.
children
[
2
]
.
children
[
1
];
var
html
=
`<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`
;
for
(
var
i
=
0
;
i
<
parseInt
(
select
.
value
);
i
++
)
{
html
+=
`<option value="${i+1}">${i+1}º</option>`
;
}
$
(
selectPeriodos
)
.
html
(
''
);
$
(
selectPeriodos
)
.
append
(
html
);
}
</
script
>
</
script
>
@
endsection
@
endsection
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