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
41f68936
Commit
41f68936
authored
Dec 29, 2022
by
Lucas Henrique
Browse files
Adicionando filtro para soma das notas máximas no controller
parent
627ba05c
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/EventoController.php
View file @
41f68936
...
@@ -175,14 +175,16 @@ class EventoController extends Controller
...
@@ -175,14 +175,16 @@ class EventoController extends Controller
// Validação quando avaliação for por Barema
// Validação quando avaliação for por Barema
if
(
$request
->
tipoAvaliacao
==
'form'
)
{
if
(
$request
->
tipoAvaliacao
==
'form'
)
{
$validateAvaliacao
=
$request
->
validate
([
$validateAvaliacao
=
$request
->
validate
([
'pdfFormAvalExterno'
=>
[(
$request
->
pdfFormAvalExternoPreenchido
!==
'sim'
?
'required'
:
''
),
'file'
,
'mimes:pdf,doc,docx,xlsx,xls,csv,zip'
,
'max:2048'
],
'pdfFormAvalExterno'
=>
[(
$request
->
pdfFormAvalExternoPreenchido
!==
'sim'
?
'required'
:
''
),
'file'
,
'mimes:pdf,doc,docx,xlsx,xls,csv,zip'
,
'max:2048'
],
]);
]);
}
elseif
(
$request
->
tipoAvaliacao
==
'campos'
)
{
}
elseif
(
$request
->
tipoAvaliacao
==
'campos'
)
{
if
(
$request
->
has
(
'campos'
)){
if
(
$request
->
has
(
'campos'
)){
$validateCampo
=
$request
->
validate
([
$validateCampo
=
$request
->
validate
([
'inputField.*.nome'
=>
[
'required'
,
'string'
],
'inputField.*.nome'
=>
[
'required'
,
'string'
],
'inputField.*.nota_maxima'
=>
[
'required'
],
'inputField.*.nota_maxima'
=>
[
'required'
],
'inputField.*.prioridade'
=>
[
'required'
]
'inputField.*.prioridade'
=>
[
'required'
],
'somaNotas'
=>
[
'required'
,
'numeric'
,
'max:10'
],
[
'somaNotas.max'
=>
'A soma dos campos não pode ser maior que 10.'
]
]);
]);
}
}
}
elseif
(
$request
->
tipoAvaliacao
==
'link'
)
{
}
elseif
(
$request
->
tipoAvaliacao
==
'link'
)
{
...
...
resources/views/evento/criarEvento.blade.php
View file @
41f68936
...
@@ -501,7 +501,7 @@
...
@@ -501,7 +501,7 @@
</
table
>
</
table
>
@
if
(
$errors
->
has
(
'inputField.*'
))
@
if
(
$errors
->
has
(
'inputField.*'
))
<
div
class
=
"col-sm-12 alert alert-danger"
style
=
"display: none"
id
=
"nota_maxima_invalida
"
>
<
div
class
=
"col-sm-12 alert alert-danger"
id
=
"inputFieldError
"
>
Você
deve
preencher
os
campos
obrigatórios
.
Você
deve
preencher
os
campos
obrigatórios
.
</
div
>
</
div
>
@
endif
@
endif
...
@@ -511,6 +511,9 @@
...
@@ -511,6 +511,9 @@
</
div
>
</
div
>
<
input
type
=
"checkbox"
id
=
"checkB[0]"
checked
name
=
"campos[]"
value
=
"0"
hidden
>
<
input
type
=
"checkbox"
id
=
"checkB[0]"
checked
name
=
"campos[]"
value
=
"0"
hidden
>
<
input
type
=
"number"
name
=
"somaNotas"
value
=
"0"
id
=
"somaNotas"
hidden
>
</
div
>
</
div
>
<
div
class
=
"col-sm-12 row"
style
=
"margin-top:10px; display: none"
id
=
"displayLink"
>
<
div
class
=
"col-sm-12 row"
style
=
"margin-top:10px; display: none"
id
=
"displayLink"
>
...
@@ -681,7 +684,6 @@
...
@@ -681,7 +684,6 @@
});
});
$
(
"#dynamicAddRemove"
)
.
on
(
'input'
,
'.nota_maxima'
,
function
()
{
$
(
"#dynamicAddRemove"
)
.
on
(
'input'
,
'.nota_maxima'
,
function
()
{
console
.
log
(
"eita"
)
somaNotas
=
0
;
somaNotas
=
0
;
$
(
".nota_maxima"
)
.
each
(
function
()
{
$
(
".nota_maxima"
)
.
each
(
function
()
{
...
@@ -692,6 +694,8 @@
...
@@ -692,6 +694,8 @@
});
});
$
(
'#somaNotas'
)
.
val
(
somaNotas
);
if
(
somaNotas
>
10
)
{
if
(
somaNotas
>
10
)
{
$
(
'.nota_maxima'
)
.
css
(
'border'
,
'1px solid red'
);
$
(
'.nota_maxima'
)
.
css
(
'border'
,
'1px solid red'
);
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
""
;
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
""
;
...
@@ -807,4 +811,11 @@
...
@@ -807,4 +811,11 @@
window
.
onload
=
showDocumentoExtra
();
window
.
onload
=
showDocumentoExtra
();
</
script
>
</
script
>
@
if
(
$errors
->
has
(
'somaNotas'
))
<
script
>
$
(
'.nota_maxima'
)
.
css
(
'border'
,
'1px solid red'
);
document
.
getElementById
(
"nota_maxima_invalida"
)
.
style
.
display
=
""
;
</
script
>
@
endif
@
endsection
@
endsection
\ No newline at end of file
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