Ejemplo n.º 1
0
 public function getDoDelete($round_id)
 {
     $round = \App\Round::find($round_id);
     if (is_null($round)) {
         \Session::flash('flash_message', 'Round not found.');
         return redirect('/handicap');
     }
     $round->delete();
     \Session::flash('flash_message', $round->id . ' was deleted.');
     return redirect('/handicap');
 }
Ejemplo n.º 2
0
 public function ShowDetail($id)
 {
     $round = Round::find($id);
     return view('front.championship.showDetail', array('round' => $round));
 }
Ejemplo n.º 3
0
 public function modification(Request $request)
 {
     if ($request->type == 1) {
         $dataRoundGet = Round::find($request->round_id);
         $dataRoundGet->active = 0;
         $dataRoundGet->save();
         $dataRound = Round::where('challenge_id', '=', $request->challenge_id)->where('stage_id', '=', $dataRoundGet->stage_id)->orderBy('id', 'DESC')->first();
         $date = new DateTime($dataRound->schedule_end);
         $hora_end = date('H:i:s', strtotime($date->format('H:i:s') . '+' . Settings::durationTrial() . ' minute'));
         $date_end = new DateTime($hora_end);
         $time_dos = Settings::durationTrial();
         $hora_start = strtotime('-' . $time_dos . ' minute', strtotime($date_end->format('H:i:s')));
         $hora_start = date('H:i:s', $hora_start);
         $dia = date('Y-m-d ', strtotime($date->format('H:i:s') . '+' . env('TIME') . ' minute'));
         Round::create(['team_id' => $dataRoundGet->team_id, 'challenge_id' => $dataRoundGet->challenge_id, 'schedule_start' => $hora_start, 'schedule_end' => $hora_end, 'stage_id' => $dataRoundGet->stage_id]);
     } else {
         $Round = Round::find($request->round_id);
         if ($request->typeText == 'active') {
             $Round->active = 1;
         } else {
             $Round->active = 0;
         }
         $Round->save();
     }
     return $this->index($request->challenge_id);
 }