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
92a8c462
Commit
92a8c462
authored
Jun 01, 2021
by
Danillo Bion
Browse files
Merge branch 'master' of
https://github.com/lmts-ufape/submeta
into modificacoes_layout_minha_conta
parents
7fca912c
05144b8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
resources/views/evento/formulario/finalizar.blade.php
View file @
92a8c462
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
</div>
</div>
<div
class=
" d-flex justify-content-between align-items-center"
style=
"margin-top: 15px; margin-bottom:18px"
>
<div
class=
" d-flex justify-content-between align-items-center"
style=
"margin-top: 15px; margin-bottom:18px"
>
<h6
style=
"font-family:Arial, Helvetica, sans-serif; margin-right:15px"
><span
style=
"color: red; font-weight:bold"
>
*
</span>
Campos obrigatórios
</h6>
<h6
style=
"font-family:Arial, Helvetica, sans-serif; margin-right:15px"
><span
style=
"color: red; font-weight:bold"
>
*
</span>
Campos obrigatórios
</h6>
<button
id=
"submeterFormProposta"
type=
"submit"
style=
"display: none;"
></button>
<button
type=
"
submit
"
class=
"btn btn-success"
id=
"idButtonSubmitProjeto"
>
{{ __('Enviar Projeto') }}
</button>
<button
type=
"
button
"
class=
"btn btn-success"
id=
"idButtonSubmitProjeto"
onclick=
"submeterProposta()"
>
{{ __('Enviar Projeto') }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
resources/views/evento/formulario/participantes.blade.php
View file @
92a8c462
...
@@ -52,7 +52,13 @@
...
@@ -52,7 +52,13 @@
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
@component('componentes.input', ['label' => 'CPF'])
@component('componentes.input', ['label' => 'CPF'])
<input
type=
"text"
class=
"form-control cpf"
name=
"cpf[]"
placeholder=
"CPF"
required
/>
<input
type=
"text"
class=
"form-control cpf"
name=
"cpf[]"
placeholder=
"CPF"
required
onchange=
"checarCPFdoCampo(this)"
onkeyup=
"mascaraCPF(this)"
/>
<span
id=
"cpf-invalido-1"
class=
"invalid-feedback cpf-invalido"
role=
"alert"
style=
"overflow: visible; display:none"
>
<span
style=
"font-style: italic;"
>
CPF inválido.
</span>
</span>
<span
id=
"cpf-valido-1"
class=
"valid-feedback"
role=
"alert"
style=
"overflow: visible; display:none"
>
<span
style=
"font-style: italic;"
>
CPF válido.
</span>
</span>
@endcomponent
@endcomponent
</div>
</div>
<div
class=
"col-6"
>
<div
class=
"col-6"
>
...
...
resources/views/evento/submeterTrabalho.blade.php
View file @
92a8c462
...
@@ -64,7 +64,14 @@
...
@@ -64,7 +64,14 @@
</
div
>
</
div
>
<
div
class
=
"col-6"
>
<
div
class
=
"col-6"
>
@
component
(
'componentes.input'
,
[
'label'
=>
'CPF'
])
@
component
(
'componentes.input'
,
[
'label'
=>
'CPF'
])
<
input
type
=
"text"
class
=
"form-control cpf"
name
=
"cpf[]"
placeholder
=
"CPF"
required
/>
<
input
type
=
"text"
class
=
"form-control cpf"
name
=
"cpf[]"
placeholder
=
"CPF"
required
onchange
=
"checarCPFdoCampo(this)"
onkeyup
=
"mascaraCPF(this)"
/>
<
span
id
=
"cpf-invalido-1"
class
=
"invalid-feedback cpf-invalido"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
span
style
=
"font-style: italic;"
>
CPF
inválido
.
</
span
>
</
span
>
<
span
id
=
"cpf-valido-1"
class
=
"valid-feedback"
role
=
"alert"
style
=
"overflow: visible; display:none"
>
<
span
style
=
"font-style: italic;"
>
CPF
válido
.
</
span
>
</
span
>
@
endcomponent
@
endcomponent
</
div
>
</
div
>
<
div
class
=
"col-6"
>
<
div
class
=
"col-6"
>
...
@@ -218,7 +225,27 @@
...
@@ -218,7 +225,27 @@
</
div
>
</
div
>
</
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
@
endsection
@
section
(
'javascript'
)
@
section
(
'javascript'
)
...
@@ -324,7 +351,7 @@
...
@@ -324,7 +351,7 @@
});
});
$
(
'.cep'
)
.
mask
(
'00000000'
);
$
(
'.cep'
)
.
mask
(
'00000000'
);
$
(
'.cpf'
)
.
mask
(
'000.000.000-00'
);
//
$('.cpf').mask('000.000.000-00');
$
(
'.numero'
)
.
mask
(
'0000000000000'
);
$
(
'.numero'
)
.
mask
(
'0000000000000'
);
var
SPMaskBehavior
=
function
(
val
)
{
var
SPMaskBehavior
=
function
(
val
)
{
return
val
.
replace
(
/
\
D
/
g
,
''
)
.
length
===
11
?
'(00) 00000-0000'
:
'(00) 0000-00009'
;
return
val
.
replace
(
/
\
D
/
g
,
''
)
.
length
===
11
?
'(00) 00000-0000'
:
'(00) 0000-00009'
;
...
@@ -677,80 +704,126 @@
...
@@ -677,80 +704,126 @@
// console.log(this.parentElement.children[0])
// console.log(this.parentElement.children[0])
// if (validarCPF(retirarFormatacao(this.value))) {
// if (validarCPF(retirarFormatacao(this.value))) {
// this.parentElement.children[0].style.display = "none";
// this.parentElement.children[1].style.display = "block";
// } else {
// this.parentElement.children[0].style.display = "block";
// this.parentElement.children[1].style.display = "none";
// this.parentElement.children[1].style.display = "none";
// this.parentElement.children[2].style.display = "block";
// } else {
// this.parentElement.children[1].style.display = "block";
// this.parentElement.children[2].style.display = "none";
// }
// }
// });
// });
// });
// });
// function validarCPF(strCPF) {
function
checarCPFdoCampo
(
input
)
{
// var soma;
if
(
input
.
value
.
length
==
14
)
{
// var resto;
if
(
validarCPF
(
retirarFormatacao
(
input
.
value
)))
{
// soma = 0;
input
.
parentElement
.
children
[
1
]
.
style
.
display
=
"none"
;
// // Verifica se foi informado todos os digitos corretamente
input
.
parentElement
.
children
[
2
]
.
style
.
display
=
"block"
;
// if (strCPF.length != 11) {
}
else
{
// return false;
input
.
parentElement
.
children
[
1
]
.
style
.
display
=
"block"
;
// }
input
.
parentElement
.
children
[
2
]
.
style
.
display
=
"none"
;
}
// // Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
}
else
{
// if (varificarDigitos(strCPF)) {
input
.
parentElement
.
children
[
1
]
.
style
.
display
=
"none"
;
// return false;
input
.
parentElement
.
children
[
2
]
.
style
.
display
=
"none"
;
// }
}
}
// // 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) {
function
validarCPF
(
strCPF
)
{
// var cont = 1;
var
soma
;
// dig1 = strCpf[0];
var
resto
;
soma
=
0
;
// Verifica se foi informado todos os digitos corretamente
if
(
strCPF
.
length
!=
11
)
{
return
false
;
}
// for(var i = 1; i < strCpf.length; i++) {
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
// if(dig1 == strCpf[i]) {
if
(
varificarDigitos
(
strCPF
))
{
// cont++;
return
false
;
// }
}
// }
// if (cont == strCpf.length) {
// Faz o calculo para validar o CPF
// return true;
for
(
var
t
=
9
;
t
<
11
;
t
++
)
{
// }
for
(
var
d
=
0
,
c
=
0
;
c
<
t
;
c
++
)
{
// return false;
d
+=
strCPF
[
c
]
*
((
t
+
1
)
-
c
);
// }
}
d
=
((
10
*
d
)
%
11
)
%
10
;
// function checarCpfs() {
if
(
strCPF
[
c
]
!=
d
)
{
// var validacoes = document.getElementsByClassName("cpf-invalido");
return
false
;
// var count = validacoes.length;
}
// var quant = 0;
}
// for(var i = 0; i < validacoes.length; i++) {
return
true
;
// if (validacoes[i].style.display == "none") {
}
// quant++;
// }
function
retirarFormatacao
(
strCpf
)
{
// }
resultado
=
""
;
// if(quant == count) {
for
(
var
i
=
0
;
i
<
strCpf
.
length
;
i
++
)
{
// return true;
if
(
strCpf
[
i
]
!=
"."
&&
strCpf
[
i
]
!=
"-"
)
{
// }
resultado
+=
strCpf
[
i
];
// return false;
}
// }
}
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
;
}
function
submeterProposta
()
{
if
(
checarCpfs
())
{
document
.
getElementById
(
"submeterFormProposta"
)
.
click
();
}
else
{
$
(
"#modalCpfInvalido"
)
.
modal
(
'show'
);
}
}
function
mascaraCPF
(
input
)
{
var
numeros
=
"0123456789.-"
;
var
resultado
=
""
;
if
(
input
.
value
.
length
<
14
)
{
for
(
var
i
=
0
;
i
<
input
.
value
.
length
;
i
++
)
{
if
(
numeros
.
indexOf
(
input
.
value
[
i
])
>
-
1
)
{
if
((
i
==
2
||
i
==
6
)
&&
input
.
value
[
i
+
1
]
!=
"."
)
{
resultado
+=
input
.
value
[
i
]
+
"."
;
}
else
if
(
i
==
10
&&
input
.
value
[
i
+
1
]
!=
"-"
)
{
resultado
+=
input
.
value
[
i
]
+
"-"
;
}
else
{
resultado
+=
input
.
value
[
i
];
}
}
}
}
else
{
for
(
var
i
=
0
;
i
<
14
;
i
++
)
{
resultado
+=
input
.
value
[
i
];
}
}
input
.
value
=
resultado
;
}
</
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