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

restricao de data em criar projeto

parent 13a317ea
...@@ -35,8 +35,10 @@ class EventoController extends Controller ...@@ -35,8 +35,10 @@ class EventoController extends Controller
$eventos = Evento::all(); $eventos = Evento::all();
// $comissaoEvento = ComissaoEvento::all(); // $comissaoEvento = ComissaoEvento::all();
// $eventos = Evento::where('coordenadorId', Auth::user()->id)->get(); // $eventos = Evento::where('coordenadorId', Auth::user()->id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('coordenador.home',['eventos'=>$eventos]); return view('coordenador.home',['eventos'=>$eventos, 'hoje'=>$hoje]);
} }
......
...@@ -10,6 +10,7 @@ use App\User; ...@@ -10,6 +10,7 @@ use App\User;
use App\Trabalho; use App\Trabalho;
use App\Proponente; use App\Proponente;
use App\Evento; use App\Evento;
use Carbon\Carbon;
class ProponenteController extends Controller class ProponenteController extends Controller
{ {
...@@ -24,7 +25,9 @@ class ProponenteController extends Controller ...@@ -24,7 +25,9 @@ class ProponenteController extends Controller
public function editais(){ public function editais(){
$eventos = Evento::all(); $eventos = Evento::all();
return view('proponente.editais', ['eventos'=> $eventos] ); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.editais', ['eventos'=> $eventos, 'hoje'=>$hoje] );
} }
public function store(Request $request){ public function store(Request $request){
...@@ -89,7 +92,9 @@ class ProponenteController extends Controller ...@@ -89,7 +92,9 @@ class ProponenteController extends Controller
public function projetosEdital($id) { public function projetosEdital($id) {
$edital = Evento::find($id); $edital = Evento::find($id);
$projetos = Trabalho::where('evento_id', '=', $id)->get(); $projetos = Trabalho::where('evento_id', '=', $id)->get();
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos]); return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]);
} }
} }
...@@ -82,8 +82,10 @@ ...@@ -82,8 +82,10 @@
@if(Auth::user()->proponentes == null) @if(Auth::user()->proponentes == null)
<br><a href="{{ route('proponente.create' )}}" class="visualizarEvento">Criar projeto</a> <br><a href="{{ route('proponente.create' )}}" class="visualizarEvento">Criar projeto</a>
@else @else
@if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao)
<br><a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="visualizarEvento">Criar projeto</a> <br><a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="visualizarEvento">Criar projeto</a>
@endif @endif
@endif
@else @else
<a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" class="visualizarEvento">Visualizar edital</a> <a href="{{ route('evento.visualizarNaoLogado', ['id'=>$evento->id]) }}" class="visualizarEvento">Visualizar edital</a>
@endif @endif
......
...@@ -49,9 +49,11 @@ ...@@ -49,9 +49,11 @@
<a href="{{ route('proponente.projetosEdital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center"> <a href="{{ route('proponente.projetosEdital', ['id' => $evento->id]) }}" class="dropdown-item" style="text-align: center">
Projetos submetidos Projetos submetidos
</a> </a>
@if($evento->inicioSubmissao <= $hoje && $hoje <= $evento->fimSubmissao)
<a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center"> <a href="{{ route('trabalho.index', ['id' => $evento->id] )}}" class="dropdown-item" style="text-align: center">
Criar projeto Criar projeto
</a> </a>
@endif
{{-- <a href="" class="dropdown-item" style="text-align: center"> {{-- <a href="" class="dropdown-item" style="text-align: center">
Visualizar resultado Visualizar resultado
</a> --}} </a> --}}
......
...@@ -25,8 +25,13 @@ ...@@ -25,8 +25,13 @@
<h3>Projetos do edital {{ $edital->nome }}</h3> <h3>Projetos do edital {{ $edital->nome }}</h3>
<h6 style="color: rgb(4, 78, 4);">Submissão irá até o dia {{ date('d-m-Y', strtotime($edital->fimSubmissao)) }}</h6> <h6 style="color: rgb(4, 78, 4);">Submissão irá até o dia {{ date('d-m-Y', strtotime($edital->fimSubmissao)) }}</h6>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-1">
<a href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-primary" style="position:relative; float: right;">Criar projeto</a> <a href="{{ route('proponente.editais') }}" class="btn btn-primary" style="position:relative; float: right;">Voltar</a>
</div>
<div class="col-sm-2">
<a @if($edital->inicioSubmissao <= $hoje && $hoje <= $edital->fimSubmissao) href="{{ route('trabalho.index', ['id' => $edital->id] )}}" class="btn btn-primary" @else href="#" class="btn btn-danger" data-toggle="tooltip" data-placement="top" title="O periodo de submissão foi encerrado." @endif style="position:relative; float: right;">Criar projeto</a>
</div> </div>
</div> </div>
</div> </div>
......
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