Пример #1
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create($course_url, $stage_url)
 {
     $curso = Course::where('url', $course_url)->first();
     $etapa = Stage::where('url', $stage_url)->where('course_id', $curso->id)->first();
     $tiposItem = ItemType::all()->pluck('name', 'id');
     return view('pages.items.create', ['curso' => $curso, 'etapa' => $etapa, 'tiposItem' => $tiposItem]);
 }
Пример #2
0
 public function detailsEtudiantByEtudiant()
 {
     if (Request::ajax()) {
         $data = Request::All();
         $stagiaire = [];
         $etudiant = Etudiant::infos($data['idEtudiant']);
         $stagiaire['etudiant'] = $etudiant;
         $stage = Stage::where('idEtudiant', $etudiant->idEtudiant)->select('sujet', 'idTuteur')->first();
         if (count($stage) == 0) {
             $stage = new Stage();
             $tuteur = new Tuteur();
             $entreprise = new Entreprise();
             $entreprise->nom = "-";
             $tuteur->nomTuteur = "-";
             $tuteur->prenomTuteur = "";
             $stage->sujet = "-";
         } else {
             $tuteur = Tuteur::infos($stage->idTuteur);
             if (count($tuteur) == 0) {
                 $tuteur = new Tuteur();
             }
             $entreprise = Entreprise::where('id', $tuteur->idEntreprise)->select('nom')->first();
         }
         $stagiaire['stage'] = $stage;
         $stagiaire['tuteur'] = $tuteur;
         $stagiaire['entreprise'] = $entreprise;
         return $stagiaire;
     } else {
         return "Error.";
     }
 }
Пример #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($course_url, $stage_url, $url)
 {
     $curso = Course::where('url', $course_url)->first();
     $etapa = Stage::where('url', $stage_url)->first();
     $item = Item::where('url', $url)->first();
     $tiposItem = ItemType::all()->pluck('name', 'id');
     return view('pages.items.edit', ['curso' => $curso, 'etapa' => $etapa, 'item' => $item, 'tiposItem' => $tiposItem]);
 }
Пример #4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Lead $lead)
 {
     // Edit an exisiting lead
     $stages = Stage::lists('name', 'id');
     $sources = Source::lists('name', 'id');
     $genders = Gender::lists('name', 'id');
     $titles = Title::lists('name', 'id');
     $users = User::lists('name', 'id');
     return view('leads.edit', compact('lead', 'stages', 'sources', 'users', 'titles', 'genders'));
 }
Пример #5
0
 public function indexTuteurEntr()
 {
     $dashboardInfos = [];
     $tuteur = Tuteur::infos(session('uid'));
     $dashboardInfos['tuteur'] = $tuteur;
     $stages = Stage::infosByTuteur(session('uid'));
     $dashboardInfos['nbStagiaire'] = $stages->count();
     $dashboardInfos['nbStagiaireValide'] = $stages->where('tuteurValide', "1")->count();
     return view("dashboard.dashboard")->with('dashboardInfos', $dashboardInfos);
 }
Пример #6
0
 public static function infosByEnseignant($idEnseignant)
 {
     $stage = Stage::where('idEnseignant', $idEnseignant)->join('utilisateur', 'utilisateur.id', '=', 'stage.idEtudiant')->select('nom as nomEtudiant', 'prenom as prenomEtudiant', 'stage.idEtudiant as idEtudiant')->get();
     /*
     $demandes = DB::table('demandeAppariement')
                     ->join('stage', 'stage.id', '=', 'demandeAppariement.idStage')
                     ->join('utilisateur', 'utilisateur.id', '=', 'stage.idEtudiant')
                     ->select('demandeAppariement.status', 'utilisateur.nom', 'utilisateur.prenom')
                     ->get();
     */
     return $stage;
 }
Пример #7
0
 public function stage($id)
 {
     $faker = Faker::create();
     for ($i = 1; $i <= $faker->numberBetween(3, 4); $i++) {
         if ($i == 4) {
             $b = 1;
         } else {
             $b = 0;
         }
         Stage::create(['name' => 'Escenario ' . $i, 'challenge_id' => $id, 'back' => $b]);
     }
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $ageGroupIds = array();
     foreach (AgeGroup::all() as $ageGroup) {
         $ageGroupIds[] = $ageGroup->id;
     }
     $principleIds = array();
     foreach (Principle::all() as $principle) {
         $principleIds[] = $principle->id;
     }
     DB::table('drills')->delete();
     DB::table('drills')->insert([['name' => 'Close Cone Passes', 'slug' => 'close-cone-passes', 'stage_id' => Stage::where('slug', 'warmup')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Close Cone Passes 2', 'slug' => 'close-cone-passes', 'stage_id' => Stage::where('slug', 'warmup')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Close Cone Passes 3', 'slug' => 'close-cone-passes', 'stage_id' => Stage::where('slug', 'warmup')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Short Short Long', 'slug' => 'short-short-long', 'stage_id' => Stage::where('slug', 'small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Short Short Long 2', 'slug' => 'short-short-long', 'stage_id' => Stage::where('slug', 'small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Shooter Keep Shooting', 'slug' => 'shooter-keep-shooting', 'stage_id' => Stage::where('slug', 'modified-small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Short Short Long 2', 'slug' => 'short-short-long', 'stage_id' => Stage::where('slug', 'small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Short Short Long 3', 'slug' => 'short-short-long', 'stage_id' => Stage::where('slug', 'small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Short Short Long 4', 'slug' => 'short-short-long', 'stage_id' => Stage::where('slug', 'small-sided-game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Small Cones Outside Game', 'slug' => 'small-cones-outside-game', 'stage_id' => Stage::where('slug', 'game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif'], ['name' => 'Small Cones Outside Game 2', 'slug' => 'small-cones-outside-game', 'stage_id' => Stage::where('slug', 'game')->first()->id, 'age_id' => json_encode($ageGroupIds), 'principle_id' => json_encode($principleIds), 'image' => 'img/drills/100_shooter_keeper_shooting.gif']]);
     $this->command->info('Drill table seeded!');
 }
Пример #9
0
 public static function index($id, array $data = ['y' => 0, 'time_start' => 0, 'time_end' => 0])
 {
     $challenge = Challenge::find($id);
     $challenge_name = $challenge->name;
     $cha = Challenge::listGroup();
     $flag = true;
     //        if(!Round::where('challenge_id','=',$id)->first()){
     $stage = Stage::where('challenge_id', '=', $id)->where('back', '=', 0)->where('active', '=', 1)->get()->toArray();
     $team = Team::where('challenge_id', '=', $id)->where('active', '=', 1)->orderBy('id', 'RAND()')->get()->toArray();
     $numStage = count($stage) + $data['y'];
     if ($data['time_start'] == 0 && $data['time_end'] == 0) {
         $date = new DateTime(Settings::ScheTrial());
         $time = 0;
         $pag = false;
         $hora_start = $date->format('H:i:s');
         $hora_end = date('H:i:s', strtotime($date->format('H:i:s') . '+' . $time . ' 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);
     } else {
         $date = new DateTime($data['time_start']);
         $time = 0;
         $pag = false;
         $hora_start = $date->format('H:i:s');
         $hora_end = date('H:i:s', strtotime($date->format('H:i:s') . '+' . $time . ' 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);
     }
     $p = 0;
     for ($i = $data['y']; $i <= count($team) - 1; $i++) {
         if (!Round::where('team_id', '=', $team[$i]['id'])->first()) {
             Round::create(['team_id' => $team[$i]['id'], 'challenge_id' => $team[$i]['challenge_id'], 'schedule_start' => $hora_end, 'schedule_end' => $hora_start, 'stage_id' => $stage[$p]['id']]);
         }
         if ($i == $numStage - 1) {
             RoundController::index($id, $data = ['y' => $i + 1, 'time_start' => $hora_start, 'time_end' => $hora_end]);
             break;
         }
         $p++;
     }
     //        }
     if (!ENV('DEVELOP')) {
         $pag = RoundController::pagination($id);
         $flag = true;
         return view('round.index', compact('flag', 'pag', 'cha', 'challenge_name', 'id'));
     }
 }
Пример #10
0
 /**
  * Agrega el ID del stage obteniendolo de la URL
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $stage_id = Stage::where('url', $request->stage_url)->first()->id;
     $items = Item::where('stage_id', $stage_id)->orderBy('position', 'desc')->get();
     //Si el curso no tiene stages
     if ($items->count() <= 0) {
         $request['position'] = 1;
     } else {
         $lastPosition = $items->first()->position;
         $request['position'] = $lastPosition + 1;
     }
     //Agrega ID del curso al request
     $request['stage_id'] = $stage_id;
     return $next($request);
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next, $param)
 {
     switch ($param) {
         case "url":
             if (Stage::where('url', $request->url)->count() > 0) {
                 return $next($request);
             }
             break;
         case "id":
             if (Stage::find($request->id)) {
                 return $next($request);
             }
             break;
     }
     return redirect()->route('stages.index', ['course_url' => $request->course_url])->withErrors(['message' => 'Se est&aacute intentando editar una etapa inexistente']);
 }
Пример #12
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     $team = Team::where('challenge_id', '=', $id)->get();
     $group = Group::where('challenge_id', '=', $id)->get();
     $array = [];
     if (count($team) < 24) {
         $array += ['message' => 'Solo Puedes crear 4 grupos tienes ' . count($group)];
     } else {
         if (count($team) >= 24) {
             $array += ['message' => 'Solo Puedes crear 8 grupos tienes ' . count($group)];
         }
     }
     $datArray = $array;
     $stage = Stage::where('challenge_id', '=', $id)->lists('name', 'id');
     $challenge = Challenge::find($id);
     $name_challenge = $challenge->name;
     $cha = $id;
     $pag = $this->pagination($id);
     return view('groups.index', compact('stage', 'pag', 'cha', 'name_challenge', 'datArray'));
 }
Пример #13
0
 public function group($id)
 {
     $faker = Faker::create();
     $counTeam = count(Team::where('challenge_id', '=', $id)->get());
     if ($counTeam < 24) {
         $crea = 4;
     } else {
         if ($counTeam >= 24) {
             $crea = 8;
         }
     }
     $sta = Stage::where('challenge_id', '=', $id)->where('back', '=', 0)->get()->toArray();
     $y = 0;
     for ($i = 1; $i <= $crea; $i++) {
         if ($y == count($sta) - 1) {
             $y = 0;
         }
         Group::create(['name' => 'Grupo ' . $i, 'challenge_id' => $id, 'stage_id' => $sta[$y]['id']]);
         $y++;
     }
 }
Пример #14
0
 public function getStageList(Request $request)
 {
     $data = $request->all();
     $user = User::where('id', $data['user_id'])->first();
     $Stage = Stage::where('category_id', $data['stage_id'])->get();
     $UserRecord = UserRecord::where('user_id', $user['id'])->get();
     for ($i = 0; $i < count($Stage); $i++) {
         $Stage[$i]['sort'] = $Stage[$i]['id'] % 100;
     }
     if (count($UserRecord) == 0) {
         for ($i = 0; $i < count($Stage); $i++) {
             $Stage[$i]['accuracy'] = 0;
         }
         for ($i = 0; $i < count($Stage); $i++) {
             $Stage[$i]['status'] = 4;
         }
     } else {
         for ($i = 0; $i < count($Stage); $i++) {
             $UserAccuracy = UserRecord::orderBy('stage_score', 'desc')->where('stages_id', $Stage[$i]['id'])->where('user_id', $user['id'])->first();
             if ($UserAccuracy == null) {
                 $Stage[$i]['accuracy'] = 0;
             } else {
                 $Stage[$i]['accuracy'] = $UserAccuracy['accuracy'];
             }
         }
         for ($i = 0; $i < count($Stage); $i++) {
             $UserStatus = UserRecord::orderBy('stage_score', 'desc')->where('stages_id', $Stage[$i]['id'])->where('user_id', $user['id'])->first();
             if ($UserStatus == null) {
                 $Stage[$i]['status'] = 4;
             } else {
                 $Stage[$i]['status'] = $UserStatus['status'];
             }
         }
     }
     // $UserRecord = UserRecord::where('user_id',  2)->get();
     // $StageRecord = $UserRecord->where('stages_id', 102)->first();
     return response()->json(['RetCode' => '1', 'Content' => ['stages' => $Stage]]);
 }
 public function getTime(Request $request)
 {
     $da = $d = CombatRound::where('rb_combat_round.id', '=', $request->combat_id)->first();
     $data_challenge = Challenge::find($da->challenge_id);
     if ($request->flag == 'true') {
         $datos_s = CombatRound::where('rb_combat_round.stage_id', '=', $da->stage_id)->groupBy('group_id')->get()->toArray();
         for ($i = 0; $i <= count($datos_s) - 1; $i++) {
             if ($da->group_id == $datos_s[$i]['group_id']) {
                 if ($i == count($datos_s) - 1) {
                     return ['success' => false, 'datos' => 'Lo sentimos este es el ultimo grupo del escenario solo se puede retrasar tiempo.'];
                 } else {
                     $Stage_back = Stage::where('challenge_id', '=', $request->challenge_id)->where('back', '=', 1)->first();
                     $Group_upda = $datos_s[$i + 1]['group_id'];
                     $combat_update = CombatRound::where('group_id', '=', $Group_upda)->update(['stage_id' => $Stage_back->id]);
                     return ['success' => true, 'datos' => 'Escenario respaldo activo'];
                 }
                 break;
             }
         }
         Log::error($datos_s);
         dd();
     } else {
         $daTwo = $d = CombatRound::where('rb_combat_round.stage_id', '=', $da->stage_id)->where('rb_combat_round.schedule_start', '>=', $da->schedule_start)->join('rb_group_stage as r_g', 'r_g.round_id', '=', 'rb_combat_round.versus_one')->join('rb_group_stage as r_g2', 'r_g2.round_id', '=', 'rb_combat_round.versus_two')->join('rb_rounds as r_b', 'r_b.id', '=', 'r_g.round_id')->join('rb_rounds as r_b2', 'r_b2.id', '=', 'r_g2.round_id')->join('rb_team as r_t', 'r_t.id', '=', 'r_b.team_id')->join('rb_team as r_t2', 'r_t2.id', '=', 'r_b2.team_id')->join('rb_groups as r_gr', 'r_gr.id', '=', 'r_g.group_id')->join('rb_groups as r_gr2', 'r_gr2.id', '=', 'r_g2.group_id')->select('r_g.id as id_rg', 'r_g.group_id as group_id_rg', 'r_g2.id as id_rg2', 'r_g2.group_id as group_id_rg2', 'r_b.team_id as r_b_team_id', 'r_b2.team_id as r_b2_team_id', 'r_gr.name as r_gr_name', 'r_gr2.name as r_gr2_name', 'r_t.name as r_t_name', 'r_t2.name as r_t2_name', 'rb_combat_round.*')->orderBy('schedule_start', 'ASC')->get()->toArray();
         $horaInicio = '00:00:00';
         for ($i = 0; $i <= count($daTwo) - 1; $i++) {
             if ($i == 0) {
                 $duration = $request->time;
                 $horaInicio = $da->schedule_start;
                 $flag = true;
             } else {
                 $duration = $data_challenge->duration;
                 $flag = false;
             }
             $dataTime = $this->incrementTimeTwo(['time_start' => $horaInicio, 'time_durat' => $duration, 'challenge_id' => $da->challenge_id, 'flag' => $flag]);
             $horaInicio = $dataTime['hora_end'];
             $daTwo[$i]['schedule_start'] = $dataTime['hora_star'];
             $daTwo[$i]['schedule_end'] = $dataTime['hora_end'];
         }
         return ['success' => true, 'datos' => $daTwo];
     }
 }
 public function dataToCompteRenduVisite()
 {
     $data = [];
     $stage = Stage::where('idEtudiant', session('idEtudiantFocus'))->first();
     $entreprise = [];
     $contact = [];
     if (count($stage) > 0) {
         $tuteur = Tuteur::where('idUtilisateur', $stage->idTuteur)->first();
         if (count($tuteur) > 0) {
             $entreprise = Entreprise::where('id', $tuteur->idEntreprise)->first();
             if (count($entreprise) > 0) {
                 $contact = Contact::where('idEntreprise', $entreprise->id)->where('type', 1)->first();
             }
         }
     }
     if (count($entreprise) == 0) {
         $entreprise = new Entreprise();
     }
     $data['entreprise'] = $entreprise;
     if (count($stage) == 0) {
         $stage = new Stage();
     }
     $data['stage'] = $stage;
     if (count($contact) == 0) {
         $contact = new Contact();
     }
     $data['contact'] = $contact;
     // dd($entreprise);
     return $data;
 }
Пример #17
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     $stage = Stage::where('id', $id);
     // If the stage exists
     if ($stage->count() > 0) {
         // IF this stage isn't the root stage
         $stage = $stage->first();
         if ($stage->root !== true) {
             Schema::dropIfExists($stage->tableName);
             // If the delete succeeds
             if ($stage->delete()) {
                 return redirect()->route('console::flow::index')->with('alert', ['type' => 'success', 'message' => 'Stage deleted.']);
             } else {
                 return redirect()->route('console::flow::index')->with('alert', ['type' => 'failure', 'message' => 'An error occurred during deletion.']);
             }
         } else {
             return redirect()->route('console::flow::index')->with('alert', ['type' => 'failure', 'message' => 'This is the root stage, and cannot be deleted.']);
         }
     } else {
         return redirect()->route('console::flow::index')->with('alert', ['type' => 'failure', 'message' => 'Stage with ID ' . $id . 'does not exist.']);
     }
 }
 /**
  * Display the random practice plan
  *
  * @param string $ageGroup  Age group slug
  * @param string $focus     Focus slug
  * @param string $principle Principle slug
  *
  * @return Response
  */
 public function plan($ageGroup, $focus, $principle, Request $request)
 {
     $savedDrills = $request->input('saved_drills') ? $request->input('saved_drills') : array();
     $ageGroupModel = AgeGroup::where('slug', $ageGroup);
     if ($ageGroupModel->count() < 1) {
         return redirect()->route('home');
     }
     if (Focus::where('slug', $focus)->count() < 1) {
         return redirect()->route('home.focus', $ageGroup);
     }
     $principleModel = Principle::where('slug', $principle);
     if ($principleModel->count() < 1) {
         return redirect()->route('home.principle', $ageGroup, $focus);
     }
     $drills = array();
     foreach (Stage::all() as $stage) {
         $drill = null;
         if (array_key_exists($stage->id, $savedDrills)) {
             $drill = Drill::where('id', $savedDrills[$stage->id])->first();
             $drill->saved = true;
         }
         if (!$drill) {
             $drill = Drill::where('stage_id', $stage->id)->get()->random();
         }
         // Filter out age groups
         if (!in_array($ageGroupModel->get()->first()->id, $drill->age_id)) {
             continue;
         }
         // Filter out principles
         if (!in_array($principleModel->get()->first()->id, $drill->principle_id)) {
             continue;
         }
         $drill->notes = str_replace("\n", '<br>', $drill->notes);
         $drill->coaching_points = str_replace("\n", '<br>', $drill->coaching_points);
         $drills[] = $drill;
     }
     return view('home.plan')->with('ageGroup', $ageGroup)->withFocus($focus)->withPrinciple($principle)->withDrills($drills);
 }
Пример #19
0
 /**
  * Fetch visits for specified stage ID
  */
 public function fetch(Stage $stage)
 {
     $response;
     $visits = Visit::where('stage', '=', $stage->id)->get()->keyBy('id')->toArray();
     $rootStageFields = Stage::where('root', true)->first()->inputFields;
     foreach ($visits as $visitID => $visitData) {
         $models = array();
         foreach ($visitData['patients'] as $patientID) {
             $patient = Patient::where('id', $patientID);
             if ($patient->count() > 0) {
                 $models[$patientID] = $patient->first()->toArray();
             }
         }
         $visits[$visitID]['patient_models'] = $models;
     }
     if (count($visits) > 0) {
         $response = ["status" => "success", "message" => "Visits found.", "visits" => $visits];
     } else {
         $response = ["status" => "success", "message" => "No visits are currently at stage " . $stage->name . "."];
     }
     return response()->json($response);
 }
Пример #20
0
 /**
  * Return a JSON list of pharmacy data
  *
  * @return \Illuminate\Http\Response
  */
 public function pharmacy(Request $request, $method)
 {
     switch ($method) {
         case "drugs":
             $pharmacy = Stage::where('type', 'pharmacy');
             if ($pharmacy->count() > 0) {
                 return response()->json(["status" => "success", "data" => $pharmacy->first()->fields]);
             } else {
                 return response()->json(["status" => "failure", "message" => "Pharmacy not configured."]);
             }
             break;
         default:
             return response()->json(["status" => "failure", "message" => "Unknown method"]);
             break;
     }
 }
 public function ajaxChangerStatusStage()
 {
     if (Request::ajax()) {
         $data = Request::All();
         $stage = Stage::where('idTuteur', session('uid'))->where('id', $data['id'])->first();
         if ($data['status'] == "0") {
             $stage->tuteurValide = false;
         } else {
             $stage->tuteurValide = true;
         }
         $stage->save();
         return "1";
     } else {
         return "Error.";
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id Resource ID
  *
  * @return Response
  */
 public function destroy($id)
 {
     Stage::findOrFail($id)->delete();
     return redirect()->route('admin.stage.index')->withMessage('The requested stage has been deleted.');
 }
 private function traitementSubmitAvis($id, $request)
 {
     $this->validate($request, avisEtudiantRequest::rules());
     // Recupere le stage
     $stage = Stage::where('idEtudiant', session('uid'))->first();
     // Update les infos
     $stage->remunerationStage = $request->remunerationStage;
     $stage->montantRemuneration = $request->montantRemuneration;
     $stage->encadrageInformaticien = $request->encadrageInformaticien;
     $stage->appelInformaticien = $request->appelInformaticien;
     $stage->travailSeul = $request->travailSeul;
     $stage->tailleEquipe = $request->tailleEquipe;
     if ($request->typeMateriel == "PC") {
         $stage->typeMateriel = $request->typeMateriel;
     } else {
         $stage->typeMateriel = $request->typeMaterielAutreDetails;
     }
     $stage->typeSysteme = 0;
     foreach ($request->typeSysteme as $value) {
         //Valeur pour autre
         if ($value == 16) {
             $stage->typeSystemeAutre = $request->autreSysteme;
             $stage->typeSysteme += $value;
         }
         $stage->typeSysteme += $value;
     }
     $stage->langagesStage = $request->langages;
     $stage->objetPrincipal = 0;
     foreach ($request->objetStage as $value) {
         //Valeur pour autre
         if ($value == 64) {
             $stage->objetPrincipalAutre = $request->autreObjet;
         }
         $stage->objetPrincipal += $value;
     }
     $stage->satisactionStage = $request->satisactionStage;
     $stage->pourquoiSatisaction = $request->pourquoiSatisaction;
     $stage->satisactionObjectif = $request->objectifsAtteints;
     $stage->pourquoiObjectif = $request->objectifsAtteintsPourquoi;
     $stage->satisactionCours = $request->satisactionCours;
     $stage->pourquoiCours = $request->pourquoiCours;
     $stage->apportStage = $request->apportStage;
     // dd($stage);
     //Sauvegarde dans la base de données
     $stage->save();
     session()->flash('registred', true);
     return Redirect()->route('ficheEtudiant', ['id' => $id]);
 }
Пример #24
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request)
 {
     //dd($request->all());
     $d = Stage::find($request->id);
     $d->delete();
     return response()->json(['success' => true]);
 }
Пример #25
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Stage $stage)
 {
     // Delete stage
     $stage->delete();
     flash()->success('Stage has been deleted!');
     return redirect('stages');
 }
Пример #26
0
 public function getStage(Request $request)
 {
     $stage = Stage::where('challenge_id', '=', $request->challenge_id)->where('active', '=', '1')->where('active', '=', 1)->where('back', '=', 0)->lists('name', 'id')->toArray();
     return $stage;
 }
Пример #27
0
        'user_id'       => 1,
        'mas'           =>$faker->randomElement([0,1]),
        'fem'           =>$faker->randomElement([0,1]),
        'mix'           =>$faker->randomElement([0,1]),
        'active'        =>$faker->randomElement([0,1]),
        'country_id'    =>$faker->randomElement([32,76,152,188,218,222,320,340,484,558,591,600,604,620,724,840,858,859]),
        'state_id'      =>$faker->randomElement([50,33,34,43,39,44,47,42,37,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,38,36,40,49,35,48,41]),
        'city_id'       =>$faker->randomElement([
            1,11, 10,7,4,8,9,6,2,3,5,2,3,4,5,1,3,8,1,9,2,2,3,7,11,9,4,6,10,8,5,1,30,4,15,26,8,31,1,5,10,18,6,27,11,25,22,2,20,14,38,19,3,37,12,13,28,32,35,17,36,23,21,34,7,16,29,33,9,24,2,9,7,1,4,3,5,6,8,10,101,79,12,61,86,27,63,78,23,44,111,2,28,110,94,7,24,64,38,93,56,74,48,68,88,62,33,43,84,45,92,21,29,18,67,90,60,25,5,39,42,91,73,72,47,13,85,112,76,81,118,14,22,49,119,26,113,66,82,77,
            96,100,109, 31,59,114,116, 65,50,16,19,104,30,11,34, 99,41,115,52,4,106,98,58, 75,20,8,117,83,17,46,9, 108,97,107,69, 51,3,1,32,71,40,54,37, 103,89,87,35,55,102,105,15, 57,53,6,10,36,70,80, 19,17,54,4,6,31, 50,5, 35, 13, 23, 10, 25, 34, 40, 48, 63, 43, 37, 28, 53, 1, 15, 52, 2, 38, 42, 21, 55, 45, 22, 61, 57, 49, 27, 9, 18, 26, 24, 12, 66, 51, 47, 20, 41, 30, 8, 65,46,
            29, 59, 56, 33, 64, 7, 60, 11, 62, 67, 16, 58, 32, 3,39, 44, 36, 14, 10, 2, 14, 3, 4, 15, 5, 6, 7, 8, 16, 9, 11, 12, 17, 13, 5, 1, 39, 3, 28, 2, 37, 34, 32, 19, 26, 8, 21, 20, 22, 16, 38, 33, 23, 14, 7, 12, 13, 36, 10, 17, 9, 25, 11, 30, 35, 18, 15, 29, 24, 4, 31, 27, 6, 15, 37, 26, 31, 25, 8, 17, 27, 24, 23, 12, 1, 16, 20, 30, 22, 3, 14, 29, 33, 43, 45, 6, 34, 13, 40, 32, 7, 5, 9, 35, 44, 11, 42, 18, 4, 19, 10, 2, 39, 38, 21, 28, 46, 36, 41, 29, 32, 40, 61, 12, 44, 51, 56, 1, 39, 53, 35, 34, 59, 75, 55, 15, 60, 49, 58, 37, 47, 31, 7, 6, 26, 17, 67, 27, 50, 64, 22, 3, 73, 54, 68, 48, 16, 38, 57, 11, 14, 21, 45, 8, 19, 24, 28, 79, 2, 74, 42, 33, 70, 5, 66, 65, 69, 72, 76, 10, 20, 41, 81, 63, 9, 52, 43, 78, 4, 46, 62, 71, 30, 25, 18, 13, 80, 77, 23, 36, 48, 38, 39, 5, 52, 51, 82, 31, 49, 47, 40, 18, 30, 84, 43, 15, 58, 6, 29, 59, 44, 3, 55, 54, 23, 9, 41, 50, 19, 67, 70, 76, 63, 17, 64, 65, 74, 10, 13, 28, 46, 32, 25, 11, 26, 80, 78, 42, 62, 34, 73, 71, 33, 81, 14, 79, 68, 12, 20, 37, 36, 35, 27, 53, 4, 60, 24, 1, 45, 22, 77, 2, 16, 56, 57, 69, 83, 75, 66, 8, 72, 7, 21, 61, 39, 120, 71, 45, 83, 9, 5, 101, 124, 1, 29, 98, 97, 70, 2, 114, 119, 10, 50, 44, 51, 30, 66, 123, 42, 61, 115, 19, 104, 25, 81, 41, 31, 76, 94, 40, 55, 36, 75, 7, 6, 3, 95, 77, 38, 62, 58, 80, 73, 46, 78, 74, 8, 125, 91, 116, 35, 118, 60, 117, 111, 53, 64, 109, 72, 93, 105, 13, 63, 47, 18, 16, 48, 33, 110, 17, 12, 28, 11, 84, 67, 20, 100, 24, 88, 90, 52, 32, 34, 54, 37, 102, 106, 68, 43, 15,
            21, 27, 22, 23, 79, 26, 14, 89, 92, 82, 86, 4, 96, 107, 57, 59, 112, 69, 121, 85, 113, 99, 122, 108, 103, 65, 87, 49, 56, 106, 1, 3, 85, 14, 102, 56, 64, 74, 124, 48, 42, 47, 87, 5, 114, 111,
            32, 41, 78, 66, 116, 110,7, 86, 118, 82, 123, 77, 8, 105, 80, 97, 21, 113, 117, 4, 40, 107, 119, 51, 115, 67, 76, 54, 55, 18, 27, 73, 90, 72, 49, 88, 52, 63, 12, 6, 98, 101, 43, 19, 62, 37, 13, 57, 104, 71, 45, 79, 112, 26, 60, 38, 46, 95, 23, 35, 121,91, 24, 53, 109, 108, 33, 120, 96, 10, 36, 20, 81, 44, 125, 59, 92, 75, 2, 65, 16, 61, 84, 100, 28, 69, 93, 99, 30, 11, 31, 29, 70, 39, 25, 122, 83, 22, 103, 17, 89, 68, 50, 94, 9, 15, 34, 58, 53, 37, 16, 73, 100, 48, 1, 49, 71, 113, 4, 63, 107, 94, 70, 44, 54, 36, 20, 27, 18, 88, 78, 3, 110, 40, 72, 76, 11, 74, 103, 62, 105, 86, 106, 42, 69, 60, 28, 109, 67, 51, 45, 104, 23, 108, 30, 85, 25, 43, 84, 19, 95, 91, 102, 21, 65, 24, 56, 90, 75, 68, 83, 58, 12, 89, 2, 6, 64, 14, 26, 15, 8, 96, 10, 52, 31, 17, 93, 34, 50, 41, 80, 22, 10, 92, 7, 5, 98, 61, 47, 112, 99, 46, 81, 66, 32, 39, 82, 97, 111, 87, 33, 59, 55, 79, 9, 35, 29, 57, 13, 38, 77, 7, 9, 20, 23, 26, 11, 18, 15, 5, 21, 14, 1, 17, 4, 29, 6, 8, 24, 31, 28, 22, 30, 27, 2, 16, 33, 32, 12, 19, 13, 3, 10, 25, 17, 18, 15, 1, 16, 5, 9, 19, 11, 10, 4, 20, 12, 8, 13, 14, 7, 2, 6, 3, 39, 5, 32, 37, 8, 44, 51, 50, 40, 45, 12, 47, 1, 28, 25, 2, 23, 11, 35, 18, 21, 48, 19, 46, 10, 6, 41, 34, 16, 42, 27, 3, 15, 20, 13, 26, 31, 49, 4, 22, 9, 38, 43, 33, 30, 17, 29, 14, 7, 24, 36, 67, 338, 175, 161, 179, 150, 487, 294, 193, 45, 483, 178, 77, 63, 102, 84, 539, 531, 33, 293, 135, 227, 426, 494, 553, 157, 91, 87, 519, 409, 184, 44, 169, 21, 2, 278, 9, 309, 166, 134, 417, 232, 559, 136, 41, 406, 354, 228, 142, 322, 374, 29, 490, 545, 434, 244, 163, 396, 40, 187, 234, 109, 171, 249, 116, 58, 206, 431, 416, 177, 24, 355, 27, 330, 276, 438, 98, 139, 19, 527, 182, 425, 220, 326, 558, 313, 436, 311, 478, 62, 214, 336, 458, 1, 296, 42, 173, 335, 260, 544, 359, 196, 419, 267, 191, 247, 504, 496, 35, 363, 288, 365, 262, 443, 473, 156, 457, 222, 471, 223, 280, 541, 201, 128, 432, 514, 442, 97, 216, 257, 100, 120, 114, 503, 38, 138, 246, 303, 522, 299, 460, 468, 205, 498, 212, 189, 39, 459, 22, 340, 181, 373, 476, 160, 568, 89, 456, 4, 400, 462, 484, 186, 567, 199, 290, 34, 99, 259, 251, 183, 549, 32, 455, 165, 245, 261, 55, 381, 352, 237, 164, 529, 520, 524, 176, 548, 18, 464, 552, 151, 47, 256, 283, 287, 488, 129, 422, 537, 501, 230, 81, 11, 376, 65, 152, 461, 339, 556, 540, 321, 547, 106, 486, 521, 405, 105, 93, 341, 221, 121, 499, 346, 518, 423, 536, 332, 479, 6, 270, 264, 395, 451, 404, 304, 463, 523, 96, 224, 215, 493, 140, 250, 569, 469, 286, 348, 528, 208, 242, 16, 397, 210, 317, 239, 383, 480, 408, 172, 370, 127, 258, 240, 50, 119, 379, 86, 532, 110, 252, 430, 320, 445, 218, 46, 562, 281, 54, 147, 331, 144, 492, 195, 94, 217, 511, 564, 329, 274, 255, 43, 14, 30, 505, 441, 66, 130, 5, 141, 557, 265, 525, 75, 143, 327, 25, 502, 517, 190, 207, 554, 60, 437, 394, 454, 31, 337, 435, 275, 3, 323, 231, 427, 10, 551, 343, 560, 411, 546, 145, 349, 356, 298, 475, 506, 78, 219, 380, 51, 550, 197, 233, 194, 118, 226, 333, 325, 449, 131, 125, 200, 64, 357, 204, 122, 410, 8, 316, 428, 74, 361, 79, 470, 418, 440, 472, 36, 508, 412, 52, 53, 305, 421, 515, 307, 308, 248, 124, 453, 282, 59, 289, 351, 235, 170, 538, 146, 353, 384, 61, 154, 362, 167, 126, 209, 319, 391, 159, 344, 291, 254, 533, 95, 424, 263, 347, 279, 512, 148, 495, 236, 211, 324, 509, 366, 85, 113, 401, 117, 439, 12, 71, 306, 253, 413, 266, 73, 20, 37, 447, 300, 76, 415, 26, 446, 133, 371, 481, 372, 269, 510, 297, 382, 392, 88, 444, 500, 377, 570, 123, 378, 271, 399, 92, 375, 390, 385, 310, 107, 83, 23, 174, 350, 342, 565, 403, 115, 389, 13, 108, 555, 295, 273, 292, 388, 387, 104, 48, 369, 398, 358, 386, 137, 566, 491, 450, 448, 516, 158, 277, 420, 535, 229, 429, 149, 155, 477, 28, 243, 530, 192, 68, 360, 452, 103, 7, 315, 132, 49, 284, 368, 112, 301, 393, 162, 101, 72, 561, 328, 238, 241, 69, 17, 15, 203, 80, 542, 268, 563, 534, 482, 185, 180, 56, 345, 111, 402, 474, 285, 485, 168, 507, 467, 302, 188, 466, 312, 70, 225, 82, 90, 367, 489, 414, 334, 543, 213, 272, 364, 314, 497, 202, 433, 526, 153, 318, 114, 181, 136, 90, 34, 41, 140, 119, 106, 15, 64, 111, 194, 86, 187, 178, 197, 109, 57, 100, 71, 8, 91, 183, 213, 89, 184, 53, 208, 49, 6, 167, 123, 14, 162, 215, 68, 107, 30, 28, 77, 210, 78, 202, 72, 84, 80, 158, 192, 29, 88, 216, 101, 43, 25, 76, 2, 39, 16, 172, 200, 207, 211, 83, 212, 105,94, 174, 186, 204, 75, 173, 17, 54, 199, 44, 170, 132, 180, 134, 143, 122, 48, 74, 60, 26, 138, 19, 102, 126, 125, 188, 175, 148, 69, 121, 166, 85, 22, 5, 33, 165, 185, 168, 176, 51, 21, 159, 133, 201, 62, 7, 31, 146, 52, 206, 169, 160, 87, 73, 47, 32, 198, 56, 81, 11, 191, 157, 42, 147, 24, 59, 9, 139, 155, 113, 66, 82, 37, 196, 190, 3, 127, 141, 112, 135, 55, 117, 128, 108, 137, 67, 179, 93, 58, 116, 50, 163, 1, 104, 96, 152, 4, 142, 65, 12, 130, 164, 40, 153, 97, 151, 193, 150, 95, 131,70, 118, 38, 144, 115, 154, 110, 45, 23, 63, 99, 182, 189, 20, 171, 79, 98, 203, 205, 177, 92, 156, 161, 46,149, 103, 18, 120, 209, 124, 27, 195, 10, 61, 217, 145, 13, 214, 129, 35, 36, 14, 11, 5, 2, 9, 10, 3, 13, 4, 15, 18, 7, 12, 17, 16, 1, 6, 8, 4, 2, 7, 3, 5, 1, 8, 9, 6, 28, 35, 9, 1, 21, 46, 44, 7, 6, 15, 25, 33, 49, 20, 48, 47, 17, 22, 45, 56, 51, 4, 13, 16, 40, 10, 58, 2, 5, 8, 52, 30, 50, 55, 32, 43, 24, 11, 27, 36, 23, 3, 19, 31, 12, 41, 34, 26, 42, 39, 14, 18, 54, 53, 38, 29, 37, 57, 6, 18, 3, 5, 13, 11, 1, 15, 2, 7, 10, 17, 12, 9, 4, 8, 14, 16, 30, 56, 20, 55, 48, 70, 17, 4, 65, 7, 46, 60, 16, 64, 47, 43, 35, 59, 36, 39, 2, 27, 41, 15, 10, 31, 40, 28, 8, 23, 32, 38, 67, 58, 19, 6, 22, 11, 57, 24, 63, 68, 45, 34, 13, 66, 1, 14, 53, 50, 18, 42, 33, 12, 26, 71, 25, 29, 72, 21, 37, 62, 52, 54, 61, 9, 5, 51, 49, 44, 3, 69, 4, 10, 13, 5, 8, 2, 14, 6, 12, 3, 11, 16, 9, 15, 17, 1, 7, 41, 19, 13, 8, 22, 40, 35, 10, 36, 37, 18, 34, 1, 30, 16, 20, 42, 39, 17, 26, 6, 31, 29, 27, 25, 14, 24, 15, 7, 32, 33, 23, 5, 38, 9, 3, 2, 12, 43, 11, 21, 4, 28, 87, 182, 92, 79, 25, 128, 26, 136, 1, 132, 194, 177, 187, 36, 93, 112, 106, 2, 166, 95, 9, 4, 38, 164, 46, 65, 17, 134, 191, 126, 16, 193, 123, 133, 152, 161, 121, 155, 129, 56, 55, 63, 35, 78, 13, 205, 60, 154, 150, 34, 167, 153, 151, 72, 76, 202, 170, 198, 27, 180, 83, 58, 160, 189, 175, 157, 33, 203, 64, 50, 103, 67, 37, 51, 40, 66, 131, 124, 69, 158, 102, 211, 183, 86, 23, 10, 107, 156, 163, 114, 109, 96, 57, 197, 42, 192, 88, 24, 162, 188, 146, 179, 71, 29, 8, 47, 127, 62, 186, 80, 165, 43, 200, 7, 148, 100, 90, 105, 28, 118, 135, 101, 81, 22, 85, 68, 44, 99, 115, 138, 30, 18, 6, 147, 74, 184, 19, 195, 20,168, 140, 185, 98, 113, 41, 117, 53, 52, 196, 14, 21, 125, 31, 49, 201, 159, 110, 137, 171, 173, 174, 181, 75, 11, 97, 207, 208, 45, 84, 5, 12, 178, 139, 119, 176, 190, 54, 169, 130, 212, 77, 94, 141, 143, 15, 73, 32, 149, 104, 209, 122, 59, 3, 142, 144, 116, 145, 172, 89, 199, 120, 48, 206, 82, 111, 39, 204, 108, 70, 91, 61, 210, 33, 15, 56, 24, 36, 29, 60, 53, 6, 20, 45, 14, 34, 21, 12, 5, 3, 11, 31, 40, 55, 43, 39, 35, 38, 52, 13, 30, 47, 46, 4, 8, 7, 16, 37, 2, 1, 26, 9, 18, 19, 23, 57, 32, 49, 51, 44, 54, 58, 42, 41, 10, 48, 50, 28, 22, 59, 17, 27, 25, 50, 59, 20, 39, 13, 105, 38, 100, 44, 87, 11, 41, 90, 2, 95, 101, 82, 26, 83, 9, 68, 106, 52, 4, 51, 54, 7, 5, 93, 35, 74, 27, 84, 78, 88, 72, 86, 77, 40, 34, 103, 67, 15, 36, 64,
            37, 29, 28, 57, 65, 6, 70, 12, 31, 97, 60, 30, 42, 71, 80, 69, 96, 61, 32, 85, 8, 91, 17, 21, 92, 43, 14, 81, 19, 102, 99, 48, 63, 55, 23, 45, 76, 1, 33, 53,62, 47, 25, 18, 89, 56, 66, 46, 24, 49, 75, 10, 104, 58, 22, 73, 94, 16, 98, 79, 3, 56, 32, 50, 7, 27, 26, 41, 22, 29, 14, 39, 51, 6, 5, 37, 13, 17, 57, 12, 8, 36, 16, 25, 24, 53, 35, 52, 38, 54, 10, 42, 40, 49, 9, 21, 20, 31, 43, 55, 46, 15, 19, 44, 18, 48, 30,3, 45, 4, 47, 58, 11, 28, 34, 2, 1, 23, 33, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 130, 10, 18, 3, 141, 142, 143, 144, 145, 82, 19, 44, 107, 146, 73, 18, 53, 2, 19, 147, 148, 149, 150, 20, 21, 151, 152, 22, 23, 24, 153, 213, 571, 218, 219, 19, 20, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 25, 21, 19, 220, 221, 61,26, 214, 154, 155, 27, 59, 74, 115, 28, 156,29, 30, 2, 157, 158, 159, 12, 160, 161, 162, 45, 31, 11, 11, 85, 60, 571, 12, 116, 127, 68, 69, 54, 20, 32, 222, 34, 55, 6, 46, 33, 163, 34, 56, 164, 35, 61, 128, 165, 13, 21, 10, 36, 129, 47, 37, 130, 38, 131, 595, 39, 223, 596,597, 598, 599
        ]),
    ];
});*/
$factory->define(App\Stage::class, function (Faker\Generator $faker) {
    $faker->addProvider(new Faker\Provider\Internet($faker));
    return ['name' => $faker->userName, 'challenge_id' => $faker->numberBetween(1, 8)];
});
$factory->define(App\Group::class, function (Faker\Generator $faker) {
    $faker->addProvider(new Faker\Provider\DateTime($faker));
    return ['name' => $faker->century, 'challenge_id' => $faker->numberBetween('1', count(Challenge::get())), 'stage_id' => $faker->numberBetween('1', count(Stage::get()))];
});
$factory->define(App\User::class, function (Faker\Generator $faker) {
    return ['name' => $faker->name, 'last_name' => $faker->lastName, 'last_name_m' => $faker->lastName, 'email' => $faker->unique()->email, 'username' => $faker->unique()->userName, 'email_alter' => $faker->email, 'password' => bcrypt('123'), 'password_two' => base64_encode('123'), 'role_id' => 1];
});
$factory->define(App\Team::class, function (Faker\Generator $faker) {
    return ['institution_id' => $faker->numberBetween('1', count(Institution::get())), 'name' => $faker->name, 'name_altered' => $faker->name, 'robot_name' => $faker->userName, 'gender' => $faker->randomElement(['MAS', 'FEM', 'MIX']), 'challenge_id' => $faker->numberBetween('1', count(Challenge::get())), 'degree_id' => $faker->numberBetween('1', count(Degree::get()))];
});
Пример #28
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($course_url, $id)
 {
     Stage::destroy($id);
     return redirect()->route('stages.index', ['course_url' => $course_url]);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param int $id Resource ID
  *
  * @return Response
  */
 public function edit($id)
 {
     $drill = Drill::findOrFail($id);
     return view('admin.drill.edit')->withDrill(Drill::findOrFail($id))->with('ageGroups', AgeGroup::all())->withPrinciples(Principle::all())->withStages(Stage::all());
 }
Пример #30
0
 public static function statusCreate()
 {
     $stage = Stage::where('id', '=', 1)->firstOrFail();
     return $stage->stage;
 }