/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index($idlevel, $level, $idspeciality, $speciality, $idmaterial, $material, $idlesson, $lesson) { $newsallarticles = Article::where('stat', '=', 'nouvelles')->orderBy('id', 'desc')->take(3)->get(); $bacallarticles = Article::where('stat', '=', 'apres-bac')->orderBy('id', 'desc')->take(3)->get(); $speciality = str_replace('-', ' ', $speciality); $material = str_replace('-', ' ', $material); $lesson = str_replace('-', ' ', $lesson); $lessonnames = Lesson::where('id', '=', $idlesson)->get(); $specialitynames = Category::where('id', '=', $idspeciality)->get(); $alllessons = Lesson::groupBy('categories_id')->orderBy('id', 'desc')->get(); $rounds1 = Lesson::where('round', '=', '1ere-session')->get(); $rounds2 = Lesson::where('round', '=', '2eme-session')->get(); $fullcat = Category::get(); $all = Category::where('parent', '=', 0); $level = str_replace('-', ' ', $level); $levelnames = Category::where('id', '=', $idlevel)->get(); $materialnames = Category::where('id', '=', $idmaterial)->get(); foreach ($lessonnames as $lessonname) { $ar_lessonname = $lessonname->ar_title; } foreach ($specialitynames as $specialityname) { $ar_specialityname = $specialityname->ar_name; } foreach ($levelnames as $levelname) { $ar_levelname = $levelname->ar_name; } foreach ($materialnames as $materialname) { $ar_materialname = $materialname->ar_name; } return view(proj . '.resumes', ['title' => $ar_lessonname, 'ar_materialname' => $ar_materialname, 'ar_levelname' => $ar_levelname, 'rounds1' => $rounds1, 'rounds2' => $rounds2, 'asccat' => $all->get(), 'allcat' => $all->orderBy('id', 'desc')->get(), 'fullcat' => $fullcat, 'idlevel' => $idlevel, 'idspeciality' => $idspeciality, 'idmaterial' => $idmaterial, 'idlesson' => $idlesson, 'level' => $level, 'newsallarticles' => $newsallarticles, 'bacallarticles' => $bacallarticles, 'alllessons' => $alllessons, 'ar_lessonname' => $ar_lessonname, 'lesson' => $lesson, 'material' => $material, 'ar_specialityname' => $ar_specialityname, 'speciality' => $speciality]); }
public function lessons($domain, $courseId) { $course = Course::find($courseId); if (!$course) { return response()->json(['error' => "Môn học không tồn tại"], 404); } $lessons = Lesson::where('course_id', $courseId)->get(); return response()->json(['course' => ['id' => $course->id, 'name' => $course->name, 'avatar_url' => $course->icon_url], 'lessons' => $lessons]); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function lesson($id_lessTyp, $id_less) { $lekcije = Lesson::where('id', $id_less)->get(); $lista = Lesson::where('id', $id_less)->with(['user' => function ($q) { $q->where('users.id', Auth::user()->id); }])->get(); $userId = Auth::user()->id; $idLe = $id_less; return view('lesson', compact('lekcije', 'userId', 'idLe', 'lista', 'id_lessTyp')); }
public static function lessons() { if (Gate::allows('view_lesson')) { return Lesson::all(); } elseif (Auth::check() && Gate::allows('view_own_lesson')) { return Lesson::where('user_id', Auth::id())->get(); } else { return null; } }
public function searchlessons(Request $request) { if ($request->ajax()) { if ($request->has('id')) { if ($request->input('id') > 0) { $find_lesson = Lesson::where('categories_id', '=', $request->input('id'))->get(); $scontent = view(athr . '.searchlessons', ['find_lesson' => $find_lesson])->render(); return response()->json($scontent); } } } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { // $lesson = Lesson::where('user_id', $request->user()->id)->get()->medias; if (Auth::user()->group_id != 1) { $lessons = Lesson::where('category_id', Auth::user()->category_id)->get(); $infos = Info::all(); $notes = Note::where('user_id', Auth::user()->id)->get(); } else { $lessons = Lesson::all(); $infos = Info::all(); $notes = Note::where('user_id', Auth::user()->id)->get(); } return view('home.index', compact('lessons', 'infos', 'notes')); }
public function note(Request $request, $courseSlug, $lessonSlug) { $course = Course::where('slug', $courseSlug)->firstOrFail(); $lesson = Lesson::where('slug', $lessonSlug)->where('course_id', $course->id)->firstOrFail(); $user = User::findOrFail($request->user_id); if (!Auth::user()->accompanies->contains($user)) { abort(403); } $note = $lesson->notes()->firstOrNew(['user_id' => $user->id, 'companion_id' => Auth::user()->id]); if (empty($request->message)) { $note->delete(); } else { $note->note = $request->message; $note->save(); } return back(); }
public function deleteLesson($id) { $lessons = Lesson::where('id', $id)->get(); $lesson = $lessons[0]->delete(); return redirect('/lessonAdmin'); }
/** * Display the specified resource. * * @param $slug * @return Response * @internal param int $id */ public function show($slug) { $lesson = Lesson::where('slug', $slug)->first(); return view('lessons.show', compact('lesson')); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($description) { $lesson = Lesson::where('description', $description)->firstOrFail(); return view('topic.htmls', compact('lesson')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $lessons = Lesson::where('user_id', Auth::user()->id)->paginate(); return view('teacher.lessons.index')->with('lessons', $lessons)->with('title', trans('titles.lessons')); }
@extends(proj.'.index') @section('dirassa') @include(proj.'.lessons_first_title') <!--content--> <?php $lessonspdf = \App\Lesson::where('id', '=', $idlesson)->get(); foreach ($lessonspdf as $lessonpdf) { $lessonspdf_path = $lessonpdf->lesson_pdf; $lessonspdf_id = $lessonpdf->id; $lessonspdf_fr = $lessonpdf->fr_title; } ?> <div class="container"> <h2 class="title_content">{{$ar_lessonname}}</h2> <span class="title_lign pink accent-2"></span> </div> <object data="{{ASSET}}/pdf/{{$lessonspdf_path}}" type="application/pdf" width="100%" height="800px"> <p>أنت لا تتوفر على تطبيق pdf في متصفحك ليمكنك من مشاهدة مباشرة للملف لكن يمكنك تحميل الملف من هنا <a href="{{ASSET}}/pdf/maths.pdf">تحميل الملف</a></p> </object> <div class="container"> <div class="fb-comments" data-href="http://developers.facebook.com/{{$lessonspdf_path}}" data-numposts="5"></div> </div> <div class="clear"></div> @include(proj.'.round') @include(proj.'.slide_post') @stop
@extends(proj.'.index') @section('dirassa') @include(proj.'.resumes_first_title') <!--content--> <?php $sommariespdf = \App\Lesson::where('id', '=', $idlesson)->get(); foreach ($sommariespdf as $sommariepdf) { $sommarypdf_path = $sommariepdf->sommary_pdf; } ?> <div class="container"> <h2 class="title_content">{{$ar_lessonname}}</h2> <span class="title_lign pink accent-2"></span> </div> <object data="{{ASSET}}/pdf/{{$sommarypdf_path}}" type="application/pdf" width="100%" height="800px"> <p>أنت لا تتوفر على تطبيق pdf في متصفحك ليمكنك من مشاهدة مباشرة للملف لكن يمكنك تحميل الملف من هنا <a href="{{ASSET}}/pdf/{{$sommarypdf_path}}">تحميل الملف</a></p> </object> <div class="container"> <div class="fb-share-button" data-href="https://developers.facebook.com/{{$sommarypdf_path}}" data-layout="button_count"></div> <div class="fb-comments" data-href="http://developers.facebook.com/{{$sommarypdf_path}}" data-numposts="5"></div> </div> <div class="clear"></div> @include(proj.'.round') @include(proj.'.slide_post') @stop
public function index(Request $request) { $lesson = Lesson::where('user_id', $request->user()->id)->get(); return view('lessons.list', ['lessons' => $lesson]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $lessons = Lesson::where('user_id', Auth::user()->id)->get()->lists('name', 'id'); return view('notes.index', ['lessons' => $lessons]); }
public function saves() { $watchLater = WatchLater::all(); $lessons = []; foreach ($watchLater as $item) { $lessons[] = Lesson::where('id', $item->lesson_id)->first(); } return view('lessons.index', compact('lessons')); }
@extends(proj.'.index') @section('dirassa') @include(proj.'.exercices_first_title') <!--content--> <?php $exercicespdf = \App\Lesson::where('id', '=', $idlesson)->get(); foreach ($exercicespdf as $exercicepdf) { $exercicepdf_path = $exercicepdf->exercice_pdf; $exercicecorrpdf_path = $exercicepdf->exercice_corr_pdf; $exercicecorrpdf_id = $exercicepdf->id; $exercicecorrpdf_fr = $exercicepdf->fr_title; } ?> <div class="container"> <h2 class="title_content">{{$ar_lessonname}}</h2> <span class="title_lign pink accent-2"></span> </div> <object data="{{ASSET}}/pdf/{{$exercicepdf_path}}" type="application/pdf" width="100%" height="800px"> <p>أنت لا تتوفر على تطبيق pdf في متصفحك ليمكنك من مشاهدة مباشرة للملف لكن يمكنك تحميل الملف من هنا <a href="{{ASSET}}/pdf/maths.pdf">تحميل الملف</a></p> </object> <h2 class="title_content">الحل</h2> <span class="title_lign pink accent-2"></span> <object data="{{ASSET}}/pdf/{{$exercicecorrpdf_path}}" type="application/pdf" width="100%" height="800px"> <p>أنت لا تتوفر على تطبيق pdf في متصفحك ليمكنك من مشاهدة مباشرة للملف لكن يمكنك تحميل الملف من هنا <a href="{{ASSET}}/pdf/examen.pdf">تحميل الملف</a></p> </object> <div class="container"> <div class="fb-comments" data-href="http://developers.facebook.com/{{$exercicepdf_path}}" data-numposts="5"></div> </div> <div class="clear"></div> @include(proj.'.round') @include(proj.'.slide_post')
public function displayPrivateLesson($lesson_id) { $lesson = Lesson::where('id', $lesson_id)->where('user_id', Auth::user()->id)->first(); if ($lesson) { $channel = Channel::where('user_id', Auth::user()->id)->first(); if ($channel) { return view('private_lesson', ['title' => $lesson->title, 'lesson_content' => $lesson->lesson_content, 'broadcast_id' => $channel->broadcast_id]); } else { //TODO: with flash? return redirect('/admin'); } } else { //TODO: with flash? return redirect('/admin'); } }