Unverified Commit b7d2533c authored by Gabriel Antônio da Silva's avatar Gabriel Antônio da Silva Committed by GitHub
Browse files

Merge branch 'master' into modificacoes_layout_2

parents 8de6a88e 18615797
...@@ -12,10 +12,17 @@ class Arquivo extends Model ...@@ -12,10 +12,17 @@ class Arquivo extends Model
* @var array * @var array
*/ */
protected $fillable = [ protected $fillable = [
'nome', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'nome', 'versao', 'versaoFinal', 'data', 'trabalhoId', 'participanteId'
]; ];
public function trabalho(){ public function trabalho(){
return $this->belongsTo('App\Trabalho', 'trabalhoId'); return $this->belongsTo('App\Trabalho', 'trabalhoId');
} }
public function participante() {
return $this->belongsTo('App\Participante', 'participanteId');
}
public function avaliadors(){
return $this->belongsToMany('App\Avaliador', 'avaliadors_plano_trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at');
}
} }
...@@ -20,6 +20,9 @@ class Avaliador extends Model ...@@ -20,6 +20,9 @@ class Avaliador extends Model
public function trabalhos(){ public function trabalhos(){
return $this->belongsToMany('App\Trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at'); return $this->belongsToMany('App\Trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at');
} }
public function planoTrabalhos(){
return $this->belongsToMany('App\Arquivo', 'avaliadors_plano_trabalho')->withPivot('status', 'AnexoParecer', 'parecer', 'recomendacao', 'created_at');
}
public function eventos(){ public function eventos(){
return $this->belongsToMany('App\Evento')->withPivot('convite', 'created_at'); return $this->belongsToMany('App\Evento')->withPivot('convite', 'created_at');
} }
......
...@@ -42,15 +42,25 @@ class AvaliadorController extends Controller ...@@ -42,15 +42,25 @@ class AvaliadorController extends Controller
public function parecer(Request $request){ public function parecer(Request $request){
//$trabalho = Trabalho::find($request->trabalho_id);
$user = User::find(Auth::user()->id); $user = User::find(Auth::user()->id);
$avaliador = $user->avaliadors->where('user_id',$user->id)->first(); $avaliador = $user->avaliadors->where('user_id',$user->id)->first();
$trabalho = $avaliador->trabalhos->find($request->trabalho_id); $trabalho = $avaliador->trabalhos->find($request->trabalho_id);
$evento = Evento::find($request->evento); $evento = Evento::find($request->evento);
$recomendacaos = Recomendacao::all(); $recomendacaos = Recomendacao::all();
//dd($request->all());
return view('avaliador.parecer', ['trabalho'=>$trabalho, 'evento'=>$evento, 'recomendacaos'=>$recomendacaos]); return view('avaliador.parecer', ['trabalho'=>$trabalho, 'evento'=>$evento, 'recomendacaos'=>$recomendacaos]);
} }
public function parecerPlano(Request $request){
$user = User::find(Auth::user()->id);
$avaliador = $user->avaliadors->where('user_id',$user->id)->first();
$plano = $avaliador->planoTrabalhos->where('id', $request->plano_id)->first();
$evento = Evento::find($request->evento);
$recomendacaos = Recomendacao::all();
// dd($plano);
return view('avaliador.parecerPlano', ['plano'=>$plano, 'evento'=>$evento, 'recomendacaos'=>$recomendacaos]);
}
public function enviarParecer(Request $request){ public function enviarParecer(Request $request){
$user = User::find(Auth::user()->id); $user = User::find(Auth::user()->id);
...@@ -91,4 +101,49 @@ class AvaliadorController extends Controller ...@@ -91,4 +101,49 @@ class AvaliadorController extends Controller
//dd( $user->avaliadors->eventos->where('id', $evento->id)->first()->pivot); //dd( $user->avaliadors->eventos->where('id', $evento->id)->first()->pivot);
return redirect()->back(); return redirect()->back();
} }
public function listarPlanos(Request $request){
$user = User::find(Auth::user()->id);
$evento = Evento::where('id', $request->evento_id)->first();
$planos = $user->avaliadors->where('user_id',$user->id)->first()->planoTrabalhos;
//dd();
return view('avaliador.listarPlanos', ['planos'=>$planos, 'evento'=>$evento]);
}
public function enviarParecerPlano(Request $request){
$user = User::find(Auth::user()->id);
$evento = Evento::find($request->evento_id);
$planos = $user->avaliadors->where('user_id',$user->id)->first()->planoTrabalhos;
$avaliador = $user->avaliadors->where('user_id',$user->id)->first();
$plano = $avaliador->planoTrabalhos->find($request->plano_id);
$plano->versao = 1;
$plano->save();
$data = Carbon::now('America/Recife');
if($request->anexoParecer == ''){
$avaliador->planoTrabalhos()
->updateExistingPivot($plano->id,['status'=> 1,'parecer'=>$request->textParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]);
}else{
$anexoParecer = $request->anexoParecer;
$path = 'anexoParecerPlano/' . $avaliador->id . $plano->id . '/';
$nome = "parecerPlano.pdf";
Storage::putFileAs($path, $anexoParecer, $nome);
$anexoParecer = $path . $nome;
$avaliador->planoTrabalhos()
->updateExistingPivot($plano->id,['status'=> 1,'parecer'=>$request->textParecer,'AnexoParecer'=> $anexoParecer, 'recomendacao'=>$request->recomendacao, 'created_at' => $data]);
}
// dd($trabalho);
return view('avaliador.listarPlanos', ['planos'=>$planos, 'evento'=>$evento ]);
}
} }
<?php
namespace App\Http\Controllers;
use App\Evento;
use App\Arquivo;
use App\Avaliador;
use Illuminate\Http\Request;
class PlanoTrabalhoController extends Controller
{
public function index($evento_id)
{
$evento = Evento::find($evento_id);
return view('planosTrabalho.index', compact('evento'));
}
public function selecionarPlanos($evento_id)
{
$evento = Evento::where('id', $evento_id)->first();
$planos = Arquivo::all();
$avaliadores = $evento->avaliadors;
foreach ($planos as $key => $plano) {
$avalSelecionadosId = $plano->avaliadors->pluck('id');
$avalProjeto = Avaliador::whereNotIn('id', $avalSelecionadosId)->get();
$plano->aval = $avalProjeto;
}
return view('planosTrabalho.selecionarPlanos', [
'evento'=> $evento,
'planos'=>$planos,
'avaliadores'=>$avaliadores
]);
}
public function atribuicao(Request $request)
{
$plano = Arquivo::where('id', $request->plano_id)->first();
$evento = Evento::where('id', $request->evento_id)->first();
$avaliadores = Avaliador::whereIn('id', $request->avaliadores_id)->get();
$plano->avaliadors()->attach($avaliadores);
$evento->avaliadors()->syncWithoutDetaching($avaliadores);
// dd($plano->avaliadors);
$plano->save();
return redirect()->back();
}
public function store(Request $request)
{
}
public function edit($id)
{
}
public function update(Request $request, $id)
{
}
public function destroy($id)
{
}
}
...@@ -18,4 +18,8 @@ class Participante extends Model ...@@ -18,4 +18,8 @@ class Participante extends Model
public function trabalhos(){ public function trabalhos(){
return $this->belongsToMany('App\Trabalho', 'trabalho_participante'); return $this->belongsToMany('App\Trabalho', 'trabalho_participante');
} }
public function planoTrabalho() {
return $this->hasOne('App\Arquivo', 'participanteId');
}
} }
...@@ -28,6 +28,7 @@ class Trabalho extends Model ...@@ -28,6 +28,7 @@ class Trabalho extends Model
'anexoAutorizacaoComiteEtica', 'anexoAutorizacaoComiteEtica',
'JustificativaAutorizacaoEtica', 'JustificativaAutorizacaoEtica',
'anexoLattesCoordenador', 'anexoLattesCoordenador',
'anexoGrupoPesquisa',
'anexoPlanilhaPontuacao', 'anexoPlanilhaPontuacao',
'anexoProjeto', 'anexoProjeto',
...@@ -82,7 +83,7 @@ class Trabalho extends Model ...@@ -82,7 +83,7 @@ class Trabalho extends Model
return $this->hasMany('App\PlanoTrabalho'); return $this->hasMany('App\PlanoTrabalho');
} }
public function participantes(){ public function participantes(){
return $this->belongsToMany('App\Participante', 'trabalho_participante'); return $this->hasMany('App\Participante', 'trabalho_id');
} }
public function proponente(){ public function proponente(){
return $this->belongsTo('App\Proponente'); return $this->belongsTo('App\Proponente');
......
...@@ -23,10 +23,11 @@ class CreateTrabalhosTable extends Migration ...@@ -23,10 +23,11 @@ class CreateTrabalhosTable extends Migration
$table->string('pontuacaoPlanilha'); $table->string('pontuacaoPlanilha');
$table->date('data')->nullable(); $table->date('data')->nullable();
//Anexos //Anexos
$table->string('anexoProjeto'); $table->string('anexoProjeto')->nullable();
$table->string('anexoDecisaoCONSU')->nullable(); $table->string('anexoDecisaoCONSU')->nullable();
$table->string('anexoPlanilhaPontuacao'); $table->string('anexoPlanilhaPontuacao')->nullable();
$table->string('anexoLattesCoordenador'); $table->string('anexoLattesCoordenador')->nullable();
$table->string('anexoGrupoPesquisa')->nullable();
$table->string('anexoAutorizacaoComiteEtica')->nullable(); $table->string('anexoAutorizacaoComiteEtica')->nullable();
$table->string('justificativaAutorizacaoEtica')->nullable(); $table->string('justificativaAutorizacaoEtica')->nullable();
//chaves estrangeiras //chaves estrangeiras
......
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAvaliadorsPlanoTrabalhoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliadors_plano_trabalho', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->text('parecer')->nullable();
$table->string('AnexoParecer')->nullable();
$table->boolean('status')->nullable();
$table->string('recomendacao')->nullable();
$table->softDeletes();
$table->unsignedBigInteger('arquivo_id');
$table->unsignedBigInteger('avaliador_id');
$table->foreign('arquivo_id')->references('id')->on('arquivos');
$table->foreign('avaliador_id')->references('id')->on('avaliadors');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('avaliadors_plano_trabalho');
}
}
...@@ -66,15 +66,38 @@ ...@@ -66,15 +66,38 @@
</div> </div>
</a> </a>
</div> </div>
{{-- <div class="col-sm-3 d-flex justify-content-center">
<a href="#" style="text-decoration:none; color: inherit;"> <div class="col-sm-3 d-flex justify-content-center ">
<div class="card text-center " style="border-radius: 30px; width: 13rem;height: 15rem;"> <a href="{{route('plano.trabalho.index', ['evento_id' => $evento->id])}}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="card-body d-flex justify-content-center"> <div class="card-body d-flex justify-content-center">
<h2 style="padding-top:15px">Mensagens</h2> <div class="container">
<div class="row titulo-card-menu">
<div class="col-md-12">
<h2 style="padding-top:15px">Planos de Trabalho</h2>
</div>
</div>
@php
$avaliadores = \App\Participante::count();
@endphp
<div class="row">
<div class="col-md-12">
<h5> total de planos de trabalho:</h5>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$avaliadores}}</h1>
</div>
</div>
</div>
</div> </div>
</div> </div>
</a> </a>
</div> --}} </div>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('admin.atribuicao') }}" method="POST"> <form action="{{ route('plano.trabalho.atribuicao') }}" method="POST">
@csrf @csrf
<input type="hidden" name="trabalho_id" value="{{ $trabalho->id }}"> <input type="hidden" name="trabalho_id" value="{{ $trabalho->id }}">
<input type="hidden" name="evento_id" value="{{ $evento->id }}"> <input type="hidden" name="evento_id" value="{{ $evento->id }}">
......
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
<img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt=""> <img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt="">
Projetos para avaliar Projetos para avaliar
</a> </a>
<a href="{{ route('avaliador.listarPlanos', ['evento_id' => $evento->id]) }}" class="dropdown-item">
<img src="{{asset('img/icons/eye-regular.svg')}}" class="icon-card" alt="">
Planos para avaliar
</a>
@elseif(!is_null(Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == false) @elseif(!is_null(Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite) && Auth::user()->avaliadors->eventos->where('id', $evento->id)->first()->pivot->convite == false)
<button disabled="disabled" class="dropdown-item"> <button disabled="disabled" class="dropdown-item">
Convite recusado Convite recusado
......
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 100px;">
<div class="container" >
<div class="row" >
<div class="col-sm-10">
<h3>Planos do Edital: {{ $evento->nome }}</h3>
</div>
</div>
</div>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome do Projeto</th>
<th scope="col">Data de Criação</th>
<th scope="col">Parecer</th>
</tr>
</thead>
<tbody>
@foreach ($planos as $plano)
<tr>
<td>{{ $plano->titulo }}</td>
<td>{{ $plano->created_at }}</td>
{{-- <td>
<a href="{{route('download', ['file' => $trabalho->anexoProjeto])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a>
</td>
<td>
@foreach( $trabalho->participantes as $participante)
@php
if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
$planoTrabalho = App\Arquivo::where('participanteId', $participante->id)->first()->nome;
}else{
$planoTrabalho = null;
}
@endphp
@if ($planoTrabalho != null)
<a href="{{route('download', ['file' => $planoTrabalho])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a>
@else
Não planos de trabalho.
@endif
@endforeach
</td> --}}
<td>
<div class="row">
<form action="{{ route('avaliador.parecer.plano', ['evento' => $evento]) }}" method="POST">
@csrf
<input type="hidden" name="plano_id" value="{{ $plano->id }}" >
<button type="submit" class="btn btn-primary mr-2 ml-2" >
Parecer
</button>
</form>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endsection
@section('javascript')
<script>
</script>
@endsection
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
<td> <td>
@foreach( $trabalho->participantes as $participante) @foreach( $trabalho->participantes as $participante)
@php @php
if( App\Arquivo::where('participanteId', $participante->pivot->participante_id)->first() != null){ if( App\Arquivo::where('participanteId', $participante->id)->first() != null){
$planoTrabalho = App\Arquivo::where('participanteId', $participante->pivot->participante_id)->first()->nome; $planoTrabalho = App\Arquivo::where('participanteId', $participante->id)->first()->nome;
}else{ }else{
$planoTrabalho = null; $planoTrabalho = null;
} }
......
@extends('layouts.app')
@section('content')
<div class="container content">
<div class="row justify-content-center">
<div class="col-sm-12">
<div class="card" style="margin-top:50px">
<div class="card-body">
<h5 class="card-title">Meu Parecer</h5>
<h6 class="card-title">Plano: {{ $plano->titulo }}</h6>
<p class="card-text">
<form method="POST" action="{{route('avaliador.enviarParecerPlano')}}" enctype="multipart/form-data">
@csrf
<input type="hidden" name="plano_id" value="{{ $plano->id }}" >
<input type="hidden" name="evento_id" value="{{ $evento->id }}" >
<div class="form-group">
<label for="exampleFormControlTextarea1">Parecer:</label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3" name="textParecer">{{ $plano->pivot->parecer }}</textarea>
</div>
<select class="custom-select" name="recomendacao" >
@foreach($recomendacaos as $recomendacao)
@if($plano->pivot->recomendacao == $recomendacao->nome)
<option selected value="{{ $recomendacao->nome }}" >{{ $recomendacao->nome }}</option>
@else
<option value="{{ $recomendacao->nome }}">{{ $recomendacao->nome }}</option>
@endif
@endforeach
</select>
<div class="form-group mt-3 md-3">
@if($plano->pivot->AnexoParecer == null)
<label for="exampleFormControlFile1">Anexo do Parecer:</label>
<input type="file" class="form-control-file" id="exampleFormControlFile1" name="anexoParecer">
@else
<label for="exampleFormControlFile1"> existe um arquivo, quer atualizar?</label>
<br> <label for="exampleFormControlFile1"> Arquivo atual:</label>
<a href="{{route('download', ['file' => $plano->pivot->AnexoParecer])}}" target="_new" style="font-size: 20px; color: #114048ff;" >
<img class="" src="{{asset('img/icons/file-download-solid.svg')}}" style="width:20px">
</a><br>
<input type="file" class="form-control-file" id="exampleFormControlFile1" name="anexoParecer">
@endif
</div>
<button type="submit" class="btn btn-primary">Enviar</button>
<a href="{{ route('avaliador.visualizarTrabalho', ['evento_id' => $evento->id])}}" class="btn btn-danger" >Cancelar</a>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('javascript')
<script type="text/javascript">
</script>
@endsection
...@@ -1991,6 +1991,27 @@ function validarPart3(){ ...@@ -1991,6 +1991,27 @@ function validarPart3(){
} }
} }
</script>
</script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
// $("#button").click(function(e){
// e.preventDefault();
// $.ajax({
// headers: {
// 'X-CSRF-Token': $('input[name="_token"]').val()
// },
// url: "{{route('trabalho.store')}}",
// type: 'post',
// enctype: 'multipart/form-data',
// success: function(result){
// console.log("success")
// console.log(result)
// },
// erro: (xhr,status,error) => {
// console.log("erro")
// }
// });
// });
</script>
@endsection @endsection
...@@ -66,9 +66,11 @@ ...@@ -66,9 +66,11 @@
<div class="color-subtitle-edital">Submissão até o dia {{ date('d/m/Y', strtotime($evento->fimSubmissao)) }}</div> <div class="color-subtitle-edital">Submissão até o dia {{ date('d/m/Y', strtotime($evento->fimSubmissao)) }}</div>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<a href="{{ route('evento.visualizarNaoLogado', ['id' => $evento->id]) }}">
<button class="btn btn-opcoes-edital background-yellow" style="float: right;" disable> <button class="btn btn-opcoes-edital background-yellow" style="float: right;" disable>
Em avaliação Em avaliação
</button> </button>
</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -85,9 +87,11 @@ ...@@ -85,9 +87,11 @@
<div class="color-subtitle-edital">Submissão até o dia {{ date('d/m/Y', strtotime($evento->fimSubmissao)) }}</div> <div class="color-subtitle-edital">Submissão até o dia {{ date('d/m/Y', strtotime($evento->fimSubmissao)) }}</div>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">
<a href="{{ route('evento.visualizarNaoLogado', ['id' => $evento->id]) }}">
<button class="btn btn-opcoes-edital background-red" style="float: right;" disabled> <button class="btn btn-opcoes-edital background-red" style="float: right;" disabled>
Encerrado Encerrado
</button> </button>
</a>
</div> </div>
</div> </div>
</div> </div>
......
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center titulo-menu mb-0">
<h4>Planos de Trabalho </h4>
</div>
<div class="row justify-content-center mb-5">
<h5>Edital Selecionado: {{ $evento->nome }} </h5>
</div>
<div class="row justify-content-center d-flex align-items-center">
<div class="col-sm-3 d-flex justify-content-center ">
<a href="{{route('admin.selecionar', ['evento_id' => $evento->id])}}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="card-body d-flex justify-content-center">
<div class="container">
<div class="row titulo-card-menu">
<div class="col-md-12">
<h2 style="padding-top:15px">Selecionar avaliadores</h2>
</div>
</div>
@php
$avaliadores = \App\Avaliador::count();
@endphp
<div class="row">
<div class="col-md-12">
<h5> total de avaliadores:</h5>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$avaliadores}}</h1>
</div>
</div>
</div>
</div>
</div>
</a>
</div>
<div class="col-sm-3 d-flex justify-content-center">
<a href="{{ route('plano.trabalho.selecionarPlanos', ['evento_id' => $evento->id]) }}" style="text-decoration:none; color: inherit;">
<div class="card text-center card-menu">
<div class="card-body d-flex justify-content-center">
<div class="container">
<div class="row titulo-card-menu">
<div class="col-md-12">
<h2 style="padding-top:15px">Planos de trabalho</h2>
</div>
</div>
@php
$arquivo = \App\Arquivo::count();
@endphp
<div class="row">
<div class="col-md-12">
<h5> total de projetos:</h5>
</div>
</div>
<div class="row">
<div class="col-md-12">
<h1 class="quant-titulo-card">{{$arquivo}}</h1>
</div>
</div>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
@endsection
@extends('layouts.app')
@section('content')
<div class="container" style="margin-top: 30px;">
<div class="container" >
<div class="row justify-content-center" style="margin-bottom: 50px;">
<div class="col-md-1">
<a href="{{ route('plano.trabalho.index', ['evento_id' => $evento->id]) }}" class="btn btn-secondary">
Voltar
</a>
</div>
<div class="col-md-10" style="text-align: center;">
<h3 class="titulo-table">Lista de Planos do Edital: <span style="color: black;">{{ $evento->nome }}</span> </h3>
</div>
<div class="col-md-1">
<!-- Button trigger modal -->
{{-- <button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModalCenter">
Enviar Convite
</button> --}}
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-sm-1">
<button class="btn" onclick="buscar(this.parentElement.parentElement.children[1].children[0])">
<img src="{{asset('img/icons/logo_lupa.png')}}" alt="">
</button>
</div>
<div class="col-sm-6">
<input type="text" class="form-control form-control-edit" placeholder="Digite o nome do projeto" onkeyup="buscar(this)">
</div>
</div>
</div>
</div>
</div>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome do Projeto</th>
<th scope="col">Proponente</th>
<th scope="col" style="text-align:center">Ação</th>
</tr>
</thead>
<tbody id="projetos">
@foreach ($planos as $plano)
<tr>
<td>{{ $plano->titulo}}</td>
{{-- <td>{{ App\Area::find($trabalho->area_id)->nome}}</td> --}}
<td>{{ $plano->participante->user->name }}</td>
<td style="text-align:center">
<button type="button" class="btn btn-primary" value="{{ $plano->id }}" id="atribuir1" data-toggle="modal" data-target="#exampleModalCenter{{ $plano->id }}">
Atribuir
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModalCenter{{ $plano->id }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content modal-submeta">
<div class="modal-header modal-header-submeta">
<h5 class="modal-title titulo-table" id="exampleModalLongTitle">Selecione o(s) avaliador(es)</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: rgb(182, 182, 182)">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form action="{{ route('plano.trabalho.atribuicao') }}" method="POST">
@csrf
<input type="hidden" name="plano_id" value="{{ $plano->id }}">
<input type="hidden" name="evento_id" value="{{ $evento->id }}">
<div class="form-group">
<label for="exampleFormControlSelect2">Selecione o(s) avaliador(es) para esse plano</label>
<select name="avaliadores_id[]" multiple class="form-control" id="exampleFormControlSelect2">
@foreach ($plano->aval as $avaliador)
<option value="{{ $avaliador->id }}" > {{ $avaliador->user->name }} ({{$avaliador->area->nome ?? 'Indefinida'}}) </option>
@endforeach
</select>
<small id="emailHelp" class="form-text text-muted">Segure SHIFT do teclado para selecionar mais de um.</small>
</div>
<div>
<button type="submit" class="btn btn-info" style="width: 100%">Atribuir</button>
</div>
</form>
</div>
</div>
</div>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="container" style="margin-top: 50px;">
<div class="row justify-content-center d-flex align-items-center" >
<h3 class="titulo-table">Status dos Planos em Avaliação do edital: <span style="color: black;">{{ $evento->nome }}</span> </h3>
</div>
</div>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th scope="col">Nome do Usuário</th>
<th scope="col">E-mail</th>
<th scope="col">Status</th>
<th scope="col" style="text-align:center">Ação</th>
</tr>
</thead>
<tbody>
@foreach ($avaliadores as $avaliador)
@php $contador = 0; @endphp
@foreach($avaliador->planoTrabalhos as $plano)
@if($plano->pivot->status == true)
@php $contador++; @endphp
@endif
@endforeach
<tr>
<td>{{ $avaliador->user->name }}</td>
<td>{{ $avaliador->user->email }}</td>
<td>{{ $contador }} / {{ $avaliador->planoTrabalhos->count() }}</td>
<td style="text-align:center"> ...</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<!-- Button trigger modal -->
@endsection
@section('javascript')
<script>
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
});
function buscar(input) {
var editais = document.getElementById('projetos').children;
if(input.value.length > 2) {
for(var i = 0; i < editais.length; i++) {
var nomeEvento = editais[i].children[0].textContent;
if(nomeEvento.substr(0).indexOf(input.value) >= 0) {
editais[i].style.display = "";
} else {
editais[i].style.display = "none";
}
}
} else {
for(var i = 0; i < editais.length; i++) {
editais[i].style.display = "";
}
}
}
</script>
@endsection
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