Commit ad8c2e48 authored by unknown's avatar unknown
Browse files

Merge branch 'master' of https://github.com/antonioDurval/submeta

parents d797e153 f556479a
...@@ -805,15 +805,24 @@ class TrabalhoController extends Controller ...@@ -805,15 +805,24 @@ class TrabalhoController extends Controller
return back()->withErrors(['Proposta não encontrada']); return back()->withErrors(['Proposta não encontrada']);
} }
$trabalho->update($request->except([ if($evento->tipo=="PIBEX"){
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao', $trabalho->update($request->except([
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'justificativaAutorizacaoEtica', 'anexoAutorizacaoComiteEtica' 'anexoProjeto', 'anexoDecisaoCONSU','modalidade'
]));
}else{
$trabalho->update($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade'
]));
}
]));
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id; $pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento); $trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->save(); $trabalho->save();
if ($request->marcado == null) { if ($request->marcado == null) {
$idExcluido = $trabalho->participantes->pluck('id'); $idExcluido = $trabalho->participantes->pluck('id');
...@@ -883,8 +892,11 @@ class TrabalhoController extends Controller ...@@ -883,8 +892,11 @@ class TrabalhoController extends Controller
$endereco = Endereco::create($data); $endereco = Endereco::create($data);
$endereco->user()->save($user); $endereco->user()->save($user);
$participante = Participante::create($data); $participante = Participante::create($data);
$participante->data_entrada = $participante->created_at;
$user->participantes()->save($participante); $user->participantes()->save($participante);
$trabalho->participantes()->save($participante); $trabalho->participantes()->save($participante);
$participante->trabalho_id = $trabalho->id;
$participante->save();
} else { } else {
// $user = $participante->user; // $user = $participante->user;
...@@ -905,10 +917,9 @@ class TrabalhoController extends Controller ...@@ -905,10 +917,9 @@ class TrabalhoController extends Controller
} }
if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho) && $request->nomePlanoTrabalho[$part] != null) {
if ($request->has('anexoPlanoTrabalho') && array_key_exists($part, $request->anexoPlanoTrabalho)) { if (Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->count()) {
if (Arquivo::where('participanteId', $participante->id)->count()) { $arquivo = Arquivo::where('participanteId', $participante->id)->where('trabalhoId', $trabalho->id)->first();
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/'; $path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $data['nomePlanoTrabalho'] . ".pdf"; $nome = $data['nomePlanoTrabalho'] . ".pdf";
$titulo = $data['nomePlanoTrabalho']; $titulo = $data['nomePlanoTrabalho'];
......
<!-- Participantes --> <!-- Participantes -->
@php $cont= 0; @endphp
<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;">
...@@ -25,7 +26,10 @@ ...@@ -25,7 +26,10 @@
</div> </div>
<div class="col-sm-8" style="display: flex; align-items: center;"> <div class="col-sm-8" style="display: flex; align-items: center;">
<a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}"> <a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">
Discente {{$i+1}} @if(isset(old('marcado')[$i]))
@if(isset(old('name')[$i]))Nome: {{old('name')[$i]}} @else Discente {{$i+1}} @endif
@if(isset(old('nomePlanoTrabalho')[$i]))<br> Plano: {{old('nomePlanoTrabalho')[$i]}} @endif
@endif
</a> </a>
</div> </div>
</div> </div>
...@@ -363,7 +367,7 @@ ...@@ -363,7 +367,7 @@
</div> </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}})">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>
</div> </div>
<div class="col-6"> <div class="col-6">
<button data-dismiss="modal" type="button" id="guardar{{$i}}" class="btn btn-success float-right" style="font-size: 16px" onclick="marcar({{$i}})">Salvar</button> <button data-dismiss="modal" type="button" id="guardar{{$i}}" class="btn btn-success float-right" style="font-size: 16px" onclick="marcar({{$i}})">Salvar</button>
......
...@@ -192,13 +192,17 @@ ...@@ -192,13 +192,17 @@
let linkNome = document.getElementById("nomePart"+(id+1)); let linkNome = document.getElementById("nomePart"+(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);
if(nome.value != ""){ if(nome.value != ""){
if(planoTrabalho.value != ""){ if(planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
}else { }else {
linkNome.innerText = `Nome: ${nome.value}`; linkNome.innerText = `Nome: ${nome.value}`;
} }
}else{
linkNome.innerText = `Discente `+(id+1);
}
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
} }
document.getElementById("checkB"+id).checked = true; document.getElementById("checkB"+id).checked = true;
...@@ -210,7 +214,9 @@ ...@@ -210,7 +214,9 @@
} }
function desmarcar(id){ function desmarcar(id){
document.getElementById("arquivoPlano"+id).setAttribute("hidden", true); if(id >= 1){;
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
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));
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<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-12"><h5 style="color: #234B8B; font-weight: bold">Anexos</h5></div> <div class="col-md-12"><h5 style="color: #234B8B; font-weight: bold">Anexos do Projeto</h5></div>
</div> </div>
<hr style="border-top: 1px solid#1492E6; margin-bottom: 10px" > <hr style="border-top: 1px solid#1492E6; margin-bottom: 10px" >
......
<!-- Participantes --> <!-- Participantes -->
<div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">4º Passo</h4></div> <div class="col-md-12" style="margin-top: 20px">
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Área do(s) discente(s)</h5></div> <div class="card" style="border-radius: 5px">
<div class="col-md-10"> <div class="card-body" style="padding-top: 0.2rem;">
<div class="card" style="border-radius: 12px; padding:15px"> <div class="container">
<div class="card-body" style="margin-bottom: -2rem"> <div class="form-row mt-3">
<div class="d-flex justify-content-between align-items-center"> <div class="col-md-11"><h5 style="color: #234B8B; font-weight: bold">Dados do(s) Discente(s)</h5></div>
<div><h5 style="color: #1492E6; margin-top:0.5rem">Discente(s)</h5></div> <div class="col-md-1 text-sm-right">
<div> <a type="button" value="{{ $edital->id }}" id="atribuir1" data-toggle="modal" data-target="#exampleModal{{$projeto->participantes->keys()->count()}}">
{{-- <button type="button" class="btn btn-light" id="buttonMais" >Adicionar discente </button> --}} <img class="" src="{{asset('img/icons/add.ico')}}" style="width:30px" alt="">
{{-- <button type="button" class="btn btn-light" id="buttonMenos" >Remover participante</button> --}} </a>
<span>Marque a caixa ao lado do discente que queira adicionar</span>
</div>
</div>
<div style="margin-top:-10px"><hr style="border-top: 1px solid#1492E6"></div>
</div>
<ol style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px">
<li id="item">
<div style="margin-bottom:15px">
<div id="participante" >
@for($i = 0; $i < $edital->numParticipantes; $i++)
@php
$p = null;
if ($projeto->participantes->keys()->contains($i)) {
$p = $projeto->participantes[$i];
}
@endphp
@if($p)
<div class="form-row mb-1">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{$i}}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div>
</a>
</div> </div>
<div class="col-1" style="margin-top:9.3px"> </div>
{{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}} <hr style="border-top: 1px solid#1492E6">
<input type="checkbox" aria-label="Checkbox for following text input" @if(old('name')[$i] ?? $p) checked @endif name="marcado[]" value="{{ $i }}"> <div class="row-cols-sm-12 justify-content-start">
</div> <ol style="counter-reset: item;list-style-type: none; margin-left:-20px; margin-right:20px; margin-top:10px">
<div class="col-md-12"> <li id="item">
<div class="collapse" id="collapseParticipante{{$i}}"> <div style="margin-bottom:15px">
<div class="container"> <div id="participante" class="row">
<div class="row"> @for($i = 0; $i < $edital->numParticipantes; $i++)
<input type="hidden" name="participante_id[]" value="{{ $p->id ?? "" }}"> @php
<input type="hidden" name="funcaoParticipante[]" value="4"> $participante = null;
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div> if ($projeto->participantes->keys()->contains($i)) {
<div class="col-6"> $participante = $projeto->participantes[$i];
@component('componentes.input', ['label' => 'Nome completo']) }
<input type="text" class="form-control " value="{{old('name')[$i] ?? $p->user->name }}" name="name[{{$i}}]" placeholder="Nome Completo" />
@endphp
@error("name.".$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <div @if(!$participante) hidden @endif class="form-row mb-1 col-md-3" style="margin-top: 10px" id="part{{$i}}">
<div class="col-sm-4" style="display: flex; align-items: center;">
<img src="{{asset('img/icons/usuario.svg')}}" style="width:60px" alt="">
</div>
<div class="col-sm-8" style="display: flex; align-items: center;">
<a href="" style="" class="justify-content-center" data-toggle="modal" data-target="#exampleModal{{$i}}" id="nomePart{{$i+1}}">
@if($participante)
@if(isset(old('name')[$i]))Nome: {{old('name')[$i]}} @else Nome: {{$participante->user->name}} @endif
@if(isset(old('nomePlanoTrabalho')[$i]))<br> Plano: {{old('nomePlanoTrabalho')[$i]}} @else <br>Plano: {{$participante->planoTrabalho->titulo}} @endif
@else
Discente
@endif
</a>
</div>
</div>
<div class="modal fade" id="exampleModal{{$i}}" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Dados do Discente {{$i+1}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="col-1" style="margin-top:9.3px" hidden>
{{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}}
<input type="checkbox" id="checkB{{$i}}" aria-label="Checkbox for following text input" @if(isset(old('marcado')[$i]) || $participante) checked @endif name="marcado[]" value="{{ $i }}">
</div>
<div class="col-md-12">
<div class="container">
<div class="row">
<input type="hidden" name="funcaoParticipante[]" value="4">
<input type="hidden" name="participante_id[]" value="{{ $participante->id ?? "" }}">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " value="{{old('name')[$i] ?? ($participante->user->name ?? "")}}" name="name[{{$i}}]" placeholder="Nome Completo" maxlength="150" id="nome{{$i}}"/>
<span style="color: red; font-size: 12px" id="caracsRestantesnome{{$i}}">
</span>
@error("name.".$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.input', ['label' => 'E-mail'])
<input type="email" class="form-control" value="{{old('email')[$i] ?? ($participante->user->email ?? "") }}" name="email[{{$i}}]" placeholder="E-mail" maxlength="150" id="email{{$i}}" />
<span style="color: red; font-size: 12px" id="caracsRestantesemail{{$i}}">
</span>
@error('email.'.$i)
<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>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'E-mail']) @component('componentes.input', ['label' => 'Data de nascimento'])
<input type="email" class="form-control" value="{{old('email')[$i] ?? $p->user->email }}" name="email[{{$i}}]" placeholder="E-mail" /> <input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? ($participante->data_de_nascimento ?? "") }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('email.'.$i) @error('data_de_nascimento.'.$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>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? $p->data_de_nascimento }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('data_de_nascimento.'.$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.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? $p->user->cpf }}" name="cpf[{{$i}}]" placeholder="CPF" />
@error('cpf.'.$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.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" value="{{old('rg')[$i] ?? $p->rg }}" name="rg[{{$i}}]" placeholder="RG" />
@error('rg.'.$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.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? $p->user->celular }}" name="celular[{{$i}}]" placeholder="Celular" />
@error('celular.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" value="{{old('cep')[$i] ?? $p->user->endereco->cep }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$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' => 'Estado'])
<select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf')[$i] ?? $p->user->endereco->uf == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.'.$i)
<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>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Cidade']) @component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control" value="{{old('cidade')[$i] ?? $p->user->endereco->cidade }}" name="cidade[{{$i}}]" placeholder="Cidade" /> <input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? ($participante->user->cpf ?? "") }}" name="cpf[{{$i}}]" placeholder="CPF" />
@error('cidade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @error('cpf.'.$i)
<strong>{{ $message }}</strong> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{old('bairro')[$i] ?? $p->user->endereco->bairro }}" name="bairro[{{$i}}]" placeholder="Bairro" />
@error('bairro.'.$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.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{old('rua')[$i] ?? $p->user->endereco->rua }}" name="rua[{{$i}}]" placeholder="Rua" />
@error('rua.'.$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.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{old('numero')[$i] ?? $p->user->endereco->numero }}" name="numero[{{$i}}]" placeholder="Número" />
@error('numero.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
<div class="form-group">
<label class=" control-label" for="firstname">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? $p->user->endereco->complemento }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Instituição de Ensino'])
<select style="display: inline" onchange="showInstituicao(this)" class="form-control" name="instituicao[{{$i}}]">
<option value="" disabled selected hidden>-- Instituição --</option>
<option @if(old('instituicao')[$i] ?? $p->user->instituicao == 'UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicao')[$i] ?? $p->user->instituicao != 'Outra' ) selected @endif value="Outra" >Outra</option>
@if($p->user->instituicao != 'UFAPE')
<option selected value="{{$p->user->instituicao}}" >{{$p->user->instituicao}}</option>
@endif
</select>
@error('instituicao.'.$i)
<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>
<div class="col-6" id="displayinstituicao[{{$i}}]" style='display:none'> <div class="col-6">
@component('componentes.input', ['label' => 'Digite a Instituição']) @component('componentes.input', ['label' => 'RG'])
<input id="outrainstituicao[{{$i}}]" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="outrainstituicao[{{$i}}]" value="{{ old('outrainstituicao')[$i] ?? $p->user->instituicao }}" placeholder="Digite o nome da Instituição" autocomplete="instituicao" autofocus> <input type="text" class="form-control rg" min="9" maxlength="9" value="{{old('rg')[$i] ?? ($participante->rg ?? "") }}" name="rg[{{$i}}]" placeholder="RG" />
@error('instituicao') @error('rg.'.$i)
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<select style="display: inline" class="form-control" name="curso[{{$i}}]" onchange="showCurso(this)">
<option value="" disabled selected hidden>-- Selecione uma opção--</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Bacharelado em Agronomia' ) selected @endif value="Bacharelado em Agronomia">Bacharelado em Agronomia</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Bacharelado em Ciência da Computação' ) selected @endif value="Bacharelado em Ciência da Computação">Bacharelado em Ciência da Computação</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Bacharelado em Engenharia de Alimentos' ) selected @endif value="Bacharelado em Engenharia de Alimentos">Bacharelado em Engenharia de Alimentos</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Bacharelado em Medicina Veterinária' ) selected @endif value="Bacharelado em Medicina Veterinária">Bacharelado em Medicina Veterinária</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Bacharelado em Zootecnia' ) selected @endif value="Bacharelado em Zootecnia">Bacharelado em Zootecnia</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Licenciatura em Letras' ) selected @endif value="Licenciatura em Letras">Licenciatura em Letras</option>
<option @if(old('curso')[$i] ?? $p->curso == 'Licenciatura em Pedagogia' ) selected @endif value="Licenciatura em Pedagogia">Licenciatura em Pedagogia</option>
<option @if(old('curso')[$i] ?? ($p->curso != 'Bacharelado em Agronomia' && $p->curso != 'Bacharelado em Ciência da Computação' && $p->curso != 'Bacharelado em Engenharia de Alimentos' && $p->curso != 'Bacharelado em Medicina Veterinária' && $p->curso != 'Bacharelado em Zootecnia' && $p->curso != 'Licenciatura em Letras' && $p->curso != 'Licenciatura em Pedagogia') ) selected @endif value="Outro" >Outro</option>
@if($p->curso != 'Bacharelado em Agronomia' && $p->curso != 'Bacharelado em Ciência da Computação' && $p->curso != 'Bacharelado em Engenharia de Alimentos' && $p->curso != 'Bacharelado em Medicina Veterinária' && $p->curso != 'Bacharelado em Zootecnia' && $p->curso != 'Licenciatura em Letras' && $p->curso != 'Licenciatura em Pedagogia' && $p->curso != 'Outro')
<option selected value="{{$p->curso}}" >{{$p->curso}}</option>
@endif
</select>
@error('curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6" id="displaycurso[{{$i}}]" style='display:none'>
@component('componentes.input', ['label' => 'Digite o nome do curso'])
<input id="outrocurso[{{$i}}]" type="text" class="form-control" name="outrocurso[{{$i}}]" value="{{ old('outrocurso')[$i] ?? $p->curso }}" placeholder="Digite o nome do curso" autocomplete="curso" autofocus>
@error('outrocurso.'.$i)
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Turno']) @component('componentes.input', ['label' => 'Celular'])
<select name="turno[{{$i}}]" class="form-control" > <input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? ($participante->user->celular ?? "") }}" name="celular[{{$i}}]" placeholder="Celular" />
<option value="" selected>-- Selecione uma opção --</option> @error('celular.'.$i)
@foreach ($enum_turno as $key => $value) <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<option @if(old('turno')[$i] ?? $p->turno == $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> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
@php <div class="col-md-12"><h5>Endereço</h5></div>
$options = array('3' => 3, '4' => 4,'5' => 5,'6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12); <div class="col-6">
@endphp @component('componentes.input', ['label' => 'CEP'])
<div class="col-6"> <input type="text" class="form-control cep" value="{{old('cep')[$i] ?? ($participante->user->endereco->cep ?? "") }}" name="cep[{{$i}}]" placeholder="CEP" />
@component('componentes.select', ['label' => 'Total de períodos/anos do curso']) @error('cep.'.$i)
<select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)" > <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if(old('total_periodos')[$i] ?? $p->total_periodos == $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> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período/Ano atual']) <div class="col-6">
<select name="periodo_atual[]" class="form-control" > @component('componentes.select', ['label' => 'Estado'])
<option selected value="{{ old('periodo_atual')[$i] ?? $p->periodo_atual }}">{{ old('periodo_atual')[$i] ?? $p->periodo_atual }}</option> <select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
</select> <option value="" selected>-- Selecione uma opção --</option>
@error('periodo_atual.'.$i) @foreach ($estados as $sigla => $nome)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <option @if(old('uf')[$i] ?? ($participante->user->endereco->uf ?? "") ) == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.'.$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.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{old('cidade')[$i] ?? ($participante->user->endereco->cidade ?? "") }}" name="cidade[{{$i}}]" placeholder="Cidade" maxlength="50" id="cidade{{$i}}" />
<span style="color: red; font-size: 12px" id="caracsRestantescidade{{$i}}">
</span>
@error('cidade.'.$i)
<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>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade']) @component('componentes.input', ['label' => 'Bairro'])
<select name="ordem_prioridade[]" class="form-control" > <input type="text" class="form-control" value="{{old('bairro')[$i] ?? ($participante->user->endereco->bairro ?? "") }}" name="bairro[{{$i}}]" placeholder="Bairro" maxlength="50" id="bairro{{$i}}" />
<option value="" selected>-- ORDEM --</option> <span style="color: red; font-size: 12px" id="caracsRestantesbairro{{$i}}">
@for($j = 1; $j <= $edital->numParticipantes; $j++) </span>
<option @if(old('ordem_prioridade')[$i] ?? $p->ordem_prioridade == $j ) selected @endif value="{{ $j }}">{{ $j }}</option> @error('bairro.'.$i)
@endfor <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</select>
@error('ordem_prioridade.'.$i)
<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>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)']) @component('componentes.input', ['label' => 'Rua'])
<input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? $p->media_do_curso }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01" > <input type="text" class="form-control" value="{{old('rua')[$i] ?? ($participante->user->endereco->rua ?? "")}}" name="rua[{{$i}}]" placeholder="Rua" maxlength="100" id="rua{{$i}}" />
@error('media_do_curso.'.$i) <span style="color: red; font-size: 12px" id="caracsRestantesrua{{$i}}">
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<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="{{$p->planoTrabalho ? $p->planoTrabalho->titulo : "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" >
@error('nomePlanoTrabalho.'.$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.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
@if($p->planoTrabalho)
<div class="row justify-content-center">
<div class="col-3 ">
<a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
@else
<div class="form-row mb-1">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{$i}}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div>
</a>
</div>
<div class="col-1" style="margin-top:9.3px">
{{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}}
<input type="checkbox" aria-label="Checkbox for following text input" @if(old('name')[$i] ?? "") checked @endif name="marcado[]" value="{{ $i }}">
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante{{$i}}">
<div class="container">
<div class="row">
<input type="hidden" name="participante_id[]" value="">
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " value="{{old('name')[$i] ?? "" }}" name="name[{{$i}}]" placeholder="Nome Completo" maxlength="150" id="nome{{$i}}" />
<span style="color: red; font-size: 12px" id="caracsRestantesnome{{$i}}">
</span> </span>
@error("name.".$i) @error('rua.'.$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>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'E-mail']) @component('componentes.input', ['label' => 'Número'])
<input type="email" class="form-control" value="{{old('email')[$i] ?? "" }}" name="email[{{$i}}]" placeholder="E-mail" maxlength="150" id="email{{$i}}" /> <input type="text" class="form-control" value="{{old('numero')[$i] ?? ($participante->user->endereco->numero ?? "") }}" name="numero[{{$i}}]" placeholder="Número" />
<span style="color: red; font-size: 12px" id="caracsRestantesemail{{$i}}"> @error('numero.'.$i)
</span> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
@error('email.'.$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.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? "" }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('data_de_nascimento.'.$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.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? "" }}" name="cpf[{{$i}}]" placeholder="CPF" />
@error('cpf.'.$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.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" value="{{old('rg')[$i] ?? "" }}" name="rg[{{$i}}]" placeholder="RG" />
@error('rg.'.$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.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? "" }}" name="celular[{{$i}}]" placeholder="Celular" />
@error('celular.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control cep" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$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' => 'Estado'])
<select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf')[$i] ?? "" == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.'.$i)
<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>
<div class="col-6"> <div class="col-12">
@component('componentes.input', ['label' => 'Cidade']) <div class="form-group">
<input type="text" class="form-control" value="{{old('cidade')[$i] ?? "" }}" name="cidade[{{$i}}]" placeholder="Cidade" maxlength="50" id="cidade{{$i}}" /> <label class=" control-label" for="firstname">Complemento</label>
<span style="color: red; font-size: 12px" id="caracsRestantescidade{{$i}}"> <input type="text" class="form-control" value="{{old('complemento')[$i] ?? ($participante->user->endereco->complemento ?? "") }}" name="complemento[{{$i}}]" placeholder="Complemento" maxlength="75" id="complemento{{$i}}"/>
</span> <span style="color: red; font-size: 12px" id="caracsRestantescomplemento{{$i}}">
@error('cidade.'.$i) </span>
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> @error('complemento.'.$i)
<strong>{{ $message }}</strong> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</span> <strong>{{ $message }}</strong>
@enderror </span>
@endcomponent @enderror
</div> </div>
<div class="col-6"> </div>
@component('componentes.input', ['label' => 'Bairro']) <div class="col-md-12"><h5>Dados do curso</h5></div>
<input type="text" class="form-control" value="{{old('bairro')[$i] ?? "" }}" name="bairro[{{$i}}]" placeholder="Bairro" maxlength="50" id="bairro{{$i}}"/> <div class="col-6">
<span style="color: red; font-size: 12px" id="caracsRestantesbairro{{$i}}"> @component('componentes.input', ['label' => 'Instituição de Ensino'])
</span> <select style="display: inline" onchange="showInstituicao(this)" class="form-control" name="instituicao[{{$i}}]">
@error('bairro.'.$i) <option value="" disabled selected hidden>-- Instituição --</option>
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"> <option @if(old('instituicao')[$i] ?? ($participante->user->instituicao ?? "") == 'UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<strong>{{ $message }}</strong> <option @if(old('instituicao')[$i] ?? ($participante->user->instituicao ?? "") == 'Outra' ) selected @endif value="Outra" >Outra</option>
</span> </select>
@enderror @error('instituicao.'.$i)
@endcomponent <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{old('rua')[$i] ?? "" }}" name="rua[{{$i}}]" placeholder="Rua" maxlength="100" id="rua{{$i}}" />
<span style="color: red; font-size: 12px" id="caracsRestantesrua{{$i}}">
</span>
@error('rua.'.$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.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{old('numero')[$i] ?? "" }}" name="numero[{{$i}}]" placeholder="Número" />
@error('numero.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
<div class="form-group">
<label class=" control-label" for="firstname">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? "" }}" name="complemento[{{$i}}]" placeholder="Complemento" maxlength="75" id="complemento{{$i}}" />
<span style="color: red; font-size: 12px" id="caracsRestantescomplemento{{$i}}">
</span>
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Instituição de Ensino'])
<select style="display: inline" onchange="showInstituicao(this)" class="form-control" name="instituicao[{{$i}}]">
<option value="" disabled selected hidden>-- Instituição --</option>
<option @if(old('instituicao')[$i] ?? "" == 'UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicao')[$i] ?? "" == 'Outra' ) selected @endif value="Outra" >Outra</option>
</select>
@error('instituicao.'.$i)
<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>
<div class="col-6" id="displayinstituicao[{{$i}}]" style='display:none'> <div class="col-6" id="displayinstituicao[{{$i}}]" style='display:none'>
@component('componentes.input', ['label' => 'Digite a Instituição']) @component('componentes.input', ['label' => 'Digite a Instituição'])
<input id="outrainstituicao[{{$i}}]" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="outrainstituicao[{{$i}}]" value="{{ old('outrainstituicao')[$i] ?? "" }}" placeholder="Digite o nome da Instituição" autocomplete="instituicao" autofocus> <input id="outrainstituicao[{{$i}}]" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="outrainstituicao[{{$i}}]" value="{{ old('outrainstituicao')[$i] ?? ($participante->user->instituicao ?? "") }}" placeholder="Digite o nome da Instituição" autocomplete="instituicao" autofocus>
@error('outrainstituicao.'.$i) @error('outrainstituicao.'.$i)
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.input', ['label' => 'Curso']) @component('componentes.input', ['label' => 'Curso'])
<select style="display: inline" class="form-control" name="curso[{{$i}}]" onchange="showCurso(this)"> <select style="display: inline" class="form-control" name="curso[{{$i}}]" onchange="showCurso(this)">
<option value="" disabled selected hidden>-- Selecione uma opção--</option> <option value="" disabled selected hidden>-- Selecione uma opção--</option>
<option @if(old('curso')[$i] ?? "" == 'Bacharelado em Agronomia' ) selected @endif value="Bacharelado em Agronomia">Bacharelado em Agronomia</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Bacharelado em Agronomia' ) selected @endif value="Bacharelado em Agronomia">Bacharelado em Agronomia</option>
<option @if(old('curso')[$i] ?? "" == 'Bacharelado em Ciência da Computação' ) selected @endif value="Bacharelado em Ciência da Computação">Bacharelado em Ciência da Computação</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Bacharelado em Ciência da Computação' ) selected @endif value="Bacharelado em Ciência da Computação">Bacharelado em Ciência da Computação</option>
<option @if(old('curso')[$i] ?? "" == 'Bacharelado em Engenharia de Alimentos' ) selected @endif value="Bacharelado em Engenharia de Alimentos">Bacharelado em Engenharia de Alimentos</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Bacharelado em Engenharia de Alimentos' ) selected @endif value="Bacharelado em Engenharia de Alimentos">Bacharelado em Engenharia de Alimentos</option>
<option @if(old('curso')[$i] ?? "" == 'Bacharelado em Medicina Veterinária' ) selected @endif value="Bacharelado em Medicina Veterinária">Bacharelado em Medicina Veterinária</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Bacharelado em Medicina Veterinária' ) selected @endif value="Bacharelado em Medicina Veterinária">Bacharelado em Medicina Veterinária</option>
<option @if(old('curso')[$i] ?? "" == 'Bacharelado em Zootecnia' ) selected @endif value="Bacharelado em Zootecnia">Bacharelado em Zootecnia</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Bacharelado em Zootecnia' ) selected @endif value="Bacharelado em Zootecnia">Bacharelado em Zootecnia</option>
<option @if(old('curso')[$i] ?? "" == 'Licenciatura em Letras' ) selected @endif value="Licenciatura em Letras">Licenciatura em Letras</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Licenciatura em Letras' ) selected @endif value="Licenciatura em Letras">Licenciatura em Letras</option>
<option @if(old('curso')[$i] ?? "" == 'Licenciatura em Pedagogia' ) selected @endif value="Licenciatura em Pedagogia">Licenciatura em Pedagogia</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Licenciatura em Pedagogia' ) selected @endif value="Licenciatura em Pedagogia">Licenciatura em Pedagogia</option>
<option @if(old('curso')[$i] ?? "" == 'Outro' ) selected @endif value="Outro" >Outro</option> <option @if(old('curso')[$i] ?? ($participante->curso ?? "") == 'Outro' ) selected @endif value="Outro" >Outro</option>
</select> </select>
@error('curso.'.$i) @error('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>
<div class="col-6" id="displaycurso[{{$i}}]" style='display:none'> <div class="col-6" id="displaycurso[{{$i}}]" style='display:none'>
@component('componentes.input', ['label' => 'Digite o nome do curso']) @component('componentes.input', ['label' => 'Digite o nome do curso'])
<input id="outrocurso[{{$i}}]" type="text" class="form-control" name="outrocurso[{{$i}}]" value="{{ old('outrocurso')[$i] ?? "" }}" placeholder="Digite o nome do curso" autocomplete="curso" autofocus> <input id="outrocurso[{{$i}}]" type="text" class="form-control" name="outrocurso[{{$i}}]" value="{{ old('outrocurso')[$i] ?? ($participante->curso ?? "") }}" placeholder="Digite o nome do curso" autocomplete="curso" autofocus>
@error('outrocurso.'.$i) @error('outrocurso.'.$i)
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Turno']) @component('componentes.select', ['label' => 'Turno'])
<select name="turno[{{$i}}]" class="form-control" > <select name="turno[{{$i}}]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option> <option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value) @foreach ($enum_turno as $key => $value)
<option @if(old('turno')[$i] ?? "" == $value ) selected @endif value="{{ $value }}">{{ $value }}</option> <option @if(old('turno')[$i] ?? ($participante->turno ?? "") == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach @endforeach
</select> </select>
@error('turno.'.$i) @error('turno.'.$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>
</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] ?? ($participante->total_periodos ?? "") == $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>
<option selected value="{{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? "") }}">{{ old('periodo_atual')[$i] ?? ($participante->periodo_atual ?? "") }}</option>
</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'])
<select name="ordem_prioridade[]" class="form-control" >
<option value="" selected>-- ORDEM --</option>
@for($j = 1; $j <= $edital->numParticipantes; $j++)
<option @if(old('total_periodos')[$i] ?? "" == $j ) selected @endif value="{{ $j }}">{{ $j }}</option>
@endfor
</select>
@error('ordem_prioridade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@if($edital->tipo != "PIBEX")
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento (média geral)'])
<input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? ($participante->media_do_curso ?? "") }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01" >
@error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@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] ?? ($participante->planoTrabalho->titulo ?? "") }}" 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> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @endcomponent
</div> </div>
@php <div class="col-12" style="margin-bottom: 10px">
$options = array('3' => 3, '4' => 4,'5' => 5,'6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12); @endphp <label>Anexo (.pfd)<span style="color: red;font-weight: bold">* </span>
<div class="col-6"> @if($participante !=null && $participante->planoTrabalho)
@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> <a style="margin-left: 5px" href="{{ route('baixar.plano', ['id' => $participante->planoTrabalho->id]) }}">
@foreach ($options as $key => $value) <i class="fas fa-file-pdf fa-2x"></i></a>
<option @if(old('total_periodos')[$i] ?? "" == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select> @endif
@error('total_periodos.'.$i) </label>
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<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> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent @error('anexoPlanoTrabalho')
</div> <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<div class="col-6">
@component('componentes.select', ['label' => 'Período/Ano atual'])
<select name="periodo_atual[]" class="form-control" >
<option selected value="{{ old('periodo_atual')[$i] ?? "" }}">{{ old('periodo_atual')[$i] ?? "" }}</option>
</select>
@error('periodo_atual.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
</span> </span>
@enderror @enderror
@endcomponent
</div> </div>
<div class="col-6"> <div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade']) <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>
<select name="ordem_prioridade[]" class="form-control" > </div>
<option value="" selected>-- ORDEM --</option> <div class="col-6">
@for($j = 1; $j <= $edital->numParticipantes; $j++) <button data-dismiss="modal" type="button" id="guardar{{$i}}" class="btn btn-success float-right" style="font-size: 16px" onclick="marcar({{$i}})">Salvar</button>
<option @if(old('ordem_prioridade')[$i] ?? "" == $j ) selected @endif value="{{ $j }}">{{ $j }}</option> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endfor @endfor
</select> </div>
@error('ordem_prioridade.'.$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.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" >
@error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<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-6">
@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 class="row justify-content-center">
<div class="col-3 ">
<a href="{{ route('baixar.plano', ['id' => $p->planoTrabalho->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div> --}}
</div>
</div> </div>
</div>
</div>
</div>
</div>
@endif
@endfor
</div>
</div>
</li>
</ol> </li>
</div> </ol>
</div>
</div>
</div>
</div>
</div> </div>
<!--X Participantes X--> <script>
</script>
<!--X Participantes X-->
...@@ -33,15 +33,11 @@ ...@@ -33,15 +33,11 @@
@include('projeto.editaFormulario.proponente') @include('projeto.editaFormulario.proponente')
@include('projeto.editaFormulario.anexos')
@include('projeto.editaFormulario.participantes') @include('projeto.editaFormulario.participantes')
{{-- @include('projeto.editaFormulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'edital'=>$edital, 'projeto' => $projeto])
--}} @include('projeto.editaFormulario.anexos')
@include('projeto.editaFormulario.finalizar') @include('projeto.editaFormulario.finalizar')
...@@ -222,7 +218,39 @@ ...@@ -222,7 +218,39 @@
}); });
function marcar(id){
let nome = document.getElementById("nome"+id);
let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
if(nome.value != ""){
if(planoTrabalho.value != ""){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
}else {
linkNome.innerText = `Nome: ${nome.value}`;
}
}
if(id >=1){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
}
document.getElementById("checkB"+id).checked = true;
$("#atribuir1").attr('data-target','#exampleModal'+(id+1));
document.getElementById("part"+id).removeAttribute("hidden");
document.getElementById("exampleModal"+id).modal('hide');
}
function desmarcar(id){
if(id >= 1){;
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id));
document.getElementById("exampleModal"+id).modal('hide');
}
</script> </script>
......
...@@ -88,24 +88,28 @@ ...@@ -88,24 +88,28 @@
</a> </a>
<div class="dropdown-menu"> <div class="dropdown-menu">
@if($projeto->evento->inicioSubmissao <= $hoje && $hoje <= $projeto->evento->fimSubmissao)
<a href="{{ route('trabalho.editar', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center;">
Editar
</a>
<hr class="dropdown-hr">
@endif
@if( $projeto->status== 'aprovado') @if( $projeto->status== 'aprovado')
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;"> <a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições Solicitar Substituições
</a> </a>
<hr class="dropdown-hr"> <hr class="dropdown-hr">
<a href="{{route('docComplementar.listar', ['projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center">
Documentos Complementares
</a>
{{--<hr class="dropdown-hr"> {{--<hr class="dropdown-hr">
<a href="" class="dropdown-item" style="text-align: center"> <a href="" class="dropdown-item" style="text-align: center">
Solicitar Certificado Solicitar Certificado
</a>--}} </a>--}}
<hr class="dropdown-hr">
@endif @endif
<a href="{{route('docComplementar.listar', ['projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center">
Documentos Complementares
</a>
<hr class="dropdown-hr">
<a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.show', ['id' => $projeto->id]) }}" class="dropdown-item" style="text-align: center">
Visualizar Visualizar
</a> </a>
...@@ -115,7 +119,6 @@ ...@@ -115,7 +119,6 @@
Relatórios Relatórios
</a> </a>
<hr class="dropdown-hr">
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Recorrer Recorrer
</a> </a>
......
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