Commit 9b7944b5 authored by luiz-davi's avatar luiz-davi
Browse files

Merge branch 'master' of github.com:luiz-davi/submeta into novos_logins_coordenador

parents 62386f44 721ddb4f
......@@ -5,6 +5,7 @@
/vendor
.env
.env.backup
.idea
.phpunit.result.cache
Homestead.json
Homestead.yaml
......
......@@ -130,7 +130,7 @@ class Evento extends Model
'tipoAvaliacao' => ['required'],
'inicioSubmissao' => ['required', 'date', 'after_or_equal:inicioSubmissao'],
'fimSubmissao' => ['required', 'date', 'after_or_equal:inicioSubmissao'],
'pdfEdital' => [('pdfEditalPreenchido'!=='sim'?'required':''), 'file', 'mimes:pdf', 'max:2048'],
'pdfEdital' => ['sometimes', 'required', 'file', 'mimes:pdf', 'max:2048'],
];
public function endereco(){
......
......@@ -25,7 +25,9 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use App\Endereco;
use App\Mail\EventoCriado;
use geekcom\ValidatorDocs\Rules\Ddd;
use Illuminate\Support\Facades\Mail;
use ZipArchive;
use Illuminate\Validation\Rule;
......@@ -82,20 +84,26 @@ class EventoController extends Controller
*/
public function store(Request $request)
{
$mytime = Carbon::now('America/Recife');
$yesterday = Carbon::yesterday('America/Recife');
$yesterday = $yesterday->toDateString();
//$admResponsavel = AdministradorResponsavel::with('user')->where('user_id', Auth()->user()->id)->first();
$user_id = Auth()->user()->id;
//dd($user_id);
if(isset($request->modeloDocumento)){
$request->validate([
'modeloDocumento' => ['file', 'max:2048', new ExcelRule($request->file('modeloDocumento'))],
]);
if(is_array($request->modeloDocumento)) {
foreach($request->modeloDocumento as $modelo){
$request->validate([
'modeloDocumento.*' => ['file', 'max:2048', new ExcelRule($modelo)],
]);
}
} else {
$request->validate([
'modeloDocumento' => ['file', 'max:2048', new ExcelRule($request->modeloDocumento)],
]);
}
}
if(isset($request->docTutorial)){
$request->validate([
'docTutorial' => ['file', 'max:2048', new ExcelRule($request->file('docTutorial'))],
......@@ -217,14 +225,22 @@ class EventoController extends Controller
}
if(isset($request->modeloDocumento)){
$modeloDocumento = $request->modeloDocumento;
$extension = $modeloDocumento->extension();
$path = 'modeloDocumento/' . $evento->id . '/';
$nome = "modelo" . "." . $extension;
Storage::putFileAs($path, $modeloDocumento, $nome);
$evento->modeloDocumento = $path . $nome;
}
$count = count($request->modeloDocumento);
$zip = new ZipArchive;
$filename = "storage/app/modeloDocumento/$evento->id/modelo.zip";
// Crie o diretório se ele não existir
if (!file_exists("storage/app/modeloDocumento/$evento->id")) {
mkdir("storage/app/modeloDocumento/$evento->id", 0777, true);
}
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
for ($i = 0; $i < $count; $i++) {
$zip->addFile($request->modeloDocumento[$i]->getRealPath(), $request->modeloDocumento[$i]->getClientOriginalName());
}
$zip->close();
$evento->modeloDocumento = $filename;
$evento->save();
}
if(isset($request->pdfFormAvalExterno) && ($request->tipoAvaliacao == 'form')){
$pdfFormAvalExterno = $request->pdfFormAvalExterno;
......@@ -299,12 +315,24 @@ class EventoController extends Controller
$pasta = 'pdfEdital/' . $eventoTemp->id;
$eventoTemp->pdfEdital = Storage::putFileAs($pasta, $request->pdfEdital, 'edital.pdf');
}
if (!(is_null($request->modeloDocumento))) {
$extension = $request->modeloDocumento->extension();
$path = 'modeloDocumento/' . $eventoTemp->id;
$nome = "modelo" . "." . $extension;
$eventoTemp->modeloDocumento = Storage::putFileAs($path, $request->modeloDocumento, $nome);
$count = count($request->modeloDocumento);
$zip = new ZipArchive;
$filename = "storage/app/modeloDocumento/$eventoTemp->id/modelo.zip";
// Crie o diretório se ele não existir
if (!file_exists("storage/app/modeloDocumento/$eventoTemp->id")) {
mkdir("storage/app/modeloDocumento/$eventoTemp->id", 0777, true);
}
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
for ($i = 0; $i < $count; $i++) {
$zip->addFile($request->modeloDocumento[$i]->getRealPath(), $request->modeloDocumento[$i]->getClientOriginalName());
}
$zip->close();
$eventoTemp->modeloDocumento = $filename;
$eventoTemp->save();
}
if(!(is_null($request->pdfFormAvalExterno)) && ($request->tipoAvaliacao == 'form')) {
$extension = $request->pdfFormAvalExterno->extension();
$pasta = 'pdfFormAvalExterno/' . $eventoTemp->id;
......@@ -531,15 +559,23 @@ class EventoController extends Controller
}
if($request->modeloDocumento != null){
foreach ($request->modeloDocumento as $key => $modeloDocumento) {
$extension = $modeloDocumento->extension();
$path = 'modeloDocumento/' . $evento->id . '/';
$nome = "modelo" . $key . "." . $extension;
Storage::putFileAs($path, $modeloDocumento, $nome);
$evento->modeloDocumento = $path . $nome;
$count = count($request->modeloDocumento);
$zip = new ZipArchive;
$filename = "storage/app/modeloDocumento/$evento->id/modelo.zip";
// Crie o diretório se ele não existir
if (!file_exists("storage/app/modeloDocumento/$evento->id")) {
mkdir("storage/app/modeloDocumento/$evento->id", 0777, true);
}
$zip->open($filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
for ($i = 0; $i < $count; $i++) {
$zip->addFile($request->modeloDocumento[$i]->getRealPath(), $request->modeloDocumento[$i]->getClientOriginalName());
}
$zip->close();
$evento->modeloDocumento = $filename;
$evento->save();
}
if(isset($request->pdfFormAvalExterno) && ($request->tipoAvaliacao == 'form')){
$pdfFormAvalExterno = $request->pdfFormAvalExterno;
$extension = $pdfFormAvalExterno->extension();
......@@ -660,8 +696,15 @@ class EventoController extends Controller
CampoAvaliacao::withTrashed()->where('evento_id', $id)->update(['evento_id' => null]);
}
Storage::deleteDirectory('pdfEdital/' . $evento->id );
Storage::deleteDirectory('modeloDocumento/' . $evento->id);
$pdfEditalPath = 'pdfEdital/' . $evento->id;
if (Storage::disk()->exists($pdfEditalPath)) {
Storage::deleteDirectory($pdfEditalPath);
}
$modeloDocumentoPath = 'modeloDocumento/' . $evento->id;
if (Storage::disk()->exists($modeloDocumentoPath)) {
Storage::deleteDirectory($modeloDocumentoPath);
}
$evento->delete();
......@@ -812,14 +855,21 @@ class EventoController extends Controller
return abort(404);
}
public function baixarModelos($id) {
$evento = Evento::find($id);
public function baixarModelos($id)
{
$evento = Evento::findOrFail($id);
$path = $evento->modeloDocumento;
return response()->download($path);
}
if (Storage::disk()->exists($evento->modeloDocumento)) {
ob_end_clean();
return Storage::download($evento->modeloDocumento);
}
// public function baixarModelos($id) {
// $evento = Evento::find($id);
return abort(404);
}
// if (Storage::disk()->exists($evento->modeloDocumento)) {
// ob_end_clean();
// return Storage::download($evento->modeloDocumento);
// }
// return abort(404);
// }
}
......@@ -402,6 +402,11 @@ class TrabalhoController extends Controller
$trabalho->anexo_SIPAC = Storage::putFileAs($pasta, $request->anexo_SIPAC, "Anexo_SIPAC." . $request->file('anexo_SIPAC')->extension());
}
//Anexo Acao Afirmativa
if (isset($request->anexo_acao_afirmativa)) {
$trabalho->anexo_acao_afirmativa = Storage::putFileAs($pasta, $request->anexo_acao_afirmativa, "Anexo_Acao_Afirmativa." . $request->file('anexo_acao_afirmativa')->extension());
}
return $trabalho;
}
......@@ -770,6 +775,17 @@ class TrabalhoController extends Controller
return abort(404);
}
public function baixarAcaoAfirmativa($id)
{
$projeto = Trabalho::find($id);
//dd($projeto);
if (Storage::disk()->exists($projeto->anexo_acao_afirmativa)) {
ob_end_clean();
return Storage::download($projeto->anexo_acao_afirmativa);
}
return abort(404);
}
public function baixarAnexoGrupoPesquisa($id)
{
$projeto = Trabalho::find($id);
......@@ -895,16 +911,30 @@ class TrabalhoController extends Controller
}
public function baixarEventoTemp($nomeAnexo)
{
{
$eventoTemp = Evento::where('criador_id', Auth::user()->id)->where('anexosStatus', 'temporario')
->orderByDesc('updated_at')->first();
if (Storage::disk()->exists($eventoTemp->$nomeAnexo)) {
return response()->download($eventoTemp->$nomeAnexo);
if (!is_null($eventoTemp) && Storage::disk()->exists($eventoTemp->$nomeAnexo)) {
ob_end_clean();
return Storage::download($eventoTemp->$nomeAnexo);
}
return abort(404);
}
public function baixarModeloEventoTemp($nomeAnexo)
{
$eventoTemp = Evento::where('criador_id', Auth::user()->id)->where('anexosStatus', 'temporario')
->orderByDesc('updated_at')->first();
if (!is_null($eventoTemp)) {
ob_end_clean();
return response()->download($eventoTemp->$nomeAnexo);
}
return abort(404);
}
//xxfa
public function update(UpdateTrabalho $request, $id)
......@@ -1178,6 +1208,10 @@ class TrabalhoController extends Controller
if($usuario){
$participante = $usuario->participantes()->first();
if(!$participante)
return json_encode([$usuario, $funcao]);
if ($participante->curso == null && $participante->curso_id != null)
$participante->curso = Curso::find($participante->curso_id)->nome;
return json_encode([$usuario, $funcao, $participante, $usuario->endereco()->first()]);
......@@ -1189,7 +1223,7 @@ class TrabalhoController extends Controller
public function salvar(StoreTrabalho $request)
{
// dd($request->all());
//dd($request->all());
try {
if (!$request->has('rascunho')) {
$request->merge([
......@@ -1217,61 +1251,74 @@ class TrabalhoController extends Controller
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra',
]));
} else {
//dd();
$trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU', 'anexoPlanilhaPontuacao',
'anexoLattesCoordenador', 'anexoGrupoPesquisa', 'anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC'
'justificativaAutorizacaoEtica','modalidade','anexo_docExtra', 'anexo_SIPAC', 'anexo_acao_afirmativa'
]));
}
//adição dos participantes
if ($request->has('marcado')) {
if ($request->has('marcado')) {
foreach ($request->marcado as $key => $part) {
$part = intval($part);
// $passwordTemporario = Str::random(8);
$data['name'] = $request->name[$part];
$data['email'] = $request->email[$part];
// $data['password'] = bcrypt($passwordTemporario);
$data['data_de_nascimento'] = $request->data_de_nascimento[$part];
$data['cpf'] = $request->cpf[$part];
$data['tipo'] = 'participante';
if (FuncaoParticipantes::where('nome', $request->funcaoParticipante[$part])->exists())
$data['funcao_participante_id'] = FuncaoParticipantes::where('nome', $request->funcaoParticipante[$part])->first()->id;
$data['rg'] = $request->rg[$part];
$data['celular'] = $request->celular[$part];
$data['cep'] = $request->cep[$part];
$data['uf'] = $request->uf[$part];
$data['cidade'] = $request->cidade[$part];
$data['rua'] = $request->rua[$part];
$data['numero'] = $request->numero[$part];
$data['bairro'] = $request->bairro[$part];
$data['complemento'] = $request->complemento[$part];
//Quando o integrante é um estudante
if($request->estudante[$part] == true){
if($request->data_de_nascimento[$part] == null){
$data_nascimento = null;
}else {
$data_nascimento = Carbon::createFromFormat('d/m/Y', $request->data_de_nascimento[$part])->toDateString();
}
$data['data_de_nascimento'] = $data_nascimento;
$data['rg'] = $request->rg[$part];
$data['celular'] = $request->celular[$part];
$data['cep'] = $request->cep[$part];
$data['uf'] = $request->uf[$part];
$data['cidade'] = $request->cidade[$part];
$data['rua'] = $request->rua[$part];
$data['numero'] = $request->numero[$part];
$data['bairro'] = $request->bairro[$part];
if($request->complemento[$part] == null) {
$data['complemento'] = "";
}else {
$data['complemento'] = $request->complemento[$part];
}
if ($request->curso[$part] != "Outro") {
$data['curso'] = $request->curso[$part];
} else {
$data['curso'] = $request->outrocurso[$part];
}
if($evento->tipo != "CONTINUO"){
if($evento->tipo != "PIBEX") {
$data['media_do_curso'] = $request->media_do_curso[$part];
}
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part];
}
}
//função no projeto
if($evento->tipo != "CONTINUO"){
if (FuncaoParticipantes::where('nome', $request->funcaoParticipante[$part])->exists())
$data['funcao_participante_id'] = FuncaoParticipantes::where('nome', $request->funcaoParticipante[$part])->first()->id;
}
//instituição do participante
if ($request->instituicao[$part] != "Outra") {
$data['instituicao'] = $request->instituicao[$part];
} else {
$data['instituicao'] = $request->outrainstituicao[$part];
}
$data['total_periodos'] = $request->total_periodos[$part];
if ($request->curso[$part] != "Outro") {
$data['curso'] = $request->curso[$part];
} else {
$data['curso'] = $request->outrocurso[$part];
}
$data['turno'] = $request->turno[$part];
$data['periodo_atual'] = $request->periodo_atual[$part];
$data['ordem_prioridade'] = $request->ordem_prioridade[$part];
if($evento->tipo!="PIBEX") {
$data['media_do_curso'] = $request->media_do_curso[$part];
}
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part];
$user = User::where('email', $data['email'])->first();
if ($user == null) {
$data['usuarioTemp'] = true;
$user = User::create($data);
......@@ -1285,26 +1332,28 @@ class TrabalhoController extends Controller
$participante = Participante::create($data);
$participante->data_entrada = $participante->created_at;
$user->participantes()->save($participante);
$participante->trabalho_id = $trabalho->id;
$participante->save();
if ($request->has('anexoPlanoTrabalho')) {
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $data['nomePlanoTrabalho'] . ".pdf";
$file = $request->anexoPlanoTrabalho[$part];
Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo();
$arquivo->titulo = $data['nomePlanoTrabalho'];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id;
$arquivo->data = now();
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
if($evento->tipo != "CONTINUO"){
if ($request->estudante[$part] == true && $request['nomePlanoTrabalho'][$part] != null) {
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id . '/';
$nome = $request['nomePlanoTrabalho'][$part] . ".pdf";
$file = $request->anexoPlanoTrabalho[$part];
Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo();
$arquivo->titulo = $request['nomePlanoTrabalho'][$part];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id;
$arquivo->data = now();
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
}
}
} else {
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho;
......@@ -1321,29 +1370,29 @@ class TrabalhoController extends Controller
$arquivo->proponenteId = $proponente->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
}
$evento->trabalhos()->save($trabalho);
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->modalidade = $request->modalidade;
$trabalho->save();
if($evento->natureza_id == 3){
foreach($request->integrantes as $integrante){
$integrante = explode(',', $integrante);
// if($evento->natureza_id == 3){
// foreach($request->integrantes as $integrante){
// $integrante = explode(',', $integrante);
$trabalho_user = new TrabalhoUser();
$trabalho_user->user_id = $integrante[0];
$trabalho_user->funcao_participante_id = $integrante[1];
$trabalho_user->trabalho_id = $trabalho->id;
$trabalho_user->save();
}
}
// $trabalho_user = new TrabalhoUser();
// $trabalho_user->user_id = $integrante[0];
// $trabalho_user->funcao_participante_id = $integrante[1];
// $trabalho_user->trabalho_id = $trabalho->id;
// $trabalho_user->save();
// }
// }
$trabalho->ods()->sync($request->ods);
DB::commit();
......
......@@ -48,9 +48,26 @@ class UserController extends Controller
function perfil()
{
$user = User::find(Auth::user()->id);
$user = Auth::user();
$cursoPart = null;
if ($user->participantes()->exists() && $user->participantes()->first()->curso_id)
$cursoPart = Curso::find($user->participantes()->first()->curso_id);
$view = 'user.perfilUser';
if ($user->tipo == 'participante')
$view = 'user.perfilParticipante';
return view('user.perfilUser', ['user' => $user]);
$naturezas = Natureza::orderBy('nome')->get();
$cursos = Curso::orderBy('nome')->get();
$areaTematica = AreaTematica::orderBy('nome')->get();
return view($view)
->with([
'user' => $user,
'cursos' => $cursos,
'naturezas' => $naturezas,
'cursoPart' => $cursoPart,
'areaTematica' => $areaTematica
]);
}
function editarPerfil(Request $request)
......@@ -58,7 +75,6 @@ class UserController extends Controller
$id = Auth()->user()->id;
$user = User::find($id);
if ($request->tipo != "proponente") {
$validated = $request->validate([
'name' => ['required', 'string', 'max:255'],
'instituicao' => ['required_if:instituicaoSelect,Outra', 'max:255'],
......@@ -94,6 +110,24 @@ class UserController extends Controller
]);
}
if ($user->tipo == 'participante') {
$validated = $request->validate([
'name' => ['required', 'string', 'max:255'],
'email' => ['required_if:alterarSenhaCheckBox,on', 'string', 'email', 'max:255', Rule::unique('users')->ignore($user->id)],
'password' => ['required_if:alterarSenhaCheckBox,on', 'string', 'min:8', 'confirmed'],
'cpf' => ['required', 'cpf', Rule::unique('users')->ignore($user->id)],
'rg' => ['required', Rule::unique('participantes')->ignore($user->participantes->first()->id)],
'celular' => ['required', 'string', 'telefone'],
'instituicao' => ['required_if:instituicaoSelect,Outra', 'max:255'],
'instituicaoSelect' => ['required_without:instituicao'],
'outroCursoEstudante' => ['required_if:cursoEstudante,Outro', 'max:255'],
'cursoEstudante' => ['required_without:outroCursoEstudante'],
'perfil' => ['required'],
'linkLattes' => ['required', 'url'],
]);
}
if ($request->alterarSenhaCheckBox != null) {
if (!(Hash::check($request->senha_atual, $user->password))) {
return redirect()->back()->withErrors(['senha_atual' => 'Senha atual não correspondente']);
......@@ -103,17 +137,17 @@ class UserController extends Controller
return redirect()->back()->withErrors(['nova_senha' => 'Senhas diferentes']);
}
}
if($user->avaliadors != null && $request->area != null && $user->tipo == "avaliador"){
$avaliador = Avaliador::where('user_id', '=', $id)->first();
$avaliador->user_id = $user->id;
//$avaliador->area_id = $request->area;
$avaliador->naturezas()->sync($request->natureza);
$avaliador->update();
$avaliador = Avaliador::where('user_id', '=', $id)->first();
$avaliador->user_id = $user->id;
//$avaliador->area_id = $request->area;
$avaliador->naturezas()->sync($request->natureza);
$avaliador->update();
}
switch ($request->tipo) {
switch ($user->tipo) {
case "administradorResponsavel":
$adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first();
$adminResp->user_id = $user->id;
......@@ -156,22 +190,30 @@ class UserController extends Controller
$proponente->update();
break;
case "participante":
$participante = Participante::where('user_id', '=', $id)->first();
//$participante = $user->participantes->where('user_id', Auth::user()->id)->first();
$participante->user_id = $user->id;
//dd($participante);
if ($user->usuarioTemp == true) {
$user->usuarioTemp = false;
$participante = $user->participantes()->first();
$participante->data_de_nascimento = $request->data_de_nascimento;
$participante->linkLattes = $request->linkLattes;
$participante->rg = $request->rg;
if ($request->outroCursoEstudante != null) {
$participante->curso = $request->outroCursoEstudante;
} else if (isset($request->cursoEstudante) && $request->cursoEstudante != "Outro") {
$participante->curso_id = $request->cursoEstudante;
}
$user->usuarioTemp = false;
$endereco = $user->endereco;
$endereco->cep = $request->cep;
$endereco->uf = $request->uf;
$endereco->cidade = $request->cidade;
$endereco->rua = $request->rua;
$endereco->numero = $request->numero;
$endereco->bairro = $request->bairro;
$endereco->complemento = $request->complemento;
$endereco->update();
$participante->update();
break;
}
$user->name = $request->name;
$user->tipo = $request->tipo;
// $user->email = $request->email;
$user->cpf = $request->cpf;
$user->celular = $request->celular;
if ($request->instituicao != null) {
......@@ -209,24 +251,46 @@ class UserController extends Controller
{
$id = Auth::user()->id;
$user = User::find($id);
$cursoPart = null;
if($user->participantes()->first() == null){
$participante = Participante::create();
$user->participantes()->save($participante);
}
if($user->endereco()->first() == null){
$endereco = Endereco::create();
$endereco->user()->save($user);
}
if ($user->participantes()->exists() && $user->participantes()->first()->curso_id)
$cursoPart = Curso::find($user->participantes()->first()->curso_id);
$adminResp = AdministradorResponsavel::where('user_id', '=', $id)->first();
$avaliador = Avaliador::where('user_id', '=', $id)->first();
$proponente = Proponente::where('user_id', '=', $id)->first();
$participante = Participante::where('user_id', '=', $id)->first();
$participante = $user->participantes()->first();
$naturezas = Natureza::orderBy('nome')->get();
$cursos = Curso::orderBy('nome')->get();
$areaTematica = AreaTematica::orderBy('nome')->get();
return view('user.perfilUser')->with(['user' => $user,
'adminResp' => $adminResp,
'avaliador' => $avaliador,
'proponente' => $proponente,
'participante' => $participante,
'cursos' => $cursos,
'naturezas' => $naturezas,
'areaTematica' => $areaTematica]);
$view = 'user.perfilUser';
if ($user->tipo == 'participante')
$view = 'user.perfilParticipante';
return view($view)
->with([
'user' => $user,
'adminResp' => $adminResp,
'avaliador' => $avaliador,
'proponente' => $proponente,
'participante' => $participante,
'cursos' => $cursos,
'naturezas' => $naturezas,
'cursoPart' => $cursoPart,
'areaTematica' => $areaTematica
]);
}
}
......@@ -6,6 +6,7 @@ use App\Evento;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
class StoreTrabalho extends FormRequest
{
......@@ -19,6 +20,17 @@ class StoreTrabalho extends FormRequest
return Auth::check();
}
protected function prepareForValidation()
{
$func = function($value) {
return ['cpf' => $value];
};
$this->merge([
'cpfs' => array_map($func, $this->cpf),
]);
}
/**
* Get the validation rules that apply to the request.
*
......@@ -26,10 +38,12 @@ class StoreTrabalho extends FormRequest
*/
public function rules()
{
// dd($this->all());
$evento = Evento::find($this->editalId);
$rules = [];
if($this->has('marcado')){
$rules['cpfs.*.cpf'] = ['distinct', 'nullable'];
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
//user
......@@ -38,42 +52,43 @@ class StoreTrabalho extends FormRequest
$rules['instituicao.'.$value] = ['required', 'string'];
$rules['cpf.'.$value] = ['required', 'string'];
$rules['celular.'.$value] = ['required', 'string'];
//endereco
$rules['rua.'.$value] = ['required', 'string'];
$rules['numero.'.$value] = ['required', 'string'];
$rules['bairro.'.$value] = ['required', 'string'];
$rules['cidade.'.$value] = ['required', 'string'];
$rules['uf.'.$value] = ['required', 'string'];
$rules['cep.'.$value] = ['required', 'string'];
//participante
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string'];
//participantes da pesquisa
if($evento->natureza_id != 3){
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['media_do_curso.' . $value] = ['required', 'string'];
if($this->estudante[$value] === true){
//endereco
$rules['rua.'.$value] = ['required', 'string'];
$rules['numero.'.$value] = ['required', 'string'];
$rules['bairro.'.$value] = ['required', 'string'];
$rules['cidade.'.$value] = ['required', 'string'];
$rules['uf.'.$value] = ['required', 'string'];
$rules['cep.'.$value] = ['required', 'string'];
//participante
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string'];
//participantes da pesquisa
if($evento->natureza_id != 3){
$rules['turno.'.$value] = ['required', 'string'];
$rules['ordem_prioridade.'.$value] = ['required', 'string'];
$rules['periodo_atual.'.$value] = ['required', 'string'];
$rules['total_periodos.'.$value] = ['required', 'string'];
$rules['media_do_curso.' . $value] = ['required', 'string'];
}
if($evento->tipo != "CONTINUO" && ($this->funcaoParticipante[$value] == "Voluntário" || $this->funcaoParticipante[$value] == "Bolsista")){
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
}
if($evento->tipo != "CONTINUO" && ($this->funcaoParticipante[$value] == "Voluntário" || $this->funcaoParticipante[$value] == "Bolsista")){
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
// if($evento->tipo != "PIBEX") {
// $rules['media_do_curso.' . $value] = ['required', 'string'];
// }
}
}
} else if($evento->tipo != "CONTINUO"){
} else if($evento->tipo != "CONTINUO" ){
$rules['anexoPlanoTrabalho'] = ['required'];
$rules['nomePlanoTrabalho'] = ['required', 'string'];
......@@ -90,6 +105,7 @@ class StoreTrabalho extends FormRequest
if($evento->tipo!="PIBEX" && $evento->tipo!="CONTINUO"){
//dd($this->preenchimentoFormFlag);
$rules['anexoPlanilhaPontuacao'] = ['required'];
$rules['anexoLattesCoordenador'] = ['required', 'mimes:pdf'];
$rules['anexoGrupoPesquisa'] = ['required', 'mimes:pdf'];
......@@ -97,6 +113,8 @@ class StoreTrabalho extends FormRequest
$rules['justificativaAutorizacaoEtica']= [Rule::requiredIf($this->autorizacaoFlag == 'nao')];
$rules['pontuacaoPlanilha'] = ['required', 'string'];
$rules['linkGrupoPesquisa'] = ['required', 'string'];
$rules['preenchimentoFormFlag'] = [Rule::in(['sim']), 'required'];
$rules['anexo_acao_afirmativa'] = [Rule::requiredIf($this->radioAcoesAfirmativas == 'sim')];
}
$rules['editalId'] = ['required', 'string'];
......@@ -120,7 +138,7 @@ class StoreTrabalho extends FormRequest
} else {
$rules['anexo_SIPAC'] = ['required', 'mimes:pdf'];
}
//dd($rules, $evento);
// dd($rules, $evento);
return $rules;
}
......@@ -137,6 +155,7 @@ class StoreTrabalho extends FormRequest
'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório',
'anexoProjeto.required' => 'O :attribute é obrigatório',
'cpf.*.required' => 'O cpf é obrigatório',
'cpfs.*.cpf.distinct' => 'O integrante com CPF :input não pode ser adicionado mais de uma vez',
'name.*.required' => 'O :attribute é obrigatório',
'email.*.required' => 'O :attribute é obrigatório',
'instituicao.*.required' => 'O :attribute é obrigatório',
......
......@@ -89,7 +89,7 @@ class User extends Authenticatable implements MustVerifyEmail
return $this->hasOne('App\AdministradorResponsavel');
}
public function participantes(){
return $this->hasMany('App\Participante');
return $this->hasMany('App\Participante')->orderBy('id', 'asc');
}
public function avaliadors(){
return $this->hasOne('App\Avaliador');
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddAnexoAcaoAfirmativaToTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->string('anexo_acao_afirmativa')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('trabalhos', function (Blueprint $table) {
$table->dropColumn('anexo_acao_afirmativa');
});
}
}
......@@ -30,9 +30,9 @@ class DatabaseSeeder extends Seeder
$this->call(EventoSeeder::class);
$this->call(TrabalhoSeeder::class);
$this->call(ArquivoSeeder::class);
$this->call(CampoAvaliacaoSeeder::class);
$this->call(AvaliadorTrabalhoSeeder::class);
$this->call(AvaliadorEventoSeeder::class);
$this->call(CampoAvaliacaoSeeder::class);
$this->call(AvaliacaoTrabalhosSeeder::class);
$this->call(AvaliacaoRelatorioSeeder::class);
......
......@@ -77,8 +77,8 @@ class UsuarioSeeder extends Seeder
]);
DB::table('users')->insert([
'name' => 'Participante2',
'email' => 'part2@ufrpe.br',
'name' => 'Participante1',
'email' => 'part1@ufrpe.br',
'password' => Hash::make('12345678'),
'tipo' => 'participante',
'email_verified_at' => '2020-01-01'
......
......@@ -274,13 +274,6 @@ section {
top: 35px;
}
.logo-ufape {
display: block;
position: relative;
height: 100px;
width: auto;
}
.format-text {
font-size: 20px;
font-weight: bolder;
......
......@@ -510,6 +510,12 @@
<a href="{{ route('baixar.anexo.consu', ['id' => $trabalho->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if($evento->tipo == 'PIBIC' && $evento->natureza_id == 2)
<div class="col-sm-4">
<label title="Decisão da Câmara ou Conselho Pertinente" for="anexo_acao_afirmativa" class="col-form-label font-tam" style="font-weight: bold">{{ __('Ação Afirmativa: ') }}</label>
<a href="{{ route('baixar.anexo.acao.afirmativa', ['id' => $trabalho->id]) }}"><img class="" src="{{asset('img/icons/pdf.ico')}}" style="width:40px" alt=""></a>
</div>
@endif
@if($evento->nome_docExtra != null)
{{-- Documento Extra --}}
<div class="col-sm-4">
......@@ -706,25 +712,27 @@
</select>
@else
@foreach($trabalho->participantes as $participante)
<div class="col-md-6">
<label style="font-weight: bold;font-size: 18px">Plano: {{$participante->planoTrabalho->titulo}}</label>
</div>
@php
$avaliacoesId = \App\AvaliacaoRelatorio::where("arquivo_id",$participante->planoTrabalho->id)->where("tipo",$tipoTemp)->pluck('user_id');
$avalProjeto = \Illuminate\Support\Facades\DB::table('users')->join('avaliadors','users.id','=','avaliadors.user_id')->whereNotIn('users.id', $avaliacoesId)->orderBy('users.name')->get();
@endphp
<select name="avaliadores_{{$participante->planoTrabalho->id}}_id[]" multiple
class="form-control" id="avaliacaoSelect"
style="height: 200px;font-size:15px">
@foreach ($avalProjeto as $avaliador)
<option value="{{ $avaliador->user_id }}"> {{ $avaliador->name }}
> {{$avaliador->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->tipo}}
> {{$avaliador->email}}</option>
@if($participante->planoTrabalho != null)
<div class="col-md-6">
<label style="font-weight: bold;font-size: 18px">Plano: {{$participante->planoTrabalho->titulo}}</label>
</div>
@php
$avaliacoesId = \App\AvaliacaoRelatorio::where("arquivo_id",$participante->planoTrabalho->id)->where("tipo",$tipoTemp)->pluck('user_id');
$avalProjeto = \Illuminate\Support\Facades\DB::table('users')->join('avaliadors','users.id','=','avaliadors.user_id')->whereNotIn('users.id', $avaliacoesId)->orderBy('users.name')->get();
@endphp
<select name="avaliadores_{{$participante->planoTrabalho->id}}_id[]" multiple
class="form-control" id="avaliacaoSelect"
style="height: 200px;font-size:15px">
@foreach ($avalProjeto as $avaliador)
<option value="{{ $avaliador->user_id }}"> {{ $avaliador->name }}
> {{$avaliador->instituicao ?? 'Instituição Indefinida'}}
> {{$avaliador->tipo}}
> {{$avaliador->email}}</option>
@endforeach
</select>
@endforeach
</select>
@endif
@endforeach
@endif
<small id="emailHelp" class="form-text text-muted">Segure SHIFT do
......@@ -1018,7 +1026,8 @@
</div>
</div>
@if($evento->natureza_id != 3)
<div class="col-md-6">
<label style="font-weight: bold;font-size: 18px">Internos</label>
</div>
......@@ -1046,7 +1055,7 @@
@endif
@endforeach
</select>
@endif
<div class="col-md-6">
<label style="font-weight: bold;font-size: 18px"><i>Ad Hoc</i></label>
......@@ -2266,21 +2275,23 @@
//console.log(seletor[0].children[0].text)=
function buscar(input) {
let seletor1 = document.getElementById('exampleFormControlSelect2').children;
let seletor2 = document.getElementById('exampleFormControlSelect3').children;
if(document.getElementById('exampleFormControlSelect2') != null){
let seletor1 = document.getElementById('exampleFormControlSelect2').children;
for(let i = 0; i < seletor1.length; i++){
let nomeAval1 = seletor1[i].textContent
for(let i = 0; i < seletor1.length; i++){
let nomeAval1 = seletor1[i].textContent
if(nomeAval1.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0){
seletor1[i].style.display = "";
}else {
seletor1[i].style.display = "none";
if(nomeAval1.toLowerCase().substr(0).indexOf(input.value.toLowerCase()) >= 0){
seletor1[i].style.display = "";
}else {
seletor1[i].style.display = "none";
}
}
}
let seletor2 = document.getElementById('exampleFormControlSelect3').children;
for(let j = 0; j < seletor2.length; j++){
let nomeAval1 = seletor2[j].textContent
......
......@@ -22,7 +22,11 @@
<div class="col-md-2">
<!-- Button trigger modal -->
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModalCenter">
Enviar Convite
@if($evento->natureza_id == 3)
Enviar Convite para Banca
@else
Enviar Convite
@endif
</button>
</div>
</div>
......@@ -247,7 +251,13 @@
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content modal-submeta">
<div class="modal-header modal-header-submeta">
<h5 class="modal-title titulo-table" id="exampleModalLongTitle" style="font-size: 20px;">Enviar Convite</h5>
<h5 class="modal-title titulo-table" id="exampleModalLongTitle" style="font-size: 20px;">
@if($evento->natureza_id == 3)
Enviar Convite para Banca
@else
Enviar Convite
@endif
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: rgb(182, 182, 182)">
<span aria-hidden="true">&times;</span>
</button>
......
......@@ -52,13 +52,13 @@
<div class="row">
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control cep" value="{{$participante->user->endereco->cep}}" name="cep" placeholder="CEP" disabled />
<input type="text" class="form-control cep" value="@if(isset($participante->user->endereco)){{$participante->user->endereco->cep}} @endif" name="cep" placeholder="CEP" disabled />
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf" id="estado" class="form-control" style="visibility: visible" disabled>
<option value="{{$participante->user->endereco->uf}}" selected>{{$participante->user->endereco->uf}}</option>
<option value="@if(isset($participante->user->endereco)) {{$participante->user->endereco->uf}} @endif" selected>@if(isset($participante->user->endereco)) {{$participante->user->endereco->uf}} @endif</option>
</select>
@endcomponent
</div>
......@@ -66,24 +66,24 @@
<div class="row">
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{$participante->user->endereco->cidade}}" name="cidade" placeholder="Cidade" maxlength="50" id="cidade{{$participante->id}}" disabled />
<input type="text" class="form-control" value=" @if(isset($participante->user->endereco)){{$participante->user->endereco->cidade}} @endif" name="cidade" placeholder="Cidade" maxlength="50" id="cidade{{$participante->id}}" disabled />
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{$participante->user->endereco->bairro}}" name="bairro" placeholder="Bairro" maxlength="50" id="bairro{{$participante->id}}" disabled />
<input type="text" class="form-control" value="@if(isset($participante->user->endereco)){{$participante->user->endereco->bairro}} @endif" name="bairro" placeholder="Bairro" maxlength="50" id="bairro{{$participante->id}}" disabled />
@endcomponent
</div>
</div>
<div class="row">
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{$participante->user->endereco->rua}}" name="rua" placeholder="Rua" maxlength="100" id="rua{{$participante->id}}" disabled />
<input type="text" class="form-control" value="@if(isset($participante->user->endereco)) {{ $participante->user->endereco->rua}} @endif" name="rua" placeholder="Rua" maxlength="100" id="rua{{$participante->id}}" disabled />
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{$participante->user->endereco->numero}}" name="numero" placeholder="Número" disabled />
<input type="text" class="form-control" value="@if(isset($participante->user->endereco)){{$participante->user->endereco->numero}} @endif" name="numero" placeholder="Número" disabled />
@endcomponent
</div>
</div>
......@@ -91,7 +91,7 @@
<div class="col-12">
<div class="form-group">
<label class=" control-label" for="firstname">Complemento</label>
<input type="text" class="form-control" value="{{$participante->user->endereco->complemento}}" name="complemento" placeholder="Complemento" maxlength="75" id="complemento{{$participante->id}}" disabled />
<input type="text" class="form-control" value="@if(isset($participante->user->endereco)){{ $participante->user->endereco->complemento}} @endif" name="complemento" placeholder="Complemento" maxlength="75" id="complemento{{$participante->id}}" disabled />
</div>
</div>
</div>
......
......@@ -2,693 +2,882 @@
@section('content')
<div class="container" style="margin-top: 3rem">
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="row justify-content-center">
<div class="col-md-8" style="margin-bottom:20px">
<div class="card shadow bg-white" style="border-radius:12px; border-width:0px;">
<div class="card-header" style="border-top-left-radius: 12px; border-top-right-radius: 12px; background-color: #fff">
<div class="d-flex justify-content-between align-items-center" style="margin-top: 9px; margin-bottom:6px">
<h5 class="card-title mb-0" style="font-size:25px; font-family:Arial, Helvetica, sans-serif; color:#1492E6">Cadastro</h5>
<h6 class="card-title mb-0" style="color:red">* Campos obrigatórios</h6>
<div class="container" style="margin-top: 3rem">
<form method="POST" action="{{ route('register') }}">
@csrf
<div class="row justify-content-center">
<div class="col-md-8" style="margin-bottom:20px">
<div class="card shadow bg-white" style="border-radius:12px; border-width:0px;">
<div class="card-header"
style="border-top-left-radius: 12px; border-top-right-radius: 12px; background-color: #fff">
<div class="d-flex justify-content-between align-items-center"
style="margin-top: 9px; margin-bottom:6px">
<h5 class="card-title mb-0"
style="font-size:25px; font-family:Arial, Helvetica, sans-serif; color:#1492E6">
Cadastro</h5>
<h6 class="card-title mb-0" style="color:red">* Campos obrigatórios</h6>
</div>
</div>
</div>
<div class="card-body">
<div class="form-row">
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center" style="margin-bottom:6px">
<h5 class="card-title mb-0" style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">Informações pessoais</h5>
<div class="card-body">
<div class="form-row">
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center"
style="margin-bottom:6px">
<h5 class="card-title mb-0"
style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">
Informações pessoais</h5>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="name" class="col-form-label" style="font-weight:600;">{{ __('Nome Completo') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" placeholder="Digite seu nome completo" value="{{ old('name') }}" required autocomplete="name" autofocus>
@error('name')
<span class="invalid-feedback" role="alert">
<div class="col-md-12">
<div class="form-group">
<label for="name" class="col-form-label"
style="font-weight:600;">{{ __('Nome Completo') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="name" type="text"
class="form-control @error('name') is-invalid @enderror" name="name"
placeholder="Digite seu nome completo" value="{{ old('name') }}" required
autocomplete="name" autofocus>
@error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="cpf" class="col-form-label" style="font-weight:600;">{{ __('CPF') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="cpf" type="text" class="form-control @error('cpf') is-invalid @enderror" name="cpf" placeholder="Digite o número do CPF" value="{{ old('cpf') }}" required autocomplete="cpf" autofocus>
@error('cpf')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="cpf" class="col-form-label" style="font-weight:600;">{{ __('CPF') }}
<span style="color: red; font-weight:bold;">*</span></label>
<input id="cpf" type="text"
class="form-control @error('cpf') is-invalid @enderror" name="cpf"
placeholder="Digite o número do CPF" value="{{ old('cpf') }}" required
autocomplete="cpf" autofocus>
@error('cpf')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="rg" class="col-form-label" style="font-weight:600;">{{ __('RG') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="rg" type="text" class="form-control @error('rg') is-invalid @enderror" name="rg" placeholder="Digite o número do RG" value="{{ old('rg') }}" required autocomplete="rg" autofocus>
@error('rg')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="rg" class="col-form-label" style="font-weight:600;">{{ __('RG') }}
<span style="color: red; font-weight:bold;">*</span></label>
<input id="rg" type="text"
class="form-control @error('rg') is-invalid @enderror" name="rg"
placeholder="Digite o número do RG" value="{{ old('rg') }}" required
autocomplete="rg" autofocus>
@error('rg')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="celular" class="col-form-label" style="font-weight:600;">{{ __('Celular') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="celular" type="text" class="form-control @error('celular') is-invalid @enderror" name="celular" placeholder="Digite o número do seu celular" value="{{ old('celular') }}" required autocomplete="celular" autofocus>
@error('celular')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="celular" class="col-form-label"
style="font-weight:600;">{{ __('Celular') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="celular" type="text"
class="form-control @error('celular') is-invalid @enderror"
name="celular" placeholder="Digite o número do seu celular"
value="{{ old('celular') }}" required autocomplete="celular" autofocus>
@error('celular')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center" style="margin-bottom:6px">
<h5 class="card-title mb-0" style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">Instituição</h5>
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center"
style="margin-bottom:6px">
<h5 class="card-title mb-0"
style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">
Instituição</h5>
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="instituicaoSelect" class="col-form-label" style="font-weight:600;">{{ __('Instituição de Vínculo') }}<span style="color: red; font-weight:bold;">*</span></label>
<select style="display: inline" onchange="showInstituicao()" class="form-control @error('instituicaoSelect') is-invalid @enderror" name="instituicaoSelect" id="instituicaoSelect">
<option value="" disabled selected hidden>-- Instituição --</option>
<option @if(old('instituicaoSelect')=='UFAPE' ) selected @endif value="UFAPE">Universidade Federal do Agreste de Pernambuco - UFAPE</option>
<option @if(old('instituicaoSelect')=='Outra' ) selected @endif value="Outra">Outra</option>
</select>
@error('instituicaoSelect')
<span class="invalid-feedback" role="alert">
<div class="col-md-12">
<div class="form-group">
<label for="instituicaoSelect" class="col-form-label"
style="font-weight:600;">{{ __('Instituição de Vínculo') }}<span
style="color: red; font-weight:bold;">*</span></label>
<select style="display: inline" onchange="showInstituicao()"
class="form-control @error('instituicaoSelect') is-invalid @enderror"
name="instituicaoSelect" id="instituicaoSelect">
<option value="" disabled selected hidden>-- Instituição --</option>
<option @if(old('instituicaoSelect')=='UFAPE' ) selected
@endif value="UFAPE">Universidade Federal do Agreste de Pernambuco -
UFAPE
</option>
<option @if(old('instituicaoSelect')=='Outra' ) selected
@endif value="Outra">Outra
</option>
</select>
@error('instituicaoSelect')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-12" id="displayOutro" style='display:none'>
<div class="form-group">
<label for="instituicao" class="col-form-label" style="font-weight:600;">{{ __('Digite a Instituição') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="instituicao" type="text" class="form-control @error('instituicao') is-invalid @enderror" name="instituicao" value="{{ old('instituicao') }}" placeholder="Digite o nome da Instituição" autofocus>
@error('instituicao')
<span class="invalid-feedback" role="alert">
<div class="col-md-12" id="displayOutro" style='display:none'>
<div class="form-group">
<label for="instituicao" class="col-form-label"
style="font-weight:600;">{{ __('Digite a Instituição') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="instituicao" type="text"
class="form-control @error('instituicao') is-invalid @enderror"
name="instituicao" value="{{ old('instituicao') }}"
placeholder="Digite o nome da Instituição" autofocus>
@error('instituicao')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="perfil" class="col-form-label" style="font-weight:600;">{{ __('Perfil') }}<span style="color: red; font-weight:bold;">*</span></label>
<select id="perfil" name="perfil" class="form-control @error('perfil') is-invalid @enderror" onchange="mudarPerfil()">
<option value="" disabled selected hidden>-- Perfil --</option>
<option @if(old('perfil')=='Professor' ) selected @endif value="Professor">Professor</option>
<option @if(old('perfil')=='Técnico' ) selected @endif value="Técnico">Técnico</option>
<option @if(old('perfil')=='Estudante' ) selected @endif value="Estudante">Estudante</option>
<option @if(old('perfil')=='Outro' ) selected @endif value="Outro">Outro</option>
</select>
@error('perfil')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="perfil" class="col-form-label"
style="font-weight:600;">{{ __('Perfil') }}<span
style="color: red; font-weight:bold;">*</span></label>
<select id="perfil" name="perfil"
class="form-control @error('perfil') is-invalid @enderror"
onchange="mudarPerfil()">
<option value="" disabled selected hidden>-- Perfil --</option>
<option @if(old('perfil')=='Professor' ) selected @endif value="Professor">
Professor
</option>
<option @if(old('perfil')=='Técnico' ) selected @endif value="Técnico">
Técnico
</option>
<option @if(old('perfil')=='Estudante' ) selected @endif value="Estudante">
Estudante
</option>
<option @if(old('perfil')=='Outro' ) selected @endif value="Outro">Outro
</option>
</select>
@error('perfil')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="outroPerfil">
<label for="outroPerfil" class="col-form-label" style="font-weight:600;">{{ __('Qual perfil?') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="outroPerfil" type="text" class="form-control @error('outroPerfil') is-invalid @enderror" name="outroPerfil" placeholder="Digite aqui qual o seu perfil" value="{{ old('outroPerfil') }}">
@error('outroPerfil')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="outroPerfil">
<label for="outroPerfil" class="col-form-label"
style="font-weight:600;">{{ __('Qual perfil?') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="outroPerfil" type="text"
class="form-control @error('outroPerfil') is-invalid @enderror"
name="outroPerfil" placeholder="Digite aqui qual o seu perfil"
value="{{ old('outroPerfil') }}">
@error('outroPerfil')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div style="display:none" id="divCursos" class="col-md-12 mb-2">
<label for="curso" class="col-form-label" style="font-weight:600;">{{ __('Cursos que Leciona') }}<span style="color: red; font-weight:bold;">*</span></label>
<br>
<div class="row col-md-12">
@foreach($cursos as $curso)
<div class="col-sm-6">
<input type="checkbox" name="curso[]" id="curso{{$curso->id}}" value="{{$curso->id}}">
<label class="form-check-label" for="curso{{$curso->id}}">
{{ $curso->nome }}
</label>
</div>
@endforeach
<div style="display:none" id="divCursos" class="col-md-12 mb-2">
<label for="curso" class="col-form-label"
style="font-weight:600;">{{ __('Cursos que Leciona') }}<span
style="color: red; font-weight:bold;">*</span></label>
<br>
<div class="row col-md-12">
@foreach($cursos as $curso)
@if($curso->nome == "Outro Curso")
<div id="divOutroCurso" class="col-sm-6" style="display: none">
<input type="checkbox" name="curso[]"
id="curso{{$curso->id}}"
value="{{$curso->id}}">
<label class="form-check-label" for="curso{{$curso->id}}">
{{ $curso->nome }}
</label>
</div>
@else
<div class="col-sm-6">
<input type="checkbox" name="curso[]"
id="curso{{$curso->id}}"
value="{{$curso->id}}">
<label class="form-check-label" for="curso{{$curso->id}}">
{{ $curso->nome }}
</label>
</div>
@endif
@endforeach
</div>
</div>
</div>
<!-- Proponente -->
<div class="col-md-6">
<div class="form-group" id="divVinculo">
<label for="vinculo" class="col-form-label" style="font-weight:600;">{{ __('Vínculo') }}<span style="color: red; font-weight:bold;">*</span></label>
<select name="vinculo" id="vinculo" class="form-control @error('vinculo') is-invalid @enderror" onchange="mudarPerfil()">
<option value="" disabled selected hidden>-- Vínculo --</option>
<option @if(old('vinculo')=='Servidor na ativa' ) selected @endif value="Servidor na ativa">Servidor na ativa</option>
<option @if(old('vinculo')=='Servidor aposentado' ) selected @endif value="Servidor aposentado">Servidor aposentado</option>
<option @if(old('vinculo')=='Professor visitante' ) selected @endif value="Professor visitante">Professor visitante</option>
<option @if(old('vinculo')=='Pós-doutorando' ) selected @endif value="Pós-doutorando">Pós-doutorando</option>
<option @if(old('vinculo')=='Outro' ) selected @endif value="Outro">Outro</option>
</select>
@error('vinculo')
<span class="invalid-feedback" role="alert">
<!-- Proponente -->
<div class="col-md-6">
<div class="form-group" id="divVinculo">
<label for="vinculo" class="col-form-label"
style="font-weight:600;">{{ __('Vínculo') }}<span
style="color: red; font-weight:bold;">*</span></label>
<select name="vinculo" id="vinculo"
class="form-control @error('vinculo') is-invalid @enderror"
onchange="mudarPerfil()">
<option value="" disabled selected hidden>-- Vínculo --</option>
<option @if(old('vinculo')=='Servidor na ativa' ) selected
@endif value="Servidor na ativa">Servidor na ativa
</option>
<option @if(old('vinculo')=='Servidor aposentado' ) selected
@endif value="Servidor aposentado">Servidor aposentado
</option>
<option @if(old('vinculo')=='Professor visitante' ) selected
@endif value="Professor visitante">Professor visitante
</option>
<option @if(old('vinculo')=='Pós-doutorando' ) selected
@endif value="Pós-doutorando">Pós-doutorando
</option>
<option @if(old('vinculo')=='Outro' ) selected @endif value="Outro">Outro
</option>
</select>
@error('vinculo')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divOutro">
<label for="outro" class="col-form-label" style="font-weight:600;">{{ __('Qual?') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="outro" type="text" class="form-control @error('outro') is-invalid @enderror" name="outro" placeholder="Digite aqui o seu vínculo" value="{{ old('outro') }}">
@error('outro')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="divOutro">
<label for="outro" class="col-form-label"
style="font-weight:600;">{{ __('Qual?') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="outro" type="text"
class="form-control @error('outro') is-invalid @enderror" name="outro"
placeholder="Digite aqui o seu vínculo" value="{{ old('outro') }}">
@error('outro')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divTitulacaoMax" style="display: none">
<label for="titulacaoMaxima" class="col-form-label" style="font-weight:600;">{{ __('Titulação Máxima') }}<span style="color: red; font-weight:bold;">*</span></label>
<select id="titulacaoMaxima" class="form-control @error('titulacaoMaxima') is-invalid @enderror" name="titulacaoMaxima" value="{{ old('titulacaoMaxima') }}" autocomplete="nome">
<option value="" disabled selected hidden>-- Titulação --</option>
<option @if(old('titulacaoMaxima')=='Doutorado' ) selected @endif value="Doutorado">Doutorado</option>
<option @if(old('titulacaoMaxima')=='Mestrado' ) selected @endif value="Mestrado">Mestrado</option>
<option @if(old('titulacaoMaxima')=='Especialização' ) selected @endif value="Especialização">Especialização</option>
<option @if(old('titulacaoMaxima')=='Graduação' ) selected @endif value="Graduação">Graduação</option>
<option @if(old('titulacaoMaxima')=='Técnico' ) selected @endif value="Técnico">Técnico</option>
</select>
@error('titulacaoMaxima')
<span class="invalid-feedback" role="alert">
@enderror
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divTitulacaoMax" style="display: none">
<label for="titulacaoMaxima" class="col-form-label"
style="font-weight:600;">{{ __('Titulação Máxima') }}<span
style="color: red; font-weight:bold;">*</span></label>
<select id="titulacaoMaxima"
class="form-control @error('titulacaoMaxima') is-invalid @enderror"
name="titulacaoMaxima" value="{{ old('titulacaoMaxima') }}"
autocomplete="nome">
<option value="" disabled selected hidden>-- Titulação --</option>
<option @if(old('titulacaoMaxima')=='Doutorado' ) selected
@endif value="Doutorado">Doutorado
</option>
<option @if(old('titulacaoMaxima')=='Mestrado' ) selected
@endif value="Mestrado">Mestrado
</option>
<option @if(old('titulacaoMaxima')=='Especialização' ) selected
@endif value="Especialização">Especialização
</option>
<option @if(old('titulacaoMaxima')=='Graduação' ) selected
@endif value="Graduação">Graduação
</option>
<option @if(old('titulacaoMaxima')=='Técnico' ) selected
@endif value="Técnico">Técnico
</option>
</select>
@error('titulacaoMaxima')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="anoTitulacao" style="display: none">
<label for="AnoTitulacao" class="col-form-label" style="font-weight:600;">{{ __('Ano da Titulação Máxima') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="AnoTitulacao" type="text" class="form-control @error('anoTitulacao') is-invalid @enderror" name="anoTitulacao" placeholder="Digite o ano de titulação" value="{{ old('anoTitulacao') }}" autocomplete="nome">
@error('anoTitulacao')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="anoTitulacao" style="display: none">
<label for="AnoTitulacao" class="col-form-label"
style="font-weight:600;">{{ __('Ano da Titulação Máxima') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="AnoTitulacao" type="text"
class="form-control @error('anoTitulacao') is-invalid @enderror"
name="anoTitulacao" placeholder="Digite o ano de titulação"
value="{{ old('anoTitulacao') }}" autocomplete="nome">
@error('anoTitulacao')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6" >
<div class="form-group" id="areaFormacao" style="display: none">
<label for="areaFormacao" class="col-form-label" style="font-weight:600;">{{ __('Área de Formação') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="areaFormacao" type="text" class="form-control @error('areaFormacao') is-invalid @enderror" name="areaFormacao" placeholder="Digite a sua área de formação" value="{{ old('areaFormacao') }}" autocomplete="nome">
@error('areaFormacao')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="areaFormacao" style="display: none">
<label for="areaFormacao" class="col-form-label"
style="font-weight:600;">{{ __('Área de Formação') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="areaFormacao" type="text"
class="form-control @error('areaFormacao') is-invalid @enderror"
name="areaFormacao" placeholder="Digite a sua área de formação"
value="{{ old('areaFormacao') }}" autocomplete="nome">
@error('areaFormacao')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="siape" style="display: none">
<label for="SIAPE" class="col-form-label" style="font-weight:600;">{{ __('SIAPE') }}</label>
<input id="SIAPE" type="text" class="form-control @error('SIAPE') is-invalid @enderror" name="SIAPE" placeholder="Digite o SIAPE" value="{{ old('SIAPE') }}" autocomplete="nome">
@error('SIAPE')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="siape" style="display: none">
<label for="SIAPE" class="col-form-label"
style="font-weight:600;">{{ __('SIAPE') }}</label>
<input id="SIAPE" type="text"
class="form-control @error('SIAPE') is-invalid @enderror" name="SIAPE"
placeholder="Digite o SIAPE" value="{{ old('SIAPE') }}"
autocomplete="nome">
@error('SIAPE')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="bolsista" style="display: none">
<label for="bolsistaProdutividade" class="col-form-label" style="font-weight:600;">{{ __('Bolsista de Produtividade') }}<span style="color: red; font-weight:bold;">*</span></label><br>
<select name="bolsistaProdutividade" id="bolsistaProdutividade" class="form-control @error('bolsistaProdutividade') is-invalid @enderror" onchange="mudarNivel()">
<option value="" disabled selected hidden>-- Bolsista --</option>
<option @if(old('bolsistaProdutividade')=='nao' ) selected @endif value="nao">Não</option>
<option @if(old('bolsistaProdutividade')=='sim' ) selected @endif value="sim">Sim</option>
</select>
@error('bolsistaProdutividade')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="bolsista" style="display: none">
<label for="bolsistaProdutividade" class="col-form-label"
style="font-weight:600;">{{ __('Bolsista de Produtividade') }}<span
style="color: red; font-weight:bold;">*</span></label><br>
<select name="bolsistaProdutividade" id="bolsistaProdutividade"
class="form-control @error('bolsistaProdutividade') is-invalid @enderror"
onchange="mudarNivel()">
<option value="" disabled selected hidden>-- Bolsista --</option>
<option @if(old('bolsistaProdutividade')=='nao' ) selected
@endif value="nao">Não
</option>
<option @if(old('bolsistaProdutividade')=='sim' ) selected
@endif value="sim">Sim
</option>
</select>
@error('bolsistaProdutividade')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="nivelInput" style="display: block;">
<label for="nivel" class="col-form-label" style="font-weight:600;">{{ __('Nível') }}<span style="color: red; font-weight:bold;">*</span></label>
<select name="nivel" id="nivel" class="form-control @error('nivel') is-invalid @enderror">
<option value="" disabled selected hidden></option>
<option value="1A">1A</option>
<option value="1B">1B</option>
<option value="1C">1C</option>
<option value="1D">1D</option>
<option value="2">2</option>
</select>
@error('nivel')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group" id="nivelInput" style="display: block;">
<label for="nivel" class="col-form-label"
style="font-weight:600;">{{ __('Nível') }}<span
style="color: red; font-weight:bold;">*</span></label>
<select name="nivel" id="nivel"
class="form-control @error('nivel') is-invalid @enderror">
<option value="" disabled selected hidden></option>
<option value="1A">1A</option>
<option value="1B">1B</option>
<option value="1C">1C</option>
<option value="1D">1D</option>
<option value="2">2</option>
</select>
@error('nivel')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<!-- Estudante -->
<div class="col-md-6">
<div class="form-group" id="dataNascimento">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{old('data_de_nascimento')}}" name="data_de_nascimento" placeholder="Data de nascimento" />
@error('data_de_nascimento')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<!-- Estudante -->
<div class="col-md-6">
<div class="form-group" id="dataNascimento">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control"
value="{{old('data_de_nascimento')}}" name="data_de_nascimento"
placeholder="Data de nascimento"/>
@error('data_de_nascimento')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="curso">
@component('componentes.input', ['label' => 'Curso'])
<select style="display: inline" class="form-control" id='cursoEstudante' name="cursoEstudante" onchange="outroCurso(this)">
<option value="" disabled selected hidden>-- Selecione uma opção--</option>
@foreach ($cursos as $curso)
<option @if(old('cursoEstudante')==$curso->id) selected @endif value='{{$curso->id}}'>{{$curso->nome}}</option>
@endforeach
<option @if(old('cursoEstudante') == "Outro" ) selected @endif value="Outro">Outro</option>
</select>
@error('curso')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="curso">
@component('componentes.input', ['label' => 'Curso'])
<select style="display: inline" class="form-control" id='cursoEstudante'
name="cursoEstudante" onchange="outroCurso(this)">
<option value="" disabled selected hidden>-- Selecione uma opção--
</option>
@foreach ($cursos as $curso)
@if($curso->nome != 'Outro Curso')
<option @if(old('cursoEstudante')==$curso->id) selected
@endif value='{{$curso->id}}'>{{$curso->nome}}</option>
@endif
@endforeach
<option @if(old('cursoEstudante') == "Outro" ) selected
@endif value="Outro">Outro
</option>
</select>
@error('curso')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-12">
<div class="form-group" id="divCursoEstudante" style="display:none">
@component('componentes.input', ['label' => 'Qual curso?'])
<input name="outroCursoEstudante" type="text" id="outroCursoEstudante" value="{{ old('outroCursoEstudante')}}" class="form-control"/>
@error('outroCursoEstudante')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
@enderror
@endcomponent
</div>
</div>
</div>
<div class="col-md-12" id='endereco'>
<div class="d-flex justify-content-between align-items-center" style="margin-bottom:6px">
<h5 class="card-title mb-0" style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">Endereço</h5>
<div class="col-md-12">
<div class="form-group" id="divCursoEstudante" style="display:none">
@component('componentes.input', ['label' => 'Qual curso?'])
<input name="outroCursoEstudante" type="text" id="outroCursoEstudante"
value="{{ old('outroCursoEstudante')}}" class="form-control"/>
@error('outroCursoEstudante')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divCep">
@component('componentes.input', ['label' => 'CEP'])
<input name="cep" type="text" id="cep" value="{{ old('cep')}}" class="form-control cep" onblur="pesquisaCep(this.value)" />
@error('cep')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
<div class="col-md-12" id='endereco'>
<div class="d-flex justify-content-between align-items-center"
style="margin-bottom:6px">
<h5 class="card-title mb-0"
style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">
Endereço</h5>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divUf">
@component('componentes.input', ['label' => 'Estado'])
<input name="uf" type="text" class="form-control" value="{{ old('uf')}}" id="uf" />
@error('uf')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
<div class="col-md-6">
<div class="form-group" id="divCep">
@component('componentes.input', ['label' => 'CEP'])
<input name="cep" type="text" id="cep" value="{{ old('cep')}}"
class="form-control cep" onblur="pesquisaCep(this.value)"/>
@error('cep')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divCidade">
@component('componentes.input', ['label' => 'Cidade'])
<input name="cidade" type="text" id="cidade" class="form-control" value="{{ old('cidade')}}" />
@error('cidade')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divBairro">
@component('componentes.input', ['label' => 'Bairro'])
<input name="bairro" type="text" id="bairro" class="form-control" value="{{ old('bairro')}}" />
@error('bairro')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id='divRua'>
@component('componentes.input', ['label' => 'Rua'])
<input name="rua" type="text" id="rua" class="form-control" value="{{ old('rua')}}" />
@error('rua')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id='numero'>
@component('componentes.input', ['label' => 'Número'])
<input name="numero" type="text" class="form-control" value="{{ old('numero')}}" />
@error('numero')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
<div class="col-md-6">
<div class="form-group" id="divUf">
@component('componentes.input', ['label' => 'Estado'])
<input name="uf" type="text" class="form-control" value="{{ old('uf')}}"
id="uf"/>
@error('uf')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
</div>
<div class='col-md-12'>
<div class="form-group" id='complemento'>
<label class=" control-label" for="firstname" style="font-weight:600;">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')}}" name="complemento" placeholder="Complemento" maxlength="75" id="complemento" />
<span style="color: red; font-size: 12px" id="caracsRestantescomplemento">
<div class="col-md-6">
<div class="form-group" id="divCidade">
@component('componentes.input', ['label' => 'Cidade'])
<input name="cidade" type="text" id="cidade" class="form-control"
value="{{ old('cidade')}}"/>
@error('cidade')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="divBairro">
@component('componentes.input', ['label' => 'Bairro'])
<input name="bairro" type="text" id="bairro" class="form-control"
value="{{ old('bairro')}}"/>
@error('bairro')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id='divRua'>
@component('componentes.input', ['label' => 'Rua'])
<input name="rua" type="text" id="rua" class="form-control"
value="{{ old('rua')}}"/>
@error('rua')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-6">
<div class="form-group" id='numero'>
@component('componentes.input', ['label' => 'Número'])
<input name="numero" type="text" class="form-control"
value="{{ old('numero')}}"/>
@error('numero')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block"><strong>{{ $message }}</strong></span>
@enderror
@endcomponent
</div>
</div>
<div class='col-md-12'>
<div class="form-group" id='complemento'>
<label class=" control-label" for="firstname" style="font-weight:600;">Complemento</label>
<input type="text" class="form-control" value="{{old('complemento')}}"
name="complemento" placeholder="Complemento" maxlength="75"
id="complemento"/>
<span style="color: red; font-size: 12px" id="caracsRestantescomplemento">
</span>
@error('complemento')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
@error('complemento')
<span class="invalid-feedback" role="alert"
style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label for="linkLattes" class="col-form-label" style="font-weight:600;">{{ __('Link do Currículo Lattes') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="linkLattes" type="text" class="form-control @error('linkLattes') is-invalid @enderror" name="linkLattes" placeholder="Digite o link do currículo Lattes" value="{{ old('linkLattes') }}" autocomplete="nome">
@error('linkLattes')
<span class="invalid-feedback" role="alert">
<div class="col-md-12">
<div class="form-group">
<label for="linkLattes" class="col-form-label"
style="font-weight:600;">{{ __('Link do Currículo Lattes') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="linkLattes" type="text"
class="form-control @error('linkLattes') is-invalid @enderror"
name="linkLattes" placeholder="Digite o link do currículo Lattes"
value="{{ old('linkLattes') }}" autocomplete="nome">
@error('linkLattes')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center" style="margin-bottom:6px">
<h5 class="card-title mb-0" style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">Acesso ao sistema</h5>
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center"
style="margin-bottom:6px">
<h5 class="card-title mb-0"
style="font-size:20px; font-family:Arial, Helvetica, sans-serif; font-family:Arial, Helvetica, sans-serif; ">
Acesso ao sistema</h5>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="email" class="col-form-label" style="font-weight:600;">{{ __('E-Mail') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" placeholder="Digite o seu e-mail" value="{{ old('email') }}" required autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="email" class="col-form-label"
style="font-weight:600;">{{ __('E-Mail') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="email" type="email"
class="form-control @error('email') is-invalid @enderror" name="email"
placeholder="Digite o seu e-mail" value="{{ old('email') }}" required
autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
@enderror
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="password" class="col-form-label" style="font-weight:600;">{{ __('Senha') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" placeholder="Digite sua senha" required autocomplete="new-password">
@error('password')
<span class="invalid-feedback" role="alert">
<div class="col-md-6">
<div class="form-group">
<label for="password" class="col-form-label"
style="font-weight:600;">{{ __('Senha') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="password" type="password"
class="form-control @error('password') is-invalid @enderror"
name="password" placeholder="Digite sua senha" required
autocomplete="new-password">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
<small>Deve ter no mínimo 8 caracteres</small>
@enderror
<small>Deve ter no mínimo 8 caracteres</small>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="password-confirm" class="col-form-label" style="font-weight:600;">{{ __('Confirme a Senha') }}<span style="color: red; font-weight:bold;">*</span></label>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" placeholder="Confirme sua senha" required autocomplete="new-password">
<div class="col-md-6">
<div class="form-group">
<label for="password-confirm" class="col-form-label"
style="font-weight:600;">{{ __('Confirme a Senha') }}<span
style="color: red; font-weight:bold;">*</span></label>
<input id="password-confirm" type="password" class="form-control"
name="password_confirmation" placeholder="Confirme sua senha" required
autocomplete="new-password">
</div>
</div>
</div>
<div class="col-md-12">
<div class="form-group" id="nivelInput" style="display: block; text-align:right">
<hr>
<button type="submit" class="btn btn-success botao-form" style="">
{{ __('Finalizar Cadastro') }}
</button>
<div class="col-md-12">
<div class="form-group" id="nivelInput" style="display: block; text-align:right">
<hr>
<button type="submit" class="btn btn-success botao-form" style="">
{{ __('Finalizar Cadastro') }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
$(document).ready(function($) {
$('#cpf').mask('000.000.000-00');
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);
<script type="text/javascript">
$(document).ready(function ($) {
$('#cpf').mask('000.000.000-00');
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);
$('#SIAPE').mask('00000000');
$('#AnoTitulacao').mask('0000');
$('#cep').mask('00000-000');
});
function mudarPerfil() {
var divDataNascimento = document.getElementById('dataNascimento');
var divCurso = document.getElementById('curso');
var divEndereco = document.getElementById('endereco');
var divCep = document.getElementById('divCep');
var divUf = document.getElementById('divUf');
var divCidade = document.getElementById('divCidade');
var divBairro = document.getElementById('divBairro');
var divRua = document.getElementById('divRua');
var divNumero = document.getElementById('numero');
var divComplemento = document.getElementById('complemento');
var divCursos = document.getElementById('divCursos');
var divVinculo = document.getElementById('divVinculo');
var divTitulacaoMax = document.getElementById('divTitulacaoMax');
var divAnoTitulacao = document.getElementById('anoTitulacao');
var divAreaFormacao = document.getElementById('areaFormacao');
var divSIAPE = document.getElementById('siape');
var divBolsista = document.getElementById('bolsista');
var divNivel = document.getElementById('nivelInput');
var divOutroVinculo = document.getElementById('divOutro');
var comboBoxPerfil = document.getElementById('perfil');
if (comboBoxPerfil.value === "Professor" || comboBoxPerfil.value === "Técnico" || comboBoxPerfil.value === "Outro") {
divVinculo.style.display = "block";
divTitulacaoMax.style.display = "block";
divAnoTitulacao.style.display = "block";
divAreaFormacao.style.display = "block";
divSIAPE.style.display = "block";
divBolsista.style.display = "block";
if (comboBoxPerfil.value === "Professor") {
divCursos.style.display = "block";
} else {
divCursos.style.display = "none";
}
};
$('#celular').mask(SPMaskBehavior, spOptions);
$('#SIAPE').mask('00000000');
$('#AnoTitulacao').mask('0000');
$('#cep').mask('00000-000');
});
function mudarPerfil() {
var divDataNascimento = document.getElementById('dataNascimento');
var divCurso = document.getElementById('curso');
var divEndereco = document.getElementById('endereco');
var divCep = document.getElementById('divCep');
var divUf = document.getElementById('divUf');
var divCidade = document.getElementById('divCidade');
var divBairro = document.getElementById('divBairro');
var divRua = document.getElementById('divRua');
var divNumero = document.getElementById('numero');
var divComplemento = document.getElementById('complemento');
var divCursos = document.getElementById('divCursos');
var divVinculo = document.getElementById('divVinculo');
var divTitulacaoMax = document.getElementById('divTitulacaoMax');
var divAnoTitulacao = document.getElementById('anoTitulacao');
var divAreaFormacao = document.getElementById('areaFormacao');
var divSIAPE = document.getElementById('siape');
var divBolsista = document.getElementById('bolsista');
var divNivel = document.getElementById('nivelInput');
var divOutroVinculo = document.getElementById('divOutro');
var comboBoxPerfil = document.getElementById('perfil');
if(comboBoxPerfil.value === "Professor" || comboBoxPerfil.value === "Técnico" || comboBoxPerfil.value === "Outro"){
divVinculo.style.display = "block";
divTitulacaoMax.style.display = "block";
divAnoTitulacao.style.display = "block";
divAreaFormacao.style.display = "block";
divSIAPE.style.display = "block";
divBolsista.style.display = "block";
if (comboBoxPerfil.value === "Professor"){
divCursos.style.display = "block";
} else {
divVinculo.style.display = "none";
divTitulacaoMax.style.display = "none";
divAnoTitulacao.style.display = "none";
divAreaFormacao.style.display = "none";
divSIAPE.style.display = "none";
divBolsista.style.display = "none";
divCursos.style.display = "none";
}
if (comboBoxPerfil.value === "Estudante") {
divDataNascimento.style.display = "block";
divCurso.style.display = "block";
divEndereco.style.display = "block";
divCep.style.display = "block";
divUf.style.display = "block";
divCidade.style.display = "block";
divBairro.style.display = "block";
divRua.style.display = "block";
divNumero.style.display = "block";
divComplemento.style.display = "block";
divNivel.style.display = "none";
divOutroVinculo.style.display = "none";
} else {
divVinculo.style.display = "none";
divTitulacaoMax.style.display = "none";
divAnoTitulacao.style.display = "none";
divAreaFormacao.style.display = "none";
divSIAPE.style.display = "none";
divBolsista.style.display = "none";
divCursos.style.display = "none";
}
if(comboBoxPerfil.value === "Estudante"){
divDataNascimento.style.display = "block";
divCurso.style.display = "block";
divEndereco.style.display = "block";
divCep.style.display = "block";
divUf.style.display = "block";
divCidade.style.display = "block";
divBairro.style.display = "block";
divRua.style.display = "block";
divNumero.style.display = "block";
divComplemento.style.display = "block";
divNivel.style.display = "none";
divOutroVinculo.style.display = "none";
} else {
divDataNascimento.style.display = "none";
divCurso.style.display = "none";
divEndereco.style.display = "none";
divCep.style.display = "none";
divUf.style.display = "none";
divCidade.style.display = "none";
divBairro.style.display = "none";
divRua.style.display = "none";
divNumero.style.display = "none";
divComplemento.style.display = "none";
} else {
divDataNascimento.style.display = "none";
divCurso.style.display = "none";
divEndereco.style.display = "none";
divCep.style.display = "none";
divUf.style.display = "none";
divCidade.style.display = "none";
divBairro.style.display = "none";
divRua.style.display = "none";
divNumero.style.display = "none";
divComplemento.style.display = "none";
}
outroPerfil();
outroVinculo();
}
outroPerfil();
outroVinculo();
}
function outroCurso() {
var comboBoxCurso = document.getElementById('cursoEstudante');
var divCurso = document.getElementById('divCursoEstudante');
if (comboBoxCurso.value === "Outro") {
divCurso.style.display = "block";
} else {
divCurso.style.display = "none";
}
}
function outroCurso(){
var comboBoxCurso = document.getElementById('cursoEstudante');
var divCurso = document.getElementById('divCursoEstudante');
function outroPerfil() {
var comboBoxPerfil = document.getElementById('perfil');
var divOutro = document.getElementById('outroPerfil');
if (comboBoxCurso.value === "Outro") {
divCurso.style.display = "block";
} else {
divCurso.style.display = "none";
if (comboBoxPerfil.value === "Outro") {
divOutro.style.display = "block";
} else {
divOutro.style.display = "none";
}
}
}
function outroPerfil() {
var comboBoxPerfil = document.getElementById('perfil');
var divOutro = document.getElementById('outroPerfil');
function outroVinculo() {
var comboBoxVinculo = document.getElementById('vinculo');
var divOutro = document.getElementById('divOutro');
if (comboBoxPerfil.value === "Outro") {
divOutro.style.display = "block";
} else {
divOutro.style.display = "none";
if (comboBoxVinculo.value === "Outro" && document.getElementById('perfil').value !== "Estudante") {
divOutro.style.display = "block";
} else {
divOutro.style.display = "none";
}
}
}
function outroVinculo() {
var comboBoxVinculo = document.getElementById('vinculo');
var divOutro = document.getElementById('divOutro');
function mudarNivel() {
var bolsista = document.getElementById('bolsistaProdutividade');
var nivel = document.getElementById('nivelInput');
if (comboBoxVinculo.value === "Outro" && document.getElementById('perfil').value !== "Estudante") {
divOutro.style.display = "block";
} else {
divOutro.style.display = "none";
if (bolsista.value === "sim") {
nivel.style.display = "block";
} else {
nivel.style.display = "none";
}
}
}
function mudarNivel() {
var bolsista = document.getElementById('bolsistaProdutividade');
var nivel = document.getElementById('nivelInput');
function showInstituicao() {
var instituicao = document.getElementById('instituicao');
var instituicaoSelect = document.getElementById('instituicaoSelect');
var divOutroCurso = document.getElementById('divOutroCurso');
if (instituicaoSelect.value === "Outra") {
document.getElementById("displayOutro").style.display = "block";
divOutroCurso.style.display = "block";
instituicao.parentElement.style.display = '';
document.getElementById('instituicao').value = "";
} else if (instituicaoSelect.value === "UFAPE") {
document.getElementById("displayOutro").style.display = "none";
}
if(instituicaoSelect.value != "Outra")
{
divOutroCurso.style.display = "none";
}
}
if (bolsista.value === "sim") {
nivel.style.display = "block";
} else {
nivel.style.display = "none";
function onload() {
mudarNivel();
outroVinculo();
mudarPerfil();
showInstituicao();
outroCurso();
}
}
function showInstituicao() {
var instituicao = document.getElementById('instituicao');
var instituicaoSelect = document.getElementById('instituicaoSelect');
if (instituicaoSelect.value === "Outra") {
document.getElementById("displayOutro").style.display = "block";
instituicao.parentElement.style.display = '';
document.getElementById('instituicao').value = "";
} else if (instituicaoSelect.value === "UFAPE") {
document.getElementById("displayOutro").style.display = "none";
window.onload = onload();
</script>
<script>
//----------------------------- Scripts para auto-complete de endereço --------------------------------//
function limpa_formulário_cep() {
//Limpa valores do formulário de cep.
document.getElementById(`rua`).value = ("");
document.getElementById(`bairro`).value = ("");
document.getElementById(`cidade`).value = ("");
document.getElementById(`uf`).value = ("");
//document.getElementById('ibge').value=("");
}
}
function onload() {
mudarNivel();
outroVinculo();
mudarPerfil();
showInstituicao();
outroCurso();
}
window.onload = onload();
</script>
<script>
//----------------------------- Scripts para auto-complete de endereço --------------------------------//
function limpa_formulário_cep() {
//Limpa valores do formulário de cep.
document.getElementById(`rua`).value = ("");
document.getElementById(`bairro`).value = ("");
document.getElementById(`cidade`).value = ("");
document.getElementById(`uf`).value = ("");
//document.getElementById('ibge').value=("");
}
function meu_callback(conteudo) {
if (!("erro" in conteudo)) {
//Atualiza os campos com os valores.
document.getElementById(`rua`).value = (conteudo.logradouro);
document.getElementById(`bairro`).value = (conteudo.bairro);
document.getElementById(`cidade`).value = (conteudo.localidade);
document.getElementById(`uf`).value = (conteudo.uf);
//document.getElementById('ibge').value=(conteudo.ibge);
} //end if.
else {
//CEP não Encontrado.
limpa_formulário_cep();
alert("CEP não encontrado.");
function meu_callback(conteudo) {
if (!("erro" in conteudo)) {
//Atualiza os campos com os valores.
document.getElementById(`rua`).value = (conteudo.logradouro);
document.getElementById(`bairro`).value = (conteudo.bairro);
document.getElementById(`cidade`).value = (conteudo.localidade);
document.getElementById(`uf`).value = (conteudo.uf);
//document.getElementById('ibge').value=(conteudo.ibge);
} //end if.
else {
//CEP não Encontrado.
limpa_formulário_cep();
alert("CEP não encontrado.");
}
}
}
function pesquisaCep(valor) {
//Nova variável "cep" somente com dígitos.
var cep = valor.replace(/\D/g, '');
function pesquisaCep(valor) {
//Nova variável "cep" somente com dígitos.
var cep = valor.replace(/\D/g, '');
//Verifica se campo cep possui valor informado.
if (cep != "") {
//Verifica se campo cep possui valor informado.
if (cep != "") {
//Expressão regular para validar o CEP.
var validacep = /^[0-9]{8}$/;
//Expressão regular para validar o CEP.
var validacep = /^[0-9]{8}$/;
//Valida o formato do CEP.
if (validacep.test(cep)) {
//Valida o formato do CEP.
if (validacep.test(cep)) {
//Preenche os campos com "..." enquanto consulta webservice.
document.getElementById(`rua`).value = "...";
document.getElementById(`bairro`).value = "...";
document.getElementById(`cidade`).value = "...";
document.getElementById(`uf`).value = "...";
//document.getElementById('ibge').value="...";
//Preenche os campos com "..." enquanto consulta webservice.
document.getElementById(`rua`).value = "...";
document.getElementById(`bairro`).value = "...";
document.getElementById(`cidade`).value = "...";
document.getElementById(`uf`).value = "...";
//document.getElementById('ibge').value="...";
//Cria um elemento javascript.
var script = document.createElement('script');
//Cria um elemento javascript.
var script = document.createElement('script');
//Sincroniza com o callback.
script.src = 'https://viacep.com.br/ws/' + cep + '/json/?callback=meu_callback';
//Sincroniza com o callback.
script.src = 'https://viacep.com.br/ws/' + cep + '/json/?callback=meu_callback';
//Insere script no documento e carrega o conteúdo.
document.body.appendChild(script);
//Insere script no documento e carrega o conteúdo.
document.body.appendChild(script);
} //end if.
else {
//cep é inválido.
limpa_formulário_cep();
alert("Formato de CEP inválido.");
}
} //end if.
else {
//cep é inválido.
//cep sem valor, limpa formulário.
limpa_formulário_cep();
alert("Formato de CEP inválido.");
}
} //end if.
else {
//cep sem valor, limpa formulário.
limpa_formulário_cep();
}
};
</script>
};
</script>
@endsection
\ No newline at end of file
......@@ -31,7 +31,7 @@
<div class="row justify-content-center" style="margin-top: 3rem;">
<div class="col-md-11" style="margin-bottom: -3rem">
<div class="card card_conteudo shadow bg-white" style="border-radius:12px; border-width:0px;">
@if($trabalhosIn != null)
@if($trabalhosIn != null && $evento->natureza_id != 3)
<div class="card-header" style="border-top-left-radius: 12px; border-top-right-radius: 12px; background-color: #fff">
<div class="d-flex justify-content-between align-items-center" style="margin-top: 9px; margin-bottom:-1rem">
<div class="bottomVoltar" style="margin-top: -20px">
......@@ -53,8 +53,8 @@
</div>
@endif
@if($trabalhosIn != null)
@if($trabalhosIn != null && $evento->natureza_id != 3)
<div class="card-body" >
<table class="table table-bordered table-hover" style="display: block; white-space: nowrap; border-radius:10px; margin-bottom:0px">
<thead>
......@@ -215,9 +215,9 @@
@if ($planoTrabalho != null)
<a href="{{route('download', ['file' => $planoTrabalho])}}" target="_new" style="font-size: 20px; color: #114048ff;" class="btn btn-light">
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:15px">
</a>
</a> <br>
@else
Não planos de trabalho.
Não planos de trabalho. <br>
@endif
@endforeach
@endif
......
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