public function edit($epreuve_id) { if (!Test::exists($epreuve_id)) { return redirect('/'); } if (!Test::isTutorTest(User::id(), $epreuve_id)) { return redirect('/'); } return view('tuteur.modifier_correction')->with(['first_name' => User::firstName(), 'last_name' => User::lastName(), 'corrections' => Test::getCorrection($epreuve_id), 'baremes' => General::getBaremes(), 'epreuve_id' => $epreuve_id, 'obsolete' => Test::isRankingObsolete($epreuve_id)]); }
public static function addCategorie($request) { $file_name = ''; if (Input::hasFile('file') && Input::file('file')->isValid()) { $file = Input::file('file'); $file_name = str_random(23) . '.' . $file->getClientOriginalExtension(); $file->move(public_path('assets\\img'), $file_name); } $categorie = new self(); $categorie->title = $request['title']; $categorie->article = $request['article']; $categorie->url = General::make_url($request['title']); $categorie->image = !empty($file_name) ? $file_name : 'default.jpg'; $categorie->save(); \Session::flash('sm', 'Saved !'); }
public function year($min, $max) { $filter = "Year of inception"; $ids = []; // return 'min:'.$min.'max:'.$max; if ($min === '0' && $max === '1950') { $users = General::where('year_of_inception', '<=', $max)->get(); foreach ($users as $user) { $ids[$user->user_id] = $user->user_id; } $products = Product::whereIn('user_id', $ids)->paginate(12); return view('search.search', compact('products', 'min', 'max', 'filter')); } if ($min === '2010' && $max === '0') { $users = General::where('year_of_inception', '>=', $max)->get(); foreach ($users as $user) { $ids[$user->user_id] = $user->user_id; } $products = Product::whereIn('user_id', $ids)->paginate(12); return view('search.search', compact('products', 'min', 'max', 'filter')); } if ($min != null && $max != null) { $users = General::where('year_of_inception', '>=', $min)->where('year_of_inception', '<=', $max)->get(); foreach ($users as $user) { $ids[$user->user_id] = $user->user_id; } $products = Product::whereIn('user_id', $ids)->paginate(12); return view('search.search', compact('products', 'min', 'max', 'filter')); } if ($min === null && $max === null) { return redirect('/search'); } }
public static function getAllTests() { return DB::table('epreuve')->where('epreuve.session_scolaire_id', General::currentSessionId())->join('ue', 'epreuve.ue_id', '=', 'ue.id')->orderBy('epreuve.date')->select('epreuve.id as id', 'epreuve.titre as titre', 'epreuve.date as date', 'epreuve.visible as visible', 'ue.sigle as ue')->get(); }
public function postParams(StudentParamsRequest $r) { User::setParams($r->scolarite, $r->profil); Session::flash('flash_message', 'Vos paramètres ont bien été enregistrés'); return view('etudiant.parametres')->with(['nb_results_not_read' => User::nbResultsNotRead(), 'first_name' => User::firstName(), 'last_name' => User::lastName(), 'parameters_defined' => User::parametersDefined(), 'user_profile' => User::profile(), 'profiles' => General::profils(), 'user_scolarite' => User::scolarite()]); }