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
17f7cc6a
Commit
17f7cc6a
authored
4 years ago
by
Carlos André
Browse files
Options
Download
Email Patches
Plain Diff
validando cpf
parent
53df699d
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/views/evento/submeterTrabalho.blade.php
+127
-17
resources/views/evento/submeterTrabalho.blade.php
resources/views/proponente/projetosEdital.blade.php
+5
-1
resources/views/proponente/projetosEdital.blade.php
with
132 additions
and
18 deletions
+132
-18
resources/views/evento/submeterTrabalho.blade.php
View file @
17f7cc6a
...
...
@@ -411,12 +411,14 @@
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"cpf1"
>
CPF
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
<
input
type
=
"text"
class
=
"form-control @error('cpf1') is-invalid @enderror"
id
=
"cpf1"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
@
error
(
'cpf1'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
<
strong
>
{{
$message
}}
</
strong
>
<
input
type
=
"text"
class
=
"form-control @error('cpf1') is-invalid @enderror cpf"
id
=
"cpf1"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
<
span
id
=
"cpf-invalido-1"
class
=
"invalid-feedback cpf-invalido"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
inválido
</
strong
>
</
span
>
<
span
id
=
"cpf-valido-1"
class
=
"valid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
válido
!</
strong
>
</
span
>
@
enderror
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"rg1"
>
RG
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
...
...
@@ -663,12 +665,14 @@
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"cpf2"
>
CPF
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
<
input
type
=
"text"
class
=
"form-control @error('cpf2') is-invalid @enderror"
id
=
"cpf2"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
@
error
(
'cpf2'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
<
strong
>
{{
$message
}}
</
strong
>
<
input
type
=
"text"
class
=
"form-control @error('cpf2') is-invalid @enderror cpf"
id
=
"cpf2"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
<
span
id
=
"cpf-invalido-2"
class
=
"invalid-feedback cpf-invalido"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
inválido
</
strong
>
</
span
>
<
span
id
=
"cpf-valido-2"
class
=
"valid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
válido
!</
strong
>
</
span
>
@
enderror
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"rg2"
>
RG
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
...
...
@@ -915,12 +919,14 @@
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"cpf3"
>
CPF
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
<
input
type
=
"text"
class
=
"form-control @error('cpf3') is-invalid @enderror"
id
=
"cpf3"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
@
error
(
'cpf3'
)
<
span
class
=
"invalid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:block"
>
<
strong
>
{{
$message
}}
</
strong
>
<
input
type
=
"text"
class
=
"form-control @error('cpf3') is-invalid @enderror cpf"
id
=
"cpf3"
name
=
"cpf[]"
placeholder
=
"Digite o CPF do participante"
required
>
<
span
id
=
"cpf-invalido-3"
class
=
"invalid-feedback cpf-invalido"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
inválido
</
strong
>
</
span
>
<
span
id
=
"cpf-valido-3"
class
=
"valid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
strong
>
CPF
válido
!</
strong
>
</
span
>
@
enderror
</
div
>
<
div
class
=
"form-group col-md-6"
>
<
label
for
=
"rg3"
>
RG
<
span
style
=
"color: red; font-weight:bold"
>*</
span
></
label
>
...
...
@@ -1197,6 +1203,28 @@
</
div
>
</
div
>
<!--
Modal
-->
<
div
class
=
"modal fade"
id
=
"modalCpfInvalido"
tabindex
=
"-1"
role
=
"dialog"
aria
-
labelledby
=
"exampleModalLabel2"
aria
-
hidden
=
"true"
>
<
div
class
=
"modal-dialog modal-dialog-centered"
role
=
"document"
>
<
div
class
=
"modal-content"
>
<
div
class
=
"modal-header"
style
=
"background-color: red;"
>
<
h5
class
=
"modal-title"
id
=
"exampleModalLabel2"
style
=
"font-size:20px; margin-top:7px; color:white; font-weight:bold; font-family: 'Roboto', sans-serif;"
>
Aviso
</
h5
>
<
button
type
=
"button"
class
=
"close"
data
-
dismiss
=
"modal"
aria
-
label
=
"Close"
>
<
span
aria
-
hidden
=
"true"
>&
times
;
</
span
>
</
button
>
</
div
>
<
div
class
=
"modal-body"
>
Existe
um
CPF
inválido
em
um
dos
participantes
por
favor
corrija
para
continuar
.
</
div
>
{{
--
<
div
class
=
"modal-footer"
>
{{
--
<
button
type
=
"button"
class
=
"btn btn-secondary"
></
button
>
{{
--
<
button
type
=
"button"
class
=
"btn btn-primary"
>
Certo
</
button
>
</
div
>
--
}}
</
div
>
</
div
>
</
div
>
</
div
>
@
endsection
@
section
(
'javascript'
)
...
...
@@ -1448,16 +1476,19 @@ function fecharModalenviarProjeto(){
function
enviarModalenviarProjeto
(){
if
(
numeroDeParticipantes
==
1
){
document
.
getElementById
(
"collapseParticipante1"
)
.
classList
.
add
(
"show"
);
document
.
getElementById
(
"clickSubmitForm"
)
.
click
();
}
else
if
(
numeroDeParticipantes
==
2
){
document
.
getElementById
(
"collapseParticipante1"
)
.
classList
.
add
(
"show"
);
document
.
getElementById
(
"collapseParticipante2"
)
.
classList
.
add
(
"show"
);
document
.
getElementById
(
"clickSubmitForm"
)
.
click
();
}
else
if
(
numeroDeParticipantes
==
3
){
document
.
getElementById
(
"collapseParticipante1"
)
.
classList
.
add
(
"show"
);
document
.
getElementById
(
"collapseParticipante2"
)
.
classList
.
add
(
"show"
);
document
.
getElementById
(
"collapseParticipante3"
)
.
classList
.
add
(
"show"
);
}
if
(
checarCpfs
())
{
document
.
getElementById
(
"clickSubmitForm"
)
.
click
();
}
else
{
$
(
"#modalCpfInvalido"
)
.
modal
(
'show'
);
}
}
/*
...
...
@@ -2029,5 +2060,84 @@ $(document).ready(()=>{
// }
// });
// });
$
(
document
)
.
ready
(
function
(){
$
(
".cpf"
)
.
change
(
function
(){
if
(
validarCPF
(
retirarFormatacao
(
this
.
value
)))
{
this
.
parentElement
.
children
[
2
]
.
style
.
display
=
"none"
;
this
.
parentElement
.
children
[
3
]
.
style
.
display
=
"block"
;
}
else
{
this
.
parentElement
.
children
[
2
]
.
style
.
display
=
"block"
;
this
.
parentElement
.
children
[
3
]
.
style
.
display
=
"none"
;
}
});
});
function
validarCPF
(
strCPF
)
{
var
soma
;
var
resto
;
soma
=
0
;
// Verifica se foi informado todos os digitos corretamente
if
(
strCPF
.
length
!=
11
)
{
return
false
;
}
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
if
(
varificarDigitos
(
strCPF
))
{
return
false
;
}
// Faz o calculo para validar o CPF
for
(
var
t
=
9
;
t
<
11
;
t
++
)
{
for
(
var
d
=
0
,
c
=
0
;
c
<
t
;
c
++
)
{
d
+=
strCPF
[
c
]
*
((
t
+
1
)
-
c
);
}
d
=
((
10
*
d
)
%
11
)
%
10
;
if
(
strCPF
[
c
]
!=
d
)
{
return
false
;
}
}
return
true
;
}
function
retirarFormatacao
(
strCpf
)
{
resultado
=
""
;
for
(
var
i
=
0
;
i
<
strCpf
.
length
;
i
++
)
{
if
(
strCpf
[
i
]
!=
"."
&&
strCpf
[
i
]
!=
"-"
)
{
resultado
+=
strCpf
[
i
];
}
}
return
resultado
;
}
function
varificarDigitos
(
strCpf
)
{
var
cont
=
1
;
dig1
=
strCpf
[
0
];
for
(
var
i
=
1
;
i
<
strCpf
.
length
;
i
++
)
{
if
(
dig1
==
strCpf
[
i
])
{
cont
++
;
}
}
if
(
cont
==
strCpf
.
length
)
{
return
true
;
}
return
false
;
}
function
checarCpfs
()
{
var
validacoes
=
document
.
getElementsByClassName
(
"cpf-invalido"
);
var
count
=
validacoes
.
length
;
var
quant
=
0
;
for
(
var
i
=
0
;
i
<
validacoes
.
length
;
i
++
)
{
if
(
validacoes
[
i
]
.
style
.
display
==
"none"
)
{
quant
++
;
}
}
if
(
quant
==
count
)
{
return
true
;
}
return
false
;
}
</
script
>
@
endsection
This diff is collapsed.
Click to expand it.
resources/views/proponente/projetosEdital.blade.php
View file @
17f7cc6a
...
...
@@ -129,7 +129,11 @@
<
h5
>
Nenhum
projeto
submetido
!</
h5
>
</
div
>
<
div
class
=
"col-md-12"
style
=
"text-align: center;"
>
<
a
href
=
"{{ route('trabalho.index', ['id' =>
$edital->id
] )}}"
>
Cliquei
aqui
para
submeter
um
projeto
.
</
a
>
@
if
(
$edital
->
inicioSubmissao
<=
$hoje
&&
$hoje
<=
$edital
->
fimSubmissao
)
<
a
href
=
"{{ route('trabalho.index', ['id' =>
$edital->id
] )}}"
>
Cliquei
aqui
para
submeter
um
projeto
.
</
a
>
@
else
<
a
href
=
"#"
>
O
periodo
de
submissão
foi
encerrado
.
</
a
>
@
endif
</
div
>
</
div
>
@
endif
...
...
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