Commit 9392de1b authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste

parent 7c65879e
......@@ -303,7 +303,7 @@ class TrabalhoController extends Controller
// Anexo grupo pesquisa
if(isset($request->anexoGrupoPesquisa)){
$trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoPlanilha, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension());
$trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoGrupoPesquisa, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension());
}
return $trabalho;
......@@ -796,8 +796,8 @@ class TrabalhoController extends Controller
}
public function baixarAnexoGrupoPesquisa($id) {
$projeto = Trabalho::find($id);
if (Storage::disk()->exists($projeto->anexoProjeto)) {
return Storage::download($projeto->anexoProjeto);
if (Storage::disk()->exists($projeto->anexoGrupoPesquisa)) {
return Storage::download($projeto->anexoGrupoPesquisa);
}
return abort(404);
}
......
......@@ -28,7 +28,7 @@
</div>
<div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)'])
<input type="file" class="input-group-text" name="anexoConsuPreenchido" placeholder="anexoConsuPreenchido" accept=".pdf" required/>
<input type="file" class="input-group-text" name="anexoCONSU" placeholder="anexoCONSU" accept=".pdf" required/>
@endcomponent
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
......
......@@ -12,7 +12,7 @@
<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()">{{ __('Enviar Projeto') }}</button>
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Enviar Projeto') }}</button>
</div>
</div>
</div>
......
<!-- 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>
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Projeto (.pdf)'])
<input type="file" class="input-group-text" name="anexoProjeto" placeholder="nomeProjeto" accept="application/pdf" required/>
@endcomponent
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Currículo Lattes do Proponente (.pdf)'])
<input type="file" class="input-group-text" name="anexoLattesCoordenador" placeholder="anexoPlanoTrabalho" accept=".pdf" required/>
@endcomponent
</div>
<div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Planilha de Pontuação (.xlsx,.xls,.ods)'])
<input type="file" class="input-group-text" name="anexoPlanilha" placeholder="anexoPlanoTrabalho" accept=".xlsx, .xls, .ods" required/>
@endcomponent
</div>
<div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)'])
<input type="file" class="input-group-text" name="anexoConsuPreenchido" placeholder="anexoConsuPreenchido" accept=".pdf" required/>
@endcomponent
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)'])
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" required/>
@endcomponent
</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" required/>
@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" required/>
@endcomponent
</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="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Enviar 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" >
<div class="form-row">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante" 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">
<div class="container">
<div class="row">
<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 " name="nomeParticipante[]" placeholder="Nome Completo" required />
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" 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" 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" name="cpf[]" placeholder="CPF" required onchange="checarCPFdoCampo(this)" onkeyup="mascaraCPF(this)"/>
<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" min="1" maxlength="12" name="rg[]" placeholder="RG" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control 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" 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(old('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" name="cidade[]" placeholder="Cidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" name="bairro[]" placeholder="Bairro" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" name="rua[]" placeholder="Rua" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" name="numero[]" placeholder="Número" required/>
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => ''])
<input type="text" class="form-control" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento" />
@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" name="universidade[]" placeholder="Universidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" 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(old('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(old('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>
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" 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">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" 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" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" required/>
@endcomponent
</div>
</div>
</div>
</div>
</div>
</div>
</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="{{ old('nomeProjeto') !== null ? old('nomeProjeto') : (isset($rascunho) ? $rascunho->titulo : '')}}" autocomplete="nomeProjeto" 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)
<option @if(old('grandeArea') !== null ? old('grandeArea') : (isset($rascunho) ? $rascunho->grande_area_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>
<option value="" disabled selected hidden>-- Área --</option>
</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>
{{-- @foreach($subAreas as $subArea)
<option @if(old('subArea') !== null ? old('subArea') : (isset($rascunho) ? $rascunho->sub_area_id : '')
==$subArea->id ) selected @endif value="{{$subArea->id}}">{{$subArea->nome}}</option>
@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-->
\ 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="{{old('linkGrupo') !== null ? old('linkGrupo') : (isset($rascunho) ? $rascunho->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="{{old('pontuacaoPlanilha') !== null ? old('pontuacaoPlanilha') : (isset($rascunho) ? $rascunho->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
@extends('layouts.app')
@section('content')
<div>
{{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" >
@csrf
<input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container">
@if (session('mensagem'))
<div class="alert alert-warning" role="alert">
{{ session('mensagem') }}
</div>
@endif
<div class="row justify-content-center">
@component('evento.formulario.projeto', ['grandeAreas' => $grandeAreas])
@endcomponent
@component('evento.formulario.proponente')
@endcomponent
@component('evento.formulario.anexos')
@endcomponent
@component('evento.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno])
@endcomponent
@component('evento.formulario.finalizar')
@endcomponent
</div>
</div>
</form>
<div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent
</div>
<!-- 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>
</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 discentes 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>
let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let buttonSubmitRascunho = document.getElementById('idButtonSubmitRascunho');
let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild;
let contador = 0;
buttonSubmit.addEventListener('click', (e)=>{
$('.collapse').addClass('show')
})
buttonSubmitRascunho.addEventListener('click', (e)=>{
})
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--;
}
}
}
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);
$("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();
}
});
$.validator.addMethod("alpha", function(value, element) {
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
});
$('.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('');
}
});
$.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( {
ignore: false,
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: 12,
},
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;
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',
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, 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});
}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});
}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, 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 1
*
*/
// 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>`;
// }
// });
// });
// $(document).ready(function(){
// $(".cpf").change(function(){
// console.log(this.parentElement.children[0])
// if (validarCPF(retirarFormatacao(this.value))) {
// 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";
// }
// });
// });
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 {
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;
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;
}
function submeterProposta() {
if (checarCpfs()) {
document.getElementById("submeterFormProposta").click();
} 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
......@@ -675,4 +675,4 @@
input.value = resultado;
}
</script>
@endsection
@endsection
\ No newline at end of file
......@@ -254,6 +254,7 @@
min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
});
$( "#criarProjetoForm" ).validate( {
ignore: false,
lang: 'PT_BR',
rules: {
firstname: "required",
......
......@@ -149,7 +149,7 @@ Route::group(['middleware' => ['isTemp', 'auth', 'verified']], function(){
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/anexoGrupoPesquisa/{id}', 'ArquivoController@baixarAnexoGrupoPesquisa' )->name('baixar.anexoGrupoPesquisa');
Route::get('/baixar/anexoGrupoPesquisa/{id}', 'TrabalhoController@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