Commit d7b1b4bd authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajustes

parent 8b64b894
......@@ -42,7 +42,7 @@
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="text" class="form-control" name="emailParticipante[]" placeholder="E-mail" required/>
<input type="email" class="form-control" name="emailParticipante[]" placeholder="E-mail" required/>
@endcomponent
</div>
<div class="col-6">
......@@ -51,24 +51,24 @@
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF', 'class' => 'cpf'])
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="text" class="form-control" name="rg[]" placeholder="RG" required/>
<input type="number" class="form-control" min="1" maxlength="8" name="rg[]" placeholder="RG" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="text" class="form-control" name="celular[]" placeholder="Celular" required/>
<input type="tel" class="form-control celular" name="celular[]" placeholder="Celular" required/>
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" name="cep[]" placeholder="CEP" required/>
<input type="number" class="form-control" name="cep[]" placeholder="CEP" required/>
@endcomponent
</div>
......@@ -104,7 +104,7 @@
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento'])
<input type="text" class="form-control" name="complemento[]" placeholder="Complemento" required/>
<input type="text" id="complemento" class="form-control" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento" required/>
@endcomponent
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
......
......@@ -42,8 +42,8 @@
@enderror
</div>
<div class="form-group col-md-4">
<label for="linkGrupo">Link do grupo de pesquisa</label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="text" name="linkGrupo"
<label for="linkGrupo">Link do grupo de pesquisa<span style="color: red; font-weight:bold">*</span></label>
<input class="form-control @error('linkGrupo') is-invalid @enderror" type="url" name="linkGrupo"
value="{{old('linkGrupo') !== null ? old('linkGrupo') : (isset($rascunho) ? $rascunho->linkGrupoPesquisa : '')}}" required>
<small>Ex.: http://dgp.cnpq.br/dgp/espelhogrupo/228363</small>
......
......@@ -59,6 +59,7 @@
@section('javascript')
<script>
......@@ -171,10 +172,29 @@
</script>
<script>
$( document ).ready( function () {
$.validator.addMethod("alpha", function(value, element) {
return this.optional(element) || value == value.match(/^[a-zA-Z\s]+$/);
});
$('.cep').mask('00000000');
$('.cpf').mask('000.000.000-00');
$('.numero').mask('0000000000000');
var SPMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
spOptions = {
onKeyPress: function(val, e, field, options) {
field.mask(SPMaskBehavior.apply({}, arguments), options);
}
};
$('.celular').mask(SPMaskBehavior, spOptions);
$('.sus').mask('000 0000 0000 0000');
$("input[type='file']").on("change", function () {
if(this.files[0].size > 2000000) {
// console.log($(this).parents( ".col-sm-5" ))
......@@ -211,7 +231,16 @@
},
email: {
required: true,
email: true
email: true,
},
"complemento[]":{
alpha:true,
},
"nomeParticipante[]":{
alpha:true,
},
agree: "required"
......@@ -220,6 +249,8 @@
nomeProjeto: "O nome do projeto é obrigatório.",
grandeArea: "Escolha uma grande área.",
area: "Escolha uma área.",
"complemento[]": "Não é permitido números.",
"nomeParticipante[]": "Não é permitido números.",
anexoProjeto: "O campo anexo do projeto é obrigatório.",
username: {
required: "Please enter a username",
......@@ -259,850 +290,9 @@
} );
</script>
{{-- <script>
function subir(e){
if(e.parentElement.previousElementSibling){
var atual = e.parentElement;
var anterior = e.parentElement.previousElementSibling;
console.log(atual)
console.log(anterior)
atual.insertAdjacentElement('afterend', anterior)
anterior.insertAdjacentElement('beforebegin', atual)
}
}
function descer(e){
if(e.parentElement.nextElementSibling){
var atual = e.parentElement;
var proximo = e.parentElement.nextElementSibling;
proximo.insertAdjacentElement('afterend', atual)
atual.insertAdjacentElement('beforebegin', proximo)
}
}
$(document).ready(function() {
let buttonMais = document.getElementById('buttonMais');
let buttonMenos = document.getElementById('buttonMenos');
let buttonForm = document.getElementById('buttonForm');
let parts = document.getElementById('participante');
const participante = parts.firstElementChild;
let contador = 2;
var validator = $( "#criarProjetoForm" ).validate();
buttonMais.addEventListener("click", (e) => {
var cln = participante.cloneNode(true);
for (i = 0; i < cln.children.length; i++) {
for (let index = 0; index < cln.children[i].querySelectorAll('input').length; index++) {
let element = cln.children[i].querySelectorAll('input')[index];
let id = element.getAttributeNode("id").value;
let name = element.getAttributeNode("name").value;
element.getAttributeNode("name").value = name + '[' + contador + ']';
element.getAttributeNode("id").value = id + contador
}
}
cln.firstElementChild.innerText = "Participante " + contador++;
parts.appendChild(cln);
});
buttonMenos.addEventListener("click", (e) => {
contador--;
if(parts.lastElementChild){
parts.removeChild(parts.lastElementChild);
}
});
buttonForm.addEventListener('click', (e)=>{
e.preventDefault();
// console.log(e)
validator.form();
$( "#formPart" ).submit();
});
});
</script> --}}
<script type="text/javascript">
// /*
// * ARRAY
// *
// */
// let arrayElementos = ['3','2','1']
// /*
// * FUNCAO: Funcao novo participante
// *
// */
// function novoParticipante(){
// if(arrayElementos.length > 0){
// $("ol").append(blocoDeCodigo(arrayElementos.pop()));
// }else{
// alert("Você atingiu o limite máximo de participantes")
// }
// }
// /*
// * FUNCAO: Funcao remove o participante
// * ENTRADA: <li>, (int)valor
// */
// function removerParticipante(valor, id){
// let participante = document.getElementById(valor);
// //console.log(valor, id, participante)
// arrayElementos.push(id);
// participante.remove();
// }
// /*
// * FUNCAO: Bloco de codigo contendo os campos do participante
// */
// function blocoDeCodigo(valor){
// //return "<li id='item"+valor+"'>Appended item "+valor+" <button type='button' onclick='removerParticipante(item"+valor+","+valor+")'>remover</button> <input id='idNomeTeste'"+valor+" type='text' name='nome[]'></li>"
// return `
// <li id="item${valor}">
// <div style="margin-bottom:15px">
// <div class="form-row">
// <div class="col-md-12">
// <a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante${valor}" href="#collapseParticipante${valor}" role="button" aria-expanded="false" aria-controls="collapseParticipante${valor}" style="width: 100%; text-align:left">
// <div class="d-flex justify-content-between align-items-center">
// <h4 id="tituloParticipante${valor}" style="color: #01487E; font-size:17px; margin-top:5px">Participante </h4>
// </div>
// </a>
// </div>
// <div class="col-md-12">
// <div class="collapse" id="collapseParticipante${valor}">
// <div class="container">
// <div class="form-row mt-3">
// <button type='button' onclick='removerParticipante("item${valor}","${valor}")'>remover</button>
// <div class="col-md-12"><h5>Dados do participante</h5></div>
// <div class="form-group col-md-6">
// <label for="nomeCompletoParticipante${valor}">Nome completo <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control js-input-name @error('nomeCompletoParticipante${valor}') is-invalid @enderror" id="nomeCompletoParticipante${valor}" name="nomeParticipante[]" placeholder="Digite o nome completo do participante" >
// @error('nomeCompletoParticipante${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <input type="hidden" name="funcaoParticipante[]" value="4">
// <div class="form-group col-md-6">
// <label for="email${valor}">E-mail <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('email${valor}') is-invalid @enderror" id="email${valor}" name="emailParticipante[]" placeholder="Digite o e-mail do participante" >
// @error('email${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="data${valor}">Data de nascimento <span style="color: red; font-weight:bold">*</span></label>
// <input type="date" class="form-control @error('data${valor}') is-invalid @enderror" id="data${valor}" name="data_de_nascimento[]" >
// @error('data${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="cpf${valor}">CPF <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('cpf${valor}') is-invalid @enderror" id="cpf${valor}" name="cpf[]" placeholder="Digite o CPF do participante" >
// @error('cpf${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="rg${valor}">RG <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('rg${valor}') is-invalid @enderror" id="rg${valor}" name="rg[]" placeholder="Digite o RG do participante" >
// @error('rg${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="celular${valor}">Celular <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('celular${valor}') is-invalid @enderror" id="celular${valor}" name="celular[]" placeholder="Digite o telefone do participante" >
// @error('celular${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="col-md-12"><h5>Endereço</h5></div>
// <div class="form-group col-md-6">
// <label for="cep${valor}">CEP <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('cep${valor}') is-invalid @enderror" id="cep${valor}" name="cep[]" placeholder="Digite o CEP do participante" >
// @error('cep${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="estado${valor}">Estado <span style="color: red; font-weight:bold">*</span></label>
// <select name="uf[]" id="estado${valor}" class="form-control" style="visibility: visible" >
// <option value="" disabled selected>-- Selecione o estado --</option>
// <option @if(old('uf') == 'AC') selected @endif value="AC">Acre</option>
// <option @if(old('uf') == 'AL') selected @endif value="AL">Alagoas</option>
// <option @if(old('uf') == 'AP') selected @endif value="AP">Amapá</option>
// <option @if(old('uf') == 'AM') selected @endif value="AM">Amazonas</option>
// <option @if(old('uf') == 'BA') selected @endif value="BA">Bahia</option>
// <option @if(old('uf') == 'CE') selected @endif value="CE">Ceará</option>
// <option @if(old('uf') == 'DF') selected @endif value="DF">Distrito Federal</option>
// <option @if(old('uf') == 'ES') selected @endif value="ES">Espírito Santo</option>
// <option @if(old('uf') == 'GO') selected @endif value="GO">Goiás</option>
// <option @if(old('uf') == 'MA') selected @endif value="MA">Maranhão</option>
// <option @if(old('uf') == 'MT') selected @endif value="MT">Mato Grosso</option>
// <option @if(old('uf') == 'MS') selected @endif value="MS">Mato Grosso do Sul</option>
// <option @if(old('uf') == 'MG') selected @endif value="MG">Minas Gerais</option>
// <option @if(old('uf') == 'PA') selected @endif value="PA">Pará</option>
// <option @if(old('uf') == 'PB') selected @endif value="PB">Paraíba</option>
// <option @if(old('uf') == 'PR') selected @endif value="PR">Paraná</option>
// <option @if(old('uf') == 'PE') selected @endif value="PE">Pernambuco</option>
// <option @if(old('uf') == 'PI') selected @endif value="PI">Piauí</option>
// <option @if(old('uf') == 'RJ') selected @endif value="RJ">Rio de Janeiro</option>
// <option @if(old('uf') == 'RN') selected @endif value="RN">Rio Grande do Norte</option>
// <option @if(old('uf') == 'RS') selected @endif value="RS">Rio Grande do Sul</option>
// <option @if(old('uf') == 'RO') selected @endif value="RO">Rondônia</option>
// <option @if(old('uf') == 'RR') selected @endif value="RR">Roraima</option>
// <option @if(old('uf') == 'SC') selected @endif value="SC">Santa Catarina</option>
// <option @if(old('uf') == 'SP') selected @endif value="SP">São Paulo</option>
// <option @if(old('uf') == 'SE') selected @endif value="SE">Sergipe</option>
// <option @if(old('uf') == 'TO') selected @endif value="TO">Tocantins</option>
// </select>
// </div>
// <div class="form-group col-md-6">
// <label for="cidade${valor}">Cidade <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('cidade${valor}') is-invalid @enderror" id="cidade${valor}" name="cidade[]" placeholder="Email" >
// @error('cidade${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="bairro${valor}">Bairro <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('bairro${valor}') is-invalid @enderror" id="bairro${valor}" name="bairro[]" placeholder="Digite o nome do bairro" >
// @error('bairro${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="rua${valor}">Rua <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('rua${valor}') is-invalid @enderror" id="rua${valor}" name="rua[]" placeholder="Digite o nome da avenida, rua, travessa..." >
// @error('rua${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="numero${valor}">Número <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('numero${valor}') is-invalid @enderror" id="numero${valor}" name="numero[]" placeholder="Digite o número" >
// @error('numero${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-12">
// <label for="complemento${valor}">Complemento <span style="color: red; font-weight:bold">*</span></label>
// <textarea type="text" class="form-control @error('complemento${valor}') is-invalid @enderror" id="complemento${valor}" name="complemento[]" placeholder="Apartamento, casa, sítio..." ></textarea>
// @error('complemento${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="col-md-12"><h5>Dados do curso</h5></div>
// <div class="form-group col-md-12">
// <label for="universidade${valor}">Universidade <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('universidade${valor}') is-invalid @enderror" id="universidade${valor}" name="universidade[]" placeholder="Digite o nome da universidade" >
// @error('universidade${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-12">
// <label for="curso${valor}">Curso <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('curso${valor}') is-invalid @enderror" id="curso${valor}" name="curso[]" placeholder="Digite o nome do curso" >
// @error('curso${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="turno${valor}">Turno <span style="color: red; font-weight:bold">*</span></label>
// <select id="turno${valor}" class="form-control" name="turno[]" >
// <option value="" disabled selected>-- TURNO --</option>
// @foreach ($enum_turno as $turno)
// <option value="{{$turno}}">{{$turno}}</option>
// @endforeach
// </select>
// </div>
// <div class="form-group col-md-6">
// <label for="totalDePeriodos${valor}">{{ __('Total de períodos do curso') }} <span style="color: red; font-weight:bold">*</span></label>
// <select name="total_periodos[]" id="totalDePeriodos${valor}" class="form-control" onchange="gerarPeriodos${valor}(this)" >
// <option value="" disabled selected>-- TOTAL DE PERIODOS --</option>
// <option value="6">6</option>
// <option value="7">7</option>
// <option value="8">8</option>
// <option value="9">9</option>
// <option value="10">10</option>
// <option value="11">11</option>
// <option value="12">12</option>
// </select>
// </div>
// <div class="form-group col-md-6">
// <label for="periodoAtual${valor}">{{ __('Período atual') }} <span style="color: red; font-weight:bold">*</span></label>
// <select name="periodo_cursado[]" id="periodoAtual${valor}" class="form-control" >
// <option value="" disabled selected>-- PERÍODO ATUAL --</option>
// </select>
// </div>
// <div class="form-group col-md-6">
// <label for="ordemDePrioridade${valor}">{{ __('Ordem de prioridade') }} <span style="color: red; font-weight:bold">*</span></label>
// <select name="ordem_prioridade[]" id="ordemDePrioridade${valor}" class="form-control" >
// <option value="" disabled selected>-- ORDEM --</option>
// <option value="1">1º</option>
// <option value="2">2º</option>
// <option value="3">3º</option>
// </select>
// </div>
// <div class="form-group col-md-6">
// <label for="coeficienteDeRendimento${valor}">Coeficiente de rendimento <span style="color: red; font-weight:bold">*</span></label>
// <input type="number" class="form-control media" id="coeficienteDeRendimento${valor}" min="0" max="10" step="0.01" value="00.00" name="media_geral_curso[]" >
// @error('coeficienteDeRendimento${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="col-md-12"><h5>Plano de trabalho</h5></div>
// <div class="form-group col-md-6">
// <label for="titulo${valor}">Título <span style="color: red; font-weight:bold">*</span></label>
// <input type="text" class="form-control @error('titulo${valor}') is-invalid @enderror" id="titulo${valor}" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" >
// @error('titulo${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// <div class="form-group col-md-6">
// <label for="anexoPlanoDeTrabalho${valor}">Anexo <span style="color: red; font-weight:bold">*</span></label>
// <div class="custom-file">
// <input type="file" class="custom-file-input @error('anexoPlanoTrabalho') is-invalid @enderror" id="anexoPlanoDeTrabalho${valor}" aria-describedby="anexoPlanoTrabalho" name="anexoPlanoTrabalho[]" onchange="verificarArquivoAnexado_pdf(this, 'anexoPlanoTrabalho${valor}')" >
// <label class="custom-file-label" id="anexoPlanoTrabalho${valor}" for="inputGroupFile01">O arquivo deve ser no formato PDF de até 2MB.</label>
// </div>
// @error('anexoPlanoDeTrabalho${valor}')
// <span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
// <strong>{{ $message }}</strong>
// </span>
// @enderror
// </div>
// </div>
// </div>
// </div>
// </div>
// </div>
// </div>
// </li>`;
// }
// /*
// * FUNCAO: Alterar o nome na aba
// *
// */
// $(document).on('keyup', "#nomeCompletoParticipante1",function () {
// if($(this).val().length>0){
// document.getElementById('tituloParticipante1').innerHTML = "Participante - "+$(this).val();
// }else{
// document.getElementById('tituloParticipante1').innerHTML = "Participante";
// }
// });
// $(document).on('keyup', "#nomeCompletoParticipante2",function () {
// if($(this).val().length>0){
// document.getElementById('tituloParticipante2').innerHTML = "Participante - "+$(this).val();
// }else{
// document.getElementById('tituloParticipante2').innerHTML = "Participante";
// }
// });
// $(document).on('keyup', "#nomeCompletoParticipante3",function () {
// if($(this).val().length>0){
// document.getElementById('tituloParticipante3').innerHTML = "Participante - "+$(this).val();
// }else{
// document.getElementById('tituloParticipante3').innerHTML = "Participante";
// }
// });
// /*
// * FUNCAOS: validar input
// */
// function validarForm(form){
// //regex
// const regexNumero = /[0-9]/;
// const regexLetra = /[A-Za-z]/;
// var regexEmail = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/;
// //informacoes do projeto
// let nomeDoProjeto = form.nomeProjeto.value;
// let grandeArea = form.grandeArea.value;
// let area = form.area.value;
// //informacoes do proponente
// let linkLattesEstudante = form.linkLattesEstudante.value;
// let pontuacaoPlanilha = form.pontuacaoPlanilha.value;
// let linkGrupo = form.linkGrupo.value;
// //anexos
// let anexoProjeto = form.anexoProjeto.value;
// let anexoLattesCoordenador = form.anexoLattesCoordenador.value;
// let anexoPlanilha = form.anexoPlanilha.value;
// let anexoCONSU = form.anexoCONSU.value;
// let anexoComiteEtica = form.anexoComiteEtica.value;
// let justificativaAutorizacaoEtica = form.justificativaAutorizacaoEtica.value;
// let radioSim = document.getElementById("radioSim").checked;
// let radioNao = document.getElementById("radioNao").checked;
// //participantes
// //let nomeCompletoParticipante = form.elements['nomeParticipante[]'];
// //let emailParticipante = form.elements['emailParticipante[]'];
// //console.log(nomeCompletoParticipante1)
// /*var myCollection = document.getElementsByTagName("input");
// console.log(myCollection.length, myCollection[24]);
// console.log(myCollection.length, myCollection[25]);
// console.log(myCollection.length, myCollection[26]);
// console.log(myCollection.length);
// if(toString(myCollection[24]) != 'undefined'){
// if(myCollection[24] == ""){
// alert('Digite seu nome completo');
// return false;
// }
// }
// */
// //participantes
// //participante1 - data
// if(arrayElementos.length == 3){
// alert("É necesário cadastrar pelo menos um participante!");
// return false;
// }else{
// for(i = 1; i<=3; i++){
// if(arrayElementos.includes(i.toString()) == false){
// //console.log("temos", i);
// //nome participante
// var elementNome = document.getElementById('nomeCompletoParticipante'+i);
// if (typeof(elementNome) != 'undefined' && elementNome != null){
// if(elementNome.value == ""){
// alert("nome vazio");
// return false;
// }else if(regexNumero.test(elementNome.value) == true){
// alert("Você colocou número no nome do participante. Verifique o campo e tente novamente!");
// return false;
// }
// }
// //email participante
// var elementEmail = document.getElementById('email'+i);
// if (typeof(elementEmail) != 'undefined' && elementEmail != null){
// if(elementEmail.value == ""){
// alert("email vazio");
// return false;
// }else if(regexEmail.test(elementEmail.value) == false){
// alert("Verifique o e-mail do participante e tente novamente!");
// return false;
// }
// }
// //data participante
// var elementData = document.getElementById('data'+i);
// if (typeof(elementData) != 'undefined' && elementData != null){
// if(elementData.value == ""){
// alert("Verifique a data de nascimento do participante e tente novamente!");
// return false;
// }
// }
// //cpf participante
// var elementCpf = document.getElementById('cpf'+i);
// if (typeof(elementCpf) != 'undefined' && elementCpf != null){
// if(elementCpf.value == ""){
// alert("cpf vazio");
// return false;
// }else if(regexLetra.test(elementCpf.value)==true){
// alert("Verifique o cpf do participante e tente novamente!");
// return false;
// }else if(validarCPF(elementCpf.value)==false){
// alert("Verifique o cpf do participante e tente novamente!");
// return false;
// }
// }
// //rg participante
// var elementRg = document.getElementById("rg"+i);
// if (typeof(elementRg) != 'undefined' && elementRg != null){
// if(elementRg.value == ""){
// alert("rg vazio");
// return false;
// }
// }
// //celular participante
// var elementCelular = document.getElementById('celular'+i);
// if (typeof(elementCelular) != 'undefined' && elementCelular != null){
// if(elementCelular.value == ""){
// alert("celular vazio");
// return false;
// }
// }
// //cep participante
// var elementCep = document.getElementById('cep'+i);
// if (typeof(elementCep) != 'undefined' && elementCep != null){
// if(elementCep.value == ""){
// alert("cep vazio");
// return false;
// }
// }
// //estado participante
// var elementEstado = document.getElementById('estado'+i);
// if (typeof(elementEstado) != 'undefined' && elementEstado != null){
// if(elementEstado.value == ""){
// alert("estado vazio");
// return false;
// }
// }
// //cidade participante
// var elementCidade = document.getElementById('cidade'+i);
// if (typeof(elementCidade) != 'undefined' && elementCidade != null){
// if(elementCidade.value == ""){
// alert("cidade vazio");
// return false;
// }
// }
// //bairro participante
// var elementBairro = document.getElementById('bairro'+i);
// if (typeof(elementBairro) != 'undefined' && elementBairro != null){
// if(elementBairro.value == ""){
// alert("bairro vazio");
// return false;
// }
// }
// //rua participante
// var elementRua = document.getElementById('rua'+i);
// if (typeof(elementRua) != 'undefined' && elementRua != null){
// if(elementRua.value == ""){
// alert("rua vazio");
// return false;
// }
// }
// //numero participante
// var elementNumero = document.getElementById('numero'+i);
// if (typeof(elementNumero) != 'undefined' && elementNumero != null){
// if(elementNumero.value == ""){
// alert("numero vazio");
// return false;
// }
// }
// //complemento participante
// var elementComplemento = document.getElementById('complemento'+i);
// if (typeof(elementComplemento) != 'undefined' && elementComplemento != null){
// if(elementComplemento.value == ""){
// alert("complemento vazio");
// return false;
// }
// }
// //universidade participante
// var elementUniversidade = document.getElementById('universidade'+i);
// if (typeof(elementUniversidade) != 'undefined' && elementUniversidade != null){
// if(elementUniversidade.value == ""){
// alert("Universidade vazio");
// return false;
// }
// }
// //curso participante
// var elementCurso = document.getElementById('curso'+i);
// if (typeof(elementCurso) != 'undefined' && elementCurso != null){
// if(elementCurso.value == ""){
// alert("Curso vazio");
// return false;
// }
// }
// //turno participante
// var elementTurno = document.getElementById('turno'+i);
// if (typeof(elementTurno) != 'undefined' && elementTurno != null){
// if(elementTurno.value == ""){
// alert("Turno vazio");
// return false;
// }
// }
// //totalDePeriodos participante
// var elementTotalDePeriodos = document.getElementById('totalDePeriodos'+i);
// if (typeof(elementTotalDePeriodos) != 'undefined' && elementTotalDePeriodos != null){
// if(elementTotalDePeriodos.value == ""){
// alert("totalDePeriodos1 vazio");
// return false;
// }
// }
// //totalDePeriodos participante
// var elementPeriodoAtual = document.getElementById('periodoAtual'+i);
// if (typeof(elementPeriodoAtual) != 'undefined' && elementPeriodoAtual != null){
// if(elementPeriodoAtual.value == ""){
// alert("periodoAtual1 vazio");
// return false;
// }
// }
// //ordemDePrioridade1 participante
// var elementOrdemDePrioridade = document.getElementById('ordemDePrioridade'+i);
// if (typeof(elementOrdemDePrioridade) != 'undefined' && elementOrdemDePrioridade != null){
// if(elementOrdemDePrioridade.value == ""){
// alert("elementOrdemDePrioridade vazio");
// return false;
// }
// }
// //coeficienteDeRendimento1 participante
// var elementCoeficienteDeRendimento = document.getElementById('coeficienteDeRendimento'+i);
// if (typeof(elementCoeficienteDeRendimento) != 'undefined' && elementCoeficienteDeRendimento != null){
// if(elementCoeficienteDeRendimento.value == ""){
// alert("elementCoeficienteDeRendimento vazio");
// return false;
// }
// }
// //titulo1 participante
// var elemenTtitulo = document.getElementById('titulo'+i);
// if (typeof(elemenTtitulo) != 'undefined' && elemenTtitulo != null){
// if(elemenTtitulo.value == ""){
// alert("elemenTtitulo vazio");
// return false;
// }
// }
// //anexoPlanoDeTrabalho1 participante
// var elemenAnexoPlanoDeTrabalho = document.getElementById('anexoPlanoDeTrabalho'+i);
// if (typeof(elemenAnexoPlanoDeTrabalho) != 'undefined' && elemenAnexoPlanoDeTrabalho != null){
// if(elemenAnexoPlanoDeTrabalho.value == ""){
// alert("elemenAnexoPlanoDeTrabalho vazio");
// return false;
// }
// }
// }
// }
// alert("ok");
// return false;
// //nome participante
// /* var elementNome = document.getElementById('nomeCompletoParticipante1');
// if (typeof(elementNome) != 'undefined' && elementNome != null){
// if(elementNome.value == ""){
// alert("nome vazio");
// return false;
// }
// }
// //email participante
// var elementEmail = document.getElementById('email1');
// if (typeof(elementEmail) != 'undefined' && elementEmail != null){
// if(elementEmail.value == ""){
// alert("email vazio");
// return false;
// }
// }
// //data participante
// var elementData = document.getElementById('data1');
// if (typeof(elementData) != 'undefined' && elementData != null){
// if(elementData.value == ""){
// alert("Data vazio");
// return false;
// }
// }
// //cpf participante
// var elementCpf = document.getElementById('cpf1');
// if (typeof(elementCpf) != 'undefined' && elementCpf != null){
// if(elementCpf.value == ""){
// alert("cpf vazio");
// return false;
// }
// }
// //rg participante
// var elementRg = document.getElementById('rg1');
// if (typeof(elementRg) != 'undefined' && elementRg != null){
// if(elementRg.value == ""){
// alert("rg vazio");
// return false;
// }
// }
// //celular participante
// var elementCelular = document.getElementById('celular1');
// if (typeof(elementCelular) != 'undefined' && elementCelular != null){
// if(elementCelular.value == ""){
// alert("celular vazio");
// return false;
// }
// }
// //cep participante
// var elementCep = document.getElementById('cep1');
// if (typeof(elementCep) != 'undefined' && elementCep != null){
// if(elementCep.value == ""){
// alert("cep vazio");
// return false;
// }
// }
// //estado participante
// var elementEstado = document.getElementById('estado1');
// if (typeof(elementEstado) != 'undefined' && elementEstado != null){
// if(elementEstado.value == ""){
// alert("estado vazio");
// return false;
// }
// }
// //cidade participante
// var elementCidade = document.getElementById('cidade1');
// if (typeof(elementCidade) != 'undefined' && elementCidade != null){
// if(elementCidade.value == ""){
// alert("cidade vazio");
// return false;
// }
// }
// //bairro participante
// var elementBairro = document.getElementById('bairro1');
// if (typeof(elementBairro) != 'undefined' && elementBairro != null){
// if(elementBairro.value == ""){
// alert("bairro vazio");
// return false;
// }
// }
// //rua participante
// var elementRua = document.getElementById('rua1');
// if (typeof(elementRua) != 'undefined' && elementRua != null){
// if(elementRua.value == ""){
// alert("rua vazio");
// return false;
// }
// }
// //numero participante
// var elementNumero = document.getElementById('numero1');
// if (typeof(elementNumero) != 'undefined' && elementNumero != null){
// if(elementNumero.value == ""){
// alert("numero vazio");
// return false;
// }
// }
// //complemento participante
// var elementComplemento = document.getElementById('complemento1');
// if (typeof(elementComplemento) != 'undefined' && elementComplemento != null){
// if(elementComplemento.value == ""){
// alert("complemento vazio");
// return false;
// }
// }
// //universidade participante
// var elementUniversidade = document.getElementById('universidade1');
// if (typeof(elementUniversidade) != 'undefined' && elementUniversidade != null){
// if(elementUniversidade.value == ""){
// alert("Universidade vazio");
// return false;
// }
// }
// //curso participante
// var elementCurso = document.getElementById('curso1');
// if (typeof(elementCurso) != 'undefined' && elementCurso != null){
// if(elementCurso.value == ""){
// alert("Curso vazio");
// return false;
// }
// }
// //turno participante
// var elementTurno = document.getElementById('turno1');
// if (typeof(elementTurno) != 'undefined' && elementTurno != null){
// if(elementTurno.value == ""){
// alert("Turno vazio");
// return false;
// }
// }
// //totalDePeriodos participante
// var elementTotalDePeriodos = document.getElementById('totalDePeriodos1');
// if (typeof(elementTotalDePeriodos) != 'undefined' && elementTotalDePeriodos != null){
// if(elementTotalDePeriodos.value == ""){
// alert("totalDePeriodos1 vazio");
// return false;
// }
// }
// //totalDePeriodos participante
// var elementPeriodoAtual = document.getElementById('periodoAtual1');
// if (typeof(elementPeriodoAtual) != 'undefined' && elementPeriodoAtual != null){
// if(elementPeriodoAtual.value == ""){
// alert("periodoAtual1 vazio");
// return false;
// }
// }
// //ordemDePrioridade1 participante
// var elementOrdemDePrioridade = document.getElementById('ordemDePrioridade1');
// if (typeof(elementOrdemDePrioridade) != 'undefined' && elementOrdemDePrioridade != null){
// if(elementOrdemDePrioridade.value == ""){
// alert("elementOrdemDePrioridade vazio");
// return false;
// }
// }
// //coeficienteDeRendimento1 participante
// var elementCoeficienteDeRendimento = document.getElementById('coeficienteDeRendimento1');
// if (typeof(elementCoeficienteDeRendimento) != 'undefined' && elementCoeficienteDeRendimento != null){
// if(elementCoeficienteDeRendimento.value == ""){
// alert("elementCoeficienteDeRendimento vazio");
// return false;
// }
// }
// //titulo1 participante
// var elemenTtitulo = document.getElementById('titulo1');
// if (typeof(elemenTtitulo) != 'undefined' && elemenTtitulo != null){
// if(elemenTtitulo.value == ""){
// alert("elemenTtitulo vazio");
// return false;
// }
// }
// //anexoPlanoDeTrabalho1 participante
// var elemenAnexoPlanoDeTrabalho = document.getElementById('anexoPlanoDeTrabalho1');
// if (typeof(elemenAnexoPlanoDeTrabalho) != 'undefined' && elemenAnexoPlanoDeTrabalho != null){
// if(elemenAnexoPlanoDeTrabalho.value == ""){
// alert("elemenAnexoPlanoDeTrabalho vazio");
// return false;
// }
// }
// */
// }
// alert("CHEGOUUU!");
// return false;
// }
function validarCPF(valor){
var soma = 0;
var resto;
......@@ -1282,83 +472,85 @@
// });
// });
$(document).ready(function(){
$(".cpf").change(function(){
if (validarCPF(retirarFormatacao(this.value))) {
this.parentElement.children[2].style.display = "none";
this.parentElement.children[3].style.display = "block";
} else {
this.parentElement.children[2].style.display = "block";
this.parentElement.children[3].style.display = "none";
}
});
});
// $(document).ready(function(){
// $(".cpf").change(function(){
// console.log(this.parentElement.children[0])
// if (validarCPF(retirarFormatacao(this.value))) {
function validarCPF(strCPF) {
var soma;
var resto;
soma = 0;
// Verifica se foi informado todos os digitos corretamente
if (strCPF.length != 11) {
return false;
}
// this.parentElement.children[0].style.display = "none";
// this.parentElement.children[1].style.display = "block";
// } else {
// this.parentElement.children[0].style.display = "block";
// this.parentElement.children[1].style.display = "none";
// }
// });
// });
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
if (varificarDigitos(strCPF)) {
return false;
}
// function validarCPF(strCPF) {
// var soma;
// var resto;
// soma = 0;
// // Verifica se foi informado todos os digitos corretamente
// if (strCPF.length != 11) {
// return false;
// }
// Faz o calculo para validar o CPF
for (var t = 9; t < 11; t++) {
for (var d = 0, c = 0; c < t; c++) {
d += strCPF[c] * ((t + 1) - c);
}
d = ((10 * d) % 11) % 10;
if (strCPF[c] != d) {
return false;
}
}
return true;
}
// // Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
// if (varificarDigitos(strCPF)) {
// return false;
// }
function retirarFormatacao(strCpf) {
resultado = "";
for(var i = 0; i < strCpf.length; i++) {
if (strCpf[i] != "." && strCpf[i] != "-") {
resultado += strCpf[i];
}
}
return resultado;
}
// // Faz o calculo para validar o CPF
// for (var t = 9; t < 11; t++) {
// for (var d = 0, c = 0; c < t; c++) {
// d += strCPF[c] * ((t + 1) - c);
// }
// d = ((10 * d) % 11) % 10;
// if (strCPF[c] != d) {
// return false;
// }
// }
// return true;
// }
function varificarDigitos(strCpf) {
var cont = 1;
dig1 = strCpf[0];
// function retirarFormatacao(strCpf) {
// resultado = "";
// for(var i = 0; i < strCpf.length; i++) {
// if (strCpf[i] != "." && strCpf[i] != "-") {
// resultado += strCpf[i];
// }
// }
// return resultado;
// }
for(var i = 1; i < strCpf.length; i++) {
if(dig1 == strCpf[i]) {
cont++;
}
}
if (cont == strCpf.length) {
return true;
}
return false;
}
// function varificarDigitos(strCpf) {
// var cont = 1;
// dig1 = strCpf[0];
function checarCpfs() {
var validacoes = document.getElementsByClassName("cpf-invalido");
var count = validacoes.length;
var quant = 0;
for(var i = 0; i < validacoes.length; i++) {
if (validacoes[i].style.display == "none") {
quant++;
}
}
if(quant == count) {
return true;
}
return false;
}
// for(var i = 1; i < strCpf.length; i++) {
// if(dig1 == strCpf[i]) {
// cont++;
// }
// }
// if (cont == strCpf.length) {
// return true;
// }
// return false;
// }
// function checarCpfs() {
// var validacoes = document.getElementsByClassName("cpf-invalido");
// var count = validacoes.length;
// var quant = 0;
// for(var i = 0; i < validacoes.length; i++) {
// if (validacoes[i].style.display == "none") {
// quant++;
// }
// }
// if(quant == count) {
// return true;
// }
// return false;
// }
</script>
@endsection
......@@ -18,10 +18,13 @@
<script src="{{ asset('js/jquery-3.4.1.min.js')}}"></script>
<script src="{{ asset('js/jquery-mask-plugin.js')}}"></script>
{{-- <script src="https://cdn.jsdelivr.net/npm/jquery-mask-plugin@1.14.16/dist/jquery.mask.min.js"></script> --}}
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="{{ asset('css/layout.css') }}" rel="stylesheet">
<style>
body{
background-color: #f8fafc
......@@ -275,8 +278,9 @@
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" ></script>
{{-- <script src="https://code.jquery.com/jquery-3.6.0.min.js" ></script> --}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-mask-plugin@1.14.16/dist/jquery.mask.min.js"></script>
<script>
$(document).ready(function() {
$("#dropdown-login").on('click', function(event){
......
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