Unverified Commit caaea21e authored by Nathalia Santos's avatar Nathalia Santos Committed by GitHub
Browse files

Merge pull request #727 from Wolf-gangSE/remover-obrigatoriedade-discente

Remover obrigatoriedade do discente em edital
parents 2be90919 4e072167
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<div class="col-sm-2"> <div class="col-sm-2">
<label for="numParticipantes" class="col-form-label">{{ __('Nº de Discentes:') }}<span style="color:red; font-weight:bold;">*</span></label> <label for="numParticipantes" class="col-form-label">{{ __('Nº de Discentes:') }}<span style="color:red; font-weight:bold;">*</span></label>
<input id="numParticipantes" type="number" min="1" max="500" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ old('numParticipantes') }}" required autocomplete="numParticipantes" autofocus> <input id="numParticipantes" type="number" min="0" max="500" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ old('numParticipantes') }}" required autocomplete="numParticipantes" autofocus>
@error('numParticipantes') @error('numParticipantes')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<label for="numParticipantes" class="col-form-label">{{ __('Nº de Discentes:') }}<span style="color: red; font-weight: bold;">*</span></label> <label for="numParticipantes" class="col-form-label">{{ __('Nº de Discentes:') }}<span style="color: red; font-weight: bold;">*</span></label>
<input id="numParticipantes" type="number" min="1" max="500" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ $evento->numParticipantes }}" required autocomplete="numParticipantes" autofocus> <input id="numParticipantes" type="number" min="0" max="500" class="form-control @error('numParticipantes') is-invalid @enderror" name="numParticipantes" value="{{ $evento->numParticipantes }}" required autocomplete="numParticipantes" autofocus>
@error('numParticipantes') @error('numParticipantes')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
......
...@@ -85,6 +85,38 @@ ...@@ -85,6 +85,38 @@
</div> </div>
@endif @endif
@if ($edital->numParticipantes == 0)
<div class="col-md-3">
<br>
<label for="nomePlanoTrabalho" class="col-form-label font-tam" style="font-weight: bold">{{ __('Título do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho') ?? "" }}" name="nomePlanoTrabalho" maxlength="255" id="nomePlanoTrabalho" required>
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho">
</span>
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-3">
<br>
<label for="anexoPlanoTrabalho" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Anexo do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho') ?? "" }}" name="anexoPlanoTrabalho" accept=".pdf" placeholder="Anexo do Plano de Trabalho" required />
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@endif
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<label for="conflitosInteresse" class="col-form-label font-tam" <label for="conflitosInteresse" class="col-form-label font-tam"
...@@ -93,7 +125,7 @@ ...@@ -93,7 +125,7 @@
<div class="col-md-10"> <div class="col-md-10">
<br> <br>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse" <textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse"
id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ old('conflitosInteresse') }}</textarea> id="conflitosInteresse" name="conflitosInteresse" rows="3">{{ old('conflitosInteresse') }}</textarea>
@error('conflitosInteresse') @error('conflitosInteresse')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
@component('evento.formulario.anexos') @component('evento.formulario.anexos')
@endcomponent @endcomponent
@if ($edital->numParticipantes != 0)
@component('evento.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno]) @component('evento.formulario.participantes', ['estados' => $estados, 'enum_turno' => $enum_turno])
@endcomponent @endcomponent
@endif
@component('evento.formulario.finalizar') @component('evento.formulario.finalizar')
@endcomponent @endcomponent
...@@ -34,11 +36,13 @@ ...@@ -34,11 +36,13 @@
</div> </div>
</div> </div>
</form> </form>
@if ($edital->numParticipantes != 0)
<div id="participanteFirst" > <div id="participanteFirst" >
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
@endcomponent @endcomponent
</div> </div>
@endif
<!-- Modal de Aviso Edit --> <!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> <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-dialog modal-dialog-centered" role="document">
......
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div> <div>
{{-- action="{{route('trabalho.store')}}" --}} {{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" > <form method="POST" id="criarProjetoForm" action="{{route('trabalho.store')}}" enctype="multipart/form-data" >
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container"> <div class="container">
<div class="row justify-content-center" style="margin-top: 35px"> <div class="row justify-content-center" style="margin-top: 35px">
@include('evento.formulario.projeto') @include('evento.formulario.projeto')
@include('evento.formulario.proponente') @include('evento.formulario.proponente')
@if ($edital->numParticipantes != 0)
@include('evento.formulario.participantes') @include('evento.formulario.participantes')
@endif
@if($edital->natureza_id == 3)
@include('evento.formulario.integrantes') @if($edital->natureza_id == 3)
@endif @include('evento.formulario.integrantes')
@endif
@include('evento.formulario.anexos')
@include('evento.formulario.anexos')
@include('evento.formulario.finalizar')
@include('evento.formulario.finalizar')
<style>
.col-form-label { <style>
font-size: 15.5px; .col-form-label {
} font-size: 15.5px;
</style> }
</style>
</div>
</div> </div>
</form> </div>
<div id="participanteFirst" > </form>
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) @if ($edital->numParticipantes != 0)
<div id="participanteFirst" >
@endcomponent @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
</div>
<!-- Modal de Aviso Edit --> @endcomponent
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> </div>
<div class="modal-dialog modal-dialog-centered" role="document"> @endif
<div class="modal-content"> <!-- Modal de Aviso Edit -->
<div class="modal-header" id="idCorCabecalhoModalDocumento"> <div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<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> <div class="modal-dialog modal-dialog-centered" role="document">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-content">
<span aria-hidden="true">&times;</span> <div class="modal-header" id="idCorCabecalhoModalDocumento">
</button> <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>
</div> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<div class="modal-body"> <span aria-hidden="true">&times;</span>
<div class="row"> </button>
<div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div> </div>
<div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;"> <div class="modal-body">
</div> <div class="row">
</div> <div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div>
</div> <div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;">
<div class="modal-footer"> </div>
<button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button> </div>
</div> </div>
</div> <div class="modal-footer">
</div> <button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button>
</div> </div>
</div>
</div> </div>
<!-- Modal --> </div>
<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>
<div class="modal-content"> <!-- Modal -->
<div class="modal-header" style="background-color: red;"> <div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<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> <div class="modal-dialog modal-dialog-centered" role="document">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-content">
<span aria-hidden="true">&times;</span> <div class="modal-header" style="background-color: red;">
</button> <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>
</div> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<div class="modal-body"> <span aria-hidden="true">&times;</span>
Existe um CPF inválido em um dos discentes por favor corrija para continuar. </button>
</div> </div>
{{-- <div class="modal-footer"> <div class="modal-body">
{{-- <button type="button" class="btn btn-secondary"></button> Existe um CPF inválido em um dos discentes por favor corrija para continuar.
{{-- <button type="button" class="btn btn-primary">Certo</button> </div>
</div> --}} {{-- <div class="modal-footer">
</div> {{-- <button type="button" class="btn btn-secondary"></button>
</div> {{-- <button type="button" class="btn btn-primary">Certo</button>
</div> </div> --}}
</div> </div>
@endsection </div>
</div>
@section('javascript') </div>
@endsection
<script> @section('javascript')
let buttonSubmit = document.getElementById('idButtonSubmitProjeto'); <script>
let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
let parts = document.getElementById('participante');
let partsFirst = document.getElementById('participanteFirst'); let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
const participante = partsFirst.firstElementChild; let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
let contador = 0; @if($edital->numParticipantes != 0)
let parts = document.getElementById('participante');
buttonSubmit.addEventListener('click', (e)=>{ let partsFirst = document.getElementById('participanteFirst');
$('.collapse').addClass('show') const participante = partsFirst.firstElementChild;
@endif
}) let contador = 0;
buttonRascunho.addEventListener('click', (e)=>{
$('.collapse').addClass('show') buttonSubmit.addEventListener('click', (e)=>{
const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">'; $('.collapse').addClass('show')
$("#criarProjetoForm").append(input);
}) })
buttonRascunho.addEventListener('click', (e)=>{
function gerarPeriodo(e){ $('.collapse').addClass('show')
var select = e.parentElement.parentElement.nextElementSibling; const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">';
selectPeriodos = select.children[0].children[1]; $("#criarProjetoForm").append(input);
var html = `<option value="" disabled selected>-- TOTAL DE PERÍODOS --</option>`; })
for(var i = 0; i < parseInt(e.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`; @if($edital->numParticipantes != 0)
} function gerarPeriodo(e){
$(selectPeriodos).html(''); var select = e.parentElement.parentElement.nextElementSibling;
$(selectPeriodos).append(html); selectPeriodos = select.children[0].children[1];
var html = `<option value="" disabled selected>-- TOTAL DE PERÍODOS --</option>`;
} for(var i = 0; i < parseInt(e.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`;
function removerPart(e){ }
console.log(e) $(selectPeriodos).html('');
if(e.parentElement.parentElement){ $(selectPeriodos).append(html);
if(parts.children.length <= 1){
}
}else{
parts.removeChild(e.parentElement.parentElement); function removerPart(e){
//contador--; console.log(e)
} if(e.parentElement.parentElement){
if(parts.children.length <= 1){
}
} }else{
parts.removeChild(e.parentElement.parentElement);
buttonMais.addEventListener("click", (e) => { //contador--;
}
if(parts.children.length >= "{{ $edital->numParticipantes }}"){
alert('Limite de participante.') }
}else{ }
contador++;
var cln = participante.cloneNode(true); buttonMais.addEventListener("click", (e) => {
cln.setAttribute('style', " ");
var id = cln.children[2].firstElementChild.id; if(parts.children.length >= "{{ $edital->numParticipantes }}"){
var id2 = cln.children[0].firstElementChild.id; alert('Limite de participante.')
cln.children[2].firstElementChild.setAttribute('id', id + contador); }else{
cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador); contador++;
cln.children[0].firstElementChild.setAttribute('id', id2 + contador); var cln = participante.cloneNode(true);
cln.setAttribute('style', " ");
for (i = 0; i < cln.children.length; i++) { var id = cln.children[2].firstElementChild.id;
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) { var id2 = cln.children[0].firstElementChild.id;
let input = cln.children[i].querySelectorAll('input')[index]; cln.children[2].firstElementChild.setAttribute('id', id + contador);
let name = input.getAttributeNode("name").value; cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador);
name = name.replace("[]", ""); cln.children[0].firstElementChild.setAttribute('id', id2 + contador);
input.getAttributeNode("name").value = name + '['+ contador +']';
let select = cln.children[i].querySelectorAll('select')[index]; for (i = 0; i < cln.children.length; i++) {
if(select){ for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let selectName = select.getAttributeNode("name").value; let input = cln.children[i].querySelectorAll('input')[index];
selectName = selectName.replace("[", ""); let name = input.getAttributeNode("name").value;
selectName = selectName.replace("]", ""); name = name.replace("[]", "");
select.getAttributeNode("name").value = selectName + '['+ contador +']'; 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("[", "");
var SPMaskBehavior = function (val) { selectName = selectName.replace("]", "");
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; select.getAttributeNode("name").value = selectName + '['+ contador +']';
}, }
spOptions = {
onKeyPress: function(val, e, field, options) { }
field.mask(SPMaskBehavior.apply({}, arguments), options); }
} var SPMaskBehavior = function (val) {
}; return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
parts.appendChild(cln); },
$("input.cpf:text").val("").mask("000.000.000-00"); spOptions = {
$("input.celular:text").val("").mask(SPMaskBehavior, spOptions); onKeyPress: function(val, e, field, options) {
$("input.cep:text").val("").mask("00000-000"); 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");
$("input.rg:text").mask('00.000.000-0');
}
function marcar(id){
let nome = document.getElementById("nome"+id);
let linkNome = document.getElementById("nomePart"+(id+1)); });
let nomePlano = document.getElementById("nomePlano"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1)); $("input.rg:text").mask('00.000.000-0');
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
if(nome.value != ""){ function marcar(id){
if(planoTrabalho.value != ""){ let nome = document.getElementById("nome"+id);
nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; let linkNome = document.getElementById("nomePart"+(id+1));
let nomePlano = document.getElementById("nomePlano"+(id+1));
}else { let linkTituloProj = document.getElementById("tituloProj"+(id+1));
nomePlano.innerText = `Nome: ${nome.value}`; let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
} if(nome.value != ""){
}else{ if(planoTrabalho.value != ""){
nomePlano.innerText = `Discente `+(id+1); nomePlano.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
}
if(id >=1){ }else {
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true); nomePlano.innerText = `Nome: ${nome.value}`;
} }
}else{
document.getElementById("checkB"+id).checked = true; nomePlano.innerText = `Discente `+(id+1);
$("#atribuir1").attr('data-target','#exampleModal'+(id+1)); }
document.getElementById("part"+id).removeAttribute("hidden"); if(id >=1){
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
}
document.getElementById("checkB"+id).checked = true;
} $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
function desmarcar(id){ document.getElementById("part"+id).removeAttribute("hidden");
if(id >= 1){; document.getElementById("exampleModal"+id).modal('hide');
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); }
$("#atribuir1").attr('data-target','#exampleModal'+(id)); function desmarcar(id){
document.getElementById("exampleModal"+id).modal('hide'); if(id >= 1){;
} document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
</script> document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id));
<script> document.getElementById("exampleModal"+id).modal('hide');
}
$( document ).ready( function () { @endif
</script>
$('#nomeParticipante').keyup(function () {
$('#display').text($(this).val());
if($('#nomeParticipante').val() == ""){ <script>
$('#display').hide();
$('#pontos').hide(); $( document ).ready( function () {
}else{ @if($edital->numParticipantes != 0)
$('#display').show(); $('#nomeParticipante').keyup(function () {
$('#pontos').show(); $('#display').text($(this).val());
} if($('#nomeParticipante').val() == ""){
}); $('#display').hide();
$('#pontos').hide();
$.validator.addMethod("alpha", function(value, element) { }else{
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/); $('#display').show();
}); $('#pontos').show();
}
$('input.cep:text').mask('00000-000'); });
$('input.cpf:text').mask('000.000.000-00'); @endif
$('.numero').mask('0000000000000');
var SPMaskBehavior = function (val) { $.validator.addMethod("alpha", function(value, element) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
}, });
spOptions = {
onKeyPress: function(val, e, field, options) { @if($edital->numParticipantes != 0)
field.mask(SPMaskBehavior.apply({}, arguments), options); $('input.cep:text').mask('00000-000');
} $('input.cpf:text').mask('000.000.000-00');
}; $('.numero').mask('0000000000000');
$('.celular').mask(SPMaskBehavior, spOptions); var SPMaskBehavior = function (val) {
$('.sus').mask('000 0000 0000 0000'); return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
$("input[type='file']").on("change", function () { spOptions = {
if(this.files[0].size > 2000000) { onKeyPress: function(val, e, field, options) {
// console.log($(this).parents( ".col-sm-5" )) field.mask(SPMaskBehavior.apply({}, arguments), options);
alert("O tamanho do arquivo deve ser menor que 2MB!"); }
$(this).val(''); };
$('.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" ))
// $.validator.setDefaults( { alert("O tamanho do arquivo deve ser menor que 2MB!");
$(this).val('');
// submitHandler: function (form) {
// form.submit(); }
// } });
// } ); @endif
// jQuery.extend(jQuery.validator.messages, {
// required: "Este campo &eacute; requerido.",
// remote: "Por favor, corrija este campo.", // $.validator.setDefaults( {
// 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.", // submitHandler: function (form) {
// date: "Por favor, forne&ccedil;a uma data v&aacute;lida.", // form.submit();
// 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.", // jQuery.extend(jQuery.validator.messages, {
// creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.", // required: "Este campo &eacute; requerido.",
// equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.", // remote: "Por favor, corrija este campo.",
// accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.", // email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
// maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."), // url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
// minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."), // date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
// rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."), // dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
// range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."), // number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
// max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."), // digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
// min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.") // 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.",
// $( "#criarProjetoForm" ).validate( { // accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
// lang: 'PT_BR', // maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
// rules: { // minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
// firstname: "required", // rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
// username: { // range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
// required: true, // max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
// minlength: 2 // min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
// }, // });
// password: { // $( "#criarProjetoForm" ).validate( {
// required: true, // lang: 'PT_BR',
// minlength: 5 // rules: {
// }, // firstname: "required",
// confirm_password: { // username: {
// required: true, // required: true,
// minlength: 5, // minlength: 2
// equalTo: "#password" // },
// }, // password: {
// email: { // required: true,
// required: true, // minlength: 5
// email: true, // },
// confirm_password: {
// }, // required: true,
// "complemento[]":{ // minlength: 5,
// equalTo: "#password"
// },
// }, // email: {
// "nomeParticipante[]":{ // required: true,
// email: true,
// alpha:true,
// }, // },
// 'rg[]':{ // "complemento[]":{
// maxlength: 12,
// }, // },
// "nomeParticipante[]":{
// agree: "required"
// }, // alpha:true,
// messages: { // },
// // nomeProjeto: "O nome do projeto é obrigatório.", // 'rg[]':{
// // 'emailParticipante[]': "Este campo é obrigatório.", // maxlength: 12,
// // 'data_de_nascimento[]': "Este campo é obrigatório.", // },
// // 'cpf[]': "Este campo é obrigatório.",
// // 'rg[]': { // agree: "required"
// // required: "Este campo é obrigatório.", // },
// // maxlength: "Este campo deve conter no máximo 8 números." // messages: {
// // }, // // nomeProjeto: "O nome do projeto é obrigatório.",
// // 'celular[]': "Este campo é obrigatório.",
// // 'cep[]': "Este campo é obrigatório.", // // 'emailParticipante[]': "Este campo é obrigatório.",
// // 'uf[]': "Este campo é obrigatório.", // // 'data_de_nascimento[]': "Este campo é obrigatório.",
// // 'cidade[]': "Este campo é obrigatório.", // // 'cpf[]': "Este campo é obrigatório.",
// // 'bairro[]': "Este campo é obrigatório.", // // 'rg[]': {
// // 'rua[]': "Este campo é obrigatório.", // // required: "Este campo é obrigatório.",
// // 'numero[]': "Este campo é obrigatório.", // // maxlength: "Este campo deve conter no máximo 8 números."
// // 'complemento[]': "Este campo é obrigatório.", // // },
// // 'universidade[]': "Este campo é obrigatório.", // // 'celular[]': "Este campo é obrigatório.",
// // 'curso[]': "Este campo é obrigatório.", // // 'cep[]': "Este campo é obrigatório.",
// // 'turno[]': "Este campo é obrigatório.", // // 'uf[]': "Este campo é obrigatório.",
// // 'total_periodos[]': "Este campo é obrigatório.", // // 'cidade[]': "Este campo é obrigatório.",
// // 'periodo_atual[]': "Este campo é obrigatório.", // // 'bairro[]': "Este campo é obrigatório.",
// // 'ordem_prioridade[]': "Este campo é obrigatório.", // // 'rua[]': "Este campo é obrigatório.",
// // 'media_geral_curso[]': "Este campo é obrigatório.", // // 'numero[]': "Este campo é obrigatório.",
// // 'nomePlanoTrabalho[]': "Este campo é obrigatório.", // // 'complemento[]': "Este campo é obrigatório.",
// // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.", // // 'universidade[]': "Este campo é obrigatório.",
// // grandeArea: "Escolha uma grande área.", // // 'curso[]': "Este campo é obrigatório.",
// // area: "Escolha uma área.", // // 'turno[]': "Este campo é obrigatório.",
// // linkGrupo: "Este campo é obrigatório.", // // 'total_periodos[]': "Este campo é obrigatório.",
// // pontuacaoPlanilha: "Este campo é obrigatório.", // // 'periodo_atual[]': "Este campo é obrigatório.",
// // anexoProjeto: "Este campo é obrigatório.", // // 'ordem_prioridade[]': "Este campo é obrigatório.",
// // anexoLattesCoordenador: "Este campo é obrigatório.", // // 'media_geral_curso[]': "Este campo é obrigatório.",
// // anexoConsuPreenchido: "Este campo é obrigatório.", // // 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// // anexoGrupoPesquisa: "Este campo é obrigatório.", // // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// // anexoPlanilha: "Este campo é obrigatório.", // // grandeArea: "Escolha uma grande área.",
// // anexoComiteEtica: "Este campo é obrigatório.", // // area: "Escolha uma área.",
// // inputJustificativa: "Este campo é obrigatório.", // // linkGrupo: "Este campo é obrigatório.",
// // "nomeParticipante[]": { // // pontuacaoPlanilha: "Este campo é obrigatório.",
// // required: "O nome do participante é obrigatório.", // // anexoProjeto: "Este campo é obrigatório.",
// // alpha: "Não é permitido números." // // anexoLattesCoordenador: "Este campo é obrigatório.",
// // }, // // anexoConsuPreenchido: "Este campo é obrigatório.",
// // username: { // // anexoGrupoPesquisa: "Este campo é obrigatório.",
// // required: "Please enter a username", // // anexoPlanilha: "Este campo é obrigatório.",
// // minlength: "Your username must consist of at least 2 characters" // // anexoComiteEtica: "Este campo é obrigatório.",
// // }, // // inputJustificativa: "Este campo é obrigatório.",
// // password: { // // "nomeParticipante[]": {
// // required: "Please provide a password", // // required: "O nome do participante é obrigatório.",
// // minlength: "Your password must be at least 5 characters long" // // alpha: "Não é permitido números."
// // }, // // },
// // confirm_password: { // // username: {
// // required: "Please provide a password", // // required: "Please enter a username",
// // minlength: "Your password must be at least 5 characters long", // // minlength: "Your username must consist of at least 2 characters"
// // equalTo: "Please enter the same password as above" // // },
// // }, // // password: {
// // email: "Please enter a valid email address", // // required: "Please provide a password",
// // agree: "Please accept our policy" // // minlength: "Your password must be at least 5 characters long"
// }, // // },
// errorElement: "em", // // confirm_password: {
// errorPlacement: function ( error, element ) { // // required: "Please provide a password",
// // Add the `help-block` class to the error element // // minlength: "Your password must be at least 5 characters long",
// error.addClass( "invalid-feedback" ); // // equalTo: "Please enter the same password as above"
// // },
// if ( element.prop( "type" ) === "checkbox" ) { // // email: "Please enter a valid email address",
// error.insertAfter( element.parent( "label" ) ); // // agree: "Please accept our policy"
// } else { // },
// error.insertAfter( element ); // errorElement: "em",
// } // errorPlacement: function ( error, element ) {
// }, // // Add the `help-block` class to the error element
// highlight: function ( element, errorClass, validClass ) { // error.addClass( "invalid-feedback" );
// $( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" );
// }, // if ( element.prop( "type" ) === "checkbox" ) {
// unhighlight: function (element, errorClass, validClass) { // error.insertAfter( element.parent( "label" ) );
// $( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" ); // } else {
// } // error.insertAfter( element );
// } ); // }
// },
} ); // highlight: function ( element, errorClass, validClass ) {
</script> // $( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" );
// },
// unhighlight: function (element, errorClass, validClass) {
<script type="text/javascript"> // $( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" );
// }
function validarCPF(valor){ // } );
var soma = 0;
var resto; } );
var inputCPF = valor.match(/\d/g).join(''); </script>
if(inputCPF == '00000000000') return false;
<script type="text/javascript">
if(inputCPF.length >11) return false;
function validarCPF(valor){
for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i); var soma = 0;
resto = (soma * 10) % 11; var resto;
var inputCPF = valor.match(/\d/g).join('');
if((resto == 10) || (resto == 11)) resto = 0;
if(resto != parseInt(inputCPF.substring(9, 10))) return false; if(inputCPF == '00000000000') return false;
soma = 0; if(inputCPF.length >11) return false;
for(i = 1; i <= 10; i++) soma = soma + parseInt(inputCPF.substring(i-1, i))*(12-i);
resto = (soma * 10) % 11; 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(10, 11))) return false; if((resto == 10) || (resto == 11)) resto = 0;
return true; 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);
* FUNCAO: Gerar as areas resto = (soma * 10) % 11;
*
*/ if((resto == 10) || (resto == 11)) resto = 0;
function areas() { if(resto != parseInt(inputCPF.substring(10, 11))) return false;
var grandeArea = $('#grandeArea').val(); return true;
$.ajax({ }
type: 'POST',
url: '{{ route('area.consulta') }}', /*
data: 'id='+grandeArea , * FUNCAO: Gerar as areas
headers: *
{ */
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') function areas() {
}, var grandeArea = $('#grandeArea').val();
success: (dados) => { $.ajax({
type: 'POST',
if (dados.length > 0) { url: '{{ route('area.consulta') }}',
if($('#oldArea').val() == null || $('#oldArea').val() == ""){ data: 'id='+grandeArea ,
var option = '<option selected disabled>-- Área --</option>'; headers:
} {
$.each(dados, function(i, obj) { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){ },
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; success: (dados) => {
}else{
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; if (dados.length > 0) {
} if($('#oldArea').val() == null || $('#oldArea').val() == ""){
}) var option = '<option selected disabled>-- Área --</option>';
} else { }
var option = "<option selected disabled>-- Área --</option>"; $.each(dados, function(i, obj) {
} if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
$('#area').html(option).show(); option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
subareas(); }else{
}, option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
error: (data) => { }
console.log(data); })
} } else {
var option = "<option selected disabled>-- Área --</option>";
}) }
} $('#area').html(option).show();
/* subareas();
* FUNCAO: Gerar as subareas },
* error: (data) => {
*/ console.log(data);
function subareas() { }
var area = $('#area').val();
$.ajax({ })
type: 'POST', }
url: '{{ route('subarea.consulta') }}', /*
data: 'id='+area , * FUNCAO: Gerar as subareas
headers: *
{ */
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') function subareas() {
}, var area = $('#area').val();
success: (dados)=> { $.ajax({
if (dados.length > 0) { type: 'POST',
if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){ url: '{{ route('subarea.consulta') }}',
var option = '<option selected disabled>-- Subárea --</option>'; data: 'id='+area ,
} headers:
$.each(dados, function(i, obj) { {
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){ 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; },
}else{ success: (dados)=> {
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; if (dados.length > 0) {
} if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){
}) var option = '<option selected disabled>-- Subárea --</option>';
} else { }
var option = "<option selected disabled>-- Subárea --</option>"; $.each(dados, function(i, obj) {
} if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
$('#subArea').html(option).show(); option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
}, }else{
error: (dados) => { option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
console.log(dados); }
} })
} else {
}) var option = "<option selected disabled>-- Subárea --</option>";
}
} $('#subArea').html(option).show();
/* },
* FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?" error: (dados) => {
* console.log(dados);
*/ }
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"; * FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; *
}else if(valor == "nao"){ */
document.getElementById("radioSim").checked = false; function displayAutorizacoesEspeciais(valor){
document.getElementById("radioNao").checked = true; if(valor == "sim"){
document.getElementById("displaySim").style.display = "none"; document.getElementById("radioSim").checked = true;
document.getElementById("displayNao").style.display = "block"; document.getElementById("radioNao").checked = false;
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("displaySim").style.display = "block";
} document.getElementById("displayNao").style.display = "none";
} document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
/* }else if(valor == "nao"){
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF) document.getElementById("radioSim").checked = false;
* document.getElementById("radioNao").checked = true;
*/ document.getElementById("displaySim").style.display = "none";
function verificarArquivoAnexado_pdf(item, legenda){ document.getElementById("displayNao").style.display = "block";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
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."; * FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
document.getElementById(item.id).value = ""; *
$("#exampleModalAnexarDocumento").modal({show: true}); */
}else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){ function verificarArquivoAnexado_pdf(item, legenda){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!"; if(item.files[0].type.split('/')[1] != "pdf"){
document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB."; document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById(item.id).value = ""; document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo PDF! ";
$("#exampleModalAnexarDocumento").modal({show: true}); document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
}else{ document.getElementById(item.id).value = "";
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; $("#exampleModalAnexarDocumento").modal({show: true});
} }else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){
} document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS) 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 = "";
function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){ $("#exampleModalAnexarDocumento").modal({show: true});
if(item.files[0].name.split('.')[1] == "xls" || item.files[0].name.split('.')[1] == "ods" || item.files[0].name.split('.')[1] == "xlsx"){ }else{
if(item.files[0].size > 2000000){ document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
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."; /* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
document.getElementById(item.id).value = ""; *
$("#exampleModalAnexarDocumento").modal({show: true}); */
}else{ function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; 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){
}else{ document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
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(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB."; document.getElementById(item.id).value = "";
document.getElementById(item.id).value = ""; $("#exampleModalAnexarDocumento").modal({show: true});
$("#exampleModalAnexarDocumento").modal({show: true}); }else{
} document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
}
} }else{
/* document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
* FUNCAO: Gerar periodos 1 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 = "";
// function gerarPeriodos1(select) { $("#exampleModalAnexarDocumento").modal({show: true});
// 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>`; * FUNCAO: Gerar periodos 1
// } *
// }); */
// }); // function gerarPeriodos1(select) {
// var div = select.parentElement.parentElement;
// $(document).ready(function(){ // var selectPeriodos = div.children[22].children[1];
// $(".cpf").change(function(){ // var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`;
// console.log(this.parentElement.children[0]) // for(var i = 0; i < parseInt(select.value); i++) {
// if (validarCPF(retirarFormatacao(this.value))) { // html += `<option value="${i+1}">${i+1}º</option>`;
// }
// this.parentElement.children[1].style.display = "none"; // });
// this.parentElement.children[2].style.display = "block"; // });
// } else {
// this.parentElement.children[1].style.display = "block"; // $(document).ready(function(){
// this.parentElement.children[2].style.display = "none"; // $(".cpf").change(function(){
// } // console.log(this.parentElement.children[0])
// }); // if (validarCPF(retirarFormatacao(this.value))) {
// });
// this.parentElement.children[1].style.display = "none";
function checarCPFdoCampo(input) { // this.parentElement.children[2].style.display = "block";
if (input.value.length == 14) { // } else {
if (validarCPF(retirarFormatacao(input.value))) { // this.parentElement.children[1].style.display = "block";
input.parentElement.children[1].style.display = "none"; // this.parentElement.children[2].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";
} function checarCPFdoCampo(input) {
} else { if (input.value.length == 14) {
input.parentElement.children[1].style.display = "none"; if (validarCPF(retirarFormatacao(input.value))) {
input.parentElement.children[2].style.display = "none"; input.parentElement.children[1].style.display = "none";
} input.parentElement.children[2].style.display = "block";
} } else {
input.parentElement.children[1].style.display = "block";
function validarCPF(strCPF) { input.parentElement.children[2].style.display = "none";
var soma; }
var resto; } else {
soma = 0; input.parentElement.children[1].style.display = "none";
// Verifica se foi informado todos os digitos corretamente input.parentElement.children[2].style.display = "none";
if (strCPF.length != 11) { }
return false; }
}
function validarCPF(strCPF) {
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11 var soma;
if (varificarDigitos(strCPF)) { var resto;
return false; soma = 0;
} // Verifica se foi informado todos os digitos corretamente
if (strCPF.length != 11) {
// Faz o calculo para validar o CPF return false;
for (var t = 9; t < 11; t++) { }
for (var d = 0, c = 0; c < t; c++) {
d += strCPF[c] * ((t + 1) - c); // Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
} if (varificarDigitos(strCPF)) {
d = ((10 * d) % 11) % 10; return false;
if (strCPF[c] != d) { }
return false;
} // Faz o calculo para validar o CPF
} for (var t = 9; t < 11; t++) {
return true; for (var d = 0, c = 0; c < t; c++) {
} d += strCPF[c] * ((t + 1) - c);
}
function retirarFormatacao(strCpf) { d = ((10 * d) % 11) % 10;
resultado = ""; if (strCPF[c] != d) {
for(var i = 0; i < strCpf.length; i++) { return false;
if (strCpf[i] != "." && strCpf[i] != "-") { }
resultado += strCpf[i]; }
} return true;
} }
return resultado;
} function retirarFormatacao(strCpf) {
resultado = "";
function varificarDigitos(strCpf) { for(var i = 0; i < strCpf.length; i++) {
var cont = 1; if (strCpf[i] != "." && strCpf[i] != "-") {
dig1 = strCpf[0]; resultado += strCpf[i];
}
for(var i = 1; i < strCpf.length; i++) { }
if(dig1 == strCpf[i]) { return resultado;
cont++; }
}
} function varificarDigitos(strCpf) {
if (cont == strCpf.length) { var cont = 1;
return true; dig1 = strCpf[0];
}
return false; for(var i = 1; i < strCpf.length; i++) {
} if(dig1 == strCpf[i]) {
cont++;
function checarCpfs() { }
var validacoes = document.getElementsByClassName("cpf-invalido"); }
var count = validacoes.length; if (cont == strCpf.length) {
var quant = 0; return true;
for(var i = 0; i < validacoes.length; i++) { }
if (validacoes[i].style.display == "none") { return false;
quant++; }
}
} function checarCpfs() {
if(quant == count) { var validacoes = document.getElementsByClassName("cpf-invalido");
return true; var count = validacoes.length;
} var quant = 0;
return false; for(var i = 0; i < validacoes.length; i++) {
} if (validacoes[i].style.display == "none") {
quant++;
function submeterProposta() { }
if (checarCpfs()) { }
document.getElementById("submeterFormProposta").click(); if(quant == count) {
} else { return true;
$("#modalCpfInvalido").modal('show'); }
} return false;
} }
function mascaraCPF(input) { function submeterProposta() {
var numeros = "0123456789.-"; if (checarCpfs()) {
var resultado = ""; document.getElementById("submeterFormProposta").click();
if (input.value.length < 14) { } else {
for (var i = 0; i < input.value.length; i++) { $("#modalCpfInvalido").modal('show');
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] != "-") { function mascaraCPF(input) {
resultado += input.value[i] + "-"; var numeros = "0123456789.-";
} else { var resultado = "";
resultado += input.value[i]; 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] != ".") {
} else { resultado += input.value[i] + ".";
for (var i = 0; i < 14; i++) { } else if (i == 10 && input.value[i+1] != "-") {
resultado += input.value[i]; resultado += input.value[i] + "-";
} } else {
} resultado += input.value[i];
input.value = resultado; }
} }
}
function showInstituicao(instituicao){ } else {
var instituicaoSelect = instituicao; for (var i = 0; i < 14; i++) {
var idSelect = instituicaoSelect.name; resultado += input.value[i];
var instituicao = document.getElementById('outra'+idSelect); }
var display = document.getElementById('display'+idSelect); }
input.value = resultado;
if(instituicaoSelect.value === "Outra"){ }
display.style.display = "block";
instituicao.parentElement.style.display = ''; function showInstituicao(instituicao){
instituicao.value=""; var instituicaoSelect = instituicao;
}else if(instituicaoSelect.value === "UFAPE"){ var idSelect = instituicaoSelect.name;
display.style.display = "none"; var instituicao = document.getElementById('outra'+idSelect);
} var display = document.getElementById('display'+idSelect);
}
if(instituicaoSelect.value === "Outra"){
function showCurso(curso){ display.style.display = "block";
var cursoSelect = curso; instituicao.parentElement.style.display = '';
var idSelect = cursoSelect.name; instituicao.value="";
var curso = document.getElementById('outro'+idSelect); }else if(instituicaoSelect.value === "UFAPE"){
var displayCurso = document.getElementById('display'+idSelect); display.style.display = "none";
}
if(cursoSelect.value === "Outro"){ }
displayCurso.style.display = "block";
curso.parentElement.style.display = ''; function showCurso(curso){
curso.value=""; var cursoSelect = curso;
}else{ var idSelect = cursoSelect.name;
displayCurso.style.display = "none"; var curso = document.getElementById('outro'+idSelect);
} var displayCurso = document.getElementById('display'+idSelect);
}
</script> if(cursoSelect.value === "Outro"){
displayCurso.style.display = "block";
curso.parentElement.style.display = '';
curso.value="";
}else{
displayCurso.style.display = "none";
}
}
</script>
@endsection @endsection
\ No newline at end of file
...@@ -21,18 +21,21 @@ ...@@ -21,18 +21,21 @@
<th scope="col" style="width:400px; text-align: center;">Projeto</th> <th scope="col" style="width:400px; text-align: center;">Projeto</th>
<th scope="col" style="width:400px; text-align: center;">Proponente</th> <th scope="col" style="width:400px; text-align: center;">Proponente</th>
<th scope="col" style="width:400px; text-align: center;">Título do Plano</th> <th scope="col" style="width:400px; text-align: center;">Título do Plano</th>
@if ($evento->numParticipantes != 0)
<th scope="col" style="width:200px; text-align: center;">Discente</th> <th scope="col" style="width:200px; text-align: center;">Discente</th>
<th scope="col" style="width:200px; text-align: center;">Relatório Parcial</th> @endif
<th scope="col" style="width:200px; text-align: center;">Relatório Final</th> <th scope="col" style="width:200px; text-align: center;">Relatório Parcial</th>
<th scope="col" style="width:200px; text-align: center;">Relatório Final</th>
</tr> </tr>
</thead> </thead>
@foreach($arquivos as $arquivo) @foreach($arquivos as $arquivo)
<tbody> <tbody>
<td style="text-align: center;" title="{{$arquivo->trabalho->titulo}}">{{$arquivo->trabalho->titulo}}</td> <td style="text-align: center;" title="{{$arquivo->trabalho->titulo}}">{{$arquivo->trabalho->titulo}}</td>
<td style="text-align: center;" title="{{$arquivo->trabalho->proponente->user->name}}">{{$arquivo->trabalho->proponente->user->name}}</td> <td style="text-align: center;" title="{{$arquivo->trabalho->proponente->user->name}}">{{$arquivo->trabalho->proponente->user->name}}</td>
<td style="text-align: center;" title="{{$arquivo->titulo}}">{{$arquivo->titulo}}</td> <td style="text-align: center;" title="{{$arquivo->titulo}}">{{$arquivo->titulo}}</td>
@if ($evento->numParticipantes != 0)
<td style="text-align: center;" title="{{$arquivo->participante->user->name}}" id="td-nomeAluno">{{$arquivo->participante->user->name}}</td> <td style="text-align: center;" title="{{$arquivo->participante->user->name}}" id="td-nomeAluno">{{$arquivo->participante->user->name}}</td>
@endif
<td style="text-align: center;"> <td style="text-align: center;">
@if((Auth::user()->proponentes != null) && ($arquivo->relatorioParcial == null) && @if((Auth::user()->proponentes != null) && ($arquivo->relatorioParcial == null) &&
($arquivo->trabalho->evento->dt_inicioRelatorioParcial <= $hoje) && ($hoje <= $arquivo->trabalho->evento->dt_fimRelatorioParcial)) ($arquivo->trabalho->evento->dt_inicioRelatorioParcial <= $hoje) && ($hoje <= $arquivo->trabalho->evento->dt_fimRelatorioParcial))
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
</div> </div>
</div> </div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js%22%3E"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script> <script>
if("{{old('autorizacaoFlag')}}" == "sim"){ if("{{old('autorizacaoFlag')}}" == "sim"){
$('#radioSim').click(); $('#radioSim').click();
......
...@@ -96,6 +96,49 @@ ...@@ -96,6 +96,49 @@
</div> </div>
@endif @endif
@if ($edital->numParticipantes == 0)
@php
$arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first();
@endphp
<div class="col-md-3">
<br>
<label for="nomePlanoTrabalho" class="col-form-label font-tam" style="font-weight: bold">{{ __('Título do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
</div>
<div class="col-md-9">
<br>
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho') ?? $arquivo->titulo ?? "" }}" name="nomePlanoTrabalho" maxlength="255" id="nomePlanoTrabalho" required>
<span style="color: red; font-size: 12px" id="caracsRestantesnomePlanoTrabalho">
</span>
@error('nomePlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-md-3">
<br>
<label for="anexoPlanoTrabalho" class="col-form-label font-tam"
style="font-weight: bold">{{ __('Anexo do plano de trabalho: ') }}<span style="color: red; font-weight:bold">*</span></label>
@if ($proponente != null && $arquivo)
<a style="margin-left: 5px"
href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}">
<i class="fas fa-file-pdf fa-2x"></i></a>
@else
<p><i class="fas fa-times-circle fa-2x"></i></p>
@endif
</div>
<div class="col-md-9">
<br>
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho') ?? '' }}" name="anexoPlanoTrabalho" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
@endif
<div class="col-md-2"> <div class="col-md-2">
<br> <br>
<label for="conflitosInteresse" class="col-form-label font-tam" <label for="conflitosInteresse" class="col-form-label font-tam"
...@@ -104,7 +147,7 @@ ...@@ -104,7 +147,7 @@
<div class="col-md-10"> <div class="col-md-10">
<br> <br>
<textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse" <textarea class="form-control @error('conflitosInteresse') is-invalid @enderror" autocomplete="conflitosInteresse"
autofocus id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ $projeto->conflitosInteresse }}</textarea> id="conflitosInteresse" name="conflitosInteresse" rows="4">{{ $projeto->conflitosInteresse }}</textarea>
@error('conflitosInteresse') @error('conflitosInteresse')
<span class="invalid-feedback" role="alert"> <span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong> <strong>{{ $message }}</strong>
......
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div> <div>
{{-- action="{{route('trabalho.store')}}" --}} {{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="updateProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" > <form method="POST" id="updateProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" >
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container"> <div class="container">
{{-- @dd($errors->get('name.*')) --}} {{-- @dd($errors->get('name.*')) --}}
{{-- @dd($errors->has('cpf.*')) --}} {{-- @dd($errors->has('cpf.*')) --}}
{{-- @dd($errors->getBags()['default']->keys()) --}} {{-- @dd($errors->getBags()['default']->keys()) --}}
@if (session('mensagem')) @if (session('mensagem'))
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
{{ session('mensagem') }} {{ session('mensagem') }}
</div> </div>
@endif @endif
<!-- @if ($errors->any()) <!-- @if ($errors->any())
<div class="alert alert-danger"> <div class="alert alert-danger">
<ul> <ul>
@foreach ($errors->all() as $error) @foreach ($errors->all() as $error)
<li>{{ $error }}</li> <li>{{ $error }}</li>
@endforeach @endforeach
</ul> </ul>
</div> </div>
@endif --> @endif -->
<div class="row justify-content-center"> <div class="row justify-content-center">
@include('projeto.editaFormulario.projeto') @include('projeto.editaFormulario.projeto')
@include('projeto.editaFormulario.proponente') @include('projeto.editaFormulario.proponente')
@include('projeto.editaFormulario.participantes') @if ($edital->numParticipantes != 0)
@include('projeto.editaFormulario.participantes')
@if($edital->natureza_id == 3) @endif
@include('projeto.editaFormulario.integrantes')
@endif @if($edital->natureza_id == 3)
@include('projeto.editaFormulario.integrantes')
@include('projeto.editaFormulario.anexos') @endif
@include('projeto.editaFormulario.finalizar') @include('projeto.editaFormulario.anexos')
@include('projeto.editaFormulario.finalizar')
</div>
</div>
</form> </div>
<div id="participanteFirst" > </div>
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) </form>
@if ($edital->numParticipantes != 0)
@endcomponent <div id="participanteFirst" >
</div> @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
<!-- Modal de Aviso Edit -->
<div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> @endcomponent
<div class="modal-dialog modal-dialog-centered" role="document"> </div>
<div class="modal-content"> @endif
<div class="modal-header" id="idCorCabecalhoModalDocumento"> <!-- Modal de Aviso Edit -->
<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> <div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-dialog modal-dialog-centered" role="document">
<span aria-hidden="true">&times;</span> <div class="modal-content">
</button> <div class="modal-header" id="idCorCabecalhoModalDocumento">
</div> <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>
<div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<div class="row"> <span aria-hidden="true">&times;</span>
<div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div> </button>
<div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;"> </div>
</div> <div class="modal-body">
</div> <div class="row">
</div> <div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div>
<div class="modal-footer"> <div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;">
<button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button> </div>
</div> </div>
</div> </div>
</div> <div class="modal-footer">
</div> <button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button>
</div>
</div> </div>
<!-- Modal --> </div>
<div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> </div>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> </div>
<div class="modal-header" style="background-color: red;"> <!-- Modal -->
<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> <div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-dialog modal-dialog-centered" role="document">
<span aria-hidden="true">&times;</span> <div class="modal-content">
</button> <div class="modal-header" style="background-color: red;">
</div> <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>
<div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
Existe um CPF inválido em um dos discentes por favor corrija para continuar. <span aria-hidden="true">&times;</span>
</div> </button>
{{-- <div class="modal-footer"> </div>
{{-- <button type="button" class="btn btn-secondary"></button> <div class="modal-body">
{{-- <button type="button" class="btn btn-primary">Certo</button> Existe um CPF inválido em um dos discentes por favor corrija para continuar.
</div> --}} </div>
</div> {{-- <div class="modal-footer">
</div> {{-- <button type="button" class="btn btn-secondary"></button>
</div> {{-- <button type="button" class="btn btn-primary">Certo</button>
</div> </div> --}}
@endsection </div>
</div>
@section('javascript') </div>
</div>
@endsection
<script>
@section('javascript')
if(document.getElementById("radioSim").checked){
document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = false; <script>
document.getElementById("displaySim").style.display = "block";
document.getElementById("displayNao").style.display = "none"; if(document.getElementById("radioSim").checked){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = true;
}else{ document.getElementById("radioNao").checked = false;
document.getElementById("radioSim").checked = false; document.getElementById("displaySim").style.display = "block";
document.getElementById("radioNao").checked = true; document.getElementById("displayNao").style.display = "none";
document.getElementById("displaySim").style.display = "none"; document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
document.getElementById("displayNao").style.display = "block"; }else{
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = false;
} document.getElementById("radioNao").checked = true;
document.getElementById("displaySim").style.display = "none";
let buttonSubmit = document.getElementById('idButtonSubmitProjeto'); document.getElementById("displayNao").style.display = "block";
let buttonRascunho = document.getElementById('idButtonSubmitRascunho'); document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
let parts = document.getElementById('participante'); }
let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild; let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let contador = 0; let buttonRascunho = document.getElementById('idButtonSubmitRascunho');
@if($edital->numParticipantes != 0)
buttonSubmit.addEventListener('click', (e)=>{ let parts = document.getElementById('participante');
$('.collapse').addClass('show') let partsFirst = document.getElementById('participanteFirst');
const participante = partsFirst.firstElementChild;
}) @endif
buttonRascunho.addEventListener('click', (e)=>{ let contador = 0;
$('.collapse').addClass('show');
const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">'; buttonSubmit.addEventListener('click', (e)=>{
$("#updateProjetoForm").append(input); $('.collapse').addClass('show')
})
})
function gerarPeriodo(e){ buttonRascunho.addEventListener('click', (e)=>{
var select = e.parentElement.parentElement.nextElementSibling; $('.collapse').addClass('show');
selectPeriodos = select.children[0].children[1]; const input = '<input id="input_rascunho" type="hidden" name="rascunho" value="true">';
var html = `<option value="" disabled selected>-- TOTAL DE PERIODOS --</option>`; $("#updateProjetoForm").append(input);
for(var i = 0; i < parseInt(e.value); i++) { })
html += `<option value="${i+1}">${i+1}º</option>`; @if($edital->numParticipantes != 0)
} function gerarPeriodo(e){
$(selectPeriodos).html(''); var select = e.parentElement.parentElement.nextElementSibling;
$(selectPeriodos).append(html); 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>`;
function removerPart(e){ }
console.log(e) $(selectPeriodos).html('');
if(e.parentElement.parentElement){ $(selectPeriodos).append(html);
if(parts.children.length <= 1){
}
}else{
parts.removeChild(e.parentElement.parentElement); function removerPart(e){
//contador--; console.log(e)
} if(e.parentElement.parentElement){
if(parts.children.length <= 1){
}
} }else{
var SPMaskBehavior = function (val) { parts.removeChild(e.parentElement.parentElement);
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; //contador--;
}, }
spOptions = {
onKeyPress: function(val, e, field, options) { }
field.mask(SPMaskBehavior.apply({}, arguments), options); }
} var SPMaskBehavior = function (val) {
}; return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
$("input.cpf:text").mask("000.000.000-00"); spOptions = {
$("input.celular:text").mask(SPMaskBehavior, spOptions); onKeyPress: function(val, e, field, options) {
$("input.cep:text").mask("00000-000"); field.mask(SPMaskBehavior.apply({}, arguments), options);
}
buttonMais.addEventListener("click", (e) => { };
if(parts.children.length >= "{{ $edital->numParticipantes }}"){ $("input.cpf:text").mask("000.000.000-00");
alert('Limite de participante.') $("input.celular:text").mask(SPMaskBehavior, spOptions);
}else{ $("input.cep:text").mask("00000-000");
contador++;
var cln = participante.cloneNode(true); buttonMais.addEventListener("click", (e) => {
cln.setAttribute('style', " ");
var id = cln.children[2].firstElementChild.id; if(parts.children.length >= "{{ $edital->numParticipantes }}"){
var id2 = cln.children[0].firstElementChild.id; alert('Limite de participante.')
cln.children[2].firstElementChild.setAttribute('id', id + contador); }else{
cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador); contador++;
cln.children[0].firstElementChild.setAttribute('id', id2 + contador); var cln = participante.cloneNode(true);
cln.setAttribute('style', " ");
for (i = 0; i < cln.children.length; i++) { var id = cln.children[2].firstElementChild.id;
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) { var id2 = cln.children[0].firstElementChild.id;
let input = cln.children[i].querySelectorAll('input')[index]; cln.children[2].firstElementChild.setAttribute('id', id + contador);
let name = input.getAttributeNode("name").value; cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador);
name = name.replace("[]", ""); cln.children[0].firstElementChild.setAttribute('id', id2 + contador);
input.getAttributeNode("name").value = name + '['+ contador +']';
let select = cln.children[i].querySelectorAll('select')[index]; for (i = 0; i < cln.children.length; i++) {
if(select){ for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let selectName = select.getAttributeNode("name").value; let input = cln.children[i].querySelectorAll('input')[index];
selectName = selectName.replace("[", ""); let name = input.getAttributeNode("name").value;
selectName = selectName.replace("]", ""); name = name.replace("[]", "");
select.getAttributeNode("name").value = selectName + '['+ contador +']'; 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("[", "");
var SPMaskBehavior = function (val) { selectName = selectName.replace("]", "");
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; select.getAttributeNode("name").value = selectName + '['+ contador +']';
}, }
spOptions = {
onKeyPress: function(val, e, field, options) { }
field.mask(SPMaskBehavior.apply({}, arguments), options); }
} var SPMaskBehavior = function (val) {
}; return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
parts.appendChild(cln); },
$("input.cpf:text").val("").mask("000.000.000-00"); spOptions = {
$("input.celular:text").val("").mask(SPMaskBehavior, spOptions); onKeyPress: function(val, e, field, options) {
$("input.cep:text").val("").mask("00000-000"); 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");
function marcar(id){
let nome = document.getElementById("nome"+id); }
let linkNome = document.getElementById("nomePart"+(id+1));
let linkTituloProj = document.getElementById("tituloProj"+(id+1));
let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id); });
if(nome.value != ""){
if(planoTrabalho.value != ""){ function marcar(id){
linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`; let nome = document.getElementById("nome"+id);
}else { let linkNome = document.getElementById("nomePart"+(id+1));
linkNome.innerText = `Nome: ${nome.value}`; let linkTituloProj = document.getElementById("tituloProj"+(id+1));
} let planoTrabalho = document.getElementById("nomePlanoTrabalho"+id);
} if(nome.value != ""){
if(id >=1){ if(planoTrabalho.value != ""){
document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true); linkNome.innerText = `Nome: ${nome.value} \n Plano: ${planoTrabalho.value}`;
} }else {
linkNome.innerText = `Nome: ${nome.value}`;
document.getElementById("checkB"+id).checked = true; }
$("#atribuir1").attr('data-target','#exampleModal'+(id+1)); }
document.getElementById("part"+id).removeAttribute("hidden"); if(id >=1){
document.getElementById("exampleModal"+id).modal('hide'); document.getElementById("cancelar"+(id-1)).setAttribute("disabled", true);
}
document.getElementById("checkB"+id).checked = true;
} $("#atribuir1").attr('data-target','#exampleModal'+(id+1));
function desmarcar(id){ document.getElementById("part"+id).removeAttribute("hidden");
if(id >= 1){; document.getElementById("exampleModal"+id).modal('hide');
document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true); }
$("#atribuir1").attr('data-target','#exampleModal'+(id)); function desmarcar(id){
document.getElementById("exampleModal"+id).modal('hide'); if(id >= 1){;
} document.getElementById("cancelar"+(id-1)).removeAttribute("disabled");
}
</script> document.getElementById("checkB"+id).checked = false;
document.getElementById("part"+id).setAttribute("hidden",true);
$("#atribuir1").attr('data-target','#exampleModal'+(id));
<script> document.getElementById("exampleModal"+id).modal('hide');
}
@endif
$.validator.addMethod("alpha", function(value, element) { </script>
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
});
<script>
$('input.cep:text').mask('00000-000');
//$('input.cpf:text').mask('000.000.000-00'); $( document ).ready( function () {
$('.numero').mask('0000000000000'); $.validator.addMethod("alpha", function(value, element) {
var SPMaskBehavior = function (val) { return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; });
}, @if($edital->numParticipantes != 0)
spOptions = { $('input.cep:text').mask('00000-000');
onKeyPress: function(val, e, field, options) { //$('input.cpf:text').mask('000.000.000-00');
field.mask(SPMaskBehavior.apply({}, arguments), options); $('.numero').mask('0000000000000');
} var SPMaskBehavior = function (val) {
}; return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
$('.celular').mask(SPMaskBehavior, spOptions); },
$('.sus').mask('000 0000 0000 0000'); spOptions = {
onKeyPress: function(val, e, field, options) {
$("input[type='file']").on("change", function () { field.mask(SPMaskBehavior.apply({}, arguments), options);
if(this.files[0].size > 2000000) { }
// console.log($(this).parents( ".col-sm-5" )) };
alert("O tamanho do arquivo deve ser menor que 2MB!"); $('.celular').mask(SPMaskBehavior, spOptions);
$(this).val(''); $('.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(); @endif
// }
// } );
// jQuery.extend(jQuery.validator.messages, { // $.validator.setDefaults( {
// required: "Este campo &eacute; requerido.",
// remote: "Por favor, corrija este campo.", // submitHandler: function (form) {
// email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.", // form.submit();
// 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).", // jQuery.extend(jQuery.validator.messages, {
// number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.", // required: "Este campo &eacute; requerido.",
// digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.", // remote: "Por favor, corrija este campo.",
// creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.", // email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
// equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.", // url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
// accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.", // date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
// maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."), // dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
// minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."), // number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
// rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."), // digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
// range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."), // creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
// max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."), // equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
// min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.") // 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."),
// $( "#criarProjetoForm" ).validate( { // minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."),
// lang: 'PT_BR', // rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."),
// rules: { // range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
// firstname: "required", // max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
// username: { // min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
// required: true, // });
// minlength: 2 // $( "#criarProjetoForm" ).validate( {
// }, // lang: 'PT_BR',
// password: { // rules: {
// required: true, // firstname: "required",
// minlength: 5 // username: {
// }, // required: true,
// confirm_password: { // minlength: 2
// required: true, // },
// minlength: 5, // password: {
// equalTo: "#password" // required: true,
// }, // minlength: 5
// email: { // },
// required: true, // confirm_password: {
// email: true, // required: true,
// minlength: 5,
// }, // equalTo: "#password"
// "complemento[]":{ // },
// email: {
// required: true,
// }, // email: true,
// "nomeParticipante[]":{
// },
// alpha:true, // "complemento[]":{
// },
// 'rg[]':{
// },
// maxlength: 12, // "nomeParticipante[]":{
// },
// alpha:true,
// agree: "required" // },
// }, // 'rg[]':{
// messages: {
// // nomeProjeto: "O nome do projeto é obrigatório.", // maxlength: 12,
// },
// // 'emailParticipante[]': "Este campo é obrigatório.",
// // 'data_de_nascimento[]': "Este campo é obrigatório.", // agree: "required"
// // 'cpf[]': "Este campo é obrigatório.", // },
// // 'rg[]': { // messages: {
// // required: "Este campo é obrigatório.", // // nomeProjeto: "O nome do projeto é obrigatório.",
// // maxlength: "Este campo deve conter no máximo 8 números."
// // }, // // 'emailParticipante[]': "Este campo é obrigatório.",
// // 'celular[]': "Este campo é obrigatório.", // // 'data_de_nascimento[]': "Este campo é obrigatório.",
// // 'cep[]': "Este campo é obrigatório.", // // 'cpf[]': "Este campo é obrigatório.",
// // 'uf[]': "Este campo é obrigatório.", // // 'rg[]': {
// // 'cidade[]': "Este campo é obrigatório.", // // required: "Este campo é obrigatório.",
// // 'bairro[]': "Este campo é obrigatório.", // // maxlength: "Este campo deve conter no máximo 8 números."
// // 'rua[]': "Este campo é obrigatório.", // // },
// // 'numero[]': "Este campo é obrigatório.", // // 'celular[]': "Este campo é obrigatório.",
// // 'complemento[]': "Este campo é obrigatório.", // // 'cep[]': "Este campo é obrigatório.",
// // 'universidade[]': "Este campo é obrigatório.", // // 'uf[]': "Este campo é obrigatório.",
// // 'curso[]': "Este campo é obrigatório.", // // 'cidade[]': "Este campo é obrigatório.",
// // 'turno[]': "Este campo é obrigatório.", // // 'bairro[]': "Este campo é obrigatório.",
// // 'total_periodos[]': "Este campo é obrigatório.", // // 'rua[]': "Este campo é obrigatório.",
// // 'periodo_atual[]': "Este campo é obrigatório.", // // 'numero[]': "Este campo é obrigatório.",
// // 'ordem_prioridade[]': "Este campo é obrigatório.", // // 'complemento[]': "Este campo é obrigatório.",
// // 'media_geral_curso[]': "Este campo é obrigatório.", // // 'universidade[]': "Este campo é obrigatório.",
// // 'nomePlanoTrabalho[]': "Este campo é obrigatório.", // // 'curso[]': "Este campo é obrigatório.",
// // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.", // // 'turno[]': "Este campo é obrigatório.",
// // grandeArea: "Escolha uma grande área.", // // 'total_periodos[]': "Este campo é obrigatório.",
// // area: "Escolha uma área.", // // 'periodo_atual[]': "Este campo é obrigatório.",
// // linkGrupo: "Este campo é obrigatório.", // // 'ordem_prioridade[]': "Este campo é obrigatório.",
// // pontuacaoPlanilha: "Este campo é obrigatório.", // // 'media_geral_curso[]': "Este campo é obrigatório.",
// // anexoProjeto: "Este campo é obrigatório.", // // 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// // anexoLattesCoordenador: "Este campo é obrigatório.", // // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// // anexoConsuPreenchido: "Este campo é obrigatório.", // // grandeArea: "Escolha uma grande área.",
// // anexoGrupoPesquisa: "Este campo é obrigatório.", // // area: "Escolha uma área.",
// // anexoPlanilha: "Este campo é obrigatório.", // // linkGrupo: "Este campo é obrigatório.",
// // anexoComiteEtica: "Este campo é obrigatório.", // // pontuacaoPlanilha: "Este campo é obrigatório.",
// // inputJustificativa: "Este campo é obrigatório.", // // anexoProjeto: "Este campo é obrigatório.",
// // "nomeParticipante[]": { // // anexoLattesCoordenador: "Este campo é obrigatório.",
// // required: "O nome do participante é obrigatório.", // // anexoConsuPreenchido: "Este campo é obrigatório.",
// // alpha: "Não é permitido números." // // anexoGrupoPesquisa: "Este campo é obrigatório.",
// // }, // // anexoPlanilha: "Este campo é obrigatório.",
// // username: { // // anexoComiteEtica: "Este campo é obrigatório.",
// // required: "Please enter a username", // // inputJustificativa: "Este campo é obrigatório.",
// // minlength: "Your username must consist of at least 2 characters" // // "nomeParticipante[]": {
// // }, // // required: "O nome do participante é obrigatório.",
// // password: { // // alpha: "Não é permitido números."
// // required: "Please provide a password", // // },
// // minlength: "Your password must be at least 5 characters long" // // username: {
// // }, // // required: "Please enter a username",
// // confirm_password: { // // minlength: "Your username must consist of at least 2 characters"
// // required: "Please provide a password", // // },
// // minlength: "Your password must be at least 5 characters long", // // password: {
// // equalTo: "Please enter the same password as above" // // required: "Please provide a password",
// // }, // // minlength: "Your password must be at least 5 characters long"
// // email: "Please enter a valid email address", // // },
// // agree: "Please accept our policy" // // confirm_password: {
// }, // // required: "Please provide a password",
// errorElement: "em", // // minlength: "Your password must be at least 5 characters long",
// errorPlacement: function ( error, element ) { // // equalTo: "Please enter the same password as above"
// // Add the `help-block` class to the error element // // },
// error.addClass( "invalid-feedback" ); // // email: "Please enter a valid email address",
// // agree: "Please accept our policy"
// if ( element.prop( "type" ) === "checkbox" ) { // },
// error.insertAfter( element.parent( "label" ) ); // errorElement: "em",
// } else { // errorPlacement: function ( error, element ) {
// error.insertAfter( element ); // // Add the `help-block` class to the error element
// } // error.addClass( "invalid-feedback" );
// },
// highlight: function ( element, errorClass, validClass ) { // if ( element.prop( "type" ) === "checkbox" ) {
// $( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" ); // error.insertAfter( element.parent( "label" ) );
// }, // } else {
// unhighlight: function (element, errorClass, validClass) { // error.insertAfter( element );
// $( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" ); // }
// } // },
// } ); // highlight: function ( element, errorClass, validClass ) {
// $( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" );
} ); // },
</script> // unhighlight: function (element, errorClass, validClass) {
// $( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" );
// }
<script type="text/javascript"> // } );
function validarCPF(valor){ } );
var soma = 0; </script>
var resto;
var inputCPF = valor.match(/\d/g).join('');
<script type="text/javascript">
if(inputCPF == '00000000000') return false;
function validarCPF(valor){
if(inputCPF.length >11) return false; var soma = 0;
var resto;
for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i); var inputCPF = valor.match(/\d/g).join('');
resto = (soma * 10) % 11;
if(inputCPF == '00000000000') return false;
if((resto == 10) || (resto == 11)) resto = 0;
if(resto != parseInt(inputCPF.substring(9, 10))) return false; if(inputCPF.length >11) return false;
soma = 0; for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i);
for(i = 1; i <= 10; i++) soma = soma + parseInt(inputCPF.substring(i-1, i))*(12-i); resto = (soma * 10) % 11;
resto = (soma * 10) % 11;
if((resto == 10) || (resto == 11)) resto = 0;
if((resto == 10) || (resto == 11)) resto = 0; if(resto != parseInt(inputCPF.substring(9, 10))) return false;
if(resto != parseInt(inputCPF.substring(10, 11))) return false;
return true; 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 if((resto == 10) || (resto == 11)) resto = 0;
* if(resto != parseInt(inputCPF.substring(10, 11))) return false;
*/ return true;
function areas() { }
var grandeArea = $('#grandeArea').val();
$.ajax({ /*
type: 'POST', * FUNCAO: Gerar as areas
url: '{{ route('area.consulta') }}', *
data: 'id='+grandeArea , */
headers: function areas() {
{ var grandeArea = $('#grandeArea').val();
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') $.ajax({
}, type: 'POST',
success: (dados) => { url: '{{ route('area.consulta') }}',
data: 'id='+grandeArea ,
if (dados.length > 0) { headers:
if($('#oldArea').val() == null || $('#oldArea').val() == ""){ {
var option = '<option selected disabled>-- Área --</option>'; 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
} },
$.each(dados, function(i, obj) { success: (dados) => {
if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; if (dados.length > 0) {
}else{ if($('#oldArea').val() == null || $('#oldArea').val() == ""){
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; var option = '<option selected disabled>-- Área --</option>';
} }
}) $.each(dados, function(i, obj) {
} else { if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
var option = "<option selected disabled>-- Área --</option>"; option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
} }else{
$('#area').html(option).show(); option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
subareas(); }
}, })
error: (data) => { } else {
console.log(data); var option = "<option selected disabled>-- Área --</option>";
} }
$('#area').html(option).show();
}) subareas();
} },
/* error: (data) => {
* FUNCAO: Gerar as subareas console.log(data);
* }
*/
function subareas() { })
var area = $('#area').val(); }
$.ajax({ /*
type: 'POST', * FUNCAO: Gerar as subareas
url: '{{ route('subarea.consulta') }}', *
data: 'id='+area , */
headers: function subareas() {
{ var area = $('#area').val();
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') $.ajax({
}, type: 'POST',
success: (dados)=> { url: '{{ route('subarea.consulta') }}',
if (dados.length > 0) { data: 'id='+area ,
if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){ headers:
var option = '<option selected disabled>-- Subárea --</option>'; {
} 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
$.each(dados, function(i, obj) { },
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){ success: (dados)=> {
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; if (dados.length > 0) {
}else{ if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; var option = '<option selected disabled>-- Subárea --</option>';
} }
}) $.each(dados, function(i, obj) {
} else { if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
var option = "<option selected disabled>-- Subárea --</option>"; option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
} }else{
$('#subArea').html(option).show(); option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
}, }
error: (dados) => { })
console.log(dados); } 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; * FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
document.getElementById("displaySim").style.display = "block"; *
document.getElementById("displayNao").style.display = "none"; */
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; function displayAutorizacoesEspeciais(valor){
}else if(valor == "nao"){ if(valor == "sim"){
document.getElementById("radioSim").checked = false; document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = true; document.getElementById("radioNao").checked = false;
document.getElementById("displaySim").style.display = "none"; document.getElementById("displaySim").style.display = "block";
document.getElementById("displayNao").style.display = "block"; document.getElementById("displayNao").style.display = "none";
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
} }else if(valor == "nao"){
} document.getElementById("radioSim").checked = false;
/* document.getElementById("radioNao").checked = true;
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF) document.getElementById("displaySim").style.display = "none";
* document.getElementById("displayNao").style.display = "block";
*/ document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
function verificarArquivoAnexado_pdf(item, legenda){ }
}
if(item.files[0].type.split('/')[1] != "pdf"){ /*
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; * FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
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 = ""; function verificarArquivoAnexado_pdf(item, legenda){
$("#exampleModalAnexarDocumento").modal({show: true});
}else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){ if(item.files[0].type.split('/')[1] != "pdf"){
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!"; 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(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
document.getElementById(item.id).value = ""; document.getElementById(item.id).value = "";
$("#exampleModalAnexarDocumento").modal({show: true}); $("#exampleModalAnexarDocumento").modal({show: true});
}else{ }else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; 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.";
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS) document.getElementById(item.id).value = "";
* $("#exampleModalAnexarDocumento").modal({show: true});
*/ }else{
function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){ document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
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"; /* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
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 = ""; function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){
$("#exampleModalAnexarDocumento").modal({show: true}); if(item.files[0].name.split('.')[1] == "xls" || item.files[0].name.split('.')[1] == "ods" || item.files[0].name.split('.')[1] == "xlsx"){
}else{ if(item.files[0].size > 2000000){
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
} document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
}else{ document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB.";
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; document.getElementById(item.id).value = "";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo XLS, XLSX ou ODS! "; $("#exampleModalAnexarDocumento").modal({show: true});
document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB."; }else{
document.getElementById(item.id).value = ""; document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
$("#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(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB.";
* FUNCAO: Gerar periodos 1 document.getElementById(item.id).value = "";
* $("#exampleModalAnexarDocumento").modal({show: 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>`; * FUNCAO: Gerar periodos 1
// for(var i = 0; i < parseInt(select.value); i++) { *
// html += `<option value="${i+1}">${i+1}º</option>`; */
// } // 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>`;
// $(document).ready(function(){ // for(var i = 0; i < parseInt(select.value); i++) {
// $(".cpf").change(function(){ // html += `<option value="${i+1}">${i+1}º</option>`;
// 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"; // $(document).ready(function(){
// } else { // $(".cpf").change(function(){
// this.parentElement.children[1].style.display = "block"; // console.log(this.parentElement.children[0])
// this.parentElement.children[2].style.display = "none"; // if (validarCPF(retirarFormatacao(this.value))) {
// }
// }); // this.parentElement.children[1].style.display = "none";
// }); // this.parentElement.children[2].style.display = "block";
// } else {
function checarCPFdoCampo(input) { // this.parentElement.children[1].style.display = "block";
if (input.value.length == 14) { // this.parentElement.children[2].style.display = "none";
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"; function checarCPFdoCampo(input) {
input.parentElement.children[2].style.display = "none"; if (input.value.length == 14) {
} if (validarCPF(retirarFormatacao(input.value))) {
} else { input.parentElement.children[1].style.display = "none";
input.parentElement.children[1].style.display = "none"; input.parentElement.children[2].style.display = "block";
input.parentElement.children[2].style.display = "none"; } else {
} input.parentElement.children[1].style.display = "block";
} input.parentElement.children[2].style.display = "none";
}
function validarCPF(strCPF) { } else {
var soma; input.parentElement.children[1].style.display = "none";
var resto; input.parentElement.children[2].style.display = "none";
soma = 0; }
// Verifica se foi informado todos os digitos corretamente }
if (strCPF.length != 11) {
return false; function validarCPF(strCPF) {
} var soma;
var resto;
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11 soma = 0;
if (varificarDigitos(strCPF)) { // Verifica se foi informado todos os digitos corretamente
return false; if (strCPF.length != 11) {
} return false;
}
// Faz o calculo para validar o CPF
for (var t = 9; t < 11; t++) { // Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
for (var d = 0, c = 0; c < t; c++) { if (varificarDigitos(strCPF)) {
d += strCPF[c] * ((t + 1) - c); return false;
} }
d = ((10 * d) % 11) % 10;
if (strCPF[c] != d) { // Faz o calculo para validar o CPF
return false; for (var t = 9; t < 11; t++) {
} for (var d = 0, c = 0; c < t; c++) {
} d += strCPF[c] * ((t + 1) - c);
return true; }
} d = ((10 * d) % 11) % 10;
if (strCPF[c] != d) {
function retirarFormatacao(strCpf) { return false;
resultado = ""; }
for(var i = 0; i < strCpf.length; i++) { }
if (strCpf[i] != "." && strCpf[i] != "-") { return true;
resultado += strCpf[i]; }
}
} function retirarFormatacao(strCpf) {
return resultado; resultado = "";
} for(var i = 0; i < strCpf.length; i++) {
if (strCpf[i] != "." && strCpf[i] != "-") {
function varificarDigitos(strCpf) { resultado += strCpf[i];
var cont = 1; }
dig1 = strCpf[0]; }
return resultado;
for(var i = 1; i < strCpf.length; i++) { }
if(dig1 == strCpf[i]) {
cont++; function varificarDigitos(strCpf) {
} var cont = 1;
} dig1 = strCpf[0];
if (cont == strCpf.length) {
return true; for(var i = 1; i < strCpf.length; i++) {
} if(dig1 == strCpf[i]) {
return false; cont++;
} }
}
function checarCpfs() { if (cont == strCpf.length) {
var validacoes = document.getElementsByClassName("cpf-invalido"); return true;
var count = validacoes.length; }
var quant = 0; return false;
for(var i = 0; i < validacoes.length; i++) { }
if (validacoes[i].style.display == "none") {
quant++; function checarCpfs() {
} var validacoes = document.getElementsByClassName("cpf-invalido");
} var count = validacoes.length;
if(quant == count) { var quant = 0;
return true; for(var i = 0; i < validacoes.length; i++) {
} if (validacoes[i].style.display == "none") {
return false; quant++;
} }
}
function submeterProposta() { if(quant == count) {
if (checarCpfs()) { return true;
document.getElementById("submeterFormProposta").click(); }
} else { return false;
$("#modalCpfInvalido").modal('show'); }
}
} function submeterProposta() {
if (checarCpfs()) {
function mascaraCPF(input) { document.getElementById("submeterFormProposta").click();
var numeros = "0123456789.-"; } else {
var resultado = ""; $("#modalCpfInvalido").modal('show');
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] != ".") { function mascaraCPF(input) {
resultado += input.value[i] + "."; var numeros = "0123456789.-";
} else if (i == 10 && input.value[i+1] != "-") { var resultado = "";
resultado += input.value[i] + "-"; if (input.value.length < 14) {
} else { for (var i = 0; i < input.value.length; i++) {
resultado += input.value[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] != "-") {
} else { resultado += input.value[i] + "-";
for (var i = 0; i < 14; i++) { } else {
resultado += input.value[i]; resultado += input.value[i];
} }
} }
input.value = resultado; }
} } else {
for (var i = 0; i < 14; i++) {
function showInstituicao(instituicao){ resultado += input.value[i];
var instituicaoSelect = instituicao; }
var idSelect = instituicaoSelect.name; }
var instituicao = document.getElementById('outra'+idSelect); input.value = resultado;
var display = document.getElementById('display'+idSelect); }
if(instituicaoSelect.value === "Outra"){ function showInstituicao(instituicao){
display.style.display = "block"; var instituicaoSelect = instituicao;
instituicao.parentElement.style.display = ''; var idSelect = instituicaoSelect.name;
//instituicao.value=""; var instituicao = document.getElementById('outra'+idSelect);
}else{ var display = document.getElementById('display'+idSelect);
display.style.display = "none";
} if(instituicaoSelect.value === "Outra"){
} display.style.display = "block";
instituicao.parentElement.style.display = '';
function showCurso(curso){ //instituicao.value="";
var cursoSelect = curso; }else{
var idSelect = cursoSelect.name; display.style.display = "none";
var curso = document.getElementById('outro'+idSelect); }
var displayCurso = document.getElementById('display'+idSelect); }
if(cursoSelect.value === "Outro"){ function showCurso(curso){
displayCurso.style.display = "block"; var cursoSelect = curso;
curso.parentElement.style.display = ''; var idSelect = cursoSelect.name;
//curso.value=""; var curso = document.getElementById('outro'+idSelect);
}else{ var displayCurso = document.getElementById('display'+idSelect);
displayCurso.style.display = "none";
} if(cursoSelect.value === "Outro"){
} displayCurso.style.display = "block";
</script> curso.parentElement.style.display = '';
//curso.value="";
}else{
displayCurso.style.display = "none";
}
}
</script>
@endsection @endsection
\ No newline at end of file
...@@ -76,6 +76,23 @@ ...@@ -76,6 +76,23 @@
</div> </div>
@endif @endif
@if ($edital->numParticipantes == 0)
@php
$arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first();
@endphp
<div class="col-md-12">
<br>
<b style="color: #4D4D4D;">Título do Plano de Trabalho: </b>
<a style="color: #4D4D4D;">{{$arquivo->titulo}}</a>
</div>
<div class="col-sm-4" style="float: left">
<label for="anexoProjeto" class="col-form-label font-tam" style="font-weight: bold">{{ __('Anexo do Plano de Trabalho: ') }}</label>
<a href="{{ route('baixar.plano', ['id' => $arquivo->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if ($projeto->conflitosInteresse != null && @if ($projeto->conflitosInteresse != null &&
(Auth::user()->tipo == 'administrador' || (Auth::user()->tipo == 'administrador' ||
Auth::user()->tipo == 'administradorResponsavel' || Auth::user()->tipo == 'administradorResponsavel' ||
......
@extends('layouts.app') @extends('layouts.app')
@section('content') @section('content')
<div> <div>
{{-- action="{{route('trabalho.store')}}" --}} {{-- action="{{route('trabalho.store')}}" --}}
<form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" > <form method="POST" id="criarProjetoForm" action="{{route('trabalho.update', ['id' => $projeto->id])}}" enctype="multipart/form-data" >
@csrf @csrf
<input type="hidden" name="editalId" value="{{$edital->id}}"> <input type="hidden" name="editalId" value="{{$edital->id}}">
<div class="container"> <div class="container">
@if (session('mensagem')) @if (session('mensagem'))
<div class="alert alert-warning" role="alert"> <div class="alert alert-warning" role="alert">
{{ session('mensagem') }} {{ session('mensagem') }}
</div> </div>
@endif @endif
@if($errors->any()) @if($errors->any())
<div class="alert alert-danger mt-1" > <div class="alert alert-danger mt-1" >
{{$errors->first()}} {{$errors->first()}}
</div> </div>
@endif @endif
<div class="row justify-content-center" style="margin-top: 4rem"> <div class="row justify-content-center" style="margin-top: 4rem">
@component('projeto.formularioVisualizar.projeto2', @component('projeto.formularioVisualizar.projeto2',
['edital' => $edital, 'projeto' => $projeto]) ['edital' => $edital, 'projeto' => $projeto])
@endcomponent @endcomponent
@component('projeto.formularioVisualizar.proponente2', ['projeto' => $projeto, 'edital' => $edital, 'areasTematicas' => $areasTematicas]) @component('projeto.formularioVisualizar.proponente2', ['projeto' => $projeto, 'edital' => $edital, 'areasTematicas' => $areasTematicas])
@endcomponent @endcomponent
@component('projeto.formularioVisualizar.anexos2', ['edital' => $edital,'projeto' => $projeto]) @component('projeto.formularioVisualizar.anexos2', ['edital' => $edital,'projeto' => $projeto])
@endcomponent @endcomponent
@component('projeto.formularioVisualizar.participantes2', ['projeto' => $projeto, 'edital' => $edital]) @if ($edital->numParticipantes != 0)
@endcomponent @component('projeto.formularioVisualizar.participantes2', ['projeto' => $projeto, 'edital' => $edital])
@if($edital->natureza_id == 3) @endcomponent
@component('projeto.formularioVisualizar.integrantes', ['projeto' => $projeto, 'edital' => $edital, 'trabalhos_user' => $trabalhos_user]) @endif
@endcomponent
@endif @if($edital->natureza_id == 3)
@component('projeto.formularioVisualizar.relatorio',['edital' => $edital,'projeto' => $projeto,'flagSubstituicao' =>$flagSubstituicao, @component('projeto.formularioVisualizar.integrantes', ['projeto' => $projeto, 'edital' => $edital, 'trabalhos_user' => $trabalhos_user])
'AvalRelatParcial' => $AvalRelatParcial, 'AvalRelatFinal' => $AvalRelatFinal, 'cont' => 0]) @endcomponent
@endcomponent @endif
@component('projeto.formularioVisualizar.resultado2', @component('projeto.formularioVisualizar.relatorio',['edital' => $edital,'projeto' => $projeto,'flagSubstituicao' =>$flagSubstituicao,
['projeto' => $projeto]) 'AvalRelatParcial' => $AvalRelatParcial, 'AvalRelatFinal' => $AvalRelatFinal, 'cont' => 0])
@endcomponent @endcomponent
{{-- @component('projeto.formularioVisualizar.finalizar', ['projeto' => $projeto]) @component('projeto.formularioVisualizar.resultado2',
@endcomponent --}} ['projeto' => $projeto])
</div> @endcomponent
<div class="row justify-content-end" style="padding: 15px;"> {{-- @component('projeto.formularioVisualizar.finalizar', ['projeto' => $projeto])
<a href="{{ url()->previous() }}" class="btn btn-primary" style="font-size: 16px;">Voltar</a> @endcomponent --}}
</div> </div>
</div> <div class="row justify-content-end" style="padding: 15px;">
</form> <a href="{{ url()->previous() }}" class="btn btn-primary" style="font-size: 16px;">Voltar</a>
<div class="modal fade" id="modalSelecionarDiscentes" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> </div>
<div class="modal-dialog modal-lg">
<div class="modal-content"> </div>
</form>
<div class="modal-header" style="overflow-x:auto; padding-left: 31px"> <div class="modal fade" id="modalSelecionarDiscentes" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<h5 class="modal-title" id="exampleModalLabel" style= "color:#1492E6">Selecione os discentes que dejesa solicitar certificado/declaração</h5> <div class="modal-dialog modal-lg">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="padding-top: 8px; color:#1492E6">
<span aria-hidden="true">&times;</span> <div class="modal-header" style="overflow-x:auto; padding-left: 31px">
</button> <h5 class="modal-title" id="exampleModalLabel" style= "color:#1492E6">Selecione os discentes que dejesa solicitar certificado/declaração</h5>
</div>
<div class="modal-body" style="padding-right: 32px;padding-left: 32px;padding-top: 20px;padding-bottom: 32px;"> <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="padding-top: 8px; color:#1492E6">
<form id="certificadoForm" action="{{route('trabalho.solicitarCertificado', $projeto)}}" method="POST"> <span aria-hidden="true">&times;</span>
@csrf </button>
<div class="form-check"> </div>
<input name="users[]" class="form-check-input" type="checkbox" value="{{$projeto->proponente->user->id}}" id="pa-{{$projeto->proponente->user->id}}"> <div class="modal-body" style="padding-right: 32px;padding-left: 32px;padding-top: 20px;padding-bottom: 32px;">
<label class="form-check-label" for="pa-{{$projeto->proponente->user->id}}"> <form id="certificadoForm" action="{{route('trabalho.solicitarCertificado', $projeto)}}" method="POST">
{{$projeto->proponente->user->name}} @csrf
</label> <div class="form-check">
</div> <input name="users[]" class="form-check-input" type="checkbox" value="{{$projeto->proponente->user->id}}" id="pa-{{$projeto->proponente->user->id}}">
@foreach ($projeto->participantes as $participante) <label class="form-check-label" for="pa-{{$projeto->proponente->user->id}}">
<div class="form-check"> {{$projeto->proponente->user->name}}
<input name="users[]" class="form-check-input" type="checkbox" value="{{$participante->user->id}}" id="pa-{{$participante->user->id}}"> </label>
<label class="form-check-label" for="pa-{{$participante->user->id}}"> </div>
{{$participante->user->name}} @foreach ($projeto->participantes as $participante)
</label> <div class="form-check">
</div> <input name="users[]" class="form-check-input" type="checkbox" value="{{$participante->user->id}}" id="pa-{{$participante->user->id}}">
@endforeach <label class="form-check-label" for="pa-{{$participante->user->id}}">
</form> {{$participante->user->name}}
</div> </label>
<div class="modal-footer d-flex justify-content-between px-3"> </div>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button> @endforeach
<button type="submit" form="certificadoForm" class="btn btn-primary">Confirmar</button> </form>
</div> </div>
</div> <div class="modal-footer d-flex justify-content-between px-3">
</div> <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
</div> <button type="submit" form="certificadoForm" class="btn btn-primary">Confirmar</button>
<div id="participanteFirst" > </div>
@component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ]) </div>
</div>
@endcomponent </div>
</div> <div id="participanteFirst" >
<!-- Modal de Aviso Edit --> @component('componentes.participante', ['enum_turno' => $enum_turno,'estados' => $estados, ])
<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"> @endcomponent
<div class="modal-content"> </div>
<div class="modal-header" id="idCorCabecalhoModalDocumento"> <!-- Modal de Aviso Edit -->
<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> <div class="modal fade" id="exampleModalAnexarDocumento" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-dialog modal-dialog-centered" role="document">
<span aria-hidden="true">&times;</span> <div class="modal-content">
</button> <div class="modal-header" id="idCorCabecalhoModalDocumento">
</div> <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>
<div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<div class="row"> <span aria-hidden="true">&times;</span>
<div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div> </button>
<div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;"> </div>
</div> <div class="modal-body">
</div> <div class="row">
</div> <div class="col-12" style="font-family: 'Roboto', sans-serif;"><label id="idTituloDaMensagemModalDocumento"></label></div>
<div class="modal-footer"> <div class="col-12" style="font-family: 'Roboto', sans-serif; margin-top:10px;">
<button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button> </div>
</div> </div>
</div> </div>
</div> <div class="modal-footer">
</div> <button type="button" class="btn btn-light" data-dismiss="modal"style="width:200px;">Fechar</button>
</div>
</div> </div>
<!-- Modal --> </div>
<div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true"> </div>
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content"> </div>
<div class="modal-header" style="background-color: red;"> <!-- Modal -->
<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> <div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <div class="modal-dialog modal-dialog-centered" role="document">
<span aria-hidden="true">&times;</span> <div class="modal-content">
</button> <div class="modal-header" style="background-color: red;">
</div> <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>
<div class="modal-body"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
Existe um CPF inválido em um dos discentes por favor corrija para continuar. <span aria-hidden="true">&times;</span>
</div> </button>
{{-- <div class="modal-footer"> </div>
{{-- <button type="button" class="btn btn-secondary"></button> <div class="modal-body">
{{-- <button type="button" class="btn btn-primary">Certo</button> Existe um CPF inválido em um dos discentes por favor corrija para continuar.
</div> --}} </div>
</div> {{-- <div class="modal-footer">
</div> {{-- <button type="button" class="btn btn-secondary"></button>
</div> {{-- <button type="button" class="btn btn-primary">Certo</button>
</div> </div> --}}
@endsection </div>
</div>
@section('javascript') </div>
</div>
<style> @endsection
body{font-family:Calibri, Tahoma, Arial}
.TabControl{ width:100%; overflow:hidden; height:400px} @section('javascript')
.TabControl #header{ width:100%; overflow:hidden}
.TabControl #content{ width:100%; overflow:hidden; height:100%; } <style>
.TabControl .abas{display:inline;} body{font-family:Calibri, Tahoma, Arial}
.TabControl .abas li{float:left} .TabControl{ width:100%; overflow:hidden; height:400px}
.aba{width:100px; height:30px; border-radius:5px 5px 0 0; .TabControl #header{ width:100%; overflow:hidden}
text-align:center; padding-top:5px;} .TabControl #content{ width:100%; overflow:hidden; height:100%; }
.ativa{width:100px; height:30px; border-radius:5px 5px 0 0; .TabControl .abas{display:inline;}
text-align:center; padding-top:5px; background:#27408B;} .TabControl .abas li{float:left}
.ativa span, .selected span{color:#fff} .aba{width:100px; height:30px; border-radius:5px 5px 0 0;
.TabControl .conteudo{width:100%; display:none; height:100%;} text-align:center; padding-top:5px;}
.selected{width:100px; height:30px; border-radius:5px 5px 0 0; .ativa{width:100px; height:30px; border-radius:5px 5px 0 0;
text-align:center; padding-top:5px; background:#27408B} text-align:center; padding-top:5px; background:#27408B;}
.ativa span, .selected span{color:#fff}
.card:hover{ .TabControl .conteudo{width:100%; display:none; height:100%;}
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.2); .selected{width:100px; height:30px; border-radius:5px 5px 0 0;
} text-align:center; padding-top:5px; background:#27408B}
.card-body{
font-size:18.4px; .card:hover{
} box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.2);
h6,h5{ }
font-size:18.4px; .card-body{
} font-size:18.4px;
</style> }
h6,h5{
<script> font-size:18.4px;
}
if(document.getElementById("radioSim").checked){ </style>
document.getElementById("radioSim").checked = true;
document.getElementById("radioNao").checked = false; <script>
document.getElementById("displaySim").style.display = "block";
document.getElementById("displayNao").style.display = "none"; if(document.getElementById("radioSim").checked){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = true;
}else{ document.getElementById("radioNao").checked = false;
document.getElementById("radioSim").checked = false; document.getElementById("displaySim").style.display = "block";
document.getElementById("radioNao").checked = true; document.getElementById("displayNao").style.display = "none";
document.getElementById("displaySim").style.display = "none"; document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
document.getElementById("displayNao").style.display = "block"; }else{
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = false;
} document.getElementById("radioNao").checked = true;
document.getElementById("displaySim").style.display = "none";
let buttonSubmit = document.getElementById('idButtonSubmitProjeto'); document.getElementById("displayNao").style.display = "block";
let parts = document.getElementById('participante'); document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
let partsFirst = document.getElementById('participanteFirst'); }
const participante = partsFirst.firstElementChild;
let contador = 0; let buttonSubmit = document.getElementById('idButtonSubmitProjeto');
let parts = document.getElementById('participante');
buttonSubmit.addEventListener('click', (e)=>{ let partsFirst = document.getElementById('participanteFirst');
$('.collapse').addClass('show') const participante = partsFirst.firstElementChild;
}) let contador = 0;
function gerarPeriodo(e){ buttonSubmit.addEventListener('click', (e)=>{
var select = e.parentElement.parentElement.nextElementSibling; $('.collapse').addClass('show')
selectPeriodos = select.children[0].children[1]; })
var html = `<option value="" disabled selected>-- TOTAL DE PERÍODOS --</option>`;
for(var i = 0; i < parseInt(e.value); i++) { function gerarPeriodo(e){
html += `<option value="${i+1}">${i+1}º</option>`; var select = e.parentElement.parentElement.nextElementSibling;
} selectPeriodos = select.children[0].children[1];
$(selectPeriodos).html(''); var html = `<option value="" disabled selected>-- TOTAL DE PERÍODOS --</option>`;
$(selectPeriodos).append(html); for(var i = 0; i < parseInt(e.value); i++) {
html += `<option value="${i+1}">${i+1}º</option>`;
} }
$(selectPeriodos).html('');
function removerPart(e){ $(selectPeriodos).append(html);
console.log(e)
if(e.parentElement.parentElement){ }
if(parts.children.length <= 1){
function removerPart(e){
}else{ console.log(e)
parts.removeChild(e.parentElement.parentElement); if(e.parentElement.parentElement){
contador--; 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{ buttonMais.addEventListener("click", (e) => {
contador++;
var cln = participante.cloneNode(true); if(parts.children.length >= "{{ $edital->numParticipantes }}"){
cln.setAttribute('style', " "); alert('Limite de participante.')
var id = cln.children[2].firstElementChild.id; }else{
var id2 = cln.children[0].firstElementChild.id; contador++;
cln.children[2].firstElementChild.setAttribute('id', id + contador); var cln = participante.cloneNode(true);
cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador); cln.setAttribute('style', " ");
cln.children[0].firstElementChild.setAttribute('id', id2 + contador); var id = cln.children[2].firstElementChild.id;
var id2 = cln.children[0].firstElementChild.id;
for (i = 0; i < cln.children.length; i++) { cln.children[2].firstElementChild.setAttribute('id', id + contador);
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) { cln.children[0].firstElementChild.setAttribute('href', "#collapseParticipante" + contador);
let input = cln.children[i].querySelectorAll('input')[index]; cln.children[0].firstElementChild.setAttribute('id', id2 + contador);
let name = input.getAttributeNode("name").value;
name = name.replace("[]", ""); for (i = 0; i < cln.children.length; i++) {
input.getAttributeNode("name").value = name + '['+ contador +']'; for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let select = cln.children[i].querySelectorAll('select')[index]; let input = cln.children[i].querySelectorAll('input')[index];
if(select){ let name = input.getAttributeNode("name").value;
let selectName = select.getAttributeNode("name").value; name = name.replace("[]", "");
selectName = selectName.replace("[", ""); input.getAttributeNode("name").value = name + '['+ contador +']';
selectName = selectName.replace("]", ""); let select = cln.children[i].querySelectorAll('select')[index];
select.getAttributeNode("name").value = selectName + '['+ contador +']'; 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) { var SPMaskBehavior = function (val) {
field.mask(SPMaskBehavior.apply({}, arguments), options); return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
} },
}; spOptions = {
parts.appendChild(cln); onKeyPress: function(val, e, field, options) {
// console.log(cln); field.mask(SPMaskBehavior.apply({}, arguments), options);
$(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); parts.appendChild(cln);
$("input.cep:text").val("").mask("00000-000"); // 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>
</script>
$( document ).ready( function () {
$('#nomeParticipante').keyup(function () { <script>
$('#display').text($(this).val());
if($('#nomeParticipante').val() == ""){ $( document ).ready( function () {
$('#display').hide();
$('#pontos').hide(); $('#nomeParticipante').keyup(function () {
}else{ $('#display').text($(this).val());
$('#display').show(); if($('#nomeParticipante').val() == ""){
$('#pontos').show(); $('#display').hide();
} $('#pontos').hide();
}); }else{
$('#display').show();
$.validator.addMethod("alpha", function(value, element) { $('#pontos').show();
return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/); }
}); });
$('.cep').mask('00000000'); $.validator.addMethod("alpha", function(value, element) {
// $('.cpf').mask('000.000.000-00'); return this.optional(element) || value == value.match(/^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/);
$('.numero').mask('0000000000000'); });
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009'; $('.cep').mask('00000000');
}, // $('.cpf').mask('000.000.000-00');
spOptions = { $('.numero').mask('0000000000000');
onKeyPress: function(val, e, field, options) { var SPMaskBehavior = function (val) {
field.mask(SPMaskBehavior.apply({}, arguments), options); return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
} },
}; spOptions = {
$('.celular').mask(SPMaskBehavior, spOptions); onKeyPress: function(val, e, field, options) {
$('.sus').mask('000 0000 0000 0000'); field.mask(SPMaskBehavior.apply({}, arguments), options);
}
$("input[type='file']").on("change", function () { };
if(this.files[0].size > 2000000) { $('.celular').mask(SPMaskBehavior, spOptions);
// console.log($(this).parents( ".col-sm-5" )) $('.sus').mask('000 0000 0000 0000');
alert("O tamanho do arquivo deve ser menor que 2MB!");
$(this).val(''); $("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();
} $.validator.setDefaults( {
} );
jQuery.extend(jQuery.validator.messages, { submitHandler: function (form) {
required: "Este campo &eacute; requerido.", form.submit();
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.", jQuery.extend(jQuery.validator.messages, {
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.", required: "Este campo &eacute; requerido.",
dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).", remote: "Por favor, corrija este campo.",
number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.", email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.", url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.", date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",
equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.", dateISO: "Por favor, forne&ccedil;a uma data v&aacute;lida (ISO).",
accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.", number: "Por favor, forne&ccedil;a um n&uacute;mero v&aacute;lido.",
maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."), digits: "Por favor, forne&ccedil;a somente d&iacute;gitos.",
minlength: jQuery.validator.format("Por favor, forne&ccedil;a ao menos {0} caracteres."), creditcard: "Por favor, forne&ccedil;a um cart&atilde;o de cr&eacute;dito v&aacute;lido.",
rangelength: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1} caracteres de comprimento."), equalTo: "Por favor, forne&ccedil;a o mesmo valor novamente.",
range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."), accept: "Por favor, forne&ccedil;a um valor com uma extens&atilde;o v&aacute;lida.",
max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."), maxlength: jQuery.validator.format("Por favor, forne&ccedil;a n&atilde;o mais que {0} caracteres."),
min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.") 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."),
$( "#criarProjetoForm" ).validate( { range: jQuery.validator.format("Por favor, forne&ccedil;a um valor entre {0} e {1}."),
lang: 'PT_BR', max: jQuery.validator.format("Por favor, forne&ccedil;a um valor menor ou igual a {0}."),
rules: { min: jQuery.validator.format("Por favor, forne&ccedil;a um valor maior ou igual a {0}.")
firstname: "required", });
username: { $( "#criarProjetoForm" ).validate( {
required: true, lang: 'PT_BR',
minlength: 2 rules: {
}, firstname: "required",
password: { username: {
required: true, required: true,
minlength: 5 minlength: 2
}, },
confirm_password: { password: {
required: true, required: true,
minlength: 5, minlength: 5
equalTo: "#password" },
}, confirm_password: {
email: { required: true,
required: true, minlength: 5,
email: true, equalTo: "#password"
},
}, email: {
"complemento[]":{ required: true,
email: true,
}, },
"nomeParticipante[]":{ "complemento[]":{
required:true,
alpha:true,
}, },
'rg[]':{ "nomeParticipante[]":{
required: true, required:true,
maxlength: 12, alpha:true,
}, },
'rg[]':{
agree: "required" required: true,
}, maxlength: 12,
messages: { },
// nomeProjeto: "O nome do projeto é obrigatório.",
agree: "required"
// 'emailParticipante[]': "Este campo é obrigatório.", },
// 'data_de_nascimento[]': "Este campo é obrigatório.", messages: {
// 'cpf[]': "Este campo é obrigatório.", // nomeProjeto: "O nome do projeto é obrigatório.",
// 'rg[]': {
// required: "Este campo é obrigatório.", // 'emailParticipante[]': "Este campo é obrigatório.",
// maxlength: "Este campo deve conter no máximo 8 números." // 'data_de_nascimento[]': "Este campo é obrigatório.",
// }, // 'cpf[]': "Este campo é obrigatório.",
// 'celular[]': "Este campo é obrigatório.", // 'rg[]': {
// 'cep[]': "Este campo é obrigatório.", // required: "Este campo é obrigatório.",
// 'uf[]': "Este campo é obrigatório.", // maxlength: "Este campo deve conter no máximo 8 números."
// 'cidade[]': "Este campo é obrigatório.", // },
// 'bairro[]': "Este campo é obrigatório.", // 'celular[]': "Este campo é obrigatório.",
// 'rua[]': "Este campo é obrigatório.", // 'cep[]': "Este campo é obrigatório.",
// 'numero[]': "Este campo é obrigatório.", // 'uf[]': "Este campo é obrigatório.",
// 'complemento[]': "Este campo é obrigatório.", // 'cidade[]': "Este campo é obrigatório.",
// 'universidade[]': "Este campo é obrigatório.", // 'bairro[]': "Este campo é obrigatório.",
// 'curso[]': "Este campo é obrigatório.", // 'rua[]': "Este campo é obrigatório.",
// 'turno[]': "Este campo é obrigatório.", // 'numero[]': "Este campo é obrigatório.",
// 'total_periodos[]': "Este campo é obrigatório.", // 'complemento[]': "Este campo é obrigatório.",
// 'periodo_atual[]': "Este campo é obrigatório.", // 'universidade[]': "Este campo é obrigatório.",
// 'ordem_prioridade[]': "Este campo é obrigatório.", // 'curso[]': "Este campo é obrigatório.",
// 'media_geral_curso[]': "Este campo é obrigatório.", // 'turno[]': "Este campo é obrigatório.",
// 'nomePlanoTrabalho[]': "Este campo é obrigatório.", // 'total_periodos[]': "Este campo é obrigatório.",
// 'anexoPlanoTrabalho[]': "Este campo é obrigatório.", // 'periodo_atual[]': "Este campo é obrigatório.",
// grandeArea: "Escolha uma grande área.", // 'ordem_prioridade[]': "Este campo é obrigatório.",
// area: "Escolha uma área.", // 'media_geral_curso[]': "Este campo é obrigatório.",
// linkGrupo: "Este campo é obrigatório.", // 'nomePlanoTrabalho[]': "Este campo é obrigatório.",
// pontuacaoPlanilha: "Este campo é obrigatório.", // 'anexoPlanoTrabalho[]': "Este campo é obrigatório.",
// anexoProjeto: "Este campo é obrigatório.", // grandeArea: "Escolha uma grande área.",
// anexoLattesCoordenador: "Este campo é obrigatório.", // area: "Escolha uma área.",
// anexoConsuPreenchido: "Este campo é obrigatório.", // linkGrupo: "Este campo é obrigatório.",
// anexoGrupoPesquisa: "Este campo é obrigatório.", // pontuacaoPlanilha: "Este campo é obrigatório.",
// anexoPlanilha: "Este campo é obrigatório.", // anexoProjeto: "Este campo é obrigatório.",
// anexoComiteEtica: "Este campo é obrigatório.", // anexoLattesCoordenador: "Este campo é obrigatório.",
// inputJustificativa: "Este campo é obrigatório.", // anexoConsuPreenchido: "Este campo é obrigatório.",
// "nomeParticipante[]": { // anexoGrupoPesquisa: "Este campo é obrigatório.",
// required: "O nome do participante é obrigatório.", // anexoPlanilha: "Este campo é obrigatório.",
// alpha: "Não é permitido números." // anexoComiteEtica: "Este campo é obrigatório.",
// }, // inputJustificativa: "Este campo é obrigatório.",
// username: { // "nomeParticipante[]": {
// required: "Please enter a username", // required: "O nome do participante é obrigatório.",
// minlength: "Your username must consist of at least 2 characters" // alpha: "Não é permitido números."
// }, // },
// password: { // username: {
// required: "Please provide a password", // required: "Please enter a username",
// minlength: "Your password must be at least 5 characters long" // minlength: "Your username must consist of at least 2 characters"
// }, // },
// confirm_password: { // password: {
// required: "Please provide a password", // required: "Please provide a password",
// minlength: "Your password must be at least 5 characters long", // minlength: "Your password must be at least 5 characters long"
// equalTo: "Please enter the same password as above" // },
// }, // confirm_password: {
// email: "Please enter a valid email address", // required: "Please provide a password",
// agree: "Please accept our policy" // minlength: "Your password must be at least 5 characters long",
}, // equalTo: "Please enter the same password as above"
errorElement: "em", // },
errorPlacement: function ( error, element ) { // email: "Please enter a valid email address",
// Add the `help-block` class to the error element // agree: "Please accept our policy"
error.addClass( "invalid-feedback" ); },
errorElement: "em",
if ( element.prop( "type" ) === "checkbox" ) { errorPlacement: function ( error, element ) {
error.insertAfter( element.parent( "label" ) ); // Add the `help-block` class to the error element
} else { error.addClass( "invalid-feedback" );
error.insertAfter( element );
} if ( element.prop( "type" ) === "checkbox" ) {
}, error.insertAfter( element.parent( "label" ) );
highlight: function ( element, errorClass, validClass ) { } else {
$( element ).parents( ".col-sm-5" ).addClass( "has-error" ).removeClass( "has-success" ); error.insertAfter( element );
}, }
unhighlight: function (element, errorClass, validClass) { },
$( element ).parents( ".col-sm-5" ).addClass( "has-success" ).removeClass( "has-error" ); 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"> } );
</script>
function validarCPF(valor){
var soma = 0;
var resto; <script type="text/javascript">
var inputCPF = valor.match(/\d/g).join('');
function validarCPF(valor){
if(inputCPF == '00000000000') return false; var soma = 0;
var resto;
if(inputCPF.length >11) return false; var inputCPF = valor.match(/\d/g).join('');
for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i); if(inputCPF == '00000000000') return false;
resto = (soma * 10) % 11;
if(inputCPF.length >11) return false;
if((resto == 10) || (resto == 11)) resto = 0;
if(resto != parseInt(inputCPF.substring(9, 10))) return false; for(i=1; i<=9; i++) soma = soma + parseInt(inputCPF.substring(i-1, i)) * (11 - i);
resto = (soma * 10) % 11;
soma = 0;
for(i = 1; i <= 10; i++) soma = soma + parseInt(inputCPF.substring(i-1, i))*(12-i); if((resto == 10) || (resto == 11)) resto = 0;
resto = (soma * 10) % 11; if(resto != parseInt(inputCPF.substring(9, 10))) return false;
if((resto == 10) || (resto == 11)) resto = 0; soma = 0;
if(resto != parseInt(inputCPF.substring(10, 11))) return false; for(i = 1; i <= 10; i++) soma = soma + parseInt(inputCPF.substring(i-1, i))*(12-i);
return true; resto = (soma * 10) % 11;
}
if((resto == 10) || (resto == 11)) resto = 0;
/* if(resto != parseInt(inputCPF.substring(10, 11))) return false;
* FUNCAO: Gerar as areas return true;
* }
*/
function areas() { /*
var grandeArea = $('#grandeArea').val(); * FUNCAO: Gerar as areas
$.ajax({ *
type: 'POST', */
url: '{{ route('area.consulta') }}', function areas() {
data: 'id='+grandeArea , var grandeArea = $('#grandeArea').val();
headers: $.ajax({
{ type: 'POST',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') url: '{{ route('area.consulta') }}',
}, data: 'id='+grandeArea ,
success: (dados) => { headers:
{
if (dados.length > 0) { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
if($('#oldArea').val() == null || $('#oldArea').val() == ""){ },
var option = '<option selected disabled>-- Área --</option>'; success: (dados) => {
}
$.each(dados, function(i, obj) { if (dados.length > 0) {
if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){ if($('#oldArea').val() == null || $('#oldArea').val() == ""){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; var option = '<option selected disabled>-- Área --</option>';
}else{ }
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; $.each(dados, function(i, obj) {
} if($('#oldArea').val() != null && $('#oldArea').val() == obj.id){
}) option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
} else { }else{
var option = "<option selected disabled>-- Área --</option>"; option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
} }
$('#area').html(option).show(); })
subareas(); } else {
}, var option = "<option selected disabled>-- Área --</option>";
error: (data) => { }
console.log(data); $('#area').html(option).show();
} subareas();
},
}) error: (data) => {
} console.log(data);
/* }
* FUNCAO: Gerar as subareas
* })
*/ }
function subareas() { /*
var area = $('#area').val(); * FUNCAO: Gerar as subareas
$.ajax({ *
type: 'POST', */
url: '{{ route('subarea.consulta') }}', function subareas() {
data: 'id='+area , var area = $('#area').val();
headers: $.ajax({
{ type: 'POST',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') url: '{{ route('subarea.consulta') }}',
}, data: 'id='+area ,
success: (dados)=> { headers:
if (dados.length > 0) { {
if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){ 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
var option = '<option selected disabled>-- Subárea --</option>'; },
} success: (dados)=> {
$.each(dados, function(i, obj) { if (dados.length > 0) {
if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){ if($('#oldSubArea').val() == null || $('#oldSubArea').val() == ""){
option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>'; var option = '<option selected disabled>-- Subárea --</option>';
}else{ }
option += '<option value="' + obj.id + '">' + obj.nome + '</option>'; $.each(dados, function(i, obj) {
} if($('#oldSubArea').val() != null && $('#oldSubArea').val() == obj.id){
}) option += '<option selected value="' + obj.id + '">' + obj.nome + '</option>';
} else { }else{
var option = "<option selected disabled>-- Subárea --</option>"; option += '<option value="' + obj.id + '">' + obj.nome + '</option>';
} }
$('#subArea').html(option).show(); })
}, } else {
error: (dados) => { var option = "<option selected disabled>-- Subárea --</option>";
console.log(dados); }
} $('#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"){ * FUNCAO: funcao responsavel pelo abre e fecha da area "possui autorizacoes especiais?"
document.getElementById("radioSim").checked = true; *
document.getElementById("radioNao").checked = false; */
document.getElementById("displaySim").style.display = "block"; function displayAutorizacoesEspeciais(valor){
document.getElementById("displayNao").style.display = "none"; if(valor == "sim"){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = true;
}else if(valor == "nao"){ document.getElementById("radioNao").checked = false;
document.getElementById("radioSim").checked = false; document.getElementById("displaySim").style.display = "block";
document.getElementById("radioNao").checked = true; document.getElementById("displayNao").style.display = "none";
document.getElementById("displaySim").style.display = "none"; document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
document.getElementById("displayNao").style.display = "block"; }else if(valor == "nao"){
document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none"; document.getElementById("radioSim").checked = false;
} document.getElementById("radioNao").checked = true;
} document.getElementById("displaySim").style.display = "none";
/* document.getElementById("displayNao").style.display = "block";
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF) document.getElementById("idAvisoAutorizacaoEspecial").style.display = "none";
* }
*/ }
function verificarArquivoAnexado_pdf(item, legenda){ /*
* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (PDF)
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! "; function verificarArquivoAnexado_pdf(item, legenda){
document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
document.getElementById(item.id).value = ""; if(item.files[0].type.split('/')[1] != "pdf"){
$("#exampleModalAnexarDocumento").modal({show: true}); document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
}else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){ document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo PDF! ";
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!"; document.getElementById(item.id).value = "";
document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB."; $("#exampleModalAnexarDocumento").modal({show: true});
document.getElementById(item.id).value = ""; }else if(item.files[0].size > 2000000 && item.files[0].type.split('/')[1] == "pdf"){
$("#exampleModalAnexarDocumento").modal({show: true}); document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
}else{ document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; document.getElementById(legenda).innerHTML = "O arquivo deve ser no formato PDF de até 2MB.";
} document.getElementById(item.id).value = "";
} $("#exampleModalAnexarDocumento").modal({show: true});
/* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS) }else{
* document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
*/ }
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"){ /* FUNCAO: funcao responsavel pela verificacao dos arquivos anexados (XLS, XLSX, ODS)
if(item.files[0].size > 2000000){ *
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; */
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!"; function verificarArquivoAnexado_xls_xlsx_ods(item, legenda){
document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB."; if(item.files[0].name.split('.')[1] == "xls" || item.files[0].name.split('.')[1] == "ods" || item.files[0].name.split('.')[1] == "xlsx"){
document.getElementById(item.id).value = ""; if(item.files[0].size > 2000000){
$("#exampleModalAnexarDocumento").modal({show: true}); document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red";
}else{ document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado é maior que 2MB!";
document.getElementById(legenda).innerHTML = item.value.split('\\')[2]; document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB.";
} document.getElementById(item.id).value = "";
}else{ $("#exampleModalAnexarDocumento").modal({show: true});
document.getElementById("idCorCabecalhoModalDocumento").style.backgroundColor = "red"; }else{
document.getElementById("idTituloDaMensagemModalDocumento").innerHTML = "O arquivo selecionado não é do tipo XLS, XLSX ou ODS! "; document.getElementById(legenda).innerHTML = item.value.split('\\')[2];
document.getElementById(legenda).innerHTML = "Formato do arquivo: XLS, XLSX ou ODS de até 2MB."; }
document.getElementById(item.id).value = ""; }else{
$("#exampleModalAnexarDocumento").modal({show: true}); 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; * FUNCAO: Gerar periodos 1
// 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++) { // function gerarPeriodos1(select) {
// html += `<option value="${i+1}">${i+1}º</option>`; // 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))) {
// $(document).ready(function(){
// this.parentElement.children[1].style.display = "none"; // $(".cpf").change(function(){
// this.parentElement.children[2].style.display = "block"; // console.log(this.parentElement.children[0])
// } else { // if (validarCPF(retirarFormatacao(this.value))) {
// this.parentElement.children[1].style.display = "block";
// this.parentElement.children[2].style.display = "none"; // 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"; function checarCPFdoCampo(input) {
} else { if (input.value.length == 14) {
input.parentElement.children[1].style.display = "block"; if (validarCPF(retirarFormatacao(input.value))) {
input.parentElement.children[2].style.display = "none"; input.parentElement.children[1].style.display = "none";
} input.parentElement.children[2].style.display = "block";
} else { } else {
input.parentElement.children[1].style.display = "none"; input.parentElement.children[1].style.display = "block";
input.parentElement.children[2].style.display = "none"; input.parentElement.children[2].style.display = "none";
} }
} } else {
input.parentElement.children[1].style.display = "none";
function validarCPF(strCPF) { input.parentElement.children[2].style.display = "none";
var soma; }
var resto; }
soma = 0;
// Verifica se foi informado todos os digitos corretamente function validarCPF(strCPF) {
if (strCPF.length != 11) { var soma;
return false; var resto;
} soma = 0;
// Verifica se foi informado todos os digitos corretamente
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11 if (strCPF.length != 11) {
if (varificarDigitos(strCPF)) { return false;
return false; }
}
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
// Faz o calculo para validar o CPF if (varificarDigitos(strCPF)) {
for (var t = 9; t < 11; t++) { return false;
for (var d = 0, c = 0; c < t; c++) { }
d += strCPF[c] * ((t + 1) - c);
} // Faz o calculo para validar o CPF
d = ((10 * d) % 11) % 10; for (var t = 9; t < 11; t++) {
if (strCPF[c] != d) { for (var d = 0, c = 0; c < t; c++) {
return false; d += strCPF[c] * ((t + 1) - c);
} }
} d = ((10 * d) % 11) % 10;
return true; if (strCPF[c] != d) {
} return false;
}
function retirarFormatacao(strCpf) { }
resultado = ""; return true;
for(var i = 0; i < strCpf.length; i++) { }
if (strCpf[i] != "." && strCpf[i] != "-") {
resultado += strCpf[i]; function retirarFormatacao(strCpf) {
} resultado = "";
} for(var i = 0; i < strCpf.length; i++) {
return resultado; if (strCpf[i] != "." && strCpf[i] != "-") {
} resultado += strCpf[i];
}
function varificarDigitos(strCpf) { }
var cont = 1; return resultado;
dig1 = strCpf[0]; }
for(var i = 1; i < strCpf.length; i++) { function varificarDigitos(strCpf) {
if(dig1 == strCpf[i]) { var cont = 1;
cont++; dig1 = strCpf[0];
}
} for(var i = 1; i < strCpf.length; i++) {
if (cont == strCpf.length) { if(dig1 == strCpf[i]) {
return true; cont++;
} }
return false; }
} if (cont == strCpf.length) {
return true;
function checarCpfs() { }
var validacoes = document.getElementsByClassName("cpf-invalido"); return false;
var count = validacoes.length; }
var quant = 0;
for(var i = 0; i < validacoes.length; i++) { function checarCpfs() {
if (validacoes[i].style.display == "none") { var validacoes = document.getElementsByClassName("cpf-invalido");
quant++; var count = validacoes.length;
} var quant = 0;
} for(var i = 0; i < validacoes.length; i++) {
if(quant == count) { if (validacoes[i].style.display == "none") {
return true; quant++;
} }
return false; }
} if(quant == count) {
return true;
function submeterProposta() { }
document.getElementById("submeterFormProposta").click(); return false;
// if (checarCpfs()) { }
// } else {
// $("#modalCpfInvalido").modal('show'); function submeterProposta() {
// } document.getElementById("submeterFormProposta").click();
} // if (checarCpfs()) {
// } else {
function mascaraCPF(input) { // $("#modalCpfInvalido").modal('show');
var numeros = "0123456789.-"; // }
var resultado = ""; }
if (input.value.length < 14) {
for (var i = 0; i < input.value.length; i++) { function mascaraCPF(input) {
if (numeros.indexOf(input.value[i]) > -1) { var numeros = "0123456789.-";
if ((i == 2 || i == 6) && input.value[i+1] != ".") { var resultado = "";
resultado += input.value[i] + "."; if (input.value.length < 14) {
} else if (i == 10 && input.value[i+1] != "-") { for (var i = 0; i < input.value.length; i++) {
resultado += input.value[i] + "-"; if (numeros.indexOf(input.value[i]) > -1) {
} else { if ((i == 2 || i == 6) && input.value[i+1] != ".") {
resultado += input.value[i]; resultado += input.value[i] + ".";
} } else if (i == 10 && input.value[i+1] != "-") {
} resultado += input.value[i] + "-";
} } else {
} else { resultado += input.value[i];
for (var i = 0; i < 14; i++) { }
resultado += input.value[i]; }
} }
} } else {
input.value = resultado; for (var i = 0; i < 14; i++) {
} resultado += input.value[i];
</script> }
@endsection }
input.value = resultado;
}
</script>
@endsection
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<hr class="dropdown-hr"> <hr class="dropdown-hr">
@endif @endif
@if( $projeto->status== 'aprovado') @if( $projeto->status== 'aprovado' && $projeto->evento->numParticipantes != 0)
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;"> <a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições Solicitar Substituições
</a> </a>
......
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<hr class="dropdown-hr"> <hr class="dropdown-hr">
@endif @endif
@if( $projeto->status== 'aprovado') @if( $projeto->status== 'aprovado' && $projeto->evento->numParticipantes != 0)
<a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;"> <a href="{{route('trabalho.trocaParticipante', ['evento_id' => $projeto->evento->id, 'projeto_id' => $projeto->id])}}" class="dropdown-item" style="text-align: center;">
Solicitar Substituições Solicitar Substituições
</a> </a>
......
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