Exemplo n.º 1
0
 /**
  * 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]);
 }
Exemplo n.º 2
0
 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]);
 }
Exemplo n.º 3
0
 /**
  * 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'));
 }
Exemplo n.º 4
0
 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;
     }
 }
Exemplo n.º 5
0
 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);
             }
         }
     }
 }
Exemplo n.º 6
0
 /**
  * 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'));
 }
Exemplo n.º 7
0
 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();
 }
Exemplo n.º 8
0
 public function deleteLesson($id)
 {
     $lessons = Lesson::where('id', $id)->get();
     $lesson = $lessons[0]->delete();
     return redirect('/lessonAdmin');
 }
Exemplo n.º 9
0
 /**
  * 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'));
 }
Exemplo n.º 10
0
 /**
  * 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'));
 }
Exemplo n.º 11
0
 /**
  * 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'));
 }
Exemplo n.º 12
0
@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
Exemplo n.º 13
0
@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
Exemplo n.º 14
0
 public function index(Request $request)
 {
     $lesson = Lesson::where('user_id', $request->user()->id)->get();
     return view('lessons.list', ['lessons' => $lesson]);
 }
Exemplo n.º 15
0
 /**
  * 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]);
 }
Exemplo n.º 16
0
 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'));
 }
Exemplo n.º 17
0
@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')
Exemplo n.º 18
0
 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');
     }
 }