Unverified Commit 8e0d6f4c authored by Gabriel Antônio da Silva's avatar Gabriel Antônio da Silva Committed by GitHub
Browse files

Merge pull request #128 from Gabriel-31415/master

Update editar projeto
parents 0ef6d08d d5e72c5b
......@@ -42,17 +42,7 @@ use Illuminate\Support\Facades\Notification;
class TrabalhoController extends Controller
{
public function index($id)
{
$edital = Evento::find($id);
$grandeAreas = GrandeArea::orderBy('nome')->get();
$funcaoParticipantes = FuncaoParticipantes::orderBy('nome')->get();
$proponente = Proponente::where('user_id', Auth::user()->id)->first();
if($proponente == null){
return view('proponente.cadastro')->with(['mensagem' => 'Você não possui perfil de Proponente, para submeter algum projeto preencha o formulário.']);;
}
$estados = array(
public $estados = array(
'AC' => 'Acre',
'AL' => 'Alagoas',
'AP' => 'Amapá',
......@@ -81,6 +71,18 @@ class TrabalhoController extends Controller
'SE' => 'Sergipe',
'TO' => 'Tocantins',
);
public function index($id)
{
$edital = Evento::find($id);
$grandeAreas = GrandeArea::orderBy('nome')->get();
$funcaoParticipantes = FuncaoParticipantes::orderBy('nome')->get();
$proponente = Proponente::where('user_id', Auth::user()->id)->first();
if($proponente == null){
return view('proponente.cadastro')->with(['mensagem' => 'Você não possui perfil de Proponente, para submeter algum projeto preencha o formulário.']);;
}
$rascunho = Trabalho::where('proponente_id', $proponente->id)->where('evento_id',$edital->id)->where('status', 'Rascunho')
->orderByDesc('updated_at')->first();
......@@ -93,7 +95,7 @@ class TrabalhoController extends Controller
'funcaoParticipantes'=> $funcaoParticipantes,
'rascunho' => $rascunho,
'enum_turno' => Participante::ENUM_TURNO,
'estados' => $estados,
'estados' => $this->estados,
]);
}
......@@ -194,7 +196,6 @@ class TrabalhoController extends Controller
}
public function validarAnexosRascunho(Request $request, $trabalho){
//dd($trabalho->getAttributes());
$validator = Validator::make($trabalho->getAttributes(),[
'anexoPlanilhaPontuacao' => $request->anexoPlanilha==null?['planilha']:[],
]);
......@@ -357,6 +358,7 @@ class TrabalhoController extends Controller
public function edit($id)
{
$proponente = Proponente::where('user_id', Auth::user()->id)->first();
$projeto = Trabalho::find($id);
$edital = Evento::find($projeto->evento_id);
$grandeAreas = GrandeArea::all();
......@@ -368,6 +370,9 @@ class TrabalhoController extends Controller
$users = User::whereIn('id', $participantesUsersIds)->get();
$arquivos = Arquivo::where('trabalhoId', $id)->get();
//dd(Participante::all());
$rascunho = Trabalho::where('proponente_id', $proponente->id)->where('evento_id',$edital->id)->where('status', 'Rascunho')
->orderByDesc('updated_at')->first();
return view('projeto.editar')->with(['projeto' => $projeto,
'grandeAreas' => $grandeAreas,
'areas' => $areas,
......@@ -378,6 +383,7 @@ class TrabalhoController extends Controller
'participantes' => $participantes,
'arquivos' => $arquivos,
'enum_turno' => Participante::ENUM_TURNO,
'estados' => $this->estados,
]);
}
......@@ -786,6 +792,13 @@ class TrabalhoController extends Controller
}
return abort(404);
}
public function baixarAnexoGrupoPesquisa($id) {
$projeto = Trabalho::find($id);
if (Storage::disk()->exists($projeto->anexoProjeto)) {
return Storage::download($projeto->anexoProjeto);
}
return abort(404);
}
public function baixarAnexoConsu($id) {
$projeto = Trabalho::find($id);
......@@ -920,10 +933,10 @@ class TrabalhoController extends Controller
$participantes = $projeto->participantes;
$participantesPermanecem = collect();
// dd($request->all());
foreach ($request->participante_id as $key => $id) {
// Novo participante
if ($id == 0) {
if ($id == 0 || $id == null) {
$userParticipante = User::where('email', $request->emailParticipante[$key])->first();
$participante = new Participante();
......@@ -1196,6 +1209,7 @@ class TrabalhoController extends Controller
$projeto->update();
// Salvando participantes
// dd($request->all());
$this->salvarParticipantes($request, $edital, $projeto, true);
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto atualizado com sucesso!']);
......
......@@ -55,6 +55,12 @@ class Trabalho extends Model
public function area(){
return $this->belongsTo('App\Area');
}
public function grandeArea(){
return $this->belongsTo('App\GrandeArea');
}
public function subArea(){
return $this->belongsTo('App\SubArea');
}
public function autor(){
return $this->belongsTo('App\User', 'autorId');
......@@ -79,6 +85,7 @@ class Trabalho extends Model
return $this->hasMany('App\PlanoTrabalho');
}
public function participantes(){
// return $this->belongsToMany('App\Trabalho', 'trabalho_participante');
return $this->hasMany('App\Participante', 'trabalho_id');
}
public function proponente(){
......
......@@ -14,6 +14,7 @@
<div class="container">
<div class="row">
<input type="hidden" name="funcaoParticipante[]" value="4">
<input type="hidden" name="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'])
......
......@@ -15,7 +15,7 @@
<!-- Styles -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="{{ asset('js/jquery-3.4.1.min.js')}}"></script>
<script src="{{ asset('js/jquery-mask-plugin.js')}}"></script>
{{-- <script src="https://cdn.jsdelivr.net/npm/jquery-mask-plugin@1.14.16/dist/jquery.mask.min.js"></script> --}}
......
@extends('layouts.app')
@section('content')
<div>
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data">
@csrf
<input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container" style="margin-top: 3rem">
<div class="row justify-content-center">
<!-- projeto -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">1º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do projeto</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do projeto</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 10px">
<label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" placeholder="Digite o nome do projeto" value="{{ $projeto->titulo }}" autocomplete="nomeProjeto" autofocus required>
@error('nomeProjeto')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" required>
<option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea)
@if($grandeArea->id === $projeto->grande_area_id)
<option value="{{$grandeArea->id}}" selected>{{$grandeArea->nome}}</option>
@else
<option value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endif
@endforeach
</select>
@error('grandeArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldArea" value="{{ old('area') }}">
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" required>
<option value="" disabled selected hidden>-- Área --</option>
@foreach($areas as $area)
@if($area->id === $projeto->area_id)
<option value="{{$area->id}}" selected>{{$area->nome}}</option>
@else
<option value="{{$area->id}}">{{$area->nome}}</option>
@endif
@endforeach
</select>
@error('area')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="subArea" class="col-form-label">{{ __('Subárea') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldSubArea" value="{{ old('subArea') }}">
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="subArea" required>
<option value="" disabled selected hidden>-- Subárea --</option>
@foreach($subAreas as $subArea)
@if($subArea->id === $projeto->sub_area_id)
<option value="{{$subArea->id}}" selected>{{$subArea->nome}}</option>
@else
<option value="{{$subArea->id}}">{{$subArea->nome}}</option>
@endif
@endforeach
</select>
@error('subArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X projeto X-->
<!-- Proponente -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">2º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do proponente</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do proponente</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 15px">
<label for="nomeCompletoParticipante1">Proponente</label>
<input class="form-control" type="text" id="nomeCoordenador" name="nomeCoordenador" disabled="disabled" value="{{ Auth()->user()->name }}">
</div>
<div class="form-group col-md-4">
<label for="linkLattesEstudante">Link do currículo Lattes<span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('linkLattesEstudante') is-invalid @enderror" type="text" name="linkLattesEstudante" required
@if(Auth()->user()->proponentes != null && Auth()->user()->proponentes->linkLattes != null)
value="{{ Auth()->user()->proponentes->linkLattes }}"
@else
value=""
@endif required>
<small>Ex.: http://lattes.cnpq.br/8363536830656923</small>
@error('linkLattesEstudante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="pontuacaoPlanilha">Valor da planilha de pontuação <span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('pontuacaoPlanilha') is-invalid @enderror" type="number" min= "0" name="pontuacaoPlanilha"
value="{{ $projeto->pontuacaoPlanilha }}" required>
@error('pontuacaoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="linkGrupo">Link do grupo de pesquisa</label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="text" name="linkGrupo"
value="{{ $projeto->linkGrupoPesquisa }}">
<small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
@error('linkGrupo')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Proponente X-->
<!-- Anexos -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">3º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Anexos</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Anexos</h5><small>Para alterar os arquivos envie os novos</small></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-6" style="margin-top: 10px">
<label for="anexoProjeto" class="col-form-label">{{ __('Anexo do projeto') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}">Arquivo atual</a>
@if(old('anexoProjetoPreenchido') != null || (isset($rascunho) && $rascunho->anexoProjeto != ""))
<a id="anexoProjetoTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoProjeto' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoProjeto" name="anexoProjetoPreenchido"
@if( isset($rascunho) && $rascunho->anexoProjeto != "") value="sim" @else value="{{old('anexoProjetoPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoProjeto') is-invalid @enderror" id="anexoProjeto" aria-describedby="inputGroupFileAddon01" name="anexoProjeto" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoProjeto">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoProjeto')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
<label for="anexoLattesCoordenador" class="col-form-label">{{ __('Anexo do currículo Lattes do Coordenador') }} <span style="color: red; font-weight:bold">*</span></label><a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoLattesPreenchido') != null || (isset($rascunho) && $rascunho->anexoLattesCoordenador != ""))
<a id="anexoLattesTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoLattesCoordenador' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoLattesPreenchido" name="anexoLattesPreenchido"
@if( isset($rascunho) && $rascunho->anexoLattesCoordenador != "") value="sim" @else value="{{old('anexoLattesPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoLattesCoordenador') is-invalid @enderror" id="anexoLattesCoordenador" aria-describedby="anexoLattesCoordenador" name="anexoLattesCoordenador" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoLattesCoordenador">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
<small>Dos últimos 5 anos</small>
@error('anexoLattesCoordenador')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanilha" class="col-form-label">{{ __('Anexo da Planilha de Pontuação') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoPlanilhaPreenchido') != null || (isset($rascunho) && $rascunho->anexoPlanilhaPontuacao != ""))
<a id="anexoPlanilhaTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoPlanilhaPontuacao' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoPlanilhaPreenchido" name="anexoPlanilhaPreenchido"
@if( isset($rascunho) && $rascunho->anexoPlanilhaPontuacao != "") value="sim" @else value="{{old('anexoPlanilhaPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanilha') is-invalid @enderror" id="anexoPlanilha" aria-describedby="anexoPlanilhaDescribe" name="anexoPlanilha" onchange="verificarArquivoAnexado_xls_xlsx_ods(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoPlanilha">Formato do arquivo: XLS, XLSX ou ODS de até 2MB.</label>
</div>
</div>
@error('anexoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanilhaPontuacao')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoCONSU" class="col-form-label">{{ __('Decisão do CONSU') }} <span style="color: red; font-weight:bold">*</span></label><a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoConsuPreenchido') != null || (isset($rascunho) && $rascunho->anexoDecisaoCONSU != "" && $rascunho->anexoDecisaoCONSU != null))
<a id="anexoConsuTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoDecisaoCONSU' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoConsuPreenchido" name="anexoConsuPreenchido"
@if( isset($rascunho) && $rascunho->anexoDecisaoCONSU != "") value="sim" @else value="{{old('anexoConsuPreenchido')}}" @endif required>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoCONSU') is-invalid @enderror" id="anexoCONSU" aria-describedby="inputGroupFileAddon01" name="anexoCONSU" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoCONSU">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.comite', ['id' => $projeto->id]) }}"> Arquivo atual</a><br>
<input type="radio" id="radioSim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br>
<span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>Selecione a autorização e envie o arquivo!</strong>
</span>
<div class="form-group" id="displaySim" style="display: none; margin-top:-1rem">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf.">{{ __('Sim, declaro que necessito de autorizações especiais') }}</label>
@error('botao')
<span id="botao" class="invalid-feedback" role="alert" style="overflow: visible; display:inline">
<strong>{{ $message }}</strong>
</span>
@enderror
<br/>
@if(old('anexoComitePreenchido') != null || (isset($rascunho) && $rascunho->anexoAutorizacaoComiteEtica != "" && $rascunho->anexoAutorizacaoComiteEtica != null))
<a id="anexoComiteTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoAutorizacaoComiteEtica' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoComitePreenchido" name="anexoComitePreenchido"
@if( isset($rascunho) && $rascunho->anexoAutorizacaoComiteEtica != "") value="sim" @else value="{{old('anexoComitePreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoComiteEtica') is-invalid @enderror" id="inputEtica" aria-describedby="inputGroupFileAddon01" name="anexoComiteEtica" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="inputEtica">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoComiteEtica')
<span id="comiteErro" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
<label for="nomeTrabalho" class="col-form-label">{{ __('Declaração de que não necessito de autorização especiais') }}</label>
@if(old('anexoJustificativaPreenchido') != null || (isset($rascunho) && $rascunho->justificativaAutorizacaoEtica != "" && $rascunho->justificativaAutorizacaoEtica != null))
<a id="anexoJustificativaTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'justificativaAutorizacaoEtica' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoJustificativaPreenchido" name="anexoJustificativaPreenchido"
@if( isset($rascunho) && $rascunho->justificativaAutorizacaoEtica != "") value="sim" @else value="{{old('anexoJustificativaPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('justificativaAutorizacaoEtica') is-invalid @enderror" id="inputJustificativa" aria-describedby="inputGroupFileAddon01" name="justificativaAutorizacaoEtica" onchange="verificarArquivoAnexado_pdf(this)" >
<label class="custom-file-label" id="custom-file-label" for="inputJustificativa">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('justificativaAutorizacaoEtica')
<span id="justificativaErro" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@php
$resultado_participante_um = array_key_exists(0, $participantes->toArray());
$resultado_participante_dois = array_key_exists(1, $participantes->toArray());
$resultado_participante_tres = array_key_exists(2, $participantes->toArray());
@endphp
<!--X Anexos X-->
<!-- 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-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Área do(s) participante(s)</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; padding:15px; margin-bottom:2rem">
<div class="card-body" style="margin-bottom: -2rem">
<div class="d-flex justify-content-between align-items-center">
<div><h5 style="color: #1492E6; margin-top:0.5rem">Discente(s)</h5></div>
<div><div class="dropdown">
<button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenuButtonAlterar" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="display: none">
Selecionar
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButtonAlterar">
<a type="button" class="dropdown-item" onclick="alterarFormacao(1)">1 Participante</a>
<a type="button" class="dropdown-item" onclick="alterarFormacao(2)">2 Participantes</a>
<a type="button" class="dropdown-item" onclick="alterarFormacao(3)">3 Participantes</a>
</div>
</div></div>
</div>
<div style="margin-top:-10px"><hr style="border-top: 1px solid#1492E6"></div>
</div>
<div class="card-body" id="selecaoParticipantes" style="text-align: center; display:block; margin-top:1rem">
<div><h5>Selecione o número de participantes do projeto</h5></div>
<div class="btn-group" style="text-align:center">
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('1')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_1_participantes.png')}}" alt="Logo" style="width: 25px" /></div>
<div class="col-md-12" style="margin-top: 10px; margin-bottom:5px"><h6>1 Participante</h6></div>
</div>
</button>
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('2')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_2_participantes.png')}}" alt="Logo" style="width: 60px" /></div>
<div class="col-md-12" style="margin-top: 10px; margin-bottom:5px"><h6>2 Participantes</h6></div>
</div>
</button>
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('3')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_3_participantes.png')}}" alt="Logo" style="width: 90px" /></div>
<div class="col-md-12" style="margin-top: 13px; margin-bottom:5px"><h6>3 Participantes</h6></div>
</div>
</button>
</div>
</div>
<div class="card-body">
<div id="participante1" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12"><h5>Clique em um dos participantes para preencher os dados</h5></div>
<div class="col-md-12">
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante1" role="button" aria-expanded="false" aria-controls="collapseParticipante1" id="buttonParticipante1" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="buttonTitulo1" style="color: #01487E; font-size:17px; margin-top:5px">Participante 1</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_um){{$participantes[0]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante1">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante1">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante1') is-invalid @enderror" id="nomeCompletoParticipante1" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->name}}@endif">
@error('nomeCompletoParticipante1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="email1">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email1') is-invalid @enderror" id="email1" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->email}}@endif">
@error('email')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="data1">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data1') is-invalid @enderror" id="data1" name="data_de_nascimento[]" required value="@if($resultado_participante_um){{$participantes[0]->data_de_nascimento}}@endif">
@error('data1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf1">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf1') is-invalid @enderror cpf" id="cpf1" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->cpf}}@endif">
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg1">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg1') is-invalid @enderror" id="rg1" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_um){{$participantes[0]->rg}}@endif">
@error('rg1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular1">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular1') is-invalid @enderror" id="celular1" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->celular}}@endif">
@error('celular1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep1">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep1') is-invalid @enderror" id="cep1" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->cep}}@endif">
@error('cep1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado1">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado1" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade1">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade1') is-invalid @enderror" id="cidade1" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->cidade}}@endif">
@error('cidade1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro1">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro1') is-invalid @enderror" id="bairro1" name="bairro[]" placeholder="Digite o nome do bairro"required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->bairro}}@endif">
@error('bairro1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua1">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua1') is-invalid @enderror" id="rua1" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..." required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->rua}}@endif">
@error('rua1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero1">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero1') is-invalid @enderror" id="numero1" name="numero[]" placeholder="Digite o número" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->numero}}@endif">
@error('numero1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento1">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento1') is-invalid @enderror" id="complemento1" name="complemento[]" placeholder="Apartamento, casa, sítio..." required>@if($resultado_participante_um){{$participantes[0]->user->endereco->complemento}}@endif</textarea>
@error('complemento1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade1">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade1') is-invalid @enderror" id="universidade1" name="universidade[]" placeholder="Digite o nome da universidade" required value="@if($resultado_participante_um){{$participantes[0]->user->instituicao}}@endif">
@error('universidade1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso1">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso1') is-invalid @enderror" id="curso1" name="curso[]" placeholder="Digite o nome do curso" required value="@if($resultado_participante_um){{$participantes[0]->curso}}@endif">
@error('curso1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno1">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno1" class="form-control" name="turno[]" >
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_um && $participantes[0]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos1">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos1" class="form-control" onchange="gerarPeriodos1(this)" >
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual1">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual1" class="form-control" >
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_um && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[0]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade1">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade1" class="form-control" >
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento1">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control" id="coeficienteDeRendimento1" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_um){{$participantes[0]->media_do_curso}}@endif">
@error('coeficienteDeRendimento1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo1">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_um)<a href="{{ route('baixar.plano', ['id' => $participantes[0]->planoTrabalho->id]) }}"> {{$participantes[0]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo1') is-invalid @enderror" id="titulo1" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho">
@error('titulo1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
<small>Para alterar o trabalho envie um novo com o titulo</small>
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho1">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoDeTrabalho1" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="anexoPlanoDeTrabalho1" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="posicaoParticipante2"></div>
<div id="participante2" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12">
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante2" role="button" aria-expanded="false" aria-controls="collapseParticipante2" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 style="color: #01487E; font-size:17px; margin-top:5px">Participante 2</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_dois){{$participantes[1]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante2">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante2">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante2') is-invalid @enderror" id="nomeCompletoParticipante2" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->name}}@endif">
@error('nomeCompletoParticipante2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="email2">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email2') is-invalid @enderror" id="email2" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->email}}@endif">
@error('email2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="data2">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data2') is-invalid @enderror" id="data2" name="data_de_nascimento[]" required value="@if($resultado_participante_dois){{$participantes[1]->data_de_nascimento}}@endif">
@error('data2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf2">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf2') is-invalid @enderror cpf" id="cpf2" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->cpf}}@endif">
<span id="cpf-invalido-2" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-2" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg2">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg2') is-invalid @enderror" id="rg2" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_dois){{$participantes[1]->rg}}@endif">
@error('rg2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular2">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular2') is-invalid @enderror" id="celular2" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->celular}}@endif">
@error('celular2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep2">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep2') is-invalid @enderror" id="cep2" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->cep}}@endif">
@error('cep2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado2">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado2" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade2">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade2') is-invalid @enderror" id="cidade2" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->cidade}}@endif">
@error('cidade2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro2">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro2') is-invalid @enderror" id="bairro2" name="bairro[]" placeholder="Digite o nome do bairro" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->bairro}}@endif">
@error('bairro2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua2">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua2') is-invalid @enderror" id="rua2" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..." required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->rua}}@endif">
@error('rua2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero2">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero2') is-invalid @enderror" id="numero2" name="numero[]" placeholder="Digite o número" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->numero}}@endif">
@error('numero2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento2">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento2') is-invalid @enderror" id="complemento2" name="complemento[]" placeholder="Apartamento, casa, sítio..." required>@if($resultado_participante_dois){{$participantes[1]->user->endereco->complemento}}@endif</textarea>
@error('complemento2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade2">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade2') is-invalid @enderror" id="universidade2" name="universidade[]" placeholder="Digite o nome da universidade" required value="@if($resultado_participante_dois){{$participantes[1]->user->instituicao}}@endif">
@error('universidade2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso2">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso2') is-invalid @enderror" id="curso2" name="curso[]" placeholder="Digite o nome do curso" required value="@if($resultado_participante_dois){{$participantes[1]->curso}}@endif">
@error('curso2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno2">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno2" class="form-control" name="turno[]" required>
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_dois && $participantes[1]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos2">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos2" class="form-control" onchange="gerarPeriodos1(this)" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual2">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual2" class="form-control" required >
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_dois && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[1]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade2">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade2" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento2">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control media" id="coeficienteDeRendimento2" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_dois){{$participantes[1]->media_do_curso}}@endif">
@error('coeficienteDeRendimento2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo2">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_dois)<a href="{{ route('baixar.plano', ['id' => $participantes[1]->planoTrabalho->id]) }}"> {{$participantes[1]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo2') is-invalid @enderror" id="titulo2" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@error('titulo2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho2">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoDeTrabalho2" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)" required>
<label class="custom-file-label" id="anexoPlanoDeTrabalho2" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="posicaoParticipante3"></div>
<div id="participante3" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12">
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante3" role="button" aria-expanded="false" aria-controls="collapseParticipante3" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 style="color: #01487E; font-size:17px; margin-top:5px">Participante 3</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_tres){{$participantes[2]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante3">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante3">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante3') is-invalid @enderror" id="nomeCompletoParticipante3" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->name}}@endif">
@error('nomeCompletoParticipante3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="email3">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email3') is-invalid @enderror" id="email3" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->email}}@endif">
@error('email3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="data3">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data3') is-invalid @enderror" id="data3" name="data_de_nascimento[]" required value="@if($resultado_participante_tres){{$participantes[2]->data_de_nascimento}}@endif">
@error('data3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf3">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf3') is-invalid @enderror cpf" id="cpf3" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->cpf}}@endif">
<span id="cpf-invalido-3" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-3" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg3">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg3') is-invalid @enderror" id="rg3" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_tres){{$participantes[2]->rg}}@endif">
@error('rg3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular3">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular3') is-invalid @enderror" id="celular3" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->celular}}@endif">
@error('celular3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep3">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep3') is-invalid @enderror" id="cep3" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->cep}}@endif">
@error('cep3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado3">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado3" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade3">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade3') is-invalid @enderror" id="cidade3" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->cidade}}@endif">
@error('cidade3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro3">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro3') is-invalid @enderror" id="bairro3" name="bairro[]" placeholder="Digite o nome do bairro" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->bairro}}@endif">
@error('bairro3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua3">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua3') is-invalid @enderror" id="rua3" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..."required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->rua}}@endif">
@error('rua3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero3">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero3') is-invalid @enderror" id="numero3" name="numero[]" placeholder="Digite o número"required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->numero}}@endif">
@error('numero3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento3">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento3') is-invalid @enderror" id="complemento3" name="complemento[]" placeholder="Apartamento, casa, sítio..."required>@if($resultado_participante_tres){{$participantes[2]->user->endereco->complemento}}@endif</textarea>
@error('complemento3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade3">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade3') is-invalid @enderror" id="universidade3" name="universidade[]" placeholder="Universidade" required value="@if($resultado_participante_tres){{$participantes[2]->instituicao}}@endif">
@error('universidade3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso3">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso3') is-invalid @enderror" id="curso3" name="curso[]" placeholder="curso" required value="@if($resultado_participante_tres){{$participantes[2]->curso}}@endif">
@error('curso3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno3">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno3" class="form-control" required name="turno[]">
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_tres && $participantes[2]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos3">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos3" class="form-control" onchange="gerarPeriodos1(this)" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual3">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual3" class="form-control" required>
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_tres && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[2]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade3">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade3" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento3">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control media" id="coeficienteDeRendimento3" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_tres){{$participantes[2]->media_do_curso}}@endif">
@error('coeficienteDeRendimento3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo3">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_tres)<a href="{{ route('baixar.plano', ['id' => $participantes[2]->planoTrabalho->id]) }}"> {{$participantes[2]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo3') is-invalid @enderror" id="titulo3" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@error('titulo3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho3">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho3') is-invalid @enderror" id="anexoPlanoDeTrabalho3" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)" required>
<label class="custom-file-label" id="anexoPlanoDeTrabalho1" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Participantes X-->
<!-- Finalizar -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">5º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Finalizar</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Finalizar</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
</div>
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button type="submit" id="clickSubmitForm" style="display: none"></button>
<button type="button" class="btn btn-success" id="idButtonSubmitProjeto" onclick="enviarModalenviarProjeto()" disabled>{{ __('Enviar Projeto') }}</button>
</div>
</div>
</div>
</div>
</div>
<!--X Finalizar X-->
</div>
</div>
</form>
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" id="idCorCabecalhoModalDocumento">
<h5 class="modal-title" id="exampleModalLabel2" style="font-size:20px; margin-top:7px; color:white; font-weight:bold; font-family: 'Roboto', sans-serif;">Aviso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div>
<div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalSubmit" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
<button type="button" class="close" onclick="fecharModalenviarProjeto()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="fecharModalenviarProjeto()">Close</button>
<button type="button" class="btn btn-primary" onclick="enviarModalenviarProjeto()">Enviar projeto</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color: red;">
<h5 class="modal-title" id="exampleModalLabel2" style="font-size:20px; margin-top:7px; color:white; font-weight:bold; font-family: 'Roboto', sans-serif;">Aviso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Existe um CPF inválido em um dos participantes por favor corrija para continuar.
</div>
{{-- <div class="modal-footer">
{{-- <button type="button" class="btn btn-secondary"></button>
{{-- <button type="button" class="btn btn-primary">Certo</button>
</div> --}}
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
/*
* GLOBAL
*/
var numeroDeParticipantes;
var tempPart1;
var tempPart2;
var tempPart3;
tempPart1 = document.getElementById("participante1");
tempPart2 = document.getElementById("participante2");
tempPart3 = document.getElementById("participante3");
$(document).ready(function () {
selecionarParticipantes("{{$participantes->count()}}");
});
/*
* FUNCAO: Mostrar no input o arquivo selecionado
*
*/
$('.custom-file-input').on('change', function() {
var fieldVal = $(this).val();
// Change the node's value by removing the fake path (Chrome)
fieldVal = fieldVal.replace("C:\\fakepath\\", "");
if (fieldVal != undefined || fieldVal != "") {
$(this).next(".custom-file-label").attr('data-content', fieldVal);
$(this).next(".custom-file-label").text(fieldVal);
}
})
/*
* FUNCAO: Gerar as areas
*
*/
function areas() {
var grandeArea = $('#grandeArea').val();
$.ajax({
type: 'POST',
url: '{{ route('area.consulta') }}',
data: 'id='+grandeArea ,
headers:
{
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: (dados) => {
if (dados.length > 0) {
if($('#oldArea').val() == null || $('#oldArea').val() == ""){
var option = '<option selected disabled>-- Área --</option>';
}
$.each(dados, function(i, obj) {
if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{
option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
}
})
} else {
var option = "<option selected disabled>-- Área --</option>";
}
$('#area').html(option).show();
subareas();
},
error: (data) => {
console.log(data);
}
})
}
/*
* FUNCAO: Gerar as subareas
*
*/
function subareas() {
var area = $('#area').val();
$.ajax({
type: 'POST',
url: '{{ route('subarea.consulta') }}',
data: 'id='+area ,
headers:
{
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: (dados)=> {
if (dados.length > 0) {
if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){
var option = '<option selected disabled>-- Subárea --</option>';
}
$.each(dados, function(i, obj) {
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}else{
option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
}
})
} else {
var option = "<option selected disabled>-- Subárea --</option>";
}
$('#subArea').html(option).show();
},
error: (dados) => {
console.log(dados);
}
})
}
/*
* FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
*
*/
function displayAutorizacoesEspeciais(valor){
if(valor == "sim"){
document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = false;
document.getElementById("displaySim").style.display = "block";
document.getElementById("displayNao").style.display = "none";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
}else if(valor == "nao"){
document.getElementById("radioSim").checked = false;
document.getElementById("radioNao").checked = true;
document.getElementById("displaySim").style.display = "none";
document.getElementById("displayNao").style.display = "block";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
}
}
/*
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
*
*/
function verificarArquivoAnexado_pdf(item){
var anexado = true;
if(item.files[0].type.split('/')[1] != "pdf"){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo PDF! ";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
anexado = false;
}else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
anexado = false;
}
if (anexado && item.id == "anexoPlanoDeTrabalho1") {
document.getElementById('titulo1').required = true;
} else if (anexado && item.id == "anexoPlanoDeTrabalho2") {
document.getElementById('titulo2').required = true;
} else if (anexado && item.id == "anexoPlanoDeTrabalho3") {
document.getElementById('titulo3').required = true;
}
}
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
*
*/
function verificarArquivoAnexado_xls_xlsx_ods(item){
if(item.files[0].name.split('.')[1] == "xls" || item.files[0].name.split('.')[1] == "ods" || item.files[0].name.split('.')[1] == "xlsx"){
if(item.files[0].size > 2000000){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
}
}else{
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo XLS, XLSX ou ODS! ";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
}
}
/*
* FUNCAO: Gerar periodos
*
*/
function gerarPeriodos1(select) {
var div = select.parentElement.parentElement;
var selectPeriodos = div.children[21].children[1];
var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`;
for(var i = 0; i < parseInt(select.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`;
}
$(selectPeriodos).html('');
$(selectPeriodos).append(html);
}
/*
* FUNCAO: Selecionar participantes do projeto
*
*/
function selecionarParticipantes(quantidade){
if(quantidade == "1"){
numeroDeParticipantes = 1;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
document.getElementById("participante3").remove();
document.getElementById("selecaoParticipantes").style.display ="none";
}else if(quantidade == 2){
numeroDeParticipantes = 2;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").remove();
document.getElementById("selecaoParticipantes").style.display ="none";
}else if(quantidade == 3){
numeroDeParticipantes = 3;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").style.display ="block";
document.getElementById("selecaoParticipantes").style.display ="none";
}
//mostrar botao alterar
document.getElementById("dropdownMenuButtonAlterar").style.display = "block";
// habilitar botao submeter projeto
document.getElementById("idButtonSubmitProjeto").disabled = false;
}
/*
* FUNCAO: abrir modal para enviar o trabalho
*/
function abrirModalenviarProjeto(){
if(validarForm() == true){
//fecharModalenviarProjeto();
}else{
document.getElementById("modalSubmit").classList.add("show");
document.getElementById("modalSubmit").style.display="block";
document.getElementById("modalSubmit").style.backgroundColor="rgba(0, 0, 0, 0.5)";
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
}
}
/*
* FUNCAO: fechar modal para enviar o trabalho
*/
function fecharModalenviarProjeto(){
document.getElementById("modalSubmit").classList.remove("show");
document.getElementById("modalSubmit").style.display="none";
document.getElementById("modalSubmit").style.backgroundColor="rgba(0, 0, 0, 0.5)";
//document.getElementById("collapseParticipante1").classList.remove("show");
//document.getElementById("collapseParticipante2").classList.remove("show");
//document.getElementById("collapseParticipante3").classList.remove("show");
}
/*
* FUNCAO: enviar modal
*
*/
function enviarModalenviarProjeto(){
if(numeroDeParticipantes == 1){
document.getElementById("collapseParticipante1").classList.add("show");
}else if(numeroDeParticipantes == 2){
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
}else if(numeroDeParticipantes == 3){
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
}
if (checarCpfs()) {
document.getElementById("clickSubmitForm").click();
} else {
$("#modalCpfInvalido").modal('show');
}
}
/*
* FUNCAO: Formacao dos participantes
*
*/
function alterarFormacao(quero){
//console.log(numeroDeParticipantes);
if(numeroDeParticipantes == 1 && quero == 2){
var container = document.getElementById("posicaoParticipante2");
container.append(tempPart2);
document.getElementById("participante2").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 1 && quero == 3){
var container2 = document.getElementById("posicaoParticipante2");
container2.append(tempPart2);
var container3 = document.getElementById("posicaoParticipante3");
container3.append(tempPart3);
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 2 && quero == 1){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 2 && quero == 3){
var container3 = document.getElementById("posicaoParticipante3");
container3.append(tempPart3);
document.getElementById("participante3").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 3 && quero == 1){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
document.getElementById("participante3").remove();
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 3 && quero == 2){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante3").remove();
numeroDeParticipantes = quero;
}
}
/* FUNCAO: validar campos
*
*/
$(document).ready(aplicarMascaras());
function aplicarMascaras() {
$('#cpf1').mask('000.000.000-00');
$('#cpf2').mask('000.000.000-00');
$('#cpf3').mask('000.000.000-00');
$('#rg1').mask('00000000');
$('#rg2').mask('00000000');
$('#rg3').mask('00000000');
$('#celular1').mask('(00) 00000-0000');
$('#celular2').mask('(00) 00000-0000');
$('#celular3').mask('(00) 00000-0000');
$('#cep1').mask('00000-000');
$('#cep2').mask('00000-000');
$('#cep3').mask('00000-000');
}
function validarForm(){
/*var buttonRadioSim = document.getElementById("radioSim");
var buttonRadioNao = document.getElementById("radioNao");
//button radio
if(buttonRadioSim.checked == false && buttonRadioNao.checked == false){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "block";
document.getElementById("idAvisoAutorizacaoEspecial").autofocus;
}
//participantes
var part1 = document.getElementById("participante1").style.visibility;
var part2 = document.getElementById("participante1").style.visibility;
var part3 = document.getElementById("participante1").style.visibility;
*/
/*
document.getElementById("modalSubmit").classList.add("show");
document.getElementById("modalSubmit").style.display="block";
document.getElementById("modalSubmit").style.backgroundColor="black";
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
//document.getElementById("collapseParticipante1").classList.remove = "collapsed";
*/
}
function validarPart1(){
//participante 1
var nome1 = document.getElementById("nomeCompletoParticipante1");
var email1 = document.getElementById("email1");
var data1 = document.getElementById("data1");
var cpf1 = document.getElementById("cpf1");
var rg1 = document.getElementById("rg1");
var celular1 = document.getElementById("celular1");
var cep1 = document.getElementById("cep1");
var estado1 = document.getElementById("estado1");
var cidade1 = document.getElementById("cidade1");
var bairro1 = document.getElementById("bairro1");
var rua1 = document.getElementById("rua1");
var numero1 = document.getElementById("numero1");
var complemento1 = document.getElementById("complemento1");
var universidade1 = document.getElementById("universidade1");
var curso1 = document.getElementById("curso1");
var turno1 = document.getElementById("turno1");
var totalDePeriodos1 = document.getElementById("totalDePeriodos1");
var periodoAtual1 = document.getElementById("periodoAtual1");
var ordemDePrioridade1 = document.getElementById("ordemDePrioridade1");
var coeficineteDeRendimento1 = document.getElementById("coeficienteDeRendimento1");
var tituloPlanoDeTrabalho1 = document.getElementById("titulo1");
var anexoPlanoDeTrabalho1 = document.getElementById("anexoPlanoDeTrabalho1");
//validacao dos campos - participante 1
if(nome1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
nome1.focus();
return true;
}else if(email1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
email1.focus();
return true;
}else if(data1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
data1.focus();
return true;
}else if(cpf1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cpf1.focus();
return true;
}else if(rg1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
rg1.focus();
return true;
}else if(celular1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
celular1.focus();
return true;
}else if(cep1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cep1.focus();
return true;
}else if(estado1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
estado1.focus();
return true;
}else if(cidade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cidade1.focus();
return true;
}else if(bairro1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
bairro1.focus();
return true;
}else if(rua1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
rua1.focus();
return true;
}else if(numero1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
numero1.focus();
return true;
}else if(complemento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
complemento1.focus();
return true;
}else if(complemento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
complemento1.focus();
return true;
}else if(universidade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
universidade1.focus();
return true;
}else if(curso1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
curso1.focus();
return true;
}else if(turno1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
turno1.focus();
return true;
}else if(totalDePeriodos1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
totalDePeriodos1.focus();
return true;
}else if(periodoAtual1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
periodoAtual1.focus();
return true;
}else if(ordemDePrioridade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade1.focus();
return true;
}else if(coeficineteDeRendimento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento1.focus();
return true;
}else if(tituloPlanoDeTrabalho1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho1.focus();
return true;
}else if(anexoPlanoDeTrabalho1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho1.focus();
return true;
}
}
function validarPart2(){
//participante 2
var nome2 = document.getElementById("nomeCompletoParticipante2");
var email2 = document.getElementById("email2");
var data2 = document.getElementById("data2");
var cpf2 = document.getElementById("cpf2");
var rg2 = document.getElementById("rg2");
var celular2 = document.getElementById("celular2");
var cep2 = document.getElementById("cep2");
var estado2 = document.getElementById("estado2");
var cidade2 = document.getElementById("cidade2");
var bairro2 = document.getElementById("bairro2");
var rua2 = document.getElementById("rua2");
var numero2 = document.getElementById("numero2");
var complemento2 = document.getElementById("complemento2");
var universidade2 = document.getElementById("universidade2");
var curso2 = document.getElementById("curso2");
var turno2 = document.getElementById("turno2");
var totalDePeriodos2 = document.getElementById("totalDePeriodos2");
var periodoAtual2 = document.getElementById("periodoAtual2");
var ordemDePrioridade2 = document.getElementById("ordemDePrioridade2");
var coeficineteDeRendimento2 = document.getElementById("coeficienteDeRendimento2");
var tituloPlanoDeTrabalho2 = document.getElementById("titulo2");
var anexoPlanoDeTrabalho2 = document.getElementById("anexoPlanoDeTrabalho2");
//validacao dos campos - participante 2
if(nome2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
nome2.focus();
return true;
} else if(email2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
email2.focus();
return true;
}else if(data2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
data2.focus();
return true;
}else if(cpf2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
cpf2.focus();
return true;
}else if(rg2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
rg2.focus();
return true;
}else if(celular2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
celular2.focus();
return true;
}else if(cep2.value == ""){
document.getElementById("colapseParticipante2").classList.add("show");
//alert("Nome não informado");
cep2.focus();
return true;
}else if(estado2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
estado2.focus();
return true;
}else if(cidade2.value == ""){
console.log(cidade2.value)
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
cidade2.focus();
return true;
}else if(bairro2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
bairro2.focus();
return true;
}else if(rua2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
rua2.focus();
return true;
}else if(numero2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
numero2.focus();
return true;
}else if(complemento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
complemento2.focus();
return true;
}else if(complemento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
complemento2.focus();
return true;
}else if(universidade2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
universidade2.focus();
return true;
}else if(curso2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
curso2.focus();
return true;
}else if(turno2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
turno2.focus();
return true;
}else if(totalDePeriodos2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
totalDePeriodos2.focus();
return true;
}else if(periodoAtual2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
periodoAtual2.focus();
return true;
}else if(ordemDePrioridade2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade2.focus();
return true;
}else if(coeficineteDeRendimento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento2.focus();
return true;
}else if(tituloPlanoDeTrabalho2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho2.focus();
return true;
}else if(anexoPlanoDeTrabalho2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho2.focus();
return true;
}
}
function validarPart3(){
//participante 3
var nome3 = document.getElementById("nomeCompletoParticipante3");
var email3 = document.getElementById("email3");
var data3 = document.getElementById("data3");
var cpf3 = document.getElementById("cpf3");
var rg3 = document.getElementById("rg3");
var celular3 = document.getElementById("celular3");
var cep3 = document.getElementById("cep3");
var estado3 = document.getElementById("estado3");
var cidade3 = document.getElementById("cidade3");
var bairro3 = document.getElementById("bairro3");
var rua3 = document.getElementById("rua3");
var numero3 = document.getElementById("numero3");
var complemento3 = document.getElementById("complemento3");
var universidade3 = document.getElementById("universidade3");
var curso3 = document.getElementById("curso3");
var turno3 = document.getElementById("turno3");
var totalDePeriodos3 = document.getElementById("totalDePeriodos3");
var periodoAtual3 = document.getElementById("periodoAtual3");
var ordemDePrioridade3 = document.getElementById("ordemDePrioridade3");
var coeficineteDeRendimento3 = document.getElementById("coeficienteDeRendimento3");
var tituloPlanoDeTrabalho3 = document.getElementById("titulo3");
var anexoPlanoDeTrabalho3 = document.getElementById("anexoPlanoDeTrabalho3");
//validacao dos campos - participante 3
if(nome3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
nome3.focus();
return true;
}else if(email3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
email3.focus();
return true;
}else if(data3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
data3.focus();
return true;
}else if(cpf3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cpf3.focus();
return true;
}else if(rg3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
rg3.focus();
return true;
}else if(celular3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
celular3.focus();
return true;
}else if(cep3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cep3.focus();
return true;
}else if(estado3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
estado3.focus();
return true;
}else if(cidade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cidade3.focus();
return true;
}else if(bairro3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
bairro3.focus();
return true;
}else if(rua3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
rua3.focus();
return true;
}else if(numero3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
numero3.focus();
return true;
}else if(complemento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
complemento3.focus();
return true;
}else if(complemento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
complemento3.focus();
return true;
}else if(universidade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
universidade3.focus();
return true;
}else if(curso3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
curso3.focus();
return true;
}else if(turno3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
turno3.focus();
return true;
}else if(totalDePeriodos3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
totalDePeriodos3.focus();
return true;
}else if(periodoAtual3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
periodoAtual3.focus();
return true;
}else if(ordemDePrioridade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade3.focus();
return true;
}else if(coeficineteDeRendimento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento3.focus();
return true;
}else if(tituloPlanoDeTrabalho3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho3.focus();
return true;
}else if(anexoPlanoDeTrabalho3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho3.focus();
return true;
}
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
// $("#button").click(function(e){
// e.preventDefault();
// $.ajax({
// headers: {
// 'X-CSRF-Token': $('input[name="_token"]').val()
// },
// url: "{{route('trabalho.store')}}",
// type: 'post',
// enctype: 'multipart/form-data',
// success: function(result){
// console.log("success")
// console.log(result)
// },
// erro: (xhr,status,error) => {
// console.log("erro")
// }
// });
// });
$(document).ready(function(){
$(".cpf").change(function(){
if (validarCPF(retirarFormatacao(this.value))) {
this.parentElement.children[2].style.display = "none";
this.parentElement.children[3].style.display = "block";
} else {
this.parentElement.children[2].style.display = "block";
this.parentElement.children[3].style.display = "none";
}
});
});
function validarCPF(strCPF) {
var soma;
var resto;
soma = 0;
// Verifica se foi informado todos os digitos corretamente
if (strCPF.length != 11) {
return false;
}
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
if (varificarDigitos(strCPF)) {
return false;
}
// Faz o calculo para validar o CPF
for (var t = 9; t < 11; t++) {
for (var d = 0, c = 0; c < t; c++) {
d += strCPF[c] * ((t + 1) - c);
}
d = ((10 * d) % 11) % 10;
if (strCPF[c] != d) {
return false;
}
}
return true;
}
function retirarFormatacao(strCpf) {
resultado = "";
for(var i = 0; i < strCpf.length; i++) {
if (strCpf[i] != "." && strCpf[i] != "-") {
resultado += strCpf[i];
}
}
return resultado;
}
function varificarDigitos(strCpf) {
var cont = 1;
dig1 = strCpf[0];
for(var i = 1; i < strCpf.length; i++) {
if(dig1 == strCpf[i]) {
cont++;
}
}
if (cont == strCpf.length) {
return true;
}
return false;
}
function checarCpfs() {
var validacoes = document.getElementsByClassName("cpf-invalido");
var count = validacoes.length;
var quant = 0;
for(var i = 0; i < validacoes.length; i++) {
if (validacoes[i].style.display == "none") {
quant++;
}
}
if(quant == count) {
return true;
}
return false;
}
</script>
@endsection
@extends('layouts.app')
@section('content')
<div>
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data">
{{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" >
@csrf
<input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container" style="margin-top: 3rem">
<div class="row justify-content-center">
<!-- projeto -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">1º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do projeto</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do projeto</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 10px">
<label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" placeholder="Digite o nome do projeto" value="{{ $projeto->titulo }}" autocomplete="nomeProjeto" autofocus required>
@error('nomeProjeto')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" required>
<option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea)
@if($grandeArea->id === $projeto->grande_area_id)
<option value="{{$grandeArea->id}}" selected>{{$grandeArea->nome}}</option>
@else
<option value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endif
@endforeach
</select>
@error('grandeArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldArea" value="{{ old('area') }}">
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" required>
<option value="" disabled selected hidden>-- Área --</option>
@foreach($areas as $area)
@if($area->id === $projeto->area_id)
<option value="{{$area->id}}" selected>{{$area->nome}}</option>
@else
<option value="{{$area->id}}">{{$area->nome}}</option>
@endif
@endforeach
</select>
@error('area')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="subArea" class="col-form-label">{{ __('Subárea') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldSubArea" value="{{ old('subArea') }}">
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="subArea" required>
<option value="" disabled selected hidden>-- Subárea --</option>
@foreach($subAreas as $subArea)
@if($subArea->id === $projeto->sub_area_id)
<option value="{{$subArea->id}}" selected>{{$subArea->nome}}</option>
@else
<option value="{{$subArea->id}}">{{$subArea->nome}}</option>
@endif
@endforeach
</select>
@error('subArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X projeto X-->
<!-- Proponente -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">2º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do proponente</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do proponente</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 15px">
<label for="nomeCompletoParticipante1">Proponente</label>
<input class="form-control" type="text" id="nomeCoordenador" name="nomeCoordenador" disabled="disabled" value="{{ Auth()->user()->name }}">
</div>
<div class="form-group col-md-4">
<label for="linkLattesEstudante">Link do currículo Lattes<span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('linkLattesEstudante') is-invalid @enderror" type="text" name="linkLattesEstudante" required
@if(Auth()->user()->proponentes != null && Auth()->user()->proponentes->linkLattes != null)
value="{{ Auth()->user()->proponentes->linkLattes }}"
@else
value=""
@endif required>
<small>Ex.: http://lattes.cnpq.br/8363536830656923</small>
@error('linkLattesEstudante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="pontuacaoPlanilha">Valor da planilha de pontuação <span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('pontuacaoPlanilha') is-invalid @enderror" type="number" min= "0" name="pontuacaoPlanilha"
value="{{ $projeto->pontuacaoPlanilha }}" required>
@error('pontuacaoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="linkGrupo">Link do grupo de pesquisa</label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="text" name="linkGrupo"
value="{{ $projeto->linkGrupoPesquisa }}">
<small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
@error('linkGrupo')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Proponente X-->
<!-- Anexos -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">3º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Anexos</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; margin-bottom:2rem">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Anexos</h5><small>Para alterar os arquivos envie os novos</small></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-6" style="margin-top: 10px">
<label for="anexoProjeto" class="col-form-label">{{ __('Anexo do projeto') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}">Arquivo atual</a>
@if(old('anexoProjetoPreenchido') != null || (isset($rascunho) && $rascunho->anexoProjeto != ""))
<a id="anexoProjetoTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoProjeto' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoProjeto" name="anexoProjetoPreenchido"
@if( isset($rascunho) && $rascunho->anexoProjeto != "") value="sim" @else value="{{old('anexoProjetoPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoProjeto') is-invalid @enderror" id="anexoProjeto" aria-describedby="inputGroupFileAddon01" name="anexoProjeto" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoProjeto">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoProjeto')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
<label for="anexoLattesCoordenador" class="col-form-label">{{ __('Anexo do currículo Lattes do Coordenador') }} <span style="color: red; font-weight:bold">*</span></label><a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoLattesPreenchido') != null || (isset($rascunho) && $rascunho->anexoLattesCoordenador != ""))
<a id="anexoLattesTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoLattesCoordenador' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoLattesPreenchido" name="anexoLattesPreenchido"
@if( isset($rascunho) && $rascunho->anexoLattesCoordenador != "") value="sim" @else value="{{old('anexoLattesPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoLattesCoordenador') is-invalid @enderror" id="anexoLattesCoordenador" aria-describedby="anexoLattesCoordenador" name="anexoLattesCoordenador" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoLattesCoordenador">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
<small>Dos últimos 5 anos</small>
@error('anexoLattesCoordenador')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanilha" class="col-form-label">{{ __('Anexo da Planilha de Pontuação') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoPlanilhaPreenchido') != null || (isset($rascunho) && $rascunho->anexoPlanilhaPontuacao != ""))
<a id="anexoPlanilhaTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoPlanilhaPontuacao' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoPlanilhaPreenchido" name="anexoPlanilhaPreenchido"
@if( isset($rascunho) && $rascunho->anexoPlanilhaPontuacao != "") value="sim" @else value="{{old('anexoPlanilhaPreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanilha') is-invalid @enderror" id="anexoPlanilha" aria-describedby="anexoPlanilhaDescribe" name="anexoPlanilha" onchange="verificarArquivoAnexado_xls_xlsx_ods(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoPlanilha">Formato do arquivo: XLS, XLSX ou ODS de até 2MB.</label>
</div>
</div>
@error('anexoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanilhaPontuacao')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoCONSU" class="col-form-label">{{ __('Decisão do CONSU') }} <span style="color: red; font-weight:bold">*</span></label><a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"> Arquivo atual</a>
@if(old('anexoConsuPreenchido') != null || (isset($rascunho) && $rascunho->anexoDecisaoCONSU != "" && $rascunho->anexoDecisaoCONSU != null))
<a id="anexoConsuTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoDecisaoCONSU' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoConsuPreenchido" name="anexoConsuPreenchido"
@if( isset($rascunho) && $rascunho->anexoDecisaoCONSU != "") value="sim" @else value="{{old('anexoConsuPreenchido')}}" @endif required>
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoCONSU') is-invalid @enderror" id="anexoCONSU" aria-describedby="inputGroupFileAddon01" name="anexoCONSU" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="anexoCONSU">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label> <a href="{{ route('baixar.anexo.comite', ['id' => $projeto->id]) }}"> Arquivo atual</a><br>
<input type="radio" id="radioSim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br>
<span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>Selecione a autorização e envie o arquivo!</strong>
</span>
<div class="form-group" id="displaySim" style="display: none; margin-top:-1rem">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf.">{{ __('Sim, declaro que necessito de autorizações especiais') }}</label>
@error('botao')
<span id="botao" class="invalid-feedback" role="alert" style="overflow: visible; display:inline">
<strong>{{ $message }}</strong>
</span>
@enderror
<br/>
@if(old('anexoComitePreenchido') != null || (isset($rascunho) && $rascunho->anexoAutorizacaoComiteEtica != "" && $rascunho->anexoAutorizacaoComiteEtica != null))
<a id="anexoComiteTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'anexoAutorizacaoComiteEtica' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoComitePreenchido" name="anexoComitePreenchido"
@if( isset($rascunho) && $rascunho->anexoAutorizacaoComiteEtica != "") value="sim" @else value="{{old('anexoComitePreenchido')}}" @endif >
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoComiteEtica') is-invalid @enderror" id="inputEtica" aria-describedby="inputGroupFileAddon01" name="anexoComiteEtica" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="custom-file-label" for="inputEtica">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('anexoComiteEtica')
<span id="comiteErro" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>{{ $message }}</strong>
</span>
@enderror
@if (session('mensagem'))
<div class="alert alert-warning" role="alert">
{{ session('mensagem') }}
</div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
<label for="nomeTrabalho" class="col-form-label">{{ __('Declaração de que não necessito de autorização especiais') }}</label>
@if(old('anexoJustificativaPreenchido') != null || (isset($rascunho) && $rascunho->justificativaAutorizacaoEtica != "" && $rascunho->justificativaAutorizacaoEtica != null))
<a id="anexoJustificativaTemp" href="{{ route('baixar.anexo.temp', ['eventoId' => $edital->id,
'nomeAnexo' => 'justificativaAutorizacaoEtica' ])}}">Arquivo atual</a>
@endif
<input type="hidden" id="anexoJustificativaPreenchido" name="anexoJustificativaPreenchido"
@if( isset($rascunho) && $rascunho->justificativaAutorizacaoEtica != "") value="sim" @else value="{{old('anexoJustificativaPreenchido')}}" @endif >
<div class="input-group">
<div class="row justify-content-center">
<div class="custom-file">
<input type="file" class="custom-file-input @error('justificativaAutorizacaoEtica') is-invalid @enderror" id="inputJustificativa" aria-describedby="inputGroupFileAddon01" name="justificativaAutorizacaoEtica" onchange="verificarArquivoAnexado_pdf(this)" >
<label class="custom-file-label" id="custom-file-label" for="inputJustificativa">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
</div>
@error('justificativaAutorizacaoEtica')
<span id="justificativaErro" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
@component('projeto.formulario.projeto',
['grandeAreas' => $grandeAreas, 'projeto' => $projeto,
'areas' => $areas, 'subareas' => $subAreas])
@endcomponent
</div>
</div>
</div>
</div>
</div>
@component('projeto.formulario.proponente', ['projeto' => $projeto])
@endcomponent
@php
$resultado_participante_um = array_key_exists(0, $participantes->toArray());
$resultado_participante_dois = array_key_exists(1, $participantes->toArray());
$resultado_participante_tres = array_key_exists(2, $participantes->toArray());
@endphp
<!--X Anexos X-->
<!-- 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-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Área do(s) participante(s)</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px; padding:15px; margin-bottom:2rem">
<div class="card-body" style="margin-bottom: -2rem">
<div class="d-flex justify-content-between align-items-center">
<div><h5 style="color: #1492E6; margin-top:0.5rem">Discente(s)</h5></div>
<div><div class="dropdown">
<button class="btn btn-light dropdown-toggle" type="button" id="dropdownMenuButtonAlterar" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="display: none">
Selecionar
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButtonAlterar">
<a type="button" class="dropdown-item" onclick="alterarFormacao(1)">1 Participante</a>
<a type="button" class="dropdown-item" onclick="alterarFormacao(2)">2 Participantes</a>
<a type="button" class="dropdown-item" onclick="alterarFormacao(3)">3 Participantes</a>
</div>
</div></div>
</div>
<div style="margin-top:-10px"><hr style="border-top: 1px solid#1492E6"></div>
</div>
@component('projeto.formulario.anexos', ['projeto' => $projeto])
@endcomponent
<div class="card-body" id="selecaoParticipantes" style="text-align: center; display:block; margin-top:1rem">
<div><h5>Selecione o número de participantes do projeto</h5></div>
<div class="btn-group" style="text-align:center">
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('1')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_1_participantes.png')}}" alt="Logo" style="width: 25px" /></div>
<div class="col-md-12" style="margin-top: 10px; margin-bottom:5px"><h6>1 Participante</h6></div>
</div>
</button>
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('2')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_2_participantes.png')}}" alt="Logo" style="width: 60px" /></div>
<div class="col-md-12" style="margin-top: 10px; margin-bottom:5px"><h6>2 Participantes</h6></div>
</div>
</button>
<button type="button" class="btn btn-light" onclick="selecionarParticipantes('3')" style="width: 123px; margin:5px; border-radius:12px">
<div class="form-row">
<div class="col-md-12" style="margin-top: 10px;"><img src="{{asset('/img/icons/icon_3_participantes.png')}}" alt="Logo" style="width: 90px" /></div>
<div class="col-md-12" style="margin-top: 13px; margin-bottom:5px"><h6>3 Participantes</h6></div>
</div>
</button>
</div>
</div>
@component('projeto.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno, 'projeto' => $projeto, 'participantes' => $participantes, 'arquivos' =>$arquivos])
@endcomponent
<div class="card-body">
<div id="participante1" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12"><h5>Clique em um dos participantes para preencher os dados</h5></div>
<div class="col-md-12">
@component('projeto.formulario.finalizar', ['projeto' => $projeto])
@endcomponent
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante1" role="button" aria-expanded="false" aria-controls="collapseParticipante1" id="buttonParticipante1" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="buttonTitulo1" style="color: #01487E; font-size:17px; margin-top:5px">Participante 1</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_um){{$participantes[0]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante1">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante1">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante1') is-invalid @enderror" id="nomeCompletoParticipante1" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->name}}@endif">
@error('nomeCompletoParticipante1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="email1">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email1') is-invalid @enderror" id="email1" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->email}}@endif">
@error('email')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="data1">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data1') is-invalid @enderror" id="data1" name="data_de_nascimento[]" required value="@if($resultado_participante_um){{$participantes[0]->data_de_nascimento}}@endif">
@error('data1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf1">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf1') is-invalid @enderror cpf" id="cpf1" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->cpf}}@endif">
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg1">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg1') is-invalid @enderror" id="rg1" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_um){{$participantes[0]->rg}}@endif">
@error('rg1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular1">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular1') is-invalid @enderror" id="celular1" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->celular}}@endif">
@error('celular1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep1">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep1') is-invalid @enderror" id="cep1" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->cep}}@endif">
@error('cep1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado1">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado1" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_um && $participantes[0]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade1">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade1') is-invalid @enderror" id="cidade1" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->cidade}}@endif">
@error('cidade1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro1">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro1') is-invalid @enderror" id="bairro1" name="bairro[]" placeholder="Digite o nome do bairro"required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->bairro}}@endif">
@error('bairro1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua1">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua1') is-invalid @enderror" id="rua1" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..." required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->rua}}@endif">
@error('rua1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero1">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero1') is-invalid @enderror" id="numero1" name="numero[]" placeholder="Digite o número" required value="@if($resultado_participante_um){{$participantes[0]->user->endereco->numero}}@endif">
@error('numero1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento1">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento1') is-invalid @enderror" id="complemento1" name="complemento[]" placeholder="Apartamento, casa, sítio..." required>@if($resultado_participante_um){{$participantes[0]->user->endereco->complemento}}@endif</textarea>
@error('complemento1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade1">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade1') is-invalid @enderror" id="universidade1" name="universidade[]" placeholder="Digite o nome da universidade" required value="@if($resultado_participante_um){{$participantes[0]->user->instituicao}}@endif">
@error('universidade1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso1">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso1') is-invalid @enderror" id="curso1" name="curso[]" placeholder="Digite o nome do curso" required value="@if($resultado_participante_um){{$participantes[0]->curso}}@endif">
@error('curso1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno1">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno1" class="form-control" name="turno[]" >
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_um && $participantes[0]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos1">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos1" class="form-control" onchange="gerarPeriodos1(this)" >
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_um && $participantes[0]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual1">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual1" class="form-control" >
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_um && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[0]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade1">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade1" class="form-control" >
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_um && $participantes[0]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento1">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control" id="coeficienteDeRendimento1" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_um){{$participantes[0]->media_do_curso}}@endif">
@error('coeficienteDeRendimento1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo1">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_um)<a href="{{ route('baixar.plano', ['id' => $participantes[0]->planoTrabalho->id]) }}"> {{$participantes[0]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo1') is-invalid @enderror" id="titulo1" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho">
@error('titulo1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
<small>Para alterar o trabalho envie um novo com o titulo</small>
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho1">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoDeTrabalho1" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)">
<label class="custom-file-label" id="anexoPlanoDeTrabalho1" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho1')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="posicaoParticipante2"></div>
<div id="participante2" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12">
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante2" role="button" aria-expanded="false" aria-controls="collapseParticipante2" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 style="color: #01487E; font-size:17px; margin-top:5px">Participante 2</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_dois){{$participantes[1]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante2">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante2">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante2') is-invalid @enderror" id="nomeCompletoParticipante2" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->name}}@endif">
@error('nomeCompletoParticipante2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="email2">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email2') is-invalid @enderror" id="email2" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->email}}@endif">
@error('email2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="data2">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data2') is-invalid @enderror" id="data2" name="data_de_nascimento[]" required value="@if($resultado_participante_dois){{$participantes[1]->data_de_nascimento}}@endif">
@error('data2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf2">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf2') is-invalid @enderror cpf" id="cpf2" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->cpf}}@endif">
<span id="cpf-invalido-2" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-2" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg2">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg2') is-invalid @enderror" id="rg2" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_dois){{$participantes[1]->rg}}@endif">
@error('rg2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular2">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular2') is-invalid @enderror" id="celular2" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->celular}}@endif">
@error('celular2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep2">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep2') is-invalid @enderror" id="cep2" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->cep}}@endif">
@error('cep2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado2">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado2" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_dois && $participantes[1]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade2">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade2') is-invalid @enderror" id="cidade2" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->cidade}}@endif">
@error('cidade2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro2">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro2') is-invalid @enderror" id="bairro2" name="bairro[]" placeholder="Digite o nome do bairro" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->bairro}}@endif">
@error('bairro2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua2">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua2') is-invalid @enderror" id="rua2" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..." required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->rua}}@endif">
@error('rua2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero2">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero2') is-invalid @enderror" id="numero2" name="numero[]" placeholder="Digite o número" required value="@if($resultado_participante_dois){{$participantes[1]->user->endereco->numero}}@endif">
@error('numero2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento2">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento2') is-invalid @enderror" id="complemento2" name="complemento[]" placeholder="Apartamento, casa, sítio..." required>@if($resultado_participante_dois){{$participantes[1]->user->endereco->complemento}}@endif</textarea>
@error('complemento2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade2">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade2') is-invalid @enderror" id="universidade2" name="universidade[]" placeholder="Digite o nome da universidade" required value="@if($resultado_participante_dois){{$participantes[1]->user->instituicao}}@endif">
@error('universidade2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso2">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso2') is-invalid @enderror" id="curso2" name="curso[]" placeholder="Digite o nome do curso" required value="@if($resultado_participante_dois){{$participantes[1]->curso}}@endif">
@error('curso2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno2">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno2" class="form-control" name="turno[]" required>
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_dois && $participantes[1]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos2">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos2" class="form-control" onchange="gerarPeriodos1(this)" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_dois && $participantes[1]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual2">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual2" class="form-control" required >
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_dois && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[1]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade2">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade2" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_dois && $participantes[1]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento2">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control media" id="coeficienteDeRendimento2" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_dois){{$participantes[1]->media_do_curso}}@endif">
@error('coeficienteDeRendimento2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo2">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_dois)<a href="{{ route('baixar.plano', ['id' => $participantes[1]->planoTrabalho->id]) }}"> {{$participantes[1]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo2') is-invalid @enderror" id="titulo2" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@error('titulo2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho2">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoDeTrabalho2" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)" required>
<label class="custom-file-label" id="anexoPlanoDeTrabalho2" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho2')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="posicaoParticipante3"></div>
<div id="participante3" style="display:none; margin-bottom:15px">
<div class="form-row">
<div class="col-md-12">
<a class="btn btn-light" data-toggle="collapse" href="#collapseParticipante3" role="button" aria-expanded="false" aria-controls="collapseParticipante3" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 style="color: #01487E; font-size:17px; margin-top:5px">Participante 3</h4>
<input type="hidden" name="participante_id[]" value="@if($resultado_participante_tres){{$participantes[2]->id}}@else 0 @endif">
</div>
</a>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante3">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5>Dados do participante</h5></div>
<div class="form-group col-md-6">
<label for="nomeCompletoParticipante3">Nome completo <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('nomeCompletoParticipante3') is-invalid @enderror" id="nomeCompletoParticipante3" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->name}}@endif">
@error('nomeCompletoParticipante3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="form-group col-md-6">
<label for="email3">E-mail <span style="color: red; font-weight:bold">*</span></label>
<input type="email" class="form-control @error('email3') is-invalid @enderror" id="email3" name="emailParticipante[]" placeholder="Digite o e-mail do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->email}}@endif">
@error('email3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="data3">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
<input type="date" class="form-control @error('data3') is-invalid @enderror" id="data3" name="data_de_nascimento[]" required value="@if($resultado_participante_tres){{$participantes[2]->data_de_nascimento}}@endif">
@error('data3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="cpf3">CPF <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cpf3') is-invalid @enderror cpf" id="cpf3" name="cpf[]" placeholder="Digite o CPF do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->cpf}}@endif">
<span id="cpf-invalido-3" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<strong>CPF inválido</strong>
</span>
<span id="cpf-valido-3" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<strong>CPF válido!</strong>
</span>
</div>
<div class="form-group col-md-6">
<label for="rg3">RG <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rg3') is-invalid @enderror" id="rg3" name="rg[]" placeholder="Digite o RG do participante" required value="@if($resultado_participante_tres){{$participantes[2]->rg}}@endif">
@error('rg3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="celular3">Celular <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('celular3') is-invalid @enderror" id="celular3" name="celular[]" placeholder="Digite o telefone do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->celular}}@endif">
@error('celular3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="form-group col-md-6">
<label for="cep3">CEP <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cep3') is-invalid @enderror" id="cep3" name="cep[]" placeholder="Digite o CEP do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->cep}}@endif">
@error('cep3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="estado3">Estado <span style="color: red; font-weight:bold">*</span></label>
<select name="uf[]" id="estado3" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione o estado --</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AC') selected @endif value="AC">Acre</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AL') selected @endif value="AL">Alagoas</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AP') selected @endif value="AP">Amapá</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'AM') selected @endif value="AM">Amazonas</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'BA') selected @endif value="BA">Bahia</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'CE') selected @endif value="CE">Ceará</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'DF') selected @endif value="DF">Distrito Federal</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'ES') selected @endif value="ES">Espírito Santo</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'GO') selected @endif value="GO">Goiás</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MA') selected @endif value="MA">Maranhão</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MT') selected @endif value="MT">Mato Grosso</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'MG') selected @endif value="MG">Minas Gerais</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PA') selected @endif value="PA">Pará</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PB') selected @endif value="PB">Paraíba</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PR') selected @endif value="PR">Paraná</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PE') selected @endif value="PE">Pernambuco</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'PI') selected @endif value="PI">Piauí</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RO') selected @endif value="RO">Rondônia</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'RR') selected @endif value="RR">Roraima</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SC') selected @endif value="SC">Santa Catarina</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SP') selected @endif value="SP">São Paulo</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'SE') selected @endif value="SE">Sergipe</option>
<option @if($resultado_participante_tres && $participantes[2]->user->endereco->uf == 'TO') selected @endif value="TO">Tocantins</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="cidade3">Cidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('cidade3') is-invalid @enderror" id="cidade3" name="cidade[]" placeholder="Digite a cidade do participante" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->cidade}}@endif">
@error('cidade3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="bairro3">Bairro <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('bairro3') is-invalid @enderror" id="bairro3" name="bairro[]" placeholder="Digite o nome do bairro" required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->bairro}}@endif">
@error('bairro3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="rua3">Rua <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('rua3') is-invalid @enderror" id="rua3" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..."required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->rua}}@endif">
@error('rua3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="numero3">Número <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('numero3') is-invalid @enderror" id="numero3" name="numero[]" placeholder="Digite o número"required value="@if($resultado_participante_tres){{$participantes[2]->user->endereco->numero}}@endif">
@error('numero3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="complemento3">Complemento <span style="color: red; font-weight:bold">*</span></label>
<textarea type="text" class="form-control @error('complemento3') is-invalid @enderror" id="complemento3" name="complemento[]" placeholder="Apartamento, casa, sítio..."required>@if($resultado_participante_tres){{$participantes[2]->user->endereco->complemento}}@endif</textarea>
@error('complemento3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="form-group col-md-12">
<label for="universidade3">Universidade <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('universidade3') is-invalid @enderror" id="universidade3" name="universidade[]" placeholder="Universidade" required value="@if($resultado_participante_tres){{$participantes[2]->instituicao}}@endif">
@error('universidade3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-12">
<label for="curso3">Curso <span style="color: red; font-weight:bold">*</span></label>
<input type="text" class="form-control @error('curso3') is-invalid @enderror" id="curso3" name="curso[]" placeholder="curso" required value="@if($resultado_participante_tres){{$participantes[2]->curso}}@endif">
@error('curso3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="turno3">Turno <span style="color: red; font-weight:bold">*</span></label>
<select id="turno3" class="form-control" required name="turno[]">
<option value="" disabled selected>-- TURNO --</option>
@foreach ($enum_turno as $turno)
<option @if($resultado_participante_tres && $participantes[2]->turno == $turno) selected @endif value="{{$turno}}">{{$turno}}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-6">
<label for="totalDePeriodos3">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="total_periodos[]" id="totalDePeriodos3" class="form-control" onchange="gerarPeriodos1(this)" required>
<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "6") selected @endif value="6">6</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "7") selected @endif value="7">7</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "8") selected @endif value="8">8</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "9") selected @endif value="9">9</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "10") selected @endif value="10">10</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "11") selected @endif value="11">11</option>
<option @if($resultado_participante_tres && $participantes[2]->total_periodos == "12") selected @endif value="12">12</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="periodoAtual3">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="periodo_cursado[]" id="periodoAtual3" class="form-control" required>
<option value="" disabled selected>-- PERÍODO ATUAL --</option>
@for ($i = 1; $resultado_participante_tres && $i <= $participantes[0]->total_periodos; $i++)
<option value="{{$i}}" @if($participantes[2]->periodo_atual == $i) selected @endif>{{$i}}º</option>
@endfor
</select>
</div>
<div class="form-group col-md-6">
<label for="ordemDePrioridade3">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
<select name="ordem_prioridade[]" id="ordemDePrioridade3" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "1") selected @endif value="1">1</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "2") selected @endif value="2">2</option>
<option @if($resultado_participante_tres && $participantes[2]->ordem_prioridade == "3") selected @endif value="3">3</option>
</select>
</div>
<div class="form-group col-md-6">
<label for="coeficienteDeRendimento3">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
<input type="number" class="form-control media" id="coeficienteDeRendimento3" min="0" max="10" step="0.01" name="media_geral_curso[]" required value="@if($resultado_participante_tres){{$participantes[2]->media_do_curso}}@endif">
@error('coeficienteDeRendimento3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="form-group col-md-6">
<label for="titulo3">Título <span style="color: red; font-weight:bold">*</span></label>@if($resultado_participante_tres)<a href="{{ route('baixar.plano', ['id' => $participantes[2]->planoTrabalho->id]) }}"> {{$participantes[2]->planoTrabalho->titulo}}</a>@endif
<input type="text" class="form-control @error('titulo3') is-invalid @enderror" id="titulo3" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@error('titulo3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="anexoPlanoDeTrabalho3">Anexo <span style="color: red; font-weight:bold">*</span></label>
<div class="custom-file">
<input type="file" class="custom-file-input @error('anexoPlanoTrabalho3') is-invalid @enderror" id="anexoPlanoDeTrabalho3" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this)" required>
<label class="custom-file-label" id="anexoPlanoDeTrabalho1" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
</div>
@error('anexoPlanoDeTrabalho3')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Participantes X-->
<!-- Finalizar -->
{{-- <div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">5º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Finalizar</h5></div> --}}
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Finalizar</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
</div>
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
</form>
<div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
<button type="submit" id="clickSubmitForm" style="display: none"></button>
<button type="button" class="btn btn-success" id="idButtonSubmitProjeto" onclick="enviarModalenviarProjeto()" disabled>{{ __('Enviar Projeto') }}</button>
</div>
@endcomponent
</div>
</div>
</div>
</div>
<!--X Finalizar X-->
</div>
</div>
</form>
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" id="idCorCabecalhoModalDocumento">
......@@ -1213,26 +65,6 @@
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalSubmit" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5>
<button type="button" class="close" onclick="fecharModalenviarProjeto()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="fecharModalenviarProjeto()">Close</button>
<button type="button" class="btn btn-primary" onclick="enviarModalenviarProjeto()">Enviar projeto</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
......@@ -1245,7 +77,7 @@
</button>
</div>
<div class="modal-body">
Existe um CPF inválido em um dos participantes por favor corrija para continuar.
Existe um CPF inválido em um dos discentes por favor corrija para continuar.
</div>
{{-- <div class="modal-footer">
{{-- <button type="button" class="btn btn-secondary"></button>
......@@ -1258,46 +90,318 @@
@endsection
@section('javascript')
<script type="text/javascript">
/*
* GLOBAL
*/
var numeroDeParticipantes;
var tempPart1;
var tempPart2;
var tempPart3;
<script>
let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild;
let contador = 0;
tempPart1 = document.getElementById("participante1");
tempPart2 = document.getElementById("participante2");
tempPart3 = document.getElementById("participante3");
buttonSubmit.addEventListener('click', (e)=>{
$('.collapse').addClass('show')
})
function gerarPeriodo(e){
var select = e.parentElement.parentElement.nextElementSibling;
selectPeriodos = select.children[0].children[1];
var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`;
for(var i = 0; i < parseInt(e.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`;
}
$(selectPeriodos).html('');
$(selectPeriodos).append(html);
}
function removerPart(e){
console.log(e)
if(e.parentElement.parentElement){
if(parts.children.length <= 1){
}else{
parts.removeChild(e.parentElement.parentElement);
contador--;
}
$(document).ready(function () {
selecionarParticipantes("{{$participantes->count()}}");
}
}
buttonMais.addEventListener("click", (e) => {
if(parts.children.length >= "{{ $edital->numParticipantes }}"){
alert('Limite de participante.')
}else{
contador++;
var cln = participante.cloneNode(true);
cln.setAttribute('style', " ");
var id = cln.children[2].firstElementChild.id;
var id2 = cln.children[0].firstElementChild.id;
cln.children[2].firstElementChild.setAttribute('id', id + contador);
cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador);
cln.children[0].firstElementChild.setAttribute('id', id2 + contador);
for (i = 0; i < cln.children.length; i++) {
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let input = cln.children[i].querySelectorAll('input')[index];
let name = input.getAttributeNode("name").value;
name = name.replace("[]", "");
input.getAttributeNode("name").value = name + '['+ contador +']';
let select = cln.children[i].querySelectorAll('select')[index];
if(select){
let selectName = select.getAttributeNode("name").value;
selectName = selectName.replace("[", "");
selectName = selectName.replace("]", "");
select.getAttributeNode("name").value = selectName + '['+ contador +']';
}
}
}
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
spOptions = {
onKeyPress: function(val, e, field, options) {
field.mask(SPMaskBehavior.apply({}, arguments), options);
}
};
parts.appendChild(cln);
// console.log(cln);
$(cln).find(".cpf").val("").mask("000.000.000-00");
// $("input.cpf:text").val("").mask("000.000.000-00");
$("input.celular:text").val("").mask(SPMaskBehavior, spOptions);
$("input.cep:text").val("").mask("00000-000");
}
});
</script>
<script>
$( document ).ready( function () {
$('#nomeParticipante').keyup(function () {
$('#display').text($(this).val());
if($('#nomeParticipante').val() == ""){
$('#display').hide();
$('#pontos').hide();
}else{
$('#display').show();
$('#pontos').show();
}
});
/*
* FUNCAO: Mostrar no input o arquivo selecionado
*
*/
$('.custom-file-input').on('change', function() {
var fieldVal = $(this).val();
$.validator.addMethod("alpha", function(value, element) {
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
});
// Change the node's value by removing the fake path (Chrome)
fieldVal = fieldVal.replace("C:\\fakepath\\", "");
$('.cep').mask('00000000');
// $('.cpf').mask('000.000.000-00');
$('.numero').mask('0000000000000');
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
spOptions = {
onKeyPress: function(val, e, field, options) {
field.mask(SPMaskBehavior.apply({}, arguments), options);
}
};
$('.celular').mask(SPMaskBehavior, spOptions);
$('.sus').mask('000 0000 0000 0000');
$("input[type='file']").on("change", function () {
if(this.files[0].size > 2000000) {
// console.log($(this).parents( ".col-sm-5" ))
alert("O tamanho do arquivo deve ser menor que 2MB!");
$(this).val('');
if (fieldVal != undefined || fieldVal != "") {
$(this).next(".custom-file-label").attr('data-content', fieldVal);
$(this).next(".custom-file-label").text(fieldVal);
}
})
});
$.validator.setDefaults( {
submitHandler: function (form) {
form.submit();
}
} );
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
});
$( "#criarProjetoForm" ).validate( {
lang: 'PT_BR',
rules: {
firstname: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
email: {
required: true,
email: true,
},
"complemento[]":{
},
"nomeParticipante[]":{
required:true,
alpha:true,
},
'rg[]':{
required: true,
maxlength: 8,
},
agree: "required"
},
messages: {
// nomeProjeto: "O nome do projeto é obrigatório.",
// 'emailParticipante[]': "Este campo é obrigatório.",
// 'data_de_nascimento[]': "Este campo é obrigatório.",
// 'cpf[]': "Este campo é obrigatório.",
// 'rg[]': {
// required: "Este campo é obrigatório.",
// maxlength: "Este campo deve conter no máximo 8 números."
// },
// 'celular[]': "Este campo é obrigatório.",
// 'cep[]': "Este campo é obrigatório.",
// 'uf[]': "Este campo é obrigatório.",
// 'cidade[]': "Este campo é obrigatório.",
// 'bairro[]': "Este campo é obrigatório.",
// 'rua[]': "Este campo é obrigatório.",
// 'numero[]': "Este campo é obrigatório.",
// 'complemento[]': "Este campo é obrigatório.",
// 'universidade[]': "Este campo é obrigatório.",
// 'curso[]': "Este campo é obrigatório.",
// 'turno[]': "Este campo é obrigatório.",
// 'total_periodos[]': "Este campo é obrigatório.",
// 'periodo_atual[]': "Este campo é obrigatório.",
// 'ordem_prioridade[]': "Este campo é obrigatório.",
// 'media_geral_curso[]': "Este campo é obrigatório.",
// 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// grandeArea: "Escolha uma grande área.",
// area: "Escolha uma área.",
// linkGrupo: "Este campo é obrigatório.",
// pontuacaoPlanilha: "Este campo é obrigatório.",
// anexoProjeto: "Este campo é obrigatório.",
// anexoLattesCoordenador: "Este campo é obrigatório.",
// anexoConsuPreenchido: "Este campo é obrigatório.",
// anexoGrupoPesquisa: "Este campo é obrigatório.",
// anexoPlanilha: "Este campo é obrigatório.",
// anexoComiteEtica: "Este campo é obrigatório.",
// inputJustificativa: "Este campo é obrigatório.",
// "nomeParticipante[]": {
// required: "O nome do participante é obrigatório.",
// alpha: "Não é permitido números."
// },
// username: {
// required: "Please enter a username",
// minlength: "Your username must consist of at least 2 characters"
// },
// password: {
// required: "Please provide a password",
// minlength: "Your password must be at least 5 characters long"
// },
// confirm_password: {
// required: "Please provide a password",
// minlength: "Your password must be at least 5 characters long",
// equalTo: "Please enter the same password as above"
// },
// email: "Please enter a valid email address",
// agree: "Please accept our policy"
},
errorElement: "em",
errorPlacement: function ( error, element ) {
// Add the `help-block` class to the error element
error.addClass( "invalid-feedback" );
if ( element.prop( "type" ) === "checkbox" ) {
error.insertAfter( element.parent( "label" ) );
} else {
error.insertAfter( element );
}
},
highlight: function ( element, errorClass, validClass ) {
$( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" );
},
unhighlight: function (element, errorClass, validClass) {
$( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" );
}
} );
} );
</script>
<script type="text/javascript">
function validarCPF(valor){
var soma = 0;
var resto;
var inputCPF = valor.match(/\d/g).join('');
if(inputCPF == '00000000000') return false;
if(inputCPF.length >11) return false;
for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i);
resto = (soma * 10) % 11;
if((resto == 10) || (resto == 11)) resto = 0;
if(resto != parseInt(inputCPF.substring(9, 10))) return false;
soma = 0;
for(i = 1; i <= 10; i++) soma = soma + parseInt(inputCPF.substring(i-1, i))*(12-i);
resto = (soma * 10) % 11;
/*
* FUNCAO: Gerar as areas
*
*/
function areas() {
if((resto == 10) || (resto == 11)) resto = 0;
if(resto != parseInt(inputCPF.substring(10, 11))) return false;
return true;
}
/*
* FUNCAO: Gerar as areas
*
*/
function areas() {
var grandeArea = $('#grandeArea').val();
$.ajax({
type: 'POST',
......@@ -1332,11 +436,11 @@ function areas() {
})
}
/*
* FUNCAO: Gerar as subareas
*
*/
function subareas() {
/*
* FUNCAO: Gerar as subareas
*
*/
function subareas() {
var area = $('#area').val();
$.ajax({
type: 'POST',
......@@ -1370,11 +474,11 @@ function subareas() {
})
}
/*
* FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
*
*/
function displayAutorizacoesEspeciais(valor){
/*
* FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
*
*/
function displayAutorizacoesEspeciais(valor){
if(valor == "sim"){
document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = false;
......@@ -1389,715 +493,93 @@ function displayAutorizacoesEspeciais(valor){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
}
}
/*
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
*
*/
function verificarArquivoAnexado_pdf(item){
var anexado = true;
/*
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
*
*/
function verificarArquivoAnexado_pdf(item, legenda){
if(item.files[0].type.split('/')[1] != "pdf"){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo PDF! ";
document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
anexado = false;
}else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
anexado = false;
}
if (anexado && item.id == "anexoPlanoDeTrabalho1") {
document.getElementById('titulo1').required = true;
} else if (anexado && item.id == "anexoPlanoDeTrabalho2") {
document.getElementById('titulo2').required = true;
} else if (anexado && item.id == "anexoPlanoDeTrabalho3") {
document.getElementById('titulo3').required = true;
}else{
document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
}
}
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
*
*/
function verificarArquivoAnexado_xls_xlsx_ods(item){
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
*
*/
function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){
if(item.files[0].name.split('.')[1] == "xls" || item.files[0].name.split('.')[1] == "ods" || item.files[0].name.split('.')[1] == "xlsx"){
if(item.files[0].size > 2000000){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB.";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
}else{
document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
}
}else{
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo XLS, XLSX ou ODS! ";
document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB.";
document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true});
}
}
/*
* FUNCAO: Gerar periodos
*
*/
function gerarPeriodos1(select) {
var div = select.parentElement.parentElement;
var selectPeriodos = div.children[21].children[1];
var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`;
for(var i = 0; i < parseInt(select.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`;
}
$(selectPeriodos).html('');
$(selectPeriodos).append(html);
}
/*
* FUNCAO: Selecionar participantes do projeto
*
*/
function selecionarParticipantes(quantidade){
if(quantidade == "1"){
numeroDeParticipantes = 1;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
document.getElementById("participante3").remove();
document.getElementById("selecaoParticipantes").style.display ="none";
}else if(quantidade == 2){
numeroDeParticipantes = 2;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").remove();
document.getElementById("selecaoParticipantes").style.display ="none";
}else if(quantidade == 3){
numeroDeParticipantes = 3;
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").style.display ="block";
document.getElementById("selecaoParticipantes").style.display ="none";
}
//mostrar botao alterar
document.getElementById("dropdownMenuButtonAlterar").style.display = "block";
// habilitar botao submeter projeto
document.getElementById("idButtonSubmitProjeto").disabled = false;
}
/*
* FUNCAO: abrir modal para enviar o trabalho
*/
function abrirModalenviarProjeto(){
if(validarForm() == true){
//fecharModalenviarProjeto();
}else{
document.getElementById("modalSubmit").classList.add("show");
document.getElementById("modalSubmit").style.display="block";
document.getElementById("modalSubmit").style.backgroundColor="rgba(0, 0, 0, 0.5)";
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
}
}
/*
* FUNCAO: fechar modal para enviar o trabalho
*/
function fecharModalenviarProjeto(){
document.getElementById("modalSubmit").classList.remove("show");
document.getElementById("modalSubmit").style.display="none";
document.getElementById("modalSubmit").style.backgroundColor="rgba(0, 0, 0, 0.5)";
//document.getElementById("collapseParticipante1").classList.remove("show");
//document.getElementById("collapseParticipante2").classList.remove("show");
//document.getElementById("collapseParticipante3").classList.remove("show");
}
/*
* FUNCAO: enviar modal
*
*/
function enviarModalenviarProjeto(){
if(numeroDeParticipantes == 1){
document.getElementById("collapseParticipante1").classList.add("show");
}else if(numeroDeParticipantes == 2){
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
}else if(numeroDeParticipantes == 3){
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
}
if (checarCpfs()) {
document.getElementById("clickSubmitForm").click();
} else {
$("#modalCpfInvalido").modal('show');
}
}
/*
* FUNCAO: Formacao dos participantes
*
*/
function alterarFormacao(quero){
//console.log(numeroDeParticipantes);
if(numeroDeParticipantes == 1 && quero == 2){
var container = document.getElementById("posicaoParticipante2");
container.append(tempPart2);
document.getElementById("participante2").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 1 && quero == 3){
var container2 = document.getElementById("posicaoParticipante2");
container2.append(tempPart2);
var container3 = document.getElementById("posicaoParticipante3");
container3.append(tempPart3);
document.getElementById("participante2").style.display ="block";
document.getElementById("participante3").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 2 && quero == 1){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 2 && quero == 3){
var container3 = document.getElementById("posicaoParticipante3");
container3.append(tempPart3);
document.getElementById("participante3").style.display ="block";
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 3 && quero == 1){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante2").remove();
document.getElementById("participante3").remove();
numeroDeParticipantes = quero;
}else if(numeroDeParticipantes == 3 && quero == 2){
document.getElementById("participante1").style.display ="block";
document.getElementById("participante3").remove();
numeroDeParticipantes = quero;
}
}
/* FUNCAO: validar campos
*
*/
$(document).ready(aplicarMascaras());
function aplicarMascaras() {
$('#cpf1').mask('000.000.000-00');
$('#cpf2').mask('000.000.000-00');
$('#cpf3').mask('000.000.000-00');
$('#rg1').mask('00000000');
$('#rg2').mask('00000000');
$('#rg3').mask('00000000');
$('#celular1').mask('(00) 00000-0000');
$('#celular2').mask('(00) 00000-0000');
$('#celular3').mask('(00) 00000-0000');
$('#cep1').mask('00000-000');
$('#cep2').mask('00000-000');
$('#cep3').mask('00000-000');
}
function validarForm(){
/*var buttonRadioSim = document.getElementById("radioSim");
var buttonRadioNao = document.getElementById("radioNao");
//button radio
if(buttonRadioSim.checked == false && buttonRadioNao.checked == false){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "block";
document.getElementById("idAvisoAutorizacaoEspecial").autofocus;
}
//participantes
var part1 = document.getElementById("participante1").style.visibility;
var part2 = document.getElementById("participante1").style.visibility;
var part3 = document.getElementById("participante1").style.visibility;
*/
/*
document.getElementById("modalSubmit").classList.add("show");
document.getElementById("modalSubmit").style.display="block";
document.getElementById("modalSubmit").style.backgroundColor="black";
document.getElementById("collapseParticipante1").classList.add("show");
document.getElementById("collapseParticipante2").classList.add("show");
document.getElementById("collapseParticipante3").classList.add("show");
//document.getElementById("collapseParticipante1").classList.remove = "collapsed";
* FUNCAO: Gerar periodos 1
*
*/
}
function validarPart1(){
//participante 1
var nome1 = document.getElementById("nomeCompletoParticipante1");
var email1 = document.getElementById("email1");
var data1 = document.getElementById("data1");
var cpf1 = document.getElementById("cpf1");
var rg1 = document.getElementById("rg1");
var celular1 = document.getElementById("celular1");
var cep1 = document.getElementById("cep1");
var estado1 = document.getElementById("estado1");
var cidade1 = document.getElementById("cidade1");
var bairro1 = document.getElementById("bairro1");
var rua1 = document.getElementById("rua1");
var numero1 = document.getElementById("numero1");
var complemento1 = document.getElementById("complemento1");
var universidade1 = document.getElementById("universidade1");
var curso1 = document.getElementById("curso1");
var turno1 = document.getElementById("turno1");
var totalDePeriodos1 = document.getElementById("totalDePeriodos1");
var periodoAtual1 = document.getElementById("periodoAtual1");
var ordemDePrioridade1 = document.getElementById("ordemDePrioridade1");
var coeficineteDeRendimento1 = document.getElementById("coeficienteDeRendimento1");
var tituloPlanoDeTrabalho1 = document.getElementById("titulo1");
var anexoPlanoDeTrabalho1 = document.getElementById("anexoPlanoDeTrabalho1");
//validacao dos campos - participante 1
if(nome1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
nome1.focus();
return true;
}else if(email1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
email1.focus();
return true;
}else if(data1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
data1.focus();
return true;
}else if(cpf1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cpf1.focus();
return true;
}else if(rg1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
rg1.focus();
return true;
}else if(celular1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
celular1.focus();
return true;
}else if(cep1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cep1.focus();
return true;
}else if(estado1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
estado1.focus();
return true;
}else if(cidade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
cidade1.focus();
return true;
}else if(bairro1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
bairro1.focus();
return true;
}else if(rua1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
rua1.focus();
return true;
}else if(numero1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
numero1.focus();
return true;
}else if(complemento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
complemento1.focus();
return true;
}else if(complemento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
complemento1.focus();
return true;
}else if(universidade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
universidade1.focus();
return true;
}else if(curso1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
curso1.focus();
return true;
}else if(turno1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
turno1.focus();
return true;
}else if(totalDePeriodos1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
totalDePeriodos1.focus();
return true;
}else if(periodoAtual1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
periodoAtual1.focus();
return true;
}else if(ordemDePrioridade1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade1.focus();
return true;
}else if(coeficineteDeRendimento1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento1.focus();
return true;
}else if(tituloPlanoDeTrabalho1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho1.focus();
return true;
}else if(anexoPlanoDeTrabalho1.value == ""){
document.getElementById("collapseParticipante1").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho1.focus();
return true;
}
}
function validarPart2(){
//participante 2
var nome2 = document.getElementById("nomeCompletoParticipante2");
var email2 = document.getElementById("email2");
var data2 = document.getElementById("data2");
var cpf2 = document.getElementById("cpf2");
var rg2 = document.getElementById("rg2");
var celular2 = document.getElementById("celular2");
var cep2 = document.getElementById("cep2");
var estado2 = document.getElementById("estado2");
var cidade2 = document.getElementById("cidade2");
var bairro2 = document.getElementById("bairro2");
var rua2 = document.getElementById("rua2");
var numero2 = document.getElementById("numero2");
var complemento2 = document.getElementById("complemento2");
var universidade2 = document.getElementById("universidade2");
var curso2 = document.getElementById("curso2");
var turno2 = document.getElementById("turno2");
var totalDePeriodos2 = document.getElementById("totalDePeriodos2");
var periodoAtual2 = document.getElementById("periodoAtual2");
var ordemDePrioridade2 = document.getElementById("ordemDePrioridade2");
var coeficineteDeRendimento2 = document.getElementById("coeficienteDeRendimento2");
var tituloPlanoDeTrabalho2 = document.getElementById("titulo2");
var anexoPlanoDeTrabalho2 = document.getElementById("anexoPlanoDeTrabalho2");
//validacao dos campos - participante 2
if(nome2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
nome2.focus();
return true;
} else if(email2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
email2.focus();
return true;
}else if(data2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
data2.focus();
return true;
}else if(cpf2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
cpf2.focus();
return true;
}else if(rg2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
rg2.focus();
return true;
}else if(celular2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
celular2.focus();
return true;
}else if(cep2.value == ""){
document.getElementById("colapseParticipante2").classList.add("show");
//alert("Nome não informado");
cep2.focus();
return true;
}else if(estado2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
estado2.focus();
return true;
}else if(cidade2.value == ""){
console.log(cidade2.value)
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
cidade2.focus();
return true;
}else if(bairro2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
bairro2.focus();
return true;
}else if(rua2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
rua2.focus();
return true;
}else if(numero2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
numero2.focus();
return true;
}else if(complemento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
complemento2.focus();
return true;
}else if(complemento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
complemento2.focus();
return true;
}else if(universidade2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
universidade2.focus();
return true;
}else if(curso2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
curso2.focus();
return true;
}else if(turno2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
turno2.focus();
return true;
}else if(totalDePeriodos2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
totalDePeriodos2.focus();
return true;
}else if(periodoAtual2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
periodoAtual2.focus();
return true;
}else if(ordemDePrioridade2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade2.focus();
return true;
}else if(coeficineteDeRendimento2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento2.focus();
return true;
}else if(tituloPlanoDeTrabalho2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho2.focus();
return true;
}else if(anexoPlanoDeTrabalho2.value == ""){
document.getElementById("collapseParticipante2").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho2.focus();
return true;
}
}
function validarPart3(){
//participante 3
var nome3 = document.getElementById("nomeCompletoParticipante3");
var email3 = document.getElementById("email3");
var data3 = document.getElementById("data3");
var cpf3 = document.getElementById("cpf3");
var rg3 = document.getElementById("rg3");
var celular3 = document.getElementById("celular3");
var cep3 = document.getElementById("cep3");
var estado3 = document.getElementById("estado3");
var cidade3 = document.getElementById("cidade3");
var bairro3 = document.getElementById("bairro3");
var rua3 = document.getElementById("rua3");
var numero3 = document.getElementById("numero3");
var complemento3 = document.getElementById("complemento3");
var universidade3 = document.getElementById("universidade3");
var curso3 = document.getElementById("curso3");
var turno3 = document.getElementById("turno3");
var totalDePeriodos3 = document.getElementById("totalDePeriodos3");
var periodoAtual3 = document.getElementById("periodoAtual3");
var ordemDePrioridade3 = document.getElementById("ordemDePrioridade3");
var coeficineteDeRendimento3 = document.getElementById("coeficienteDeRendimento3");
var tituloPlanoDeTrabalho3 = document.getElementById("titulo3");
var anexoPlanoDeTrabalho3 = document.getElementById("anexoPlanoDeTrabalho3");
//validacao dos campos - participante 3
if(nome3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
nome3.focus();
return true;
}else if(email3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
email3.focus();
return true;
}else if(data3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
data3.focus();
return true;
}else if(cpf3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cpf3.focus();
return true;
}else if(rg3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
rg3.focus();
return true;
}else if(celular3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
celular3.focus();
return true;
}else if(cep3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cep3.focus();
return true;
}else if(estado3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
estado3.focus();
return true;
}else if(cidade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
cidade3.focus();
return true;
}else if(bairro3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
bairro3.focus();
return true;
}else if(rua3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
rua3.focus();
return true;
}else if(numero3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
numero3.focus();
return true;
}else if(complemento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
complemento3.focus();
return true;
}else if(complemento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
complemento3.focus();
return true;
}else if(universidade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
universidade3.focus();
return true;
}else if(curso3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
curso3.focus();
return true;
}else if(turno3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
turno3.focus();
return true;
}else if(totalDePeriodos3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
totalDePeriodos3.focus();
return true;
}else if(periodoAtual3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
periodoAtual3.focus();
return true;
}else if(ordemDePrioridade3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
ordemDePrioridade3.focus();
return true;
}else if(coeficineteDeRendimento3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
coeficineteDeRendimento3.focus();
return true;
}else if(tituloPlanoDeTrabalho3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
tituloPlanoDeTrabalho3.focus();
return true;
}else if(anexoPlanoDeTrabalho3.value == ""){
document.getElementById("collapseParticipante3").classList.add("show");
//alert("Nome não informado");
anexoPlanoDeTrabalho3.focus();
return true;
}
}
// function gerarPeriodos1(select) {
// var div = select.parentElement.parentElement;
// var selectPeriodos = div.children[22].children[1];
// var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`;
// for(var i = 0; i < parseInt(select.value); i++) {
// html += `<option value="${i+1}">${i+1}º</option>`;
// }
// });
// });
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
// $("#button").click(function(e){
// e.preventDefault();
// $(document).ready(function(){
// $(".cpf").change(function(){
// console.log(this.parentElement.children[0])
// if (validarCPF(retirarFormatacao(this.value))) {
// $.ajax({
// headers: {
// 'X-CSRF-Token': $('input[name="_token"]').val()
// },
// url: "{{route('trabalho.store')}}",
// type: 'post',
// enctype: 'multipart/form-data',
// success: function(result){
// console.log("success")
// console.log(result)
// },
// erro: (xhr,status,error) => {
// console.log("erro")
// this.parentElement.children[1].style.display = "none";
// this.parentElement.children[2].style.display = "block";
// } else {
// this.parentElement.children[1].style.display = "block";
// this.parentElement.children[2].style.display = "none";
// }
// });
// });
$(document).ready(function(){
$(".cpf").change(function(){
if (validarCPF(retirarFormatacao(this.value))) {
this.parentElement.children[2].style.display = "none";
this.parentElement.children[3].style.display = "block";
function checarCPFdoCampo(input) {
if (input.value.length == 14) {
if (validarCPF(retirarFormatacao(input.value))) {
input.parentElement.children[1].style.display = "none";
input.parentElement.children[2].style.display = "block";
} else {
this.parentElement.children[2].style.display = "block";
this.parentElement.children[3].style.display = "none";
input.parentElement.children[1].style.display = "block";
input.parentElement.children[2].style.display = "none";
}
} else {
input.parentElement.children[1].style.display = "none";
input.parentElement.children[2].style.display = "none";
}
}
});
});
function validarCPF(strCPF) {
var soma;
......@@ -2165,5 +647,36 @@ function validarPart3(){
}
return false;
}
function submeterProposta() {
document.getElementById("submeterFormProposta").click();
// if (checarCpfs()) {
// } else {
// $("#modalCpfInvalido").modal('show');
// }
}
function mascaraCPF(input) {
var numeros = "0123456789.-";
var resultado = "";
if (input.value.length < 14) {
for (var i = 0; i < input.value.length; i++) {
if (numeros.indexOf(input.value[i]) > -1) {
if ((i == 2 || i == 6) && input.value[i+1] != ".") {
resultado += input.value[i] + ".";
} else if (i == 10 && input.value[i+1] != "-") {
resultado += input.value[i] + "-";
} else {
resultado += input.value[i];
}
}
}
} else {
for (var i = 0; i < 14; i++) {
resultado += input.value[i];
}
}
input.value = resultado;
}
</script>
@endsection
<!-- Anexos -->
<div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">3º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Anexos</h5></div>
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Anexos</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
{{-- Anexo do Projeto --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo do projeto (.pdf)'])
<input type="file" class="input-group-text" name="anexoProjeto" placeholder="nomeProjeto" accept="application/pdf" />
@endcomponent
</div>
<div class="col-3 ">
<a href="{{ route('baixar.anexo.projeto', ['id' => $projeto->id])}}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
{{-- Anexo do currículo --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo do currículo Lattes do Coordenador (.pdf)'])
<input type="file" class="input-group-text" name="anexoLattesCoordenador" placeholder="anexoPlanoTrabalho" accept=".pdf" />
@endcomponent
</div>
<div class="col-3 ">
<a href="{{ route('baixar.anexo.lattes', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
{{-- Anexo da Planilha de Pontuação --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo da Planilha de Pontuação (.xlsx,.xls,.ods)'])
<input type="file" class="input-group-text" name="anexoPlanilha" placeholder="anexoPlanoTrabalho" accept=".xlsx, .xls, .ods" />
@endcomponent
</div>
<div class="col-3 ">
<a href="{{ route('baixar.anexo.planilha', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
{{-- Anexo da Decisão do CONSU --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)'])
<input type="file" class="input-group-text" name="anexoConsuPreenchido" placeholder="anexoConsuPreenchido" accept=".pdf" />
@endcomponent
</div>
<div class="col-3 ">
<a href="{{ route('baixar.anexo.consu', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
{{-- Anexo do Grupo de Pesquisa --}}
<div class="form-group col-md-6" style="margin-top: 10px">
<div class="row justify-content-center">
<div class="col-12">
@component('componentes.input', ['label' => 'Anexo do Grupo de Pesquisa (.pdf)'])
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" />
@endcomponent
</div>
<div class="col-3 ">
<a href="{{ route('baixar.anexoGrupoPesquisa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
<div class="col-md-6"></div>
<div class="form-group col-md-6">
<label for="botao" class="col-form-label @error('botao') is-invalid @enderror" data-toggle="tooltip" data-placement="bottom" title="Se possuir, coloque todas em único arquivo pdf." style="margin-right: 15px;">{{ __('Possui autorizações especiais?') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="radio" checked id="radioSim" onchange="displayAutorizacoesEspeciais('sim')">
<label for="radioSim" style="margin-right: 5px">Sim</label>
<input type="radio" id="radioNao" onchange="displayAutorizacoesEspeciais('nao')">
<label for="radioNao" style="margin-right: 5px">Não</label><br>
<span id="idAvisoAutorizacaoEspecial" class="invalid-feedback" role="alert" style="overflow: visible; display:none">
<strong>Selecione a autorização e envie o arquivo!</strong>
</span>
<div class="form-group" id="displaySim" style="display: block; margin-top:-1rem">
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)'])
<input type="file" class="input-group-text" name="anexoComiteEtica" placeholder="anexoComiteEtica" accept=".pdf" />
@endcomponent
</div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
@component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)'])
<input type="file" class="input-group-text" name="inputJustificativa" placeholder="inputJustificativa" accept=".pdf" />
@endcomponent
</div>
<div class="row justify-content-center">
<div class="col-3 ">
<a href="{{ route('baixar.anexo.justificativa', ['id' => $projeto->id]) }}"><i class="fas fa-file-pdf fa-2x"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Anexos X-->
\ No newline at end of file
<!-- Finalizar -->
<div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">5º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Finalizar</h5></div>
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Finalizar</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
</div>
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button id="submeterFormProposta" type="submit" style="display: none;"></button>
<button type="button" class="btn btn-success" id="idButtonSubmitProjeto" onclick="submeterProposta()">{{ __('Atualizar Projeto') }}</button>
</div>
</div>
</div>
</div>
</div>
<!--X Finalizar X-->
\ No newline at end of file
<!-- 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-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Área do(s) discente(s)</h5></div>
<div class="col-md-10">
<div class="card" style="border-radius: 12px; padding:15px">
<div class="card-body" style="margin-bottom: -2rem">
<div class="d-flex justify-content-between align-items-center">
<div><h5 style="color: #1492E6; margin-top:0.5rem">Discente(s)</h5></div>
<div>
<button type="button" class="btn btn-light" id="buttonMais" >Adicionar discente </button>
{{-- <button type="button" class="btn btn-light" id="buttonMenos" >Remover participante</button> --}}
</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" >
@foreach ($participantes as $key => $p)
<div class="form-row mt-2">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{ $p->id }}" 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:4.3px">
<button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante{{ $p->id }}">
<div class="container">
<div class="row">
<input type="hidden" name="participante_id[]" value="{{ $p->id }}">
<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="{{ $p->user->name }}" name="nomeParticipante[]" placeholder="Nome Completo" required />
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" value="{{ $p->user->email }}" name="emailParticipante[]" placeholder="E-mail" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{ $p->data_de_nascimento }}" name="data_de_nascimento[]" placeholder="Data de nascimento" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{ $p->user->cpf }}" name="cpf[]" placeholder="CPF" required />
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF inválido.</span>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF válido.</span>
</span>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" value="{{ $p->rg }}" min="1" maxlength="8" name="rg[]" placeholder="RG" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{ $p->user->celular }}" name="celular[]" placeholder="Celular" required/>
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="number" class="form-control" value="{{ $p->user->endereco->cep }}" name="cep[]" placeholder="CEP" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf[]" id="estado" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if( $p->user->endereco->uf == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{ $p->user->endereco->cidade }}" name="cidade[]" placeholder="Cidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{ $p->user->endereco->bairro }}" name="bairro[]" placeholder="Bairro" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{ $p->user->endereco->rua }}" name="rua[]" placeholder="Rua" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{ $p->user->endereco->numero }}" name="numero[]" placeholder="Número" required/>
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento'])
<input type="text" class="form-control" value="{{ $p->user->endereco->complemento }}" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento" required/>
@endcomponent
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" value="{{ $p->user->instituicao }}" name="universidade[]" placeholder="Universidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" value="{{ $p->curso }}" name="curso[]" placeholder="Curso" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[]" class="form-control" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if($p->turno == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
@endcomponent
</div>
@php
$options = array('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 do curso'])
<select name="total_periodos[]" class="form-control" onchange="gerarPeriodo(this)" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if($p->total_periodos == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" required >
<option value="" disabled selected>-- Selecione uma opção --</option>
<option selected value="{{ $p->periodo_atual }}">{{ $p->periodo_atual }}</option>
</select>
@endcomponent
</div>
<div class="col-6">
@php
$ordens = array('1' => 1, '2' => 2,'3' => 3,);
@endphp
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
@foreach ($ordens as $ordem)
<option @if($p->ordem_prioridade == $ordem) @endif selected value="{{ $p->ordem_prioridade }}">{{ $p->ordem_prioridade }}</option>
@endforeach
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" value="{{ $p->media_do_curso }}" name="media_geral_curso[]" min="0" max="10" step="0.01" required>
@endcomponent
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6">
{{-- @dd($arquivos) --}}
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{ $arquivos[$loop->index]->titulo }}" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" value="{{ $arquivos[$loop->index]->titulo }}" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@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>
@endforeach
</div>
</div>
</li>
</ol>
</div>
</div>
<!--X Participantes X-->
<!-- projeto -->
<div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">1º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do projeto</h5></div>
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do projeto</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 10px">
<label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" placeholder="Digite o nome do projeto" value="{{ $projeto->titulo }}" autocomplete="nomeProjeto" required >
@error('nomeProjeto')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
{{-- @dd($projeto->grandeArea->nome) --}}
<div class="form-group col-md-4">
<label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" required>
<option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea)
<option @if($projeto->grandeArea->id == $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endforeach
</select>
@error('grandeArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldArea" value="{{ old('area') }}" >
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" required>
@foreach($areas as $area)
<option @if($projeto->area->id == $area->id ) selected @endif value="{{$area->id}}">{{$area->nome}}</option>
@endforeach
</select>
@error('area')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-4">
<label for="subArea" class="col-form-label">{{ __('Subárea') }} </label>
<input type="hidden" id="oldSubArea" value="{{ old('subArea') }}" >
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="subArea" >
<option value="" disabled selected hidden>-- Subárea --</option>
@if ($projeto->subarea != null)
@foreach($subareas as $subarea)
<option @if($projeto->subarea->id == $subarea->id ) selected @endif value="{{$subarea->id}}">{{$subarea->nome}}</option>
@endforeach
@endif
</select>
@error('subArea')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X projeto X-->
\ No newline at end of file
<!-- Proponente -->
<div class="col-md-10" style="text-align: center; margin-top:2rem"><h4 style="margin-top: 1rem;">2º Passo</h4></div>
<div class="col-md-10" style="text-align: center;"><h5 style="margin-bottom:1rem;color:#909090">Preencha os campos com as informações do proponente</h5></div>
<div class="col-md-10">
<div class="card" style="border-radius: 12px">
<div class="card-body">
<div class="container">
<div class="form-row mt-3">
<div class="col-md-12"><h5 style="color: #1492E6; margin-bottom:-0.4rem">Informações do proponente</h5></div>
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 15px">
<label for="nomeCompletoProponente1">Proponente</label>
<input class="form-control" type="text" id="nomeCompletoProponente1" name="nomeCoordenador" disabled="disabled" value="{{ Auth()->user()->name }}">
</div>
<div class="form-group col-md-6">
<label for="linkLattesEstudante">Link do currículo Lattes<span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('linkLattesEstudante') is-invalid @enderror" type="text" name="linkLattesEstudante"
@if(Auth()->user()->proponentes != null && Auth()->user()->proponentes->linkLattes != null)
value="{{ Auth()->user()->proponentes->linkLattes }}"
@else
value=""
@endif required >
<small>Ex.: http://lattes.cnpq.br/8363536830656923</small>
@error('linkLattesEstudante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="linkGrupo">Link do grupo de pesquisa</label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="url" name="linkGrupo"
value="{{ $projeto->linkGrupoPesquisa }}" required>
<small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
@error('linkGrupo')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
<label for="pontuacaoPlanilha">Valor da planilha de pontuação <span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('pontuacaoPlanilha') is-invalid @enderror" type="number" min="0" name="pontuacaoPlanilha"
value="{{ $projeto->pontuacaoPlanilha }}" required>
@error('pontuacaoPlanilha')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
</div>
</div>
</div>
</div>
<!--X Proponente X-->
\ No newline at end of file
......@@ -1155,6 +1155,9 @@
</div>
</div>
</div>
<div>
<button type="button" class="btn btn-success mt-4" id="exportarPDF">Imprimir proposta</button>
</div>
</div>
</div>
......@@ -1181,10 +1184,7 @@
</div>
</div> --}}
<!--X Finalizar X-->
</div>
<div>
<a class="btn btn-success mt-4" href="{{ route('exportar.projeto', ['id' => $projeto->id]) }}" target="_blank" rel="noopener noreferrer">Baixar PDF</a>
<button type="button" class="btn btn-success mt-4" id="exportarPDF">Imprimir proposta</button>
</div>
</div>
{{-- </form> --}}
......
......@@ -145,11 +145,12 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
Route::get('/baixar/anexo-projeto/{id}', 'TrabalhoController@baixarAnexoProjeto' )->name('baixar.anexo.projeto');
Route::get('/baixar/anexo-consu/{id}', 'TrabalhoController@baixarAnexoConsu' )->name('baixar.anexo.consu');
Route::get('/baixar/anexo-comite/{id}', 'TrabalhoController@baixarAnexoComite' )->name('baixar.anexo.comite');
Route::get('/baixar/anexo-justificativa/{id}', 'TrabalhoController@baixarAnexoJustificativa' )->name('baixar.anexo.justificativa');
Route::get('/baixar/anexo-justificativa/{id}', 'TrabalhoController@baixarAnexoJustificativa')->name('baixar.anexo.justificativa');
Route::get('/baixar/anexo-lattes/{id}', 'TrabalhoController@baixarAnexoLattes' )->name('baixar.anexo.lattes');
Route::get('/baixar/anexo-planilha/{id}','TrabalhoController@baixarAnexoPlanilha' )->name('baixar.anexo.planilha');
Route::get('/baixar/plano-de-trabalho/{id}', 'ArquivoController@baixarPlano' )->name('baixar.plano');
Route::get('/baixar/anexo-temp/{eventoId}/{nomeAnexo}', 'TrabalhoController@baixarAnexoTemp' )->name('baixar.anexo.temp');
Route::get('/baixar/anexoGrupoPesquisa/{id}', 'ArquivoController@baixarAnexoGrupoPesquisa' )->name('baixar.anexoGrupoPesquisa');
Route::get('/baixar/anexo-temp/{eventoId}/{nomeAnexo}', 'TrabalhoController@baixarAnexoTemp')->name('baixar.anexo.temp');
Route::get('/baixar/evento-temp/{nomeAnexo}', 'TrabalhoController@baixarEventoTemp' )->name('baixar.evento.temp');
});
......
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