Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
13ac2a80
Commit
13ac2a80
authored
4 years ago
by
Carlos André
Browse files
Options
Download
Plain Diff
conflito
parents
78fb7c9b
466cda04
master
carl-branch
dependabot/composer/dompdf/dompdf-1.2.2
dependabot/composer/guzzlehttp/guzzle-6.5.8
dependabot/composer/guzzlehttp/psr7-1.8.5
dependabot/composer/symfony/http-kernel-4.4.50
dependabot/npm_and_yarn/axios-0.21.2
dependabot/npm_and_yarn/decode-uri-component-0.2.2
dependabot/npm_and_yarn/express-4.18.2
dependabot/npm_and_yarn/json5-and-json5-2.2.3
dependabot/npm_and_yarn/loader-utils-and-webpack-cli-1.4.2
dependabot/npm_and_yarn/minimist-and-mkdirp-1.2.8
dependabot/npm_and_yarn/qs-and-express-6.11.0
excluir_projeto_submetido
minha_conta
modificacoes_aviso
modificacoes_layout_9
modificacoes_layout_minha_conta
modificacoes_perfil_avaliador
updates_mar
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/Http/Controllers/TrabalhoController.php
+10
-7
app/Http/Controllers/TrabalhoController.php
resources/views/evento/formulario/participantes.blade.php
+4
-164
resources/views/evento/formulario/participantes.blade.php
resources/views/evento/submeterTrabalho.blade.php
+13
-15
resources/views/evento/submeterTrabalho.blade.php
with
27 additions
and
186 deletions
+27
-186
app/Http/Controllers/TrabalhoController.php
View file @
13ac2a80
...
@@ -834,27 +834,30 @@ class TrabalhoController extends Controller
...
@@ -834,27 +834,30 @@ class TrabalhoController extends Controller
}
}
public
function
salvar
(
Request
$request
)
{
public
function
salvar
(
Request
$request
)
{
// dd($request->all());
try
{
$edital
=
Evento
::
find
(
$request
->
editalId
);
$edital
=
Evento
::
find
(
$request
->
editalId
);
$hoje
=
now
();
$hoje
=
now
();
// dd($request->all());
if
(
!
(
$edital
->
inicioSubmissao
<
$hoje
&&
$edital
->
fimSubmissao
>=
$hoje
))
{
if
(
!
(
$edital
->
inicioSubmissao
<
$hoje
&&
$edital
->
fimSubmissao
>=
$hoje
))
{
return
redirect
()
->
route
(
'inicial'
)
->
with
([
'error'
=>
0
,
'mensagem'
=>
'As submissões para o edital '
.
$edital
->
titulo
.
' foram encerradas.'
]);
return
redirect
()
->
route
(
'inicial'
)
->
with
([
'error'
=>
0
,
'mensagem'
=>
'As submissões para o edital '
.
$edital
->
titulo
.
' foram encerradas.'
]);
}
}
$projeto
=
$this
->
atribuirDados
(
$request
,
$edital
);
$projeto
=
$this
->
atribuirDados
(
$request
,
$edital
);
$projeto
->
save
();
$projeto
->
save
();
// dd($request->all());
// Email de submissão
// Email de submissão
//
$subject = "Submissão de Trabalho";
$subject
=
"Submissão de Trabalho"
;
//
$proponente = Auth()->user();
$proponente
=
Auth
()
->
user
();
//
Mail::to($proponente->email)->send(new SubmissaoTrabalho($proponente, $subject, $edital, $projeto));
Mail
::
to
(
$proponente
->
email
)
->
send
(
new
SubmissaoTrabalho
(
$proponente
,
$subject
,
$edital
,
$projeto
));
// Salvando participantes
// Salvando participantes
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
);
$this
->
salvarParticipantes
(
$request
,
$edital
,
$projeto
);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto submetido com sucesso!'
]);
return
redirect
(
route
(
'proponente.projetos'
))
->
with
([
'mensagem'
=>
'Projeto submetido com sucesso!'
]);
}
catch
(
\
Throwable
$th
)
{
return
back
()
->
with
([
'mensagem'
=>
$th
->
getMessage
()]);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/views/evento/formulario/participantes.blade.php
View file @
13ac2a80
...
@@ -18,177 +18,17 @@
...
@@ -18,177 +18,17 @@
<li
id=
"item"
>
<li
id=
"item"
>
<div
style=
"margin-bottom:15px"
>
<div
style=
"margin-bottom:15px"
>
<div
id=
"participante"
>
<div
id=
"participante"
>
{{--
<div
class=
"form-row"
style=
"display: none"
id=
"participantePrimeiro"
>
<button
type=
"button"
class=
"btn btn-danger"
id=
"buttonRemover"
onclick=
"removerPart(this)"
>
Remover participante
</button>
<div
class=
"col-md-12"
>
<a
class=
"btn btn-light"
data-toggle=
"collapse"
id=
"idCollapseParticipante"
href=
"#collapseParticipante"
role=
"button"
aria-expanded=
"false"
aria-controls=
"collapseParticipante"
style=
"width: 100%; text-align:left"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<h4
id=
"tituloParticipante"
style=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<span
id=
"pontos"
style=
"display: none;"
>
:
</span>
<span
style=
"display: none;"
id=
"display"
></span>
</h4>
</div>
</a>
</div>
<div
class=
"col-md-12"
>
<div
class=
"collapse"
id=
"collapseParticipante"
>
<div
class=
"container"
>
<div
class=
"row"
>
<input
type=
"hidden"
name=
"funcaoParticipante[]"
value=
"4"
>
<div
class=
"col-md-12 mt-3"
><h5>
Dados do participante
</h5></div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Nome completo'])
<input
type=
"text"
class=
"form-control "
id=
"nomeParticipante"
name=
"nomeParticipante[]"
placeholder=
"Nome Completo"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'E-mail'])
<input
type=
"email"
class=
"form-control"
name=
"emailParticipante[]"
placeholder=
"E-mail"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Data de nascimento'])
<input
type=
"date"
class=
"form-control"
name=
"data_de_nascimento[]"
placeholder=
"Data de nascimento"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'CPF'])
<input
type=
"text"
class=
"form-control cpf"
name=
"cpf[]"
placeholder=
"CPF"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'RG'])
<input
type=
"number"
class=
"form-control"
min=
"1"
maxlength=
"8"
name=
"rg[]"
placeholder=
"RG"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Celular'])
<input
type=
"tel"
class=
"form-control celular"
name=
"celular[]"
placeholder=
"Celular"
required
/>
@endcomponent
</div>
<div
class=
"col-md-12"
><h5>
Endereço
</h5></div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'CEP'])
<input
type=
"number"
class=
"form-control"
name=
"cep[]"
placeholder=
"CEP"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.select', ['label' => 'Estado'])
<select
name=
"uf[]"
id=
"estado"
class=
"form-control"
style=
"visibility: visible"
required
>
<option
value=
""
disabled
selected
>
-- Selecione uma opção --
</option>
@foreach ($estados as $sigla => $nome)
<option
@
if
(
old
('
uf
'
) =
=
$
sigla
)
selected
@
endif
value=
"{{ $sigla }}"
>
{{ $nome }}
</option>
@endforeach
</select>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Cidade'])
<input
type=
"text"
class=
"form-control"
name=
"cidade[]"
placeholder=
"Cidade"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Bairro'])
<input
type=
"text"
class=
"form-control"
name=
"bairro[]"
placeholder=
"Bairro"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Rua'])
<input
type=
"text"
class=
"form-control"
name=
"rua[]"
placeholder=
"Rua"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Número'])
<input
type=
"text"
class=
"form-control"
name=
"numero[]"
placeholder=
"Número"
required
/>
@endcomponent
</div>
<div
class=
"col-12"
>
@component('componentes.input', ['label' => 'Complemento'])
<input
type=
"text"
id=
"complemento"
class=
"form-control"
name=
"complemento[]"
pattern=
"[A-Za-z]+"
placeholder=
"Complemento"
required
/>
@endcomponent
</div>
<div
class=
"col-md-12"
><h5>
Dados do curso
</h5></div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Universidade'])
<input
type=
"text"
class=
"form-control"
name=
"universidade[]"
placeholder=
"Universidade"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Curso'])
<input
type=
"text"
class=
"form-control"
name=
"curso[]"
placeholder=
"Curso"
required
/>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.select', ['label' => 'Turno'])
<select
name=
"turno[]"
class=
"form-control"
required
>
<option
value=
""
disabled
selected
>
-- Selecione uma opção --
</option>
@foreach ($enum_turno as $key => $value)
<option
@
if
(
old
('
turno
'
) =
=
$
value
)
selected
@
endif
value=
"{{ $value }}"
>
{{ $value }}
</option>
@endforeach
</select>
@endcomponent
</div>
@php
$options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12);
@endphp
<div
class=
"col-6"
>
@component('componentes.select', ['label' => 'Total de períodos do curso'])
<select
name=
"total_periodos[]"
class=
"form-control"
onchange=
"gerarPeriodo(this)"
required
>
<option
value=
""
disabled
selected
>
-- Selecione uma opção --
</option>
@foreach ($options as $key => $value)
<option
@
if
(
old
('
total_periodos
'
) =
=
$
key
)
selected
@
endif
value=
"{{ $key }}"
>
{{ $value }}
</option>
@endforeach
</select>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.select', ['label' => 'Período atual'])
<select
name=
"periodo_atual[]"
class=
"form-control"
required
>
<option
value=
""
disabled
selected
>
-- Selecione uma opção --
</option>
</select>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select
name=
"ordem_prioridade[]"
class=
"form-control"
required
>
<option
value=
""
disabled
selected
>
-- ORDEM --
</option>
<option
value=
"1"
>
1
</option>
<option
value=
"2"
>
2
</option>
<option
value=
"3"
>
3
</option>
</select>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input
type=
"number"
class=
"form-control media"
name=
"media_geral_curso[]"
min=
"0"
max=
"10"
step=
"0.01"
required
>
@endcomponent
</div>
<div
class=
"col-md-12"
><h5>
Plano de trabalho
</h5></div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Título'])
<input
type=
"text"
class=
"form-control"
name=
"nomePlanoTrabalho[]"
placeholder=
"Digite o título do plano de trabalho"
required
>
@endcomponent
</div>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input
type=
"file"
class=
"input-group-text"
name=
"anexoPlanoTrabalho[]"
accept=
".pdf"
placeholder=
"Anexo do Plano de Trabalho"
required
/>
@endcomponent
</div>
</div>
</div>
</div>
</div>
</div>
--}}
<div
class=
"form-row"
>
<div
class=
"form-row"
>
{{--
<button
type=
"button"
onload=
"myScript(this)"
onclick=
"subir(this)"
>
Subir
</button>
<div
class=
"col-md-11"
>
<button
type=
"button"
onload=
"myScript(this)"
onclick=
"descer(this)"
>
Descer
</button>
--}}
<button
type=
"button"
class=
"btn btn-danger"
id=
"buttonRemover"
onclick=
"removerPart(this)"
>
Remover participante
</button>
<div
class=
"col-md-12"
>
<a
class=
"btn btn-light"
data-toggle=
"collapse"
id=
"idCollapseParticipante"
href=
"#collapseParticipante"
role=
"button"
aria-expanded=
"false"
aria-controls=
"collapseParticipante"
style=
"width: 100%; text-align:left"
>
<a
class=
"btn btn-light"
data-toggle=
"collapse"
id=
"idCollapseParticipante"
href=
"#collapseParticipante"
role=
"button"
aria-expanded=
"false"
aria-controls=
"collapseParticipante"
style=
"width: 100%; text-align:left"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<div
class=
"d-flex justify-content-between align-items-center"
>
<h4
id=
"tituloParticipante"
style=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<span
id=
"pontos"
style=
"display: none;"
>
:
</span>
<span
style=
"display: none;"
id=
"display"
></span>
</h4>
<h4
id=
"tituloParticipante"
style=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<span
id=
"pontos"
style=
"display: none;"
>
:
</span>
<span
style=
"display: none;"
id=
"display"
></span>
</h4>
</div>
</div>
</a>
</a>
</div>
</div>
<div
class=
"col-1"
>
<button
type=
"button"
class=
"btn btn-danger"
id=
"buttonRemover"
onclick=
"removerPart(this)"
>
X
</button>
</div>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<div
class=
"collapse"
id=
"collapseParticipante"
>
<div
class=
"collapse"
id=
"collapseParticipante"
>
<div
class=
"container"
>
<div
class=
"container"
>
...
...
This diff is collapsed.
Click to expand it.
resources/views/evento/submeterTrabalho.blade.php
View file @
13ac2a80
...
@@ -30,9 +30,8 @@
...
@@ -30,9 +30,8 @@
</
div
>
</
div
>
</
form
>
</
form
>
<
div
id
=
"participanteFirst"
>
<
div
id
=
"participanteFirst"
>
<
div
class
=
"form-row"
style
=
"display: none"
id
=
"participantePrimeiro"
>
<
div
class
=
"form-row mt-2"
style
=
"display: none;"
>
<
button
type
=
"button"
class
=
"btn btn-danger"
id
=
"buttonRemover"
onclick
=
"removerPart(this)"
>
Remover
participante
</
button
>
<
div
class
=
"col-md-11"
>
<
div
class
=
"col-md-12"
>
<
a
class
=
"btn btn-light"
data
-
toggle
=
"collapse"
id
=
"idCollapseParticipante"
href
=
"#collapseParticipante"
role
=
"button"
aria
-
expanded
=
"false"
aria
-
controls
=
"collapseParticipante"
style
=
"width: 100%; text-align:left"
>
<
a
class
=
"btn btn-light"
data
-
toggle
=
"collapse"
id
=
"idCollapseParticipante"
href
=
"#collapseParticipante"
role
=
"button"
aria
-
expanded
=
"false"
aria
-
controls
=
"collapseParticipante"
style
=
"width: 100%; text-align:left"
>
<
div
class
=
"d-flex justify-content-between align-items-center"
>
<
div
class
=
"d-flex justify-content-between align-items-center"
>
<
h4
id
=
"tituloParticipante"
style
=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<
span
id
=
"pontos"
style
=
"display: none;"
>:</
span
>
<
span
style
=
"display: none;"
id
=
"display"
></
span
>
</
h4
>
<
h4
id
=
"tituloParticipante"
style
=
"color: #01487E; font-size:17px; margin-top:5px"
>
Participante
<
span
id
=
"pontos"
style
=
"display: none;"
>:</
span
>
<
span
style
=
"display: none;"
id
=
"display"
></
span
>
</
h4
>
...
@@ -289,7 +288,7 @@
...
@@ -289,7 +288,7 @@
</
div
>
</
div
>
<
div
class
=
"col-12"
>
<
div
class
=
"col-12"
>
@
component
(
'componentes.input'
,
[
'label'
=>
'Complemento'
])
@
component
(
'componentes.input'
,
[
'label'
=>
'Complemento'
])
<
input
type
=
"text"
class
=
"form-control"
name
=
"complemento[]"
pattern
=
"[A-Za-z]+"
placeholder
=
"Complemento"
required
/>
<
input
type
=
"text"
class
=
"form-control"
name
=
"complemento[]"
pattern
=
"[A-Za-z]+"
placeholder
=
"Complemento"
required
/>
@
endcomponent
@
endcomponent
</
div
>
</
div
>
<
div
class
=
"col-md-12"
><
h5
>
Dados
do
curso
</
h5
></
div
>
<
div
class
=
"col-md-12"
><
h5
>
Dados
do
curso
</
h5
></
div
>
...
@@ -470,11 +469,12 @@
...
@@ -470,11 +469,12 @@
}
}
}
}
function
removerPart
(
e
){
function
removerPart
(
e
){
if
(
e
.
parentElement
){
console
.
log
(
e
)
if
(
e
.
parentElement
.
parentElement
){
if
(
parts
.
children
.
length
<=
1
){
if
(
parts
.
children
.
length
<=
1
){
}
else
{
}
else
{
parts
.
removeChild
(
e
.
parentElement
);
parts
.
removeChild
(
e
.
parentElement
.
parentElement
);
contador
--
;
contador
--
;
}
}
...
@@ -489,15 +489,13 @@
...
@@ -489,15 +489,13 @@
}
else
{
}
else
{
contador
++
;
contador
++
;
var
cln
=
participante
.
cloneNode
(
true
);
var
cln
=
participante
.
cloneNode
(
true
);
cln
.
style
.
display
=
'block'
;
cln
.
setAttribute
(
'style'
,
" "
);
// console.log(cln.children[2].firstElementChild.id)
var
id
=
cln
.
children
[
2
]
.
firstElementChild
.
id
;
// console.log(cln.children[1].firstElementChild.href)
var
id2
=
cln
.
children
[
1
]
.
firstElementChild
.
id
;
// var id = cln.children[2].firstElementChild.id;
cln
.
children
[
2
]
.
firstElementChild
.
setAttribute
(
'id'
,
id
+
contador
);
// var href = cln.children[1].firstElementChild.href;
cln
.
children
[
1
]
.
firstElementChild
.
setAttribute
(
'href'
,
"#collapseParticipante"
+
contador
);
// cln.children[2].firstElementChild.id = id + contador;
cln
.
children
[
1
]
.
firstElementChild
.
setAttribute
(
'id'
,
id2
+
contador
);
// cln.children[1].firstElementChild.href = href + contador;
// console.log(cln.children[2].firstElementChild.id)
// console.log(cln.children[1].firstElementChild.href)
// console.log(cln.style.display = 'block')
// console.log(cln.style.display = 'block')
for
(
i
=
0
;
i
<
cln
.
children
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
cln
.
children
.
length
;
i
++
)
{
for
(
let
index
=
0
;
index
<
cln
.
children
[
i
]
.
querySelectorAll
(
'input'
)
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
cln
.
children
[
i
]
.
querySelectorAll
(
'input'
)
.
length
;
index
++
)
{
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help