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

ajuste

parents f49bbb66 31dfd106
......@@ -67,7 +67,7 @@ class UserController extends Controller
} else {
$validated = $request->validate([
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255'],
//'email' => ['required', 'string', 'email', 'max:255'],
'cpf' => ['required', 'cpf'],
'celular' => ['required', 'string'],
'instituicao' => ['required_if:instituicaoSelect,Outra', 'max:255'],
......@@ -84,11 +84,12 @@ class UserController extends Controller
'bolsistaProdutividade' => ['required_with:titulacaoMaxima,anoTitulacao,areaFormacao,linkLattes'],
'bolsistaProdutividade' => Rule::requiredIf((isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando')),
'nivel' => ['required_if:bolsistaProdutividade,sim'],
//'nivel' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''],
// 'nivel' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''],
'linkLattes' => ['required_with:titulacaoMaxima,anoTitulacao,areaFormacao,bolsistaProdutividade'],
'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'required':''],
'linkLattes' => [(isset($request['cargo']) && $request['cargo'] !== 'Estudante') || (isset($request['cargo']) && $request['cargo'] === 'Estudante' && isset($request['vinculo']) && $request['vinculo'] === 'Pós-doutorando') ? 'link_lattes':''],
]);
]);
}
if ($request->alterarSenhaCheckBox != null) {
......@@ -99,6 +100,7 @@ class UserController extends Controller
if (!($request->nova_senha === $request->confirmar_senha)) {
return redirect()->back()->withErrors(['nova_senha' => 'Senhas diferentes']);
}
}
if(Auth()->user()->avaliadors != null && $request->area != null && Auth()->user()->tipo != "avaliador"){
$avaliador = Avaliador::where('user_id', '=', $id)->first();
......@@ -160,7 +162,7 @@ class UserController extends Controller
$user->name = $request->name;
$user->tipo = $request->tipo;
$user->email = $request->email;
// $user->email = $request->email;
$user->cpf = $request->cpf;
$user->celular = $request->celular;
if ($request->instituicao != null) {
......@@ -173,6 +175,7 @@ class UserController extends Controller
$user->password = bcrypt($request->nova_senha);
}
$user->update();
return redirect( route('user.perfil') )->with(['mensagem' => 'Dados atualizados com sucesso.']);
......
......@@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class Proponente extends Model
{
protected $fillable = ['SIAPE', 'cargo','vinculo','titulacaoMaxima','anoTitulacao','areaFormacao','bolsistaProdutividade','nivel','linkLattes'];
public function user(){
return $this->belongsTo('App\User');
}
......
......@@ -497,4 +497,11 @@ button.close {
display: block;
margin-right:10px;
}
}
.imagem_shadow{
transition: -webkit-filter 0.5s;
}
.imagem_shadow:hover{
-webkit-filter: drop-shadow(5px 5px 5px rgb(206, 206, 206)); filter: drop-shadow(5px 5px 5px rgb(206, 206, 206));
}
\ No newline at end of file
......@@ -48,7 +48,7 @@
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="number" class="form-control" name="cep[]" placeholder="CEP" required/>
<input type="text" class="form-control cep" name="cep[]" placeholder="CEP" required/>
@endcomponent
</div>
......
......@@ -11,8 +11,8 @@
</div>
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Enviar Projeto') }}</button>
<button id="submeterFormProposta" type="submit" style="display: none;"></button>
<button type="button" class="btn btn-success" id="idButtonSubmitProjeto" onclick="submeterProposta()">{{ __('Enviar Projeto') }}</button>
</div>
</div>
</div>
......
......@@ -26,8 +26,8 @@
</div>
</a>
</div>
<div class="col-1">
<button type="button" class="btn btn-danger" id="buttonRemover" onclick="removerPart(this)" >X</button>
<div class="col-1" style="margin-top:4.3px">
<button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante">
......@@ -52,7 +52,13 @@
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" required/>
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" required onchange="checarCPFdoCampo(this)" onkeyup="mascaraCPF(this)"/>
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF inválido.</span>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF válido.</span>
</span>
@endcomponent
</div>
<div class="col-6">
......
......@@ -59,7 +59,27 @@
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="modalCpfInvalido" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header" style="background-color: red;">
<h5 class="modal-title" id="exampleModalLabel2" style="font-size:20px; margin-top:7px; color:white; font-weight:bold; font-family: 'Roboto', sans-serif;">Aviso</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Existe um CPF inválido em um dos participantes por favor corrija para continuar.
</div>
{{-- <div class="modal-footer">
{{-- <button type="button" class="btn btn-secondary"></button>
{{-- <button type="button" class="btn btn-primary">Certo</button>
</div> --}}
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
......@@ -143,6 +163,7 @@
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");
}
......@@ -174,7 +195,7 @@
});
$('.cep').mask('00000000');
$('.cpf').mask('000.000.000-00');
// $('.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';
......@@ -527,80 +548,126 @@
// console.log(this.parentElement.children[0])
// if (validarCPF(retirarFormatacao(this.value))) {
// 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";
// this.parentElement.children[2].style.display = "block";
// } else {
// this.parentElement.children[1].style.display = "block";
// this.parentElement.children[2].style.display = "none";
// }
// });
// });
// function validarCPF(strCPF) {
// var soma;
// var resto;
// soma = 0;
// // Verifica se foi informado todos os digitos corretamente
// if (strCPF.length != 11) {
// return false;
// }
// // Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
// if (varificarDigitos(strCPF)) {
// return false;
// }
// // Faz o calculo para validar o CPF
// for (var t = 9; t < 11; t++) {
// for (var d = 0, c = 0; c < t; c++) {
// d += strCPF[c] * ((t + 1) - c);
// }
// d = ((10 * d) % 11) % 10;
// if (strCPF[c] != d) {
// return false;
// }
// }
// return true;
// }
// function retirarFormatacao(strCpf) {
// resultado = "";
// for(var i = 0; i < strCpf.length; i++) {
// if (strCpf[i] != "." && strCpf[i] != "-") {
// resultado += strCpf[i];
// }
// }
// return resultado;
// }
function checarCPFdoCampo(input) {
if (input.value.length == 14) {
if (validarCPF(retirarFormatacao(input.value))) {
input.parentElement.children[1].style.display = "none";
input.parentElement.children[2].style.display = "block";
} else {
input.parentElement.children[1].style.display = "block";
input.parentElement.children[2].style.display = "none";
}
} else {
input.parentElement.children[1].style.display = "none";
input.parentElement.children[2].style.display = "none";
}
}
// function varificarDigitos(strCpf) {
// var cont = 1;
// dig1 = strCpf[0];
function validarCPF(strCPF) {
var soma;
var resto;
soma = 0;
// Verifica se foi informado todos os digitos corretamente
if (strCPF.length != 11) {
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;
// }
// Verifica se foi informada uma sequência de digitos repetidos. Ex: 111.111.111-11
if (varificarDigitos(strCPF)) {
return false;
}
// Faz o calculo para validar o CPF
for (var t = 9; t < 11; t++) {
for (var d = 0, c = 0; c < t; c++) {
d += strCPF[c] * ((t + 1) - c);
}
d = ((10 * d) % 11) % 10;
if (strCPF[c] != d) {
return false;
}
}
return true;
}
function retirarFormatacao(strCpf) {
resultado = "";
for(var i = 0; i < strCpf.length; i++) {
if (strCpf[i] != "." && strCpf[i] != "-") {
resultado += strCpf[i];
}
}
return resultado;
}
function varificarDigitos(strCpf) {
var cont = 1;
dig1 = strCpf[0];
for(var i = 1; i < strCpf.length; i++) {
if(dig1 == strCpf[i]) {
cont++;
}
}
if (cont == strCpf.length) {
return true;
}
return false;
}
function checarCpfs() {
var validacoes = document.getElementsByClassName("cpf-invalido");
var count = validacoes.length;
var quant = 0;
for(var i = 0; i < validacoes.length; i++) {
if (validacoes[i].style.display == "none") {
quant++;
}
}
if(quant == count) {
return true;
}
return false;
}
function submeterProposta() {
if (checarCpfs()) {
document.getElementById("submeterFormProposta").click();
} else {
$("#modalCpfInvalido").modal('show');
}
}
function mascaraCPF(input) {
var numeros = "0123456789.-";
var resultado = "";
if (input.value.length < 14) {
for (var i = 0; i < input.value.length; i++) {
if (numeros.indexOf(input.value[i]) > -1) {
if ((i == 2 || i == 6) && input.value[i+1] != ".") {
resultado += input.value[i] + ".";
} else if (i == 10 && input.value[i+1] != "-") {
resultado += input.value[i] + "-";
} else {
resultado += input.value[i];
}
}
}
} else {
for (var i = 0; i < 14; i++) {
resultado += input.value[i];
}
}
input.value = resultado;
}
</script>
@endsection
......@@ -273,7 +273,7 @@
<div><a href="https://www.facebook.com/LMTSUFAPE/" target="_blank"><img src="{{ asset('img/icons/icon_facebook.svg') }}" alt="Logo" width="40px;" style="margin:5px"></a></div>
<div><a href="https://www.instagram.com/lmts_ufape/" target="_blank"><img src="{{ asset('img/icons/icon_instagram.svg') }}" alt="Logo" width="40px;" style="margin:5px"></a></div>
</div>
<div><img src="{{ asset('img/icons/icon_email.svg') }}" alt="Logo" width="20px;" style="margin:5px;"> <span>lmts@ufrpe.br</span></div>
<div><img src="{{ asset('img/icons/icon_email.svg') }}" alt="Logo" width="20px;" style="margin:5px;"> <span>lmts@ufape.br</span></div>
</div>
</div>
</div>
......
......@@ -2,8 +2,36 @@
@section('content')
<div class="container">
<div class="container" style="margin-bottom:8rem">
<div class="row justify-content-center" style="margin-top: 2rem;">
<div class="col-md-12 form-group" style="text-align: center">
<h5 style="color: #1492E6; margin-top:0.5rem; font-size:25px">Página inicial</h5>
<h5 style="color: #909090; margin-top:0.7rem; font-size:22px; font-weight:normal">Proponente</h5>
</div>
<div class="" style="text-align: center">
<div class="form-group imagem_shadow" style="border-radius: 12px; padding:14px; height:200px; width:190px; margin:15px">
<a href="{{route('coord.home')}}" style="text-decoration:none; color: inherit;">
<img src="{{asset('img/icons/icon_editais.png')}}" alt="" width="120px">
<h5 style="color: #073763; margin-top:0.5rem; font-size:25px;">Editais</h5>
</a>
</div>
</div>
<div class="" style="text-align: center">
<div class="form-group imagem_shadow" style="border-radius: 12px; padding:14px; height:200px; width:250px; margin:15px">
<a href="{{ route('proponente.projetos')}}" style="text-decoration:none; color: inherit;">
@if(\App\Trabalho::where('proponente_id', auth()->user()->proponentes->id)->count() > 0)
<img src="{{asset('img/icons/icon_pasta_cheia.png')}}" alt="" width="140px" style="margin-top: 45px; -webkit-filter: drop-shadow(5px 5px 5px rgb(206, 206, 206)); filter: drop-shadow(5px 5px 5px rgb(206, 206, 206));">
@else
<img src="{{asset('img/icons/icon_pasta_vazia.png')}}" alt="" width="140px" style="margin-top: 45px; -webkit-filter: drop-shadow(5px 5px 5px rgb(206, 206, 206)); filter: drop-shadow(5px 5px 5px rgb(206, 206, 206));">
@endif
<h5 style="color: #073763; margin-top:0.5rem; font-size:25px">Minhas propostas</h5>
</a>
</div>
</div>
</div>
</div>
<!--
<div class="row justify-content-center titulo-menu">
<h4>Página Principal - Proponente</h4>
</div>
......@@ -95,5 +123,5 @@
</div> --}}
</div>
</div>
-->
@endsection
......@@ -43,7 +43,7 @@
<form action="{{route('proponente.projetos')}}" method="get">
@csrf
<div class="btn-group">
<input type="text" class="form-control" name="buscar" placeholder="Digite o nome do edital" value="{{$busca}}" style="margin-right: 5px;border-radius:8px; border-color:#dcdcdc;">
<input type="text" class="form-control" name="buscar" placeholder="Pesquisar propostas" value="{{$busca}}" style="margin-right: 5px;border-radius:8px; border-color:#dcdcdc;">
<button type="submit" class="btn btn-light shadow-sm" style="border-radius: 8px; margin-right:3px"><img src="{{asset('img/icons/logo_lupa.png')}}" alt="" width="20px"></button>
</div>
</form>
......
This diff is collapsed.
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