Commit bed68413 authored by Yuri Resende's avatar Yuri Resende
Browse files

Modificando a adição de integrantes durante a submisão de editais

parent 3d0b7975
...@@ -1153,9 +1153,9 @@ class TrabalhoController extends Controller ...@@ -1153,9 +1153,9 @@ class TrabalhoController extends Controller
public function buscarUsuario(Request $request) { public function buscarUsuario(Request $request) {
$usuario = User::where('cpf', $request->cpf_consulta)->first(); $usuario = User::where('cpf', $request->cpf_consulta)->first();
$funcao = FuncaoParticipantes::where('id', $request->funcao)->first(); $funcao = FuncaoParticipantes::where('id', $request->funcao)->first();
$participante = $usuario->participantes()->first();
if($usuario){ if($usuario){
$participante = $usuario->participantes()->first();
return json_encode([$usuario, $funcao, $participante, $usuario->endereco()->first()]); return json_encode([$usuario, $funcao, $participante, $usuario->endereco()->first()]);
} }
...@@ -1165,7 +1165,7 @@ class TrabalhoController extends Controller ...@@ -1165,7 +1165,7 @@ class TrabalhoController extends Controller
public function salvar(StoreTrabalho $request) public function salvar(StoreTrabalho $request)
{ {
//dd($request->all()); // dd($request->all());
try { try {
if (!$request->has('rascunho')) { if (!$request->has('rascunho')) {
$request->merge([ $request->merge([
...@@ -1201,15 +1201,15 @@ class TrabalhoController extends Controller ...@@ -1201,15 +1201,15 @@ class TrabalhoController extends Controller
])); ]));
} }
//adição dos participantes
if ($request->has('marcado')) { if ($request->has('marcado')) {
foreach ($request->marcado as $key => $part) { foreach ($request->marcado as $key => $part) {
$part = intval($part); $part = intval($part);
$passwordTemporario = Str::random(8); // $passwordTemporario = Str::random(8);
$data['name'] = $request->name[$part]; $data['name'] = $request->name[$part];
$data['email'] = $request->email[$part]; $data['email'] = $request->email[$part];
$data['password'] = bcrypt($passwordTemporario); // $data['password'] = bcrypt($passwordTemporario);
$data['data_de_nascimento'] = $request->data_de_nascimento[$part]; $data['data_de_nascimento'] = $request->data_de_nascimento[$part];
$data['cpf'] = $request->cpf[$part]; $data['cpf'] = $request->cpf[$part];
$data['tipo'] = 'participante'; $data['tipo'] = 'participante';
...@@ -1265,6 +1265,7 @@ class TrabalhoController extends Controller ...@@ -1265,6 +1265,7 @@ class TrabalhoController extends Controller
$participante->save(); $participante->save();
if ($request->has('anexoPlanoTrabalho')) { if ($request->has('anexoPlanoTrabalho')) {
dd("plano de trabalho");
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/'; $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $data['nomePlanoTrabalho'] . ".pdf"; $nome = $data['nomePlanoTrabalho'] . ".pdf";
$file = $request->anexoPlanoTrabalho[$part]; $file = $request->anexoPlanoTrabalho[$part];
...@@ -1279,6 +1280,7 @@ class TrabalhoController extends Controller ...@@ -1279,6 +1280,7 @@ class TrabalhoController extends Controller
$arquivo->save(); $arquivo->save();
} }
} }
} else { } else {
...@@ -1309,9 +1311,9 @@ class TrabalhoController extends Controller ...@@ -1309,9 +1311,9 @@ class TrabalhoController extends Controller
if($evento->natureza_id == 3){ if($evento->natureza_id == 3){
foreach($request->integrantes as $integrante){ foreach($request->integrantes as $integrante){
$integrante = explode(',', $integrante); $integrante = explode(',', $integrante);
$trabalho_user = new TrabalhoUser(); $trabalho_user = new TrabalhoUser();
$trabalho_user->user_id = $integrante[0]; $trabalho_user->user_id = $integrante[0];
$trabalho_user->funcao_participante_id = $integrante[1]; $trabalho_user->funcao_participante_id = $integrante[1];
......
...@@ -26,8 +26,6 @@ class StoreTrabalho extends FormRequest ...@@ -26,8 +26,6 @@ class StoreTrabalho extends FormRequest
*/ */
public function rules() public function rules()
{ {
//dd($this->all());
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
$rules = []; $rules = [];
...@@ -51,20 +49,33 @@ class StoreTrabalho extends FormRequest ...@@ -51,20 +49,33 @@ class StoreTrabalho extends FormRequest
$rules['rg.'.$value] = ['required', 'string']; $rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string']; $rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string']; $rules['curso.'.$value] = ['required', 'string'];
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string']; //participantes da pesquisa
$rules['periodo_atual.'.$value] = ['required', 'string']; if($evento->natureza_id != 3){
$rules['total_periodos.'.$value] = ['required', 'string']; $rules['turno.'.$value] = ['required', 'string'];
if($evento->tipo != "PIBEX") { $rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['media_do_curso.' . $value] = ['required', 'string']; $rules['media_do_curso.' . $value] = ['required', 'string'];
} }
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if($evento->tipo != "CONTINUO"){
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
// if($evento->tipo != "PIBEX") {
// $rules['media_do_curso.' . $value] = ['required', 'string'];
// }
} }
} }
} else { } else if($evento->tipo != "CONTINUO"){
$rules['anexoPlanoTrabalho'] = ['required']; $rules['anexoPlanoTrabalho'] = ['required'];
$rules['nomePlanoTrabalho'] = ['required', 'string']; $rules['nomePlanoTrabalho'] = ['required', 'string'];
} }
...@@ -72,10 +83,13 @@ class StoreTrabalho extends FormRequest ...@@ -72,10 +83,13 @@ class StoreTrabalho extends FormRequest
if($this->has('rascunho')) { if($this->has('rascunho')) {
$rules = []; $rules = [];
return $rules; return $rules;
}else{ } else {
//anexos
if($evento->nome_docExtra != null ){ if($evento->nome_docExtra != null ){
$rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true),'file', 'mimes:zip,doc,docx,pdf', 'max:2048']; $rules['anexo_docExtra'] = [Rule::requiredIf($evento->obrigatoriedade_docExtra == true),'file', 'mimes:zip,doc,docx,pdf', 'max:2048'];
} }
if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){ if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
$rules['anexoPlanilhaPontuacao'] = ['required']; $rules['anexoPlanilhaPontuacao'] = ['required'];
$rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf']; $rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf'];
...@@ -91,22 +105,26 @@ class StoreTrabalho extends FormRequest ...@@ -91,22 +105,26 @@ class StoreTrabalho extends FormRequest
$rules['titulo'] = ['required', 'string']; $rules['titulo'] = ['required', 'string'];
$rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; $rules['grande_area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string'];
$rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string']; $rules['area_id'] = [Rule::requiredIf($evento->natureza_id != 3), 'string'];
if($evento->natureza_id == 3){ if($evento->natureza_id == 3){
$rules['area_tematica_id'] = ['required', 'string']; $rules['area_tematica_id'] = ['required', 'string'];
$rules['ods'] = ['required']; $rules['ods'] = ['required'];
} }
$rules['linkLattesEstudante'] = ['required', 'string'];
$rules['linkLattesEstudante'] = ['required', 'string'];
if($evento->tipo!="CONTINUO"){ if($evento->tipo!="CONTINUO"){
$rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf']; $rules['anexoDecisaoCONSU'] = [Rule::requiredIf($evento->consu), 'mimes:pdf'];
$rules['anexoProjeto'] = ['required', 'mimes:pdf']; $rules['anexoProjeto'] = ['required', 'mimes:pdf'];
} else { } else {
$rules['anexo_SIPAC'] = ['required', 'mimes:pdf']; $rules['anexo_SIPAC'] = ['required', 'mimes:pdf'];
} }
//dd($rules, $evento);
// dd($rules, $evento);
return $rules; return $rules;
} }
} }
......
<div class="col-md-12" style="margin-top: 20px"> <div class="col-md-12" style="margin-top: 20px">
<div class="card" style="border-radius: 5px"> <div class="card" style="border-radius: 5px">
<div class="card-body" style="padding-top: 0.2rem;"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="container"> <div class="container">
<div class="form-row mt-3"> <div class="form-row mt-3">
<div class="col-md-11"> <div class="col-md-11">
<h5 style="color: #234B8B; font-weight: bold">Adicionar Integrante(s)</h5> <h5 style="color: #234B8B; font-weight: bold">Adicionar Integrante(s)</h5>
</div> </div>
<div class="col-md-1 text-sm-right"> <div class="col-md-1 text-sm-right">
<a type="button" value="{{ $edital->id }}" id="atribuir1" data-toggle="modal" data-target="#modalIntegrante"> <a type="button" value="{{ $edital->id }}" id="atribuir1" data-toggle="modal" data-target="#modalIntegrante">
<img class="" src="{{asset('img/icons/add.ico')}}" style="width:30px" alt=""> <img class="" src="{{asset('img/icons/add.ico')}}" style="width:30px" alt="">
</a> </a>
</div> </div>
</div> </div>
<hr style="border-top: 1px solid#1492E6"> <hr style="border-top: 1px solid#1492E6">
<div class="row" id="integrante"> <!-- <h6 style="color: #234B8B; font-weight: bold;">Integrantes</h6> -->
</div> <div class="row" id="integrante" style="display:none">
</div>
@include('evento.formulario.participantes') @include('evento.formulario.participantes')
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- MODAL --> <!-- MODAL -->
<div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal fade" id="modalIntegrante" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl"> <div class="modal-dialog modal-dialog-centered modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5> <h5 class="modal-title" id="exampleModalLabel">Adicionar Integrante</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="container">
<div class="row justify-content-center" style="padding-left:35px; padding-right:45px">
<div class="form-row d-flex align-items-end" style="padding: 30px;"> <div class="form-controll" style="margin-left:10px; margin-top:10px; margin-bottom:15px; font-weight:bold;">
<div class="col-md-8">
<label for="cpf_consulta">CPF:</label> <div class="form-row d-flex">
<input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();"> <label for="cpf_consulta">CPF:</label>
</div> <input type="text" id="cpf_consulta" name="cpf_consulta" class="form-control" onkeyup="mask_cpf();">
<div class="col-md-4"> </div>
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
<div class="form-row d-flex" style="margin-top:10px">
<label for="funcao_participante">Função do Integrante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div>
<div class="form-row justify-content-center" style="margin-top:20px;">
<button type="button" class="btn btn-primary" onclick="preencherUsuarioExistente()">Adicionar</button>
</div>
</div>
</div> </div>
</div>
<div class="form-row" style="padding: 0px 30px 30px 30px;">
<label for="funcao_participante">Função do Participante:</label>
<select name="" id="funcao_participante" class="form-control">
@foreach($funcaoParticipantes as $funcao)
@if($funcao->nome != 'Bolsista')
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@elseif($edital->tipo != "CONTINUO")
<option value="{{$funcao->id}}">{{ $funcao->nome }}</option>
@endif
@endforeach
</select>
</div> </div>
</div> </div>
</div> </div>
...@@ -152,6 +158,7 @@ ...@@ -152,6 +158,7 @@
if(data == 'inexistente' || $('#cpf_consulta').val() == ""){ if(data == 'inexistente' || $('#cpf_consulta').val() == ""){
exibirModalUsuarioInexistente(); exibirModalUsuarioInexistente();
}else { }else {
console.log(data);
exibirUsuarioAdicionado(data); exibirUsuarioAdicionado(data);
$('#integrante').append(` $('#integrante').append(`
<div id="integrante${data[0]['id']}" class="col-md-6"> <div id="integrante${data[0]['id']}" class="col-md-6">
...@@ -165,6 +172,7 @@ ...@@ -165,6 +172,7 @@
<strong>CPF:</strong> ${data[0]['cpf']} <strong>CPF:</strong> ${data[0]['cpf']}
<strong>Função:</strong> ${data[1]['nome']} <strong>Função:</strong> ${data[1]['nome']}
<button type="button" class="btn btn-danger" onclick="removerIntegrante(${data[0]['id']})">Remover</button> <button type="button" class="btn btn-danger" onclick="removerIntegrante(${data[0]['id']})">Remover</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -184,22 +192,50 @@ ...@@ -184,22 +192,50 @@
function exibirUsuarioAdicionado(data) { function exibirUsuarioAdicionado(data) {
$('#modalIntegrante').modal('hide'); $('#modalIntegrante').modal('hide');
document.getElementById(`nome${modal_id}`).value = data[0]['name']; document.getElementById(`nome${modal_id}`).value = data[0]['name'];
document.getElementById(`nome${modal_id}`).setAttribute("readonly", "");
document.getElementById(`email${modal_id}`).value = data[0]['email']; document.getElementById(`email${modal_id}`).value = data[0]['email'];
document.getElementById(`email${modal_id}`).setAttribute("readonly", "");
document.getElementById(`data_de_nascimento${modal_id}`).value = (new Date(data[2]['data_de_nascimento'])).toLocaleDateString(); document.getElementById(`data_de_nascimento${modal_id}`).value = (new Date(data[2]['data_de_nascimento'])).toLocaleDateString();
document.getElementById(`data_de_nascimento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cpf${modal_id}`).value = data[0]['cpf']; document.getElementById(`cpf${modal_id}`).value = data[0]['cpf'];
document.getElementById(`cpf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rg${modal_id}`).value = data[2]['rg']; document.getElementById(`rg${modal_id}`).value = data[2]['rg'];
document.getElementById(`rg${modal_id}`).setAttribute("readonly", "");
document.getElementById(`celular${modal_id}`).value = data[0]['celular']; document.getElementById(`celular${modal_id}`).value = data[0]['celular'];
document.getElementById(`celular${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cep${modal_id}`).value = data[3]['cep']; document.getElementById(`cep${modal_id}`).value = data[3]['cep'];
document.getElementById(`cep${modal_id}`).setAttribute("readonly", "");
document.getElementById(`uf${modal_id}`).value = data[3]['uf']; document.getElementById(`uf${modal_id}`).value = data[3]['uf'];
document.getElementById(`uf${modal_id}`).setAttribute("readonly", "");
document.getElementById(`cidade${modal_id}`).value = data[3]['cidade']; document.getElementById(`cidade${modal_id}`).value = data[3]['cidade'];
document.getElementById(`cidade${modal_id}`).setAttribute("readonly", "");
document.getElementById(`bairro${modal_id}`).value = data[3]['bairro']; document.getElementById(`bairro${modal_id}`).value = data[3]['bairro'];
document.getElementById(`bairro${modal_id}`).setAttribute("readonly", "");
document.getElementById(`rua${modal_id}`).value = data[3]['rua']; document.getElementById(`rua${modal_id}`).value = data[3]['rua'];
document.getElementById(`rua${modal_id}`).setAttribute("readonly", "");
document.getElementById(`numero${modal_id}`).value = data[3]['numero']; document.getElementById(`numero${modal_id}`).value = data[3]['numero'];
document.getElementById(`numero${modal_id}`).setAttribute("readonly", "");
document.getElementById(`complemento${modal_id}`).value = data[3]['complemento']; document.getElementById(`complemento${modal_id}`).value = data[3]['complemento'];
document.getElementById(`complemento${modal_id}`).setAttribute("readonly", "");
document.getElementById(`instituicao[${modal_id}]`).value = data[0]['instituicao']; document.getElementById(`instituicao[${modal_id}]`).value = data[0]['instituicao'];
document.getElementById(`instituicao[${modal_id}]`).setAttribute("readonly", "");
document.getElementById(`curso[${modal_id}]`).value = data[2]['curso']; document.getElementById(`curso[${modal_id}]`).value = data[2]['curso'];
document.getElementById(`curso[${modal_id}]`).setAttribute("readonly", "");
$(`#exampleModal${modal_id}`).modal('show'); $(`#exampleModal${modal_id}`).modal('show');
console.log(data);
} }
</script> </script>
\ No newline at end of file
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
</a> </a>
</div> </div>
</div> --> </div> -->
<hr style="border-top: 1px solid#1492E6"> <!-- <hr style="border-top: 1px solid#1492E6">
<h6 style="color: #234B8B; font-weight: bold">Participantes</h6> -->
<div class="row-cols-sm-12 justify-content-start"> <div class="row-cols-sm-12 justify-content-start">
<ol style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px"> <ol style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px">
<li id="item"> <li id="item">
...@@ -39,10 +40,10 @@ ...@@ -39,10 +40,10 @@
@endif @endif
<h6> <h6>
<a id="nomePlano{{$i+1}}"></a><br> <a id="nomePlano{{$i+1}}"></a><br>
<a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">Informações</a> <a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">Mais Informações</a>
</h6> </h6>
<div class="col-sm-5 pl-0" style="margin-top: 10px; text-align: left;"> <div class="col-sm-5 pl-0" style="margin-top: 10px; text-align: left;">
<button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 12px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Excluir</button> <button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger btn-sm" style="font-size: 12px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Remover</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -52,7 +53,7 @@ ...@@ -52,7 +53,7 @@
<div class="modal-dialog modal-dialog-centered modal-xl"> <div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Dados do Discente {{$i+1}}</h5> <h5 class="modal-title" id="exampleModalLabel">Dados do Integrante {{$i+1}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
...@@ -268,115 +269,120 @@ ...@@ -268,115 +269,120 @@
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[{{$i}}]" class="form-control">
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if((old('turno')[$i] ?? "" )==$value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
@error('turno.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@php
$options = array('3' => 3, '4' => 4, '5' => 5, '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/anos do curso'])
<select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)">
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if((old('total_periodos')[$i] ?? "" )==$key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@error('total_periodos.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período/Ano atual'])
<select name="periodo_atual[]" class="form-control">
<option value="" selected>-- Selecione uma opção --</option>
@if(old('periodo_atual')[$i] ?? '')
<option selected value="{{ old('periodo_atual')[$i] ?? '' }}">{{ old('periodo_atual')[$i] ?? '' }}</option>
@endif
</select> @if($edital->natureza_id != 3)
@error('periodo_atual.'.$i) <div class="col-6">
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @component('componentes.select', ['label' => 'Turno'])
<strong>{{ $message }}</strong> <select name="turno[{{$i}}]" class="form-control">
</span> <option value="" selected>-- Selecione uma opção --</option>
@enderror @foreach ($enum_turno as $key => $value)
@endcomponent <option @if((old('turno')[$i] ?? "" )==$value ) selected @endif value="{{ $value }}">{{ $value }}</option>
</div> @endforeach
<div class="col-6"> </select>
@error('turno.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@php
$options = array('3' => 3, '4' => 4, '5' => 5, '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/anos do curso'])
<select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)">
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if((old('total_periodos')[$i] ?? "" )==$key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@error('total_periodos.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período/Ano atual'])
<select name="periodo_atual[]" class="form-control">
<option value="" selected>-- Selecione uma opção --</option>
@if(old('periodo_atual')[$i] ?? '')
<option selected value="{{ old('periodo_atual')[$i] ?? '' }}">{{ old('periodo_atual')[$i] ?? '' }}</option>
@endif
</select>
@error('periodo_atual.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade']) @component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control"> <select name="ordem_prioridade[]" class="form-control">
<option value="" selected>-- ORDEM --</option> <option value="" selected>-- ORDEM --</option>
@for($j = 1; $j <= $edital->numParticipantes; $j++) @for($j = 1; $j <= $edital->numParticipantes; $j++)
<option @if((old('ordem_prioridade')[$i] ?? "" )==$j) selected @endif value="{{ $j }}">{{ $j }}</option> <option @if((old('ordem_prioridade')[$i] ?? "" )==$j) selected @endif value="{{ $j }}">{{ $j }}</option>
@endfor @endfor
</select> </select>
@error('ordem_prioridade.'.$i) @error('ordem_prioridade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
@if($edital->tipo != "PIBEX")
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)']) @component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)'])
<input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? "" }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01"> <input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? "" }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01">
@error('media_do_curso.'.$i) @error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
@endif
@if($edital->tipo != "CONTINUO")
<div class="col-md-12">
<h5>Plano de trabalho</h5>
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" maxlength="255" id="nomePlanoTrabalho{{$i}}">
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}">
</span>
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo (.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@endif @endif
<div class="col-md-12">
<h5>Plano de trabalho</h5>
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" maxlength="255" id="nomePlanoTrabalho{{$i}}">
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho{{$i}}">
</span>
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo (.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
{{-- <div class="col-6"> {{-- <div class="col-6">
<button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Cancelar</button> <button data-dismiss="modal" type="button" id="cancelar{{$i}}" class=" btn btn-danger" style="font-size: 16px" onclick="desmarcar({{$i}})" @if(isset(old('marcado')[$i+1])) disabled @endif>Cancelar</button>
......
...@@ -198,12 +198,17 @@ ...@@ -198,12 +198,17 @@
let nomePlano = document.getElementById("nomePlano"+(id+1)); let nomePlano = document.getElementById("nomePlano"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
let cpf = document.getElementById("cpf"+id);
//let funcao = document.getElementById("funcao_participante");
let email = document.getElementById("email"+id);
console.log(planoTrabalho);
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho != null && planoTrabalho.value != ""){
nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção:`;
}else { }else {
nomePlano.innerText = `Nome: ${nome.value}`; nomePlano.innerText = `Nome: ${nome.value} \n E-mail: ${email.value} \n CPF: ${cpf.value}\nFunção:`;
} }
}else{ }else{
nomePlano.innerText = `Discente `+(id+1); nomePlano.innerText = `Discente `+(id+1);
...@@ -227,7 +232,8 @@ ...@@ -227,7 +232,8 @@
} }
document.getElementById("checkB"+id).checked = false; document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id)); //$("#atribuir1").attr('data-target','#exampleModal'+(id));
modal_id -= 1;
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("exampleModal"+id).modal('hide');
} }
@endif @endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment