Unverified Commit e211da21 authored by José Rômulo's avatar José Rômulo Committed by GitHub
Browse files

Merge pull request #1 from lmts-ufape/master

Pequenas correções participantes
parents 33f702f1 035e8bd3
......@@ -12,7 +12,7 @@ class Arquivo extends Model
* @var array
*/
protected $fillable = [
'nome', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId'
'nome','titulo', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId'
];
public function trabalho(){
......
......@@ -12,7 +12,7 @@ class Endereco extends Model
* @var array
*/
protected $fillable = [
'rua', 'numero', 'bairro', 'cidade','uf', 'cep',
'rua', 'numero', 'bairro', 'cidade','uf', 'cep','complemento'
];
public function user(){
......
......@@ -64,6 +64,16 @@ class AdministradorController extends Controller
return view('administrador.analisar')->with(['trabalhos' => $trabalhos, 'evento' => $evento, 'funcaoParticipantes' => $funcaoParticipantes]);
}
public function showProjetos(Request $request){
$evento = Evento::where('id', $request->evento_id)->first();
$projetos = Trabalho::all();
return view('administrador.listaProjetos')->with(['projetos' => $projetos, 'evento' => $evento]);
}
public function visualizarParecer(Request $request){
$avaliador = Avaliador::find($request->avaliador_id);
......
......@@ -2,8 +2,8 @@
namespace App\Http\Controllers;
use Auth;
use PDF;
use Auth;
use App\Area;
use App\User;
use App\Evento;
......@@ -31,8 +31,11 @@ use Illuminate\Http\Request;
use App\Mail\SubmissaoTrabalho;
use App\OutrasInfoParticipante;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use App\Http\Requests\StoreTrabalho;
use Illuminate\Support\Facades\Mail;
use App\Http\Requests\UpdateTrabalho;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use App\Mail\EmailParaUsuarioNaoCadastrado;
......@@ -167,8 +170,8 @@ class TrabalhoController extends Controller
$pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
if(!(is_null($request->anexoCONSU)) ) {
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, "CONSU.pdf");
if(!(is_null($request->anexoDecisaoCONSU)) ) {
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf");
}
if (!(is_null($request->anexoComiteEtica))) {
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf");
......@@ -182,8 +185,8 @@ class TrabalhoController extends Controller
if (!(is_null($request->anexoLattesCoordenador))) {
$trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Lattes_Coordenador.pdf");
}
if (!(is_null($request->anexoPlanilha))) {
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension());
if (!(is_null($request->anexoPlanilhaPontuacao))) {
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension());
}
$trabalho->update();
......@@ -197,7 +200,7 @@ class TrabalhoController extends Controller
public function validarAnexosRascunho(Request $request, $trabalho){
$validator = Validator::make($trabalho->getAttributes(),[
'anexoPlanilhaPontuacao' => $request->anexoPlanilha==null?['planilha']:[],
'anexoPlanilhaPontuacao' => $request->anexoPlanilhaPontuacao==null?['planilha']:[],
]);
if ($validator->fails()) {
......@@ -222,20 +225,20 @@ class TrabalhoController extends Controller
//Anexo Decisão CONSU
if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') {
if(isset($request->anexoCONSU)){
if(isset($request->anexoDecisaoCONSU)){
if(Storage::disk()->exists($trabalho->anexoDecisaoCONSU)) {
Storage::delete($trabalho->anexoDecisaoCONSU);
}
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, 'CONSU.pdf');
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf');
}
}
//Autorização ou Justificativa
if( isset($request->anexoComiteEtica)){
if( isset($request->anexoAutorizacaoComiteEtica)){
if(Storage::disk()->exists($trabalho->anexoAutorizacaoComiteEtica)) {
Storage::delete($trabalho->anexoAutorizacaoComiteEtica);
}
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, 'Comite_de_etica.pdf');
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoAutorizacaoComiteEtica, 'Comite_de_etica.pdf');
} elseif( isset($request->justificativaAutorizacaoEtica)){
if(Storage::disk()->exists($trabalho->justificativaAutorizacaoEtica)) {
......@@ -253,11 +256,11 @@ class TrabalhoController extends Controller
}
//Anexo Planilha
if( isset($request->anexoPlanilha)){
if( isset($request->anexoPlanilhaPontuacao)){
if(Storage::disk()->exists($trabalho->anexoPlanilhaPontuacao)) {
Storage::delete($trabalho->anexoPlanilhaPontuacao);
}
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension());
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension());
}
// Anexo grupo pesquisa
......@@ -265,7 +268,7 @@ class TrabalhoController extends Controller
if(Storage::disk()->exists($trabalho->anexoGrupoPesquisa)) {
Storage::delete($trabalho->anexoGrupoPesquisa);
}
$trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoPlanilha, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension());
$trabalho->anexoGrupoPesquisa = Storage::putFileAs($pasta, $request->anexoGrupoPesquisa, "Grupo_de_pesquisa.". $request->file('anexoGrupoPesquisa')->extension());
}
return $trabalho;
......@@ -278,14 +281,14 @@ class TrabalhoController extends Controller
//Anexo Decisão CONSU
if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM') {
if( isset($request->anexoCONSU)){
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, 'CONSU.pdf');
if( isset($request->anexoDecisaoCONSU)){
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, 'CONSU.pdf');
}
}
//Autorização ou Justificativa
if( isset($request->anexoComiteEtica)){
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, 'Comite_de_etica.pdf');
if( isset($request->anexoAutorizacaoComiteEtica)){
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoAutorizacaoComiteEtica, 'Comite_de_etica.pdf');
} elseif( isset($request->justificativaAutorizacaoEtica)){
$trabalho->justificativaAutorizacaoEtica = Storage::putFileAs($pasta, $request->justificativaAutorizacaoEtica, 'Justificativa.pdf');
......@@ -297,8 +300,8 @@ class TrabalhoController extends Controller
}
//Anexo Planilha
if( isset($request->anexoPlanilha)){
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.". $request->file('anexoPlanilha')->extension());
if( isset($request->anexoPlanilhaPontuacao)){
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.". $request->file('anexoPlanilhaPontuacao')->extension());
}
// Anexo grupo pesquisa
......@@ -389,234 +392,233 @@ class TrabalhoController extends Controller
]);
}
public function update(Request $request, $id)
{
$mytime = Carbon::now('America/Recife');
$mytime = $mytime->toDateString();
$evento = Evento::find($request->editalId);
$coordenador = CoordenadorComissao::find($evento->coordenadorId);
//Relaciona o projeto criado com o proponente que criou o projeto
$proponente = Proponente::where('user_id', Auth::user()->id)->first();
//$trabalho->proponentes()->save($proponente);
//dd($coordenador->id);
$trabalho = "trabalho";
if($evento->inicioSubmissao > $mytime){
if($mytime >= $evento->fimSubmissao){
return redirect()->route('home');
}
}
//O anexo de Decisão do CONSU dependo do tipo de edital
if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){
$validatedData = $request->validate([
'editalId' => ['required', 'string'],
'nomeProjeto' => ['required', 'string'],
'grandeArea' => ['required', 'string'],
'area' => ['required', 'string'],
'subArea' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupo' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'nomeParticipante.*' => ['required', 'string'],
'emailParticipante.*' => ['required', 'string'],
'funcaoParticipante.*' => ['required', 'string'],
]);
}else{
//Caso em que o anexo da Decisão do CONSU não necessário
$validatedData = $request->validate([
'editalId' => ['required', 'string'],
'nomeProjeto' => ['required', 'string',],
'grandeArea' => ['required', 'string'],
'area' => ['required', 'string'],
'subArea' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupo' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'nomeCoordenador' => ['required', 'string'],
'nomeParticipante.*' => ['required', 'string'],
'emailParticipante.*' => ['required', 'string'],
'funcaoParticipante.*' => ['required', 'string'],
]);
}
$trabalho = Trabalho::find($id);
$trabalho->titulo = $request->nomeProjeto;
$trabalho->coordenador_id = $coordenador->id;
$trabalho->grande_area_id = $request->grandeArea;
$trabalho->area_id = $request->area;
$trabalho->sub_area_id = $request->subArea;
$trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha;
$trabalho->linkGrupoPesquisa = $request->linkGrupo;
$trabalho->linkLattesEstudante = $request->linkLattesEstudante;
$trabalho->data = $mytime;
$trabalho->evento_id = $request->editalId;
$trabalho->proponente_id = $proponente->id;
$pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
if (!(is_null($request->anexoCONSU))) {
Storage::delete($trabalho->anexoDecisaoCONSU);
$trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoCONSU, "CONSU.pdf");
}
if (!(is_null($request->anexoProjeto))) {
Storage::delete($trabalho->anexoProjeto);
$trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf");
}
if (!(is_null($request->anexoComiteEtica))) {
Storage::delete($trabalho->anexoComiteEtica);
$trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf");
}
if (!(is_null($request->anexoLattesCoordenador))) {
Storage::delete($trabalho->anexoLattesCoordenador);
$trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf");
}
if (!(is_null($request->anexoPlanilha))) {
Storage::delete($trabalho->anexoLattesCoordenador);
$trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilha, "Planilha.pdf");
}
//atualizando projeto
$trabalho->update();
// criando novos participantes que podem ter sido adicionados
$participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
$users = User::whereIn('id', $participantesUsersIds)->get();
$emailParticipantes = [];
foreach ($users as $user) {
array_push($emailParticipantes, $user->email);
}
foreach ($request->emailParticipante as $key => $value) {
// criando novos participantes que podem ter sido adicionados
if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) {
$userParticipante = User::where('email', $value)->first();
if($userParticipante == null){
$passwordTemporario = Str::random(8);
$subject = "Participante de Projeto";
Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject));
$usuario = User::create([
'email' => $value,
'password' => bcrypt($passwordTemporario),
'usuarioTemp' => true,
'name' => $request->nomeParticipante[$key],
'tipo' => 'participante',
]);
$participante = new Participante();
$participante->user_id = $usuario->id;
$participante->trabalho_id = $trabalho->id;
$participante->funcao_participante_id = $request->funcaoParticipante[$key];
$participante->save();
}else{
$participante = new Participante();
$participante->user_id = $userParticipante->id;
$participante->trabalho_id = $trabalho->id;
$participante->funcao_participante_id = $request->funcaoParticipante[$key];
$participante->save();
$participante->trabalhos()->save($trabalho);
$subject = "Participante de Projeto";
$email = $value;
Mail::to($email)
->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
}
$path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id;
$arquivo->data = $mytime;
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
//atualizando os participantes que já estão no projeto e planos de trabalho se enviados
if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) {
$userParticipante = User::where('email', $value)->first();
if($userParticipante != null){
$user = User::where('email', $request->emailParticipante[$key])->first();
$participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
$user->name = $request->nomeParticipante[$key];
$user->update();
$participante->funcao_participante_id = $request->funcaoParticipante[$key];
$participante->update();
//atualizando planos de trabalho
if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) {
if (!(is_null($request->anexoPlanoTrabalho[$key]))) {
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
//se plano já existir, deletar
if($arquivo != null){
Storage::delete($arquivo->nome);
$arquivo->delete();
}
//atualizar plano
if($request->semPlano[$key] == null){
$path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome);
$arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $trabalho->id;
$arquivo->data = $mytime;
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
}
}
//removendo planos de trabalho
if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){
if($request->semPlano[$key] == 'sim'){
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
//se plano já existir, deletar
if($arquivo != null){
Storage::delete($arquivo->nome);
$arquivo->delete();
}
}
}
}
}
}
// Atualizando possiveis usuários removidos
$participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
$users = User::whereIn('id', $participantesUsersIds)->get();
// $mytime = Carbon::now('America/Recife');
// $mytime = $mytime->toDateString();
// $evento = Evento::find($request->editalId);
// $coordenador = CoordenadorComissao::find($evento->coordenadorId);
// //Relaciona o projeto criado com o proponente que criou o projeto
// $proponente = Proponente::where('user_id', Auth::user()->id)->first();
// //$trabalho->proponentes()->save($proponente);
// //dd($coordenador->id);
// $trabalho = "trabalho";
// if($evento->inicioSubmissao > $mytime){
// if($mytime >= $evento->fimSubmissao){
// return redirect()->route('home');
// }
// }
// //O anexo de Decisão do CONSU dependo do tipo de edital
// if( $evento->tipo == 'PIBIC' || $evento->tipo == 'PIBIC-EM'){
// $validatedData = $request->validate([
// 'editalId' => ['required', 'string'],
// 'nomeProjeto' => ['required', 'string'],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string'],
// 'linkLattesEstudante' => ['required', 'string'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante.*' => ['required', 'string'],
// ]);
// }else{
// //Caso em que o anexo da Decisão do CONSU não necessário
// $validatedData = $request->validate([
// 'editalId' => ['required', 'string'],
// 'nomeProjeto' => ['required', 'string',],
// 'grandeArea' => ['required', 'string'],
// 'area' => ['required', 'string'],
// 'subArea' => ['required', 'string'],
// 'pontuacaoPlanilha' => ['required', 'string'],
// 'linkGrupo' => ['required', 'string'],
// 'linkLattesEstudante' => ['required', 'string'],
// 'nomeCoordenador' => ['required', 'string'],
// 'nomeParticipante.*' => ['required', 'string'],
// 'emailParticipante.*' => ['required', 'string'],
// 'funcaoParticipante.*' => ['required', 'string'],
// ]);
// }
// $trabalho = Trabalho::find($id);
// $trabalho->titulo = $request->nomeProjeto;
// $trabalho->coordenador_id = $coordenador->id;
// $trabalho->grande_area_id = $request->grandeArea;
// $trabalho->area_id = $request->area;
// $trabalho->sub_area_id = $request->subArea;
// $trabalho->pontuacaoPlanilha = $request->pontuacaoPlanilha;
// $trabalho->linkGrupoPesquisa = $request->linkGrupo;
// $trabalho->linkLattesEstudante = $request->linkLattesEstudante;
// $trabalho->data = $mytime;
// $trabalho->evento_id = $request->editalId;
// $trabalho->proponente_id = $proponente->id;
// $pasta = 'trabalhos/' . $request->editalId . '/' . $trabalho->id;
// if (!(is_null($request->anexoDecisaoCONSU))) {
// Storage::delete($trabalho->anexoDecisaoCONSU);
// $trabalho->anexoDecisaoCONSU = Storage::putFileAs($pasta, $request->anexoDecisaoCONSU, "CONSU.pdf");
// }
// if (!(is_null($request->anexoProjeto))) {
// Storage::delete($trabalho->anexoProjeto);
// $trabalho->anexoProjeto = Storage::putFileAs($pasta, $request->anexoProjeto, "Projeto.pdf");
// }
// if (!(is_null($request->anexoComiteEtica))) {
// Storage::delete($trabalho->anexoComiteEtica);
// $trabalho->anexoAutorizacaoComiteEtica = Storage::putFileAs($pasta, $request->anexoComiteEtica, "Comite_de_etica.pdf");
// }
// if (!(is_null($request->anexoLattesCoordenador))) {
// Storage::delete($trabalho->anexoLattesCoordenador);
// $trabalho->anexoLattesCoordenador = Storage::putFileAs($pasta, $request->anexoLattesCoordenador, "Latter_Coordenador.pdf");
// }
// if (!(is_null($request->anexoPlanilhaPontuacao))) {
// Storage::delete($trabalho->anexoLattesCoordenador);
// $trabalho->anexoPlanilhaPontuacao = Storage::putFileAs($pasta, $request->anexoPlanilhaPontuacao, "Planilha.pdf");
// }
// //atualizando projeto
// $trabalho->update();
// // criando novos participantes que podem ter sido adicionados
// $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
// $users = User::whereIn('id', $participantesUsersIds)->get();
// $emailParticipantes = [];
// foreach ($users as $user) {
// array_push($emailParticipantes, $user->email);
// }
// foreach ($request->emailParticipante as $key => $value) {
// // criando novos participantes que podem ter sido adicionados
// if (!(in_array($request->emailParticipante[$key], $emailParticipantes, false))) {
// $userParticipante = User::where('email', $value)->first();
// if($userParticipante == null){
// $passwordTemporario = Str::random(8);
// $subject = "Participante de Projeto";
// Mail::to($value)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, ' ', 'Participante', $evento->nome, $passwordTemporario, $subject));
// $usuario = User::create([
// 'email' => $value,
// 'password' => bcrypt($passwordTemporario),
// 'usuarioTemp' => true,
// 'name' => $request->nomeParticipante[$key],
// 'tipo' => 'participante',
// ]);
// $participante = new Participante();
// $participante->user_id = $usuario->id;
// $participante->trabalho_id = $trabalho->id;
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->save();
// }else{
// $participante = new Participante();
// $participante->user_id = $userParticipante->id;
// $participante->trabalho_id = $trabalho->id;
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->save();
// $participante->trabalhos()->save($trabalho);
// $subject = "Participante de Projeto";
// $email = $value;
// Mail::to($email)
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $evento, $trabalho));
// }
// $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
// $nome = $request->nomePlanoTrabalho[$key] .".pdf";
// $file = $request->anexoPlanoTrabalho[$key];
// Storage::putFileAs($path, $file, $nome);
// $arquivo = new Arquivo();
// $arquivo->titulo = $request->nomePlanoTrabalho[$key];
// $arquivo->nome = $path . $nome;
// $arquivo->trabalhoId = $trabalho->id;
// $arquivo->data = $mytime;
// $arquivo->participanteId = $participante->id;
// $arquivo->versaoFinal = true;
// $arquivo->save();
// }
// //atualizando os participantes que já estão no projeto e planos de trabalho se enviados
// if (in_array($request->emailParticipante[$key], $emailParticipantes, false)) {
// $userParticipante = User::where('email', $value)->first();
// if($userParticipante != null){
// $user = User::where('email', $request->emailParticipante[$key])->first();
// $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
// $user->name = $request->nomeParticipante[$key];
// $user->update();
// $participante->funcao_participante_id = $request->funcaoParticipante[$key];
// $participante->update();
// //atualizando planos de trabalho
// if ($request->anexoPlanoTrabalho != null && array_key_exists($key, $request->anexoPlanoTrabalho)) {
// if (!(is_null($request->anexoPlanoTrabalho[$key]))) {
// $arquivo = Arquivo::where('participanteId', $participante->id)->first();
// //se plano já existir, deletar
// if($arquivo != null){
// Storage::delete($arquivo->nome);
// $arquivo->delete();
// }
// //atualizar plano
// if($request->semPlano[$key] == null){
// $path = 'trabalhos/' . $request->editalId . '/' . $trabalho->id .'/';
// $nome = $request->nomePlanoTrabalho[$key] .".pdf";
// $file = $request->anexoPlanoTrabalho[$key];
// Storage::putFileAs($path, $file, $nome);
// $arquivo = new Arquivo();
// $arquivo->titulo = $request->nomePlanoTrabalho[$key];
// $arquivo->nome = $path . $nome;
// $arquivo->trabalhoId = $trabalho->id;
// $arquivo->data = $mytime;
// $arquivo->participanteId = $participante->id;
// $arquivo->versaoFinal = true;
// $arquivo->save();
// }
// }
// }
// //removendo planos de trabalho
// if($request->nomePlanoTrabalho != null && array_key_exists($key, $request->nomePlanoTrabalho)){
// if($request->semPlano[$key] == 'sim'){
// $arquivo = Arquivo::where('participanteId', $participante->id)->first();
// //se plano já existir, deletar
// if($arquivo != null){
// Storage::delete($arquivo->nome);
// $arquivo->delete();
// }
// }
// }
// }
// }
// }
// // Atualizando possiveis usuários removidos
// $participantesUsersIds = Participante::where('trabalho_id', '=', $trabalho->id)->select('user_id')->get();
// $users = User::whereIn('id', $participantesUsersIds)->get();
// foreach ($users as $user) {
// if (!(in_array($user->email, $request->emailParticipante, false))) {
// $participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
// $arquivo = Arquivo::where('participanteId', $participante->id)->first();
// if($arquivo != null){
// Storage::delete($arquivo->nome);
// $arquivo->delete();
// }
// $participante->delete();
// }
// }
foreach ($users as $user) {
if (!(in_array($user->email, $request->emailParticipante, false))) {
$participante = Participante::where([['user_id', '=', $user->id], ['trabalho_id', '=', $trabalho->id]])->first();
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
if($arquivo != null){
Storage::delete($arquivo->nome);
$arquivo->delete();
}
$participante->delete();
}
}
return redirect()->route('evento.visualizar',['id'=>$request->editalId]);
}
public function destroy(Request $request)
{
......@@ -627,7 +629,8 @@ class TrabalhoController extends Controller
$participantes = $projeto->participantes;
foreach ($participantes as $participante) {
$plano = $participante->planoTrabalho;
$plano->delete();
if($plano)
$plano->delete();
$participante->delete();
}
......@@ -870,33 +873,316 @@ class TrabalhoController extends Controller
return abort(404);
}
public function salvar(Request $request) {
try {
// try {
$edital = Evento::find($request->editalId);
$hoje = now();
if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) {
return redirect()->route('inicial')->with(['error'=> 0, 'mensagem' => 'As submissões para o edital '. $edital->titulo .' foram encerradas.']);
}
// $edital = Evento::find($request->editalId);
// $hoje = now();
// if (!($edital->inicioSubmissao < $hoje && $edital->fimSubmissao >= $hoje)) {
// return redirect()->route('inicial')->with(['error'=> 0, 'mensagem' => 'As submissões para o edital '. $edital->titulo .' foram encerradas.']);
// }
$projeto = $this->atribuirDados($request, $edital);
$projeto->save();
// Email de submissão
// $subject = "Submissão de Trabalho";
// $proponente = Auth()->user();
// Mail::to($proponente->email)->send(new SubmissaoTrabalho($proponente, $subject, $edital, $projeto));
$id = $projeto->id;
Notification::send(Auth::user(), new SubmissaoNotification($id));
// $projeto = $this->atribuirDados($request, $edital);
// $projeto->save();
// // Email de submissão
// // $subject = "Submissão de Trabalho";
// // $proponente = Auth()->user();
// // Mail::to($proponente->email)->send(new SubmissaoTrabalho($proponente, $subject, $edital, $projeto));
// $id = $projeto->id;
// Notification::send(Auth::user(), new SubmissaoNotification($id));
// Salvando participantes
$this->salvarParticipantes($request, $edital, $projeto);
// // Salvando participantes
// $this->salvarParticipantes($request, $edital, $projeto);
// return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto submetido com sucesso!']);
// } catch (\Throwable $th) {
// return back()->with(['mensagem' => $th->getMessage()]);
// }
// foreach ($request->marcado as $key => $value) {
// $user = User::firstOrCreate([
// ['email' => $request->email[$value]],
// [
// 'name' => $request->name[$value], 'instituicao' => $request->instituicao[$value],
// 'cpf' => $request->cpf[$value], 'celular' => $request->celular[$value],
// ]
// ]);
// $participante = Participante::create([
// 'rg' => $request->rg[$value], 'data_de_nascimento'=> $request->data_de_nascimento[$value],
// 'curso' => $request->curso[$value], 'turno' => $request->turno[$value],
// 'ordem_prioridade'=> $request->ordem_prioridade[$value],'periodo_atual' => $request->periodo_atual[$value],
// 'total_periodos' => $request->total_periodos[$value],'media_do_curso'=> $request->media_do_curso[$value]
// ]);
// $user->endereco()->create([
// 'rua' => $request->rua[$value],
// 'numero' => $request->numero[$value],
// 'bairro' => $request->bairro[$value],
// 'cidade' => $request->cidade[$value],
// 'uf' => $request->uf[$value],
// 'cep' => $request->cep[$value],
// 'complemento' => $request->complemento[$value],
// ]);
// $user->participantes()->save($participante);
// $trabalho->participantes()->save($participante);
// }
public function update(UpdateTrabalho $request, $id)
{
// dd($request->participante_id);
// dd( $request->all() );
try {
if (!$request->has('rascunho') ) {
$request->merge([
'status' => 'submetido'
]);
}else{
$request->merge([
'status' => 'rascunho'
]);
}
$evento = Evento::find($request->editalId);
$request->merge([
'coordenador_id' => $evento->coordenadorComissao->id
]);
DB::beginTransaction();
$trabalho = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
$trabalho->update($request->except([
'anexoProjeto', 'anexoDecisaoCONSU','anexoPlanilhaPontuacao',
'anexoLattesCoordenador','anexoGrupoPesquisa','anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica'
]));
if ($request->marcado == null) {
$idExcluido = $trabalho->participantes->pluck('id');
}else{
$idExcluido = [];
}
// dd($idExcluido);
// dd(array_search( 2, $request->marcado));
foreach ($request->participante_id as $key => $value) {
// $value = intval($value);
if($request->marcado != null && array_search( $key, $request->marcado) === false){
if($value !== null)
array_push($idExcluido, $value);
}
}
// dd($idExcluido);
foreach ($idExcluido as $key => $value) {
$trabalho->participantes()->find($value)->delete();
}
$trabalho->refresh();
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';
$data['funcao_participante_id'] = 4;
$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];
$data['instituicao'] = $request->instituicao[$part];
$data['total_periodos'] = $request->total_periodos[$part];
$data['curso'] = $request->curso[$part];
$data['turno'] = $request->turno[$part];
$data['periodo_atual'] = $request->periodo_atual[$part];
$data['ordem_prioridade'] = $request->ordem_prioridade[$part];
$data['media_do_curso'] = $request->media_do_curso[$part];
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part];
$participante = Participante::find($request->participante_id[$part]);
if (!$participante){
$data['usuarioTemp'] = true;
$user = User::updateOrCreate(
['email' => $data['email']],
$data
);
$endereco = Endereco::create($data);
$endereco->user()->save($user);
$participante = Participante::create($data);
$user->participantes()->save($participante);
$trabalho->participantes()->save($participante);
}else{
$user = $participante->user;
$user->update($data);
$endereco = $user->endereco;
$endereco->update($data);
$participante = $user->participantes->where('trabalho_id', $trabalho->id)->first();
if (!$participante){
$participante = Participante::create($data);
$user->participantes()->save($participante);
$trabalho->participantes()->save($participante);
}else{
$participante->update($data);
}
}
if ( $request->has('anexoPlanoTrabalho') && array_key_exists($part,$request->anexoPlanoTrabalho) ) {
if(Arquivo::where('participanteId', $participante->id)->count()){
$arquivo = Arquivo::where('participanteId', $participante->id)->first();
$path = 'trabalhos/' . $evento->id . '/' . $trabalho->id .'/';
$nome = $data['nomePlanoTrabalho'] .".pdf";
$file = $request->anexoPlanoTrabalho[$part] ;
Storage::putFileAs($path, $file, $nome);
$arquivo->update([
'titulo' => $nome,
'nome' => $path . $nome,
'data' => now() ,
]);
}else{
$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();
}
}
}
}
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->save();
DB::commit();
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta atualizada!']);
} catch (\Throwable $th) {
DB::rollback();
return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]);
}
}
public function salvar(StoreTrabalho $request) {
try {
if (!$request->has('rascunho') ) {
$request->merge([
'status' => 'submetido'
]);
}
$evento = Evento::find($request->editalId);
$request->merge([
'coordenador_id' => $evento->coordenadorComissao->id
]);
DB::beginTransaction();
$trabalho = Auth::user()->proponentes->trabalhos()
->create($request->except([
'anexoProjeto', 'anexoDecisaoCONSU','anexoPlanilhaPontuacao',
'anexoLattesCoordenador','anexoGrupoPesquisa','anexoAutorizacaoComiteEtica',
'justificativaAutorizacaoEtica'
]));
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';
$data['funcao_participante_id'] = 4;
$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];
$data['instituicao'] = $request->instituicao[$part];
$data['total_periodos'] = $request->total_periodos[$part];
$data['curso'] = $request->curso[$part];
$data['turno'] = $request->turno[$part];
$data['periodo_atual'] = $request->periodo_atual[$part];
$data['ordem_prioridade'] = $request->ordem_prioridade[$part];
$data['media_do_curso'] = $request->media_do_curso[$part];
$data['nomePlanoTrabalho'] = $request->nomePlanoTrabalho[$part];
$user = User::where('email' , $data['email'])->first();
if (!$user){
$data['usuarioTemp'] = true;
$user = User::create($data);
$endereco = Endereco::create($data);
$endereco->user()->save($user);
}
$participante = $user->participantes->where('trabalho_id', $trabalho->id)->first();
if (!$participante){
$participante = Participante::create($data);
}
$user->participantes()->save($participante);
$trabalho->participantes()->save($participante);
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();
}
}
}
$evento->trabalhos()->save($trabalho);
$pasta = 'trabalhos/' . $evento->id . '/' . $trabalho->id;
$trabalho = $this->armazenarAnexosFinais($request, $pasta, $trabalho, $evento);
$trabalho->save();
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto submetido com sucesso!']);
DB::commit();
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']);
} catch (\Throwable $th) {
return back()->with(['mensagem' => $th->getMessage()]);
DB::rollback();
return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]);
}
}
......@@ -987,7 +1273,7 @@ class TrabalhoController extends Controller
$subject = "Participante de Projeto";
// Mail::to($request->emailParticipante[$key])->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
Mail::to($request->emailParticipante[$key])->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
} else {
$participante->user_id = $userParticipante->id;
......@@ -1005,11 +1291,11 @@ class TrabalhoController extends Controller
$participante->save();
$subject = "Participante de Projeto";
// Mail::to($request->emailParticipante[$key])
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
Mail::to($request->emailParticipante[$key])
->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
}
if($request->nomePlanoTrabalho[$key] != null){
$usuario = User::where('email', $request->emailParticipante[$key])->first();
$participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first();
......@@ -1028,7 +1314,7 @@ class TrabalhoController extends Controller
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
// dd($arquivo);
}
// Editado
} elseif ($id > 0) {
......@@ -1095,7 +1381,8 @@ class TrabalhoController extends Controller
$participantesExcluidos = $participantes->diff($participantesPermanecem);
foreach ($participantesExcluidos as $participante) {
$plano = $participante->planoTrabalho;
$plano->delete();
if($plano)
$plano->delete();
$participante->delete();
}
......@@ -1148,9 +1435,25 @@ class TrabalhoController extends Controller
$participante->media_do_curso = $request->media_geral_curso[$key];
$participante->save();
$usuario = User::where('email', $email)->first();
$participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first();
$path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome);
$agora = now();
$arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $projeto->id;
$arquivo->data = $agora;
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
$subject = "Participante de Projeto";
// Mail::to($email)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
Mail::to($email)->send(new EmailParaUsuarioNaoCadastrado(Auth()->user()->name, $projeto->titulo, 'Participante', $edital->nome, $passwordTemporario, $subject));
} else {
$participante->user_id = $userParticipante->id;
......@@ -1167,31 +1470,51 @@ class TrabalhoController extends Controller
$participante->media_do_curso = $request->media_geral_curso[$key];
$participante->save();
if ($request->anexoPlanoTrabalho[$key]) {
$path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome);
$agora = now();
$arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $projeto->id;
$arquivo->data = $agora;
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
$subject = "Participante de Projeto";
// Mail::to($email)
// ->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
Mail::to($email)
->send(new SubmissaoTrabalho($userParticipante, $subject, $edital, $projeto));
}
if($request->nomePlanoTrabalho[$key] != null){
$usuario = User::where('email', $email)->first();
$participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first();
$path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/';
$nome = $request->nomePlanoTrabalho[$key] .".pdf";
$file = $request->anexoPlanoTrabalho[$key];
Storage::putFileAs($path, $file, $nome);
$agora = now();
$arquivo = new Arquivo();
$arquivo->titulo = $request->nomePlanoTrabalho[$key];
$arquivo->nome = $path . $nome;
$arquivo->trabalhoId = $projeto->id;
$arquivo->data = $agora;
$arquivo->participanteId = $participante->id;
$arquivo->versaoFinal = true;
$arquivo->save();
}
// if($request->nomePlanoTrabalho[$key] != null){
// $usuario = User::where('email', $email)->first();
// $participante = Participante::where([['user_id', '=', $usuario->id], ['trabalho_id', '=', $projeto->id]])->first();
// $path = 'trabalhos/' . $edital->id . '/' . $projeto->id .'/';
// $nome = $request->nomePlanoTrabalho[$key] .".pdf";
// $file = $request->anexoPlanoTrabalho[$key];
// Storage::putFileAs($path, $file, $nome);
// $agora = now();
// $arquivo = new Arquivo();
// $arquivo->titulo = $request->nomePlanoTrabalho[$key];
// $arquivo->nome = $path . $nome;
// $arquivo->trabalhoId = $projeto->id;
// $arquivo->data = $agora;
// $arquivo->participanteId = $participante->id;
// $arquivo->versaoFinal = true;
// $arquivo->save();
// }
}
}
......@@ -1211,8 +1534,8 @@ class TrabalhoController extends Controller
$projeto = $this->atribuirDados($request, $edital, $projeto);
$projeto->update();
// Salvando participantes
// dd($request->all());
// Salvando participantes
$this->salvarParticipantes($request, $edital, $projeto, true);
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Projeto atualizado com sucesso!']);
......
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
class StoreTrabalho extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Auth::check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rules = [
'editalId' => ['required', 'string'],
'marcado.*' => ['required'],
'titulo' => ['required', 'string'],
'grande_area_id' => ['required', 'string'],
'area_id' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'],
'anexoProjeto' => ['required', 'mimes:pdf'],
'anexoDecisaoCONSU' => ['required', 'mimes:pdf'],
'anexoPlanilhaPontuacao' => ['required'],
'anexoLattesCoordenador' => ['required', 'mimes:pdf'],
'anexoGrupoPesquisa' => ['required', 'mimes:pdf'],
'anexoAutorizacaoComiteEtica' => [Rule::requiredIf($this->justificativaAutorizacaoEtica == null)],
'justificativaAutorizacaoEtica' => [Rule::requiredIf($this->anexoAutorizacaoComiteEtica == null)],
];
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
//user
$rules['name.'.$value] = ['required', 'string'];
$rules['email.'.$value] = ['required', 'string'];
$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'];
$rules['complemento.'.$value] = ['required', 'string'];
//participante
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string'];
$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'];
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
}
}
if ($this->has('rascunho')) {
return [
];
}else{
return $rules;
}
}
public function messages()
{
return [
'titulo.required' => 'O :attribute é obrigatório',
'marcado.*.required' => 'Por favor selcione algum participante, é obrigatório',
'grande_area_id.required' => 'O campo grande área é obrigatório',
'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório',
'anexoProjeto.required' => 'O :attribute é obrigatório',
'cpf.*.required' => 'O cpf é obrigatório',
'name.*.required' => 'O :attribute é obrigatório',
'email.*.required' => 'O :attribute é obrigatório',
'instituicao.*.required' => 'O :attribute é obrigatório',
'emailParticipante.*.required' => 'O :attribute é obrigatório',
'celular.*.required' => 'O :attribute é obrigatório',
'rua.*.required' => 'O :attribute é obrigatório',
'numero.*.required' => 'O :attribute é obrigatório',
'bairro.*.required' => 'O :attribute é obrigatório',
'cidade.*.required' => 'O :attribute é obrigatório',
'uf.*.required' => 'O :attribute é obrigatório',
'cep.*.required' => 'O :attribute é obrigatório',
'complemento.*.required' => 'O :attribute é obrigatório',
'rg.*.required' => 'O :attribute é obrigatório',
'data_de_nascimento.*.required' => 'O :attribute é obrigatório',
'curso.*.required' => 'O :attribute é obrigatório',
'turno.*.required' => 'O :attribute é obrigatório',
'ordem_prioridade.*.required' => 'O :attribute é obrigatório',
'periodo_atual.*.required' => 'O :attribute é obrigatório',
'total_periodos.*.required' => 'O :attribute é obrigatório',
'media_do_curso.*.required' => 'O :attribute é obrigatório',
'anexoPlanoTrabalho.*.required' => 'O :attribute é obrigatório',
'nomePlanoTrabalho.*.required' => 'O :attribute é obrigatório',
];
}
}
<?php
namespace App\Http\Requests;
use App\Trabalho;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rule;
class UpdateTrabalho extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$projeto = Trabalho::find($this->id);
$rules = [
'editalId' => ['required', 'string'],
'marcado.*' => ['required'],
'titulo' => ['required', 'string'],
'grande_area_id' => ['required', 'string'],
'area_id' => ['required', 'string'],
'linkLattesEstudante' => ['required', 'string'],
'pontuacaoPlanilha' => ['required', 'string'],
'linkGrupoPesquisa' => ['required', 'string'],
'anexoProjeto' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoProjeto == null)], 'mimes:pdf'],
'anexoDecisaoCONSU' => ['mimes:pdf'],
'anexoPlanilhaPontuacao' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoPlanilhaPontuacao == null)]],
'anexoLattesCoordenador' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoLattesCoordenador == null)], 'mimes:pdf'],
'anexoGrupoPesquisa' => [[Rule::requiredIf(!$this->has('rascunho') && $projeto->anexoGrupoPesquisa == null)], 'mimes:pdf'],
'anexoAutorizacaoComiteEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null) )
],
'justificativaAutorizacaoEtica' => [
Rule::requiredIf((!$this->has('rascunho') && $projeto->anexoAutorizacaoComiteEtica == null))
],
];
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
//user
$rules['name.'.$value] = ['required', 'string'];
$rules['email.'.$value] = ['required', 'string'];
$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'];
$rules['complemento.'.$value] = ['required', 'string'];
//participante
$rules['rg.'.$value] = ['required', 'string'];
$rules['data_de_nascimento.'.$value] = ['required', 'string'];
$rules['curso.'.$value] = ['required', 'string'];
$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'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
}
}
}
// dd($this->all());
if ($this->has('rascunho')) {
return [
];
}else{
return $rules;
}
}
}
......@@ -10,7 +10,7 @@ class Participante extends Model
use SoftDeletes;
public const ENUM_TURNO = ['Matutino', 'Vespertino', 'Noturno', 'Integral'];
protected $fillable = ['name', 'user_id', 'trabalho_id', 'participante_id'];
protected $fillable = ['rg', 'data_de_nascimento', 'curso', 'participante_id', 'turno', 'ordem_prioridade', 'periodo_atual', 'total_periodos', 'media_do_curso'];
public function user(){
return $this->belongsTo('App\User');
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3207e2b84c84b9381475a4fa738eca3e",
"content-hash": "a7ad1113629bd318dc8dbe9e51d021a1",
"packages": [
{
"name": "barryvdh/laravel-dompdf",
......@@ -72,6 +72,350 @@
],
"time": "2020-12-27T12:05:53+00:00"
},
{
"name": "doctrine/cache",
"version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/c9622c6820d3ede1e2315a6a377ea1076e421d88",
"reference": "c9622c6820d3ede1e2315a6a377ea1076e421d88",
"shasum": ""
},
"require": {
"php": "~7.1 || ^8.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4",
"psr/cache": ">=3"
},
"require-dev": {
"alcaeus/mongo-php-adapter": "^1.1",
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^8.0",
"mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
"predis/predis": "~1.0",
"psr/cache": "^1.0 || ^2.0",
"symfony/cache": "^4.4 || ^5.2"
},
"suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
"homepage": "https://www.doctrine-project.org/projects/cache.html",
"keywords": [
"abstraction",
"apcu",
"cache",
"caching",
"couchdb",
"memcached",
"php",
"redis",
"xcache"
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/2.0.3"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"time": "2021-05-25T09:43:04+00:00"
},
{
"name": "doctrine/dbal",
"version": "2.13.2",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
"reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/dbal/zipball/8dd39d2ead4409ce652fd4f02621060f009ea5e4",
"reference": "8dd39d2ead4409ce652fd4f02621060f009ea5e4",
"shasum": ""
},
"require": {
"doctrine/cache": "^1.0|^2.0",
"doctrine/deprecations": "^0.5.3",
"doctrine/event-manager": "^1.0",
"ext-pdo": "*",
"php": "^7.1 || ^8"
},
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2020.2",
"phpstan/phpstan": "0.12.81",
"phpunit/phpunit": "^7.5.20|^8.5|9.5.5",
"squizlabs/php_codesniffer": "3.6.0",
"symfony/cache": "^4.4",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "4.6.4"
},
"suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"bin": [
"bin/doctrine-dbal"
],
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\DBAL\\": "lib/Doctrine/DBAL"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
}
],
"description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.",
"homepage": "https://www.doctrine-project.org/projects/dbal.html",
"keywords": [
"abstraction",
"database",
"db2",
"dbal",
"mariadb",
"mssql",
"mysql",
"oci8",
"oracle",
"pdo",
"pgsql",
"postgresql",
"queryobject",
"sasql",
"sql",
"sqlanywhere",
"sqlite",
"sqlserver",
"sqlsrv"
],
"support": {
"issues": "https://github.com/doctrine/dbal/issues",
"source": "https://github.com/doctrine/dbal/tree/2.13.2"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal",
"type": "tidelift"
}
],
"time": "2021-06-18T21:48:39+00:00"
},
{
"name": "doctrine/deprecations",
"version": "v0.5.3",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "9504165960a1f83cc1480e2be1dd0a0478561314"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314",
"reference": "9504165960a1f83cc1480e2be1dd0a0478561314",
"shasum": ""
},
"require": {
"php": "^7.1|^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^6.0|^7.0|^8.0",
"phpunit/phpunit": "^7.0|^8.0|^9.0",
"psr/log": "^1.0"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/v0.5.3"
},
"time": "2021-03-21T12:59:47+00:00"
},
{
"name": "doctrine/event-manager",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/event-manager.git",
"reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f",
"reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"conflict": {
"doctrine/common": "<2.9@dev"
},
"require-dev": {
"doctrine/coding-standard": "^6.0",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Common\\": "lib/Doctrine/Common"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
},
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com"
}
],
"description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.",
"homepage": "https://www.doctrine-project.org/projects/event-manager.html",
"keywords": [
"event",
"event dispatcher",
"event manager",
"event system",
"events"
],
"support": {
"issues": "https://github.com/doctrine/event-manager/issues",
"source": "https://github.com/doctrine/event-manager/tree/1.1.x"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager",
"type": "tidelift"
}
],
"time": "2020-05-29T18:28:51+00:00"
},
{
"name": "doctrine/inflector",
"version": "2.0.3",
......@@ -511,16 +855,16 @@
},
{
"name": "geekcom/validator-docs",
"version": "3.5.2",
"version": "3.5.3",
"source": {
"type": "git",
"url": "https://github.com/geekcom/validator-docs.git",
"reference": "92eb11c55081e6cfe0594d58ab0232e0c6980cab"
"reference": "94064a98379dca1e781bd358e4c10d7a1cff0020"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/geekcom/validator-docs/zipball/92eb11c55081e6cfe0594d58ab0232e0c6980cab",
"reference": "92eb11c55081e6cfe0594d58ab0232e0c6980cab",
"url": "https://api.github.com/repos/geekcom/validator-docs/zipball/94064a98379dca1e781bd358e4c10d7a1cff0020",
"reference": "94064a98379dca1e781bd358e4c10d7a1cff0020",
"shasum": ""
},
"require": {
......@@ -532,8 +876,7 @@
"php-coveralls/php-coveralls": "^2.2",
"phpstan/phpstan": "^0.12.5",
"phpunit/phpunit": "^8.4|^9.4",
"squizlabs/php_codesniffer": "*",
"symplify/changelog-linker": "^8.3"
"squizlabs/php_codesniffer": "*"
},
"type": "library",
"extra": {
......@@ -561,15 +904,15 @@
"description": "Biblioteca para validação de Título de Eleitor, CPF, CNPJ, NIS e CNH",
"support": {
"issues": "https://github.com/geekcom/validator-docs/issues",
"source": "https://github.com/geekcom/validator-docs/tree/3.5.2"
"source": "https://github.com/geekcom/validator-docs/tree/3.5.3"
},
"funding": [
{
"url": "https://gumroad.com/geekcom",
"url": "https://nubank.com.br/pagar/518o5/zVBzxd00Sb",
"type": "custom"
}
],
"time": "2021-04-23T00:05:14+00:00"
"time": "2021-06-29T20:08:48+00:00"
},
{
"name": "guzzlehttp/guzzle",
......@@ -774,16 +1117,16 @@
},
{
"name": "laravel/framework",
"version": "v6.20.27",
"version": "v6.20.29",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb"
"reference": "00fa9c04aed10d68481f5757b89da0e6798f53b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/92c0417e60efc39bc556ba5dfc9b20a56f7848fb",
"reference": "92c0417e60efc39bc556ba5dfc9b20a56f7848fb",
"url": "https://api.github.com/repos/laravel/framework/zipball/00fa9c04aed10d68481f5757b89da0e6798f53b3",
"reference": "00fa9c04aed10d68481f5757b89da0e6798f53b3",
"shasum": ""
},
"require": {
......@@ -923,7 +1266,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2021-05-11T14:00:28+00:00"
"time": "2021-06-22T13:41:06+00:00"
},
{
"name": "laravel/tinker",
......@@ -1049,16 +1392,16 @@
},
{
"name": "league/commonmark",
"version": "1.6.2",
"version": "1.6.5",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
"reference": "7d70d2f19c84bcc16275ea47edabee24747352eb"
"reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb",
"reference": "7d70d2f19c84bcc16275ea47edabee24747352eb",
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/44ffd8d3c4a9133e4bd0548622b09c55af39db5f",
"reference": "44ffd8d3c4a9133e4bd0548622b09c55af39db5f",
"shasum": ""
},
"require": {
......@@ -1076,7 +1419,7 @@
"github/gfm": "0.29.0",
"michelf/php-markdown": "~1.4",
"mikehaertl/php-shellcommand": "^1.4",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan": "^0.12.90",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.2",
"scrutinizer/ocular": "^1.5",
"symfony/finder": "^4.2"
......@@ -1146,20 +1489,20 @@
"type": "tidelift"
}
],
"time": "2021-05-12T11:39:41+00:00"
"time": "2021-06-26T11:57:13+00:00"
},
{
"name": "league/flysystem",
"version": "1.1.3",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a"
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a",
"reference": "9be3b16c877d477357c015cec057548cf9b2a14a",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32",
"shasum": ""
},
"require": {
......@@ -1175,7 +1518,6 @@
"phpunit/phpunit": "^8.5.8"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
......@@ -1233,7 +1575,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/1.x"
"source": "https://github.com/thephpleague/flysystem/tree/1.1.4"
},
"funding": [
{
......@@ -1241,7 +1583,7 @@
"type": "other"
}
],
"time": "2020-08-23T07:39:11+00:00"
"time": "2021-06-23T21:56:05+00:00"
},
{
"name": "league/mime-type-detection",
......@@ -1397,16 +1739,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.48.1",
"version": "2.50.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16"
"reference": "f47f17d17602b2243414a44ad53d9f8b9ada5fdb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8d1f50f1436fb4b05e7127360483dd9c6e73da16",
"reference": "8d1f50f1436fb4b05e7127360483dd9c6e73da16",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/f47f17d17602b2243414a44ad53d9f8b9ada5fdb",
"reference": "f47f17d17602b2243414a44ad53d9f8b9ada5fdb",
"shasum": ""
},
"require": {
......@@ -1458,15 +1800,15 @@
{
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
"homepage": "https://markido.com"
},
{
"name": "kylekatarnls",
"homepage": "http://github.com/kylekatarnls"
"homepage": "https://github.com/kylekatarnls"
}
],
"description": "An API extension for DateTime that supports 281 different languages.",
"homepage": "http://carbon.nesbot.com",
"homepage": "https://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
......@@ -1486,7 +1828,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T22:08:38+00:00"
"time": "2021-06-28T22:38:45+00:00"
},
{
"name": "nikic/php-parser",
......@@ -2353,16 +2695,16 @@
},
{
"name": "symfony/console",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a62acecdf5b50e314a4f305cd01b5282126f3095"
"reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/a62acecdf5b50e314a4f305cd01b5282126f3095",
"reference": "a62acecdf5b50e314a4f305cd01b5282126f3095",
"url": "https://api.github.com/repos/symfony/console/zipball/9aa1eb46c1b12fada74dc0c529e93d1ccef22576",
"reference": "9aa1eb46c1b12fada74dc0c529e93d1ccef22576",
"shasum": ""
},
"require": {
......@@ -2422,7 +2764,7 @@
"description": "Eases the creation of beautiful and testable command line interfaces",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/console/tree/v4.4.25"
"source": "https://github.com/symfony/console/tree/v4.4.26"
},
"funding": [
{
......@@ -2438,7 +2780,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T11:20:16+00:00"
"time": "2021-06-06T09:12:27+00:00"
},
{
"name": "symfony/css-selector",
......@@ -2643,16 +2985,16 @@
},
{
"name": "symfony/error-handler",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/error-handler.git",
"reference": "310a756cec00d29d89a08518405aded046a54a8b"
"reference": "4001f01153d0eb5496fe11d8c76d1e56b47fdb88"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/310a756cec00d29d89a08518405aded046a54a8b",
"reference": "310a756cec00d29d89a08518405aded046a54a8b",
"url": "https://api.github.com/repos/symfony/error-handler/zipball/4001f01153d0eb5496fe11d8c76d1e56b47fdb88",
"reference": "4001f01153d0eb5496fe11d8c76d1e56b47fdb88",
"shasum": ""
},
"require": {
......@@ -2692,7 +3034,7 @@
"description": "Provides tools to manage errors and ease debugging PHP code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/error-handler/tree/v4.4.25"
"source": "https://github.com/symfony/error-handler/tree/v4.4.26"
},
"funding": [
{
......@@ -2708,7 +3050,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:39:37+00:00"
"time": "2021-06-24T07:57:22+00:00"
},
{
"name": "symfony/event-dispatcher",
......@@ -3013,16 +3355,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "0c79d5a65ace4fe66e49702658c024a419d2438b"
"reference": "8759ed5c27c2a8a47cb60f367f4be6727f08d58b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/0c79d5a65ace4fe66e49702658c024a419d2438b",
"reference": "0c79d5a65ace4fe66e49702658c024a419d2438b",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/8759ed5c27c2a8a47cb60f367f4be6727f08d58b",
"reference": "8759ed5c27c2a8a47cb60f367f4be6727f08d58b",
"shasum": ""
},
"require": {
......@@ -3061,7 +3403,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v4.4.25"
"source": "https://github.com/symfony/http-foundation/tree/v4.4.26"
},
"funding": [
{
......@@ -3077,20 +3419,20 @@
"type": "tidelift"
}
],
"time": "2021-05-26T11:20:16+00:00"
"time": "2021-06-26T21:56:04+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "3795165596fe81a52296b78c9aae938d434069cc"
"reference": "e08b2fb8a6eedd81c70522e514bad9b2c1fff881"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/3795165596fe81a52296b78c9aae938d434069cc",
"reference": "3795165596fe81a52296b78c9aae938d434069cc",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/e08b2fb8a6eedd81c70522e514bad9b2c1fff881",
"reference": "e08b2fb8a6eedd81c70522e514bad9b2c1fff881",
"shasum": ""
},
"require": {
......@@ -3165,7 +3507,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v4.4.25"
"source": "https://github.com/symfony/http-kernel/tree/v4.4.26"
},
"funding": [
{
......@@ -3181,20 +3523,20 @@
"type": "tidelift"
}
],
"time": "2021-06-01T07:12:08+00:00"
"time": "2021-06-30T08:18:06+00:00"
},
{
"name": "symfony/mime",
"version": "v5.3.0",
"version": "v5.3.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "ed710d297b181f6a7194d8172c9c2423d58e4852"
"reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/ed710d297b181f6a7194d8172c9c2423d58e4852",
"reference": "ed710d297b181f6a7194d8172c9c2423d58e4852",
"url": "https://api.github.com/repos/symfony/mime/zipball/47dd7912152b82d0d4c8d9040dbc93d6232d472a",
"reference": "47dd7912152b82d0d4c8d9040dbc93d6232d472a",
"shasum": ""
},
"require": {
......@@ -3248,7 +3590,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v5.3.0"
"source": "https://github.com/symfony/mime/tree/v5.3.2"
},
"funding": [
{
......@@ -3264,7 +3606,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-06-09T10:58:01+00:00"
},
{
"name": "symfony/polyfill-ctype",
......@@ -3916,16 +4258,16 @@
},
{
"name": "symfony/process",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "cd61e6dd273975c6625316de9d141ebd197f93c9"
"reference": "7e812c84c3f2dba173d311de6e510edf701685a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/cd61e6dd273975c6625316de9d141ebd197f93c9",
"reference": "cd61e6dd273975c6625316de9d141ebd197f93c9",
"url": "https://api.github.com/repos/symfony/process/zipball/7e812c84c3f2dba173d311de6e510edf701685a8",
"reference": "7e812c84c3f2dba173d311de6e510edf701685a8",
"shasum": ""
},
"require": {
......@@ -3957,7 +4299,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v4.4.25"
"source": "https://github.com/symfony/process/tree/v4.4.26"
},
"funding": [
{
......@@ -3973,7 +4315,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T11:20:16+00:00"
"time": "2021-06-09T14:57:04+00:00"
},
{
"name": "symfony/routing",
......@@ -4144,16 +4486,16 @@
},
{
"name": "symfony/translation",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4"
"reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/dfe132c5c6d89f90ce7f961742cc532e9ca16dd4",
"reference": "dfe132c5c6d89f90ce7f961742cc532e9ca16dd4",
"url": "https://api.github.com/repos/symfony/translation/zipball/2f7fa60b8d10ca71c30dc46b0870143183a8f131",
"reference": "2f7fa60b8d10ca71c30dc46b0870143183a8f131",
"shasum": ""
},
"require": {
......@@ -4212,7 +4554,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v4.4.25"
"source": "https://github.com/symfony/translation/tree/v4.4.26"
},
"funding": [
{
......@@ -4228,7 +4570,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:39:37+00:00"
"time": "2021-06-06T08:51:46+00:00"
},
{
"name": "symfony/translation-contracts",
......@@ -4310,16 +4652,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v4.4.25",
"version": "v4.4.26",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0"
"reference": "a586efdf2aa832d05b9249e9115d24f6a2691160"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0",
"reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/a586efdf2aa832d05b9249e9115d24f6a2691160",
"reference": "a586efdf2aa832d05b9249e9115d24f6a2691160",
"shasum": ""
},
"require": {
......@@ -4379,7 +4721,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v4.4.25"
"source": "https://github.com/symfony/var-dumper/tree/v4.4.26"
},
"funding": [
{
......@@ -4395,7 +4737,7 @@
"type": "tidelift"
}
],
"time": "2021-05-27T09:48:32+00:00"
"time": "2021-06-17T06:35:48+00:00"
},
{
"name": "thiagocfn/inscricaoestadual",
......@@ -5961,16 +6303,16 @@
},
{
"name": "phpunit/phpunit",
"version": "8.5.16",
"version": "8.5.17",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "cc66f2fc61296be66c99931a862200e7456b9a01"
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/cc66f2fc61296be66c99931a862200e7456b9a01",
"reference": "cc66f2fc61296be66c99931a862200e7456b9a01",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/79067856d85421c56d413bd238d4e2cd6b0e54da",
"reference": "79067856d85421c56d413bd238d4e2cd6b0e54da",
"shasum": ""
},
"require": {
......@@ -6042,7 +6384,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.16"
"source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.17"
},
"funding": [
{
......@@ -6054,7 +6396,7 @@
"type": "github"
}
],
"time": "2021-06-05T04:46:20+00:00"
"time": "2021-06-23T05:12:43+00:00"
},
{
"name": "scrivo/highlight.php",
......@@ -6979,5 +7321,5 @@
"php": "^7.2"
},
"platform-dev": [],
"plugin-api-version": "2.0.0"
"plugin-api-version": "2.1.0"
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableUsers extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('email')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
//
});
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterTableArquivos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('arquivos', function (Blueprint $table) {
$table->string('nome')->nullable()->change();
$table->string('titulo')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('arquivos', function (Blueprint $table) {
//
});
}
}
......@@ -112,41 +112,60 @@
</a>
</div>
<div class="col-sm-3 d-flex justify-content-center">
<a href="{{ route('admin.usuarios') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="container">
<div class="row titulo-card-menu">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Usuários</h2>
</div>
<div class="col-sm-3 d-flex justify-content-center">
<a href="{{ route('admin.usuarios') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="container">
<div class="row titulo-card-menu">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Usuários</h2>
</div>
<div class="row">
<div class="col-md-12">
<h6> total de usuários:</h6>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h6> total de usuários:</h6>
</div>
@php
$usuarios = \App\User::count();
@endphp
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$usuarios}}</h1>
</div>
</div>
@php
$usuarios = \App\User::count();
@endphp
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$usuarios}}</h1>
</div>
</div>
</div>
</a>
</div>
{{-- <div class="col-sm-3 d-flex justify-content-center">
<a href="{{ route('admin.usuarios') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center " style="border-radius: 31px; width: 13rem;height: 15rem;">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Mensagens</h2>
</div>
</div>
</a>
</div> --}}
</div>
</div>
</a>
</div>
<br>
<div class="col-sm-3 d-flex justify-content-center m-4">
<a href="{{ route('admin.showProjetos') }}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="container">
<div class="row titulo-card-menu">
<div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Projetos</h2>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h6> total de usuários:</h6>
</div>
</div>
@php
$trabalhos = \App\Trabalho::count();
@endphp
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$trabalhos}}</h1>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
......
@extends('layouts.app')
@section('content')
<div class="container" >
<div class="row" >
<div class="col-sm-5" style="float: center;">
<h4 class="titulo-table">Editais</h4>
</div>
</div>
<hr>
@if(session('mensagem'))
<div class="row">
<div class="col-md-12" style="margin-top: 30px;">
<div class="alert alert-success">
<p>{{session('mensagem')}}</p>
</div>
</div>
</div>
@endif
<div class="row">
<div class="col-md-12">
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome da Proposta</th>
<th scope="col">Autor</th>
<th scope="col">Email</th>
<th scope="col">Data de Criação</th>
<th scope="col">Status</th>
<th scope="col">Opção</th>
</tr>
</thead>
<tbody id="eventos">
@foreach ($projetos as $projeto)
<tr>
<td>
<a href="{{ route('trabalho.show',['id'=>$projeto->id]) }}" class="visualizarEvento">
{{ $projeto->titulo }}
</a>
</td>
<td>{{ $projeto->proponente->user->name }}</td>
<td>{{ $projeto->proponente->user->email }}</td>
<td>{{ date('d/m/Y', strtotime($projeto->created_at)) }}</td>
<td>{{ $projeto->status }}</td>
<td>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
\ No newline at end of file
@php
$class = $class ?? " ";
$obrigatorio = $obrigatorio ?? " ";
// $obrigatorio = $obrigatorio ?? " ";
@endphp
<div class="form-group">
<label class=" control-label {{ $class }}" for="firstname">{{ $label }} @if($obrigatorio) <span style="color: red; font-weight:bold">*</span> @endif</label>
<label class=" control-label {{ $class }}" for="firstname">{{ $label }} <span style="color: red; font-weight:bold">*</span></label>
{{ $slot }}
<div class="">
{{ $slot }}
</div>
</div>
......@@ -9,8 +9,9 @@
<div class="col-1">
<button type="button" class="btn btn-danger" id="buttonRemover" onclick="removerPart(this)" >X</button>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante">
<div class="collapse @error('name') show @enderror" id="collapseParticipante">
<div class="container">
<div class="row">
<input type="hidden" name="funcaoParticipante[]" value="4">
......@@ -18,95 +19,175 @@
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " name="nomeParticipante[]" placeholder="Nome Completo" required />
<input type="text" class="form-control " name="name[]" placeholder="Nome Completo" />
@error('name.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" name="emailParticipante[]" placeholder="E-mail" required/>
<input type="email" class="form-control" name="email[]" placeholder="E-mail" />
@error('email.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" name="data_de_nascimento[]" placeholder="Data de nascimento" required/>
<input type="date" class="form-control" 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 class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" required/>
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" />
@endcomponent
@error('cpf.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" name="rg[]" placeholder="RG" required/>
<input type="number" class="form-control" min="1" maxlength="12" name="rg[]" placeholder="RG" />
@error('rg.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="text" class="form-control celular" name="celular[]" placeholder="Celular" required/>
<input type="text" class="form-control celular" name="celular[]" placeholder="Celular" />
@error('celular.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control cep" name="cep[]" placeholder="CEP" required/>
<input type="text" class="form-control cep" name="cep[]" placeholder="CEP" />
@error('cep.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf[]" id="estado" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
<select name="uf[]" id="estado" class="form-control" style="visibility: visible" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf') == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" name="cidade[]" placeholder="Cidade" required/>
<input type="text" class="form-control" name="cidade[]" placeholder="Cidade" />
@error('cidade.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" name="bairro[]" placeholder="Bairro" required/>
<input type="text" class="form-control" name="bairro[]" placeholder="Bairro" />
@error('bairro.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" name="rua[]" placeholder="Rua" required/>
<input type="text" class="form-control" name="rua[]" placeholder="Rua" />
@error('rua.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" name="numero[]" placeholder="Número" required/>
<input type="text" class="form-control" name="numero[]" placeholder="Número" />
@error('numero.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => ''])
<input type="text" class="form-control" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento"/>
@error('complemento.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" name="universidade[]" placeholder="Universidade" required/>
<input type="text" class="form-control" name="universidade[]" placeholder="Universidade" />
@error('universidade.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" name="curso[]" placeholder="Curso" required/>
<input type="text" class="form-control" name="curso[]" placeholder="Curso" />
@error('curso.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[]" class="form-control" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
<select name="turno[]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if(old('turno') == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
@error('turno.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@php
......@@ -114,46 +195,81 @@
@endphp
<div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos do curso'])
<select name="total_periodos[]" class="form-control" onchange="gerarPeriodo(this)" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
<select name="total_periodos[]" class="form-control" onchange="gerarPeriodo(this)" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if(old('total_periodos') == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@error('total_periodos.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" required >
<option value="" disabled selected>-- Selecione uma opção --</option>
<select name="periodo_atual[]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option>
</select>
@error('periodo_atual.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<select name="ordem_prioridade[]" class="form-control" >
<option value="" selected>-- ORDEM --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
@error('ordem_prioridade.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" name="media_geral_curso[]" min="0" max="10" step="0.01" required>
<input type="number" class="form-control media" name="media_do_curso[]" min="0" max="10" step="0.01" >
@error('media_do_curso.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
<input type="text" class="form-control" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" >
@error('nomePlanoTrabalho.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" required/>
<input type="file" class="input-group-text" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.*')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
......
......@@ -11,30 +11,54 @@
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Projeto (.pdf)'])
<input type="file" class="input-group-text" name="anexoProjeto" placeholder="nomeProjeto" accept="application/pdf" required/>
<input type="file" class="input-group-text" name="anexoProjeto" placeholder="nomeProjeto" accept="application/pdf" />
@error('anexoProjeto')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Currículo Lattes do Proponente (.pdf)'])
<input type="file" class="input-group-text" name="anexoLattesCoordenador" placeholder="anexoPlanoTrabalho" accept=".pdf" required/>
<input type="file" class="input-group-text" name="anexoLattesCoordenador" placeholder="anexoPlanoTrabalho" accept=".pdf" />
@endcomponent
@error('anexoLattesCoordenador')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Planilha de Pontuação (.xlsx,.xls,.ods)'])
<input type="file" class="input-group-text" name="anexoPlanilha" placeholder="anexoPlanoTrabalho" accept=".xlsx, .xls, .ods" required/>
<input type="file" class="input-group-text" name="anexoPlanilhaPontuacao" placeholder="anexoPlanilhaPontuacao" accept=".xlsx, .xls, .ods" />
@error('anexoPlanilhaPontuacao')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="form-group col-md-6">
@component('componentes.input', ['label' => 'Decisão do CONSU (.pdf)'])
<input type="file" class="input-group-text" name="anexoCONSU" placeholder="anexoCONSU" accept=".pdf" required/>
@endcomponent
<label class=" control-label" for="firstname">Decisão do CONSU (.pdf)</label>
<input type="file" class="input-group-text" name="anexoDecisaoCONSU" accept=".pdf" />
@error('anexoDecisaoCONSU')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="form-group col-md-6" style="margin-top: 10px">
@component('componentes.input', ['label' => 'Grupo de Pesquisa (.pdf)'])
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" required/>
<input type="file" class="input-group-text" name="anexoGrupoPesquisa" placeholder="Anexo do Grupo de Pesquisa" accept="application/pdf" />
@error('anexoGrupoPesquisa')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
......@@ -50,13 +74,23 @@
<div class="form-group" id="displaySim" style="display: block; margin-top:-1rem">
@component('componentes.input', ['label' => 'Sim, declaro que necessito de autorizações especiais (.pdf)'])
<input type="file" class="input-group-text" name="anexoComiteEtica" placeholder="anexoComiteEtica" accept=".pdf" required/>
<input type="file" class="input-group-text" name="anexoAutorizacaoComiteEtica" placeholder="anexoComiteEtica" accept=".pdf" />
@error('anexoAutorizacaoComiteEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="form-group" id="displayNao" style="display: none; margin-top:-1rem">
@component('componentes.input', ['label' => 'Declaração de que não necessito de autorização especiais (.pdf)'])
<input type="file" class="input-group-text" name="inputJustificativa" placeholder="inputJustificativa" accept=".pdf" required/>
<input type="file" class="input-group-text" name="justificativaAutorizacaoEtica" placeholder="justificativaAutorizacaoEtica" accept=".pdf" />
@error('justificativaAutorizacaoEtica')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
......
......@@ -12,7 +12,8 @@
<div class=" d-flex justify-content-between align-items-center" style="margin-top: 15px; margin-bottom:18px">
<h6 style="font-family:Arial, Helvetica, sans-serif; margin-right:15px"><span style="color: red; font-weight:bold">*</span> Campos obrigatórios</h6>
<button id="submeterFormProposta" type="submit" style="display: none;"></button>
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Enviar Projeto') }}</button>
<button type="submit" class="btn btn-primary " id="idButtonSubmitRascunho" >{{ __('Salvar como rascunho') }}</button>
<button type="submit" class="btn btn-success" id="idButtonSubmitProjeto" >{{ __('Submeter Proposta') }}</button>
</div>
</div>
</div>
......
......@@ -18,174 +18,290 @@
<li id="item">
<div style="margin-bottom:15px">
<div id="participante" >
<div class="form-row">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div>
</a>
</div>
<div class="col-1" style="margin-top:4.3px">
<button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button>
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante">
<div class="container">
<div class="row">
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " name="nomeParticipante[]" placeholder="Nome Completo" required />
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" name="emailParticipante[]" placeholder="E-mail" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" name="data_de_nascimento[]" placeholder="Data de nascimento" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" name="cpf[]" placeholder="CPF" required onchange="checarCPFdoCampo(this)" onkeyup="mascaraCPF(this)"/>
<span id="cpf-invalido-1" class="invalid-feedback cpf-invalido" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF inválido.</span>
@for($i = 0; $i < $edital->numParticipantes; $i++)
<div class="form-row mb-1">
<div class="col-md-11">
<a class="btn btn-light" data-toggle="collapse" id="idCollapseParticipante" href="#collapseParticipante{{$i}}" role="button" aria-expanded="false" aria-controls="collapseParticipante" style="width: 100%; text-align:left">
<div class="d-flex justify-content-between align-items-center">
<h4 id="tituloParticipante" style="color: #01487E; font-size:17px; margin-top:5px">Discente<span id="pontos" style="display: none;">:</span> <span style="display: none;" id="display"></span> </h4>
</div>
</a>
</div>
<div class="col-1" style="margin-top:9.3px">
{{-- <button type="button" class="btn btn-danger shadow-sm" id="buttonRemover" onclick="removerPart(this)" >X</button> --}}
<input type="checkbox" aria-label="Checkbox for following text input" @if(old('name')[$i] ?? "" == $i) checked @endif name="marcado[]" value="{{ $i }}">
</div>
<div class="col-md-12">
<div class="collapse" id="collapseParticipante{{$i}}">
<div class="container">
<div class="row">
<input type="hidden" name="funcaoParticipante[]" value="4">
<div class="col-md-12 mt-3"><h5>Dados do discente</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Nome completo'])
<input type="text" class="form-control " value="{{old('name')[$i] ?? "" }}" name="name[{{$i}}]" placeholder="Nome Completo" />
@error("name.".$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
<span id="cpf-valido-1" class="valid-feedback" role="alert" style="overflow: visible; display:none">
<span style="font-style: italic;">CPF válido.</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'E-mail'])
<input type="email" class="form-control" value="{{old('email')[$i] ?? "" }}" name="email[{{$i}}]" placeholder="E-mail" />
@error('email.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Data de nascimento'])
<input type="date" class="form-control" value="{{old('data_de_nascimento')[$i] ?? "" }}" name="data_de_nascimento[{{$i}}]" placeholder="Data de nascimento" />
@error('data_de_nascimento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'CPF'])
<input type="text" class="form-control cpf" value="{{old('cpf')[$i] ?? "" }}" name="cpf[{{$i}}]" placeholder="CPF" />
@error('cpf.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" value="{{old('rg')[$i] ?? "" }}" name="rg[{{$i}}]" placeholder="RG" />
@error('rg.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" value="{{old('celular')[$i] ?? "" }}" name="celular[{{$i}}]" placeholder="Celular" />
@error('celular.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control" value="{{old('cep')[$i] ?? "" }}" name="cep[{{$i}}]" placeholder="CEP" />
@error('cep.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf[{{$i}}]" id="estado" class="form-control" style="visibility: visible" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf')[$i] ?? "" == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@error('uf.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'RG'])
<input type="number" class="form-control" min="1" maxlength="12" name="rg[]" placeholder="RG" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Celular'])
<input type="tel" class="form-control celular" name="celular[]" placeholder="Celular" required/>
@endcomponent
</div>
<div class="col-md-12"><h5>Endereço</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'CEP'])
<input type="text" class="form-control cep" name="cep[]" placeholder="CEP" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Estado'])
<select name="uf[]" id="estado" class="form-control" style="visibility: visible" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($estados as $sigla => $nome)
<option @if(old('uf') == $sigla ) selected @endif value="{{ $sigla }}">{{ $nome }}</option>
@endforeach
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" name="cidade[]" placeholder="Cidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" name="bairro[]" placeholder="Bairro" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" name="rua[]" placeholder="Rua" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" name="numero[]" placeholder="Número" required/>
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento', 'obrigatorio' => ''])
<input type="text" class="form-control" name="complemento[]" pattern="[A-Za-z]+" placeholder="Complemento" />
@endcomponent
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" name="universidade[]" placeholder="Universidade" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" name="curso[]" placeholder="Curso" required/>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[]" class="form-control" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if(old('turno') == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
@endcomponent
</div>
@php
$options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12);
@endphp
<div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos do curso'])
<select name="total_periodos[]" class="form-control" onchange="gerarPeriodo(this)" required>
<option value="" disabled selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if(old('total_periodos') == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" required >
<option value="" disabled selected>-- Selecione uma opção --</option>
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" required>
<option value="" disabled selected>-- ORDEM --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" name="media_geral_curso[]" min="0" max="10" step="0.01" required>
@endcomponent
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Cidade'])
<input type="text" class="form-control" value="{{old('cidade')[$i] ?? "" }}" name="cidade[{{$i}}]" placeholder="Cidade" />
@error('cidade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Bairro'])
<input type="text" class="form-control" value="{{old('bairro')[$i] ?? "" }}" name="bairro[{{$i}}]" placeholder="Bairro" />
@error('bairro.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Rua'])
<input type="text" class="form-control" value="{{old('rua')[$i] ?? "" }}" name="rua[{{$i}}]" placeholder="Rua" />
@error('rua.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Número'])
<input type="text" class="form-control" value="{{old('numero')[$i] ?? "" }}" name="numero[{{$i}}]" placeholder="Número" />
@error('numero.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-12">
@component('componentes.input', ['label' => 'Complemento',])
<input type="text" class="form-control" value="{{old('complemento')[$i] ?? "" }}" name="complemento[{{$i}}]" placeholder="Complemento" />
@error('complemento.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Dados do curso</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Universidade'])
<input type="text" class="form-control" value="{{old('instituicao')[$i] ?? "" }}" name="instituicao[{{$i}}]" placeholder="Universidade" />
@error('instituicao.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Curso'])
<input type="text" class="form-control" value="{{old('curso')[$i] ?? "" }}" name="curso[{{$i}}]" placeholder="Curso" />
@error('curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Turno'])
<select name="turno[{{$i}}]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($enum_turno as $key => $value)
<option @if(old('turno')[$i] ?? "" == $value ) selected @endif value="{{ $value }}">{{ $value }}</option>
@endforeach
</select>
@error('turno.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
@php
$options = array('6' => 6, '7' => 7,'8' => 8,'9' => 9,'10' => 10,'11' => 11,'12' => 12);
@endphp
<div class="col-6">
@component('componentes.select', ['label' => 'Total de períodos do curso'])
<select name="total_periodos[{{$i}}]" class="form-control" onchange="gerarPeriodo(this)" >
<option value="" selected>-- Selecione uma opção --</option>
@foreach ($options as $key => $value)
<option @if(old('total_periodos')[$i] ?? "" == $key ) selected @endif value="{{ $key }}">{{ $value }}</option>
@endforeach
</select>
@error('total_periodos.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Período atual'])
<select name="periodo_atual[]" class="form-control" >
<option value="" selected>-- Selecione uma opção --</option>
</select>
@error('periodo_atual.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.select', ['label' => 'Ordem de prioridade'])
<select name="ordem_prioridade[]" class="form-control" >
<option value="" selected>-- ORDEM --</option>
@for($j = 1; $j <= 3; $j++)
<option @if(old('total_periodos')[$i] ?? "" == $j ) selected @endif value="{{ $j }}">{{ $j }}</option>
@endfor
</select>
@error('ordem_prioridade.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Coeficiente de rendimento'])
<input type="number" class="form-control media" value="{{old('media_do_curso')[$i] ?? "" }}" name="media_do_curso[{{$i}}]" min="0" max="10" step="0.01" >
@error('media_do_curso.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" value="{{old('nomePlanoTrabalho')[$i] ?? "" }}" name="nomePlanoTrabalho[{{$i}}]" placeholder="Digite o título do plano de trabalho" >
@error('nomePlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" value="{{old('anexoPlanoTrabalho')[$i] ?? "" }}" name="anexoPlanoTrabalho[{{$i}}]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" />
@error('anexoPlanoTrabalho.'.$i)
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@error('anexoPlanoTrabalho')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
@enderror
@endcomponent
</div>
</div>
<div class="col-md-12"><h5>Plano de trabalho</h5></div>
<div class="col-6">
@component('componentes.input', ['label' => 'Título'])
<input type="text" class="form-control" name="nomePlanoTrabalho[]" placeholder="Digite o título do plano de trabalho" required>
@endcomponent
</div>
<div class="col-6">
@component('componentes.input', ['label' => 'Anexo(.pdf)'])
<input type="file" class="input-group-text" name="anexoPlanoTrabalho[]" accept=".pdf" placeholder="Anexo do Plano de Trabalho" required/>
@endcomponent
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endfor
</div>
</div>
......
......@@ -11,9 +11,9 @@
<div class="col-md-12" style="margin-bottom: -0.8rem;"><hr style="border-top: 1px solid#1492E6"></div>
<div class="form-group col-md-12" style="margin-top: 10px">
<label for="nomeProjeto" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="nomeProjeto" type="text" class="form-control @error('nomeProjeto') is-invalid @enderror" name="nomeProjeto" placeholder="Digite o nome do projeto" value="{{ old('nomeProjeto') !== null ? old('nomeProjeto') : (isset($rascunho) ? $rascunho->titulo : '')}}" autocomplete="nomeProjeto" required >
@error('nomeProjeto')
<label for="titulo" class="col-form-label">{{ __('Nome do Projeto') }} <span style="color: red; font-weight:bold">*</span></label>
<input id="titulo" type="text" class="form-control @error('titulo') is-invalid @enderror" name="titulo" placeholder="Digite o nome do projeto" value="{{old('titulo')}}" autocomplete="titulo" >
@error('titulo')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
......@@ -22,14 +22,14 @@
<div class="form-group col-md-4">
<label for="grandeArea" class="col-form-label">{{ __('Grande Área') }} <span style="color: red; font-weight:bold">*</span></label>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grandeArea" onchange="areas()" required>
<select class="form-control @error('grandeArea') is-invalid @enderror" id="grandeArea" name="grande_area_id" onchange="areas()" >
<option value="" disabled selected hidden>-- Grande Área --</option>
@foreach($grandeAreas as $grandeArea)
<option @if(old('grandeArea') !== null ? old('grandeArea') : (isset($rascunho) ? $rascunho->grande_area_id : '')
== $grandeArea->id ) selected @endif value="{{$grandeArea->id}}">{{$grandeArea->nome}}</option>
@endforeach
</select>
@error('grandeArea')
@error('grande_area_id')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
......@@ -38,10 +38,10 @@
<div class="form-group col-md-4">
<label for="area" class="col-form-label">{{ __('Área') }} <span style="color: red; font-weight:bold">*</span></label>
<input type="hidden" id="oldArea" value="{{ old('area') }}" >
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area" onchange="subareas()" required>
<select class="form-control @error('area') is-invalid @enderror" id="area" name="area_id" onchange="subareas()" >
<option value="" disabled selected hidden>-- Área --</option>
</select>
@error('area')
@error('area_id')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
......@@ -50,7 +50,7 @@
<div class="form-group col-md-4">
<label for="subArea" class="col-form-label">{{ __('Subárea') }} </label>
<input type="hidden" id="oldSubArea" value="{{ old('subArea') }}" >
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="subArea" >
<select class="form-control @error('subArea') is-invalid @enderror" id="subArea" name="sub_area_id" >
<option value="" disabled selected hidden>-- Subárea --</option>
{{-- @foreach($subAreas as $subArea)
<option @if(old('subArea') !== null ? old('subArea') : (isset($rascunho) ? $rascunho->sub_area_id : '')
......@@ -58,7 +58,7 @@
@endforeach --}}
</select>
@error('subArea')
@error('sub_area_id')
<span class="invalid-feedback" role="alert" style="overflow: visible; display:block">
<strong>{{ $message }}</strong>
</span>
......
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