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
6951d09f
Commit
6951d09f
authored
May 09, 2023
by
José Fernando Mendes da Costa
Browse files
corrige para quando o usuario informa outro curso
parent
43433ea8
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
6951d09f
...
...
@@ -1173,11 +1173,12 @@ class TrabalhoController extends Controller
public
function
buscarUsuario
(
Request
$request
)
{
$usuario
=
User
::
where
(
'cpf'
,
$request
->
cpf_consulta
)
->
first
();
$funcao
=
FuncaoParticipantes
::
where
(
'id'
,
$request
->
funcao
)
->
first
();
$cursos
=
Curso
::
pluck
(
'nome'
,
'id'
)
->
all
();
if
(
$usuario
){
$participante
=
$usuario
->
participantes
()
->
first
();
return
json_encode
([
$usuario
,
$funcao
,
$participante
,
$usuario
->
endereco
()
->
first
(),
$cursos
]);
if
(
$participante
->
curso
==
null
&&
$participante
->
curso_id
!=
null
)
$participante
->
curso
=
Curso
::
find
(
$participante
->
curso_id
)
->
nome
;
return
json_encode
([
$usuario
,
$funcao
,
$participante
,
$usuario
->
endereco
()
->
first
()]);
}
return
json_encode
(
'inexistente'
);
...
...
resources/views/evento/formulario/integrantes.blade.php
View file @
6951d09f
...
...
@@ -265,8 +265,7 @@
document
.
getElementById
(
`instituicao[
${
modal_id
}
]`
).
value
=
data
[
0
][
'
instituicao
'
];
document
.
getElementById
(
`instituicao[
${
modal_id
}
]`
).
setAttribute
(
"
readonly
"
,
""
);
document
.
getElementById
(
`curso[
${
modal_id
}
]`
).
value
=
data
[
4
][
data
[
2
][
'
curso_id
'
]];
console
.
log
(
data
[
2
][
'
curso_id
'
],
data
[
4
],
data
[
4
][
data
[
2
][
'
curso_id
'
]]);
document
.
getElementById
(
`curso[
${
modal_id
}
]`
).
value
=
data
[
2
][
'
curso
'
];
document
.
getElementById
(
`curso[
${
modal_id
}
]`
).
setAttribute
(
"
readonly
"
,
""
);
console
.
log
(
document
.
getElementById
(
`funcaoParticipante
${
modal_id
}
`
));
...
...
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