Ejemplo n.º 1
0
 public function create()
 {
     $instructors = DB::table('users')->where('user_role', '2')->lists('user_name', 'user_id');
     $course_times = Course_time::lists('course_time_name', 'course_time_id');
     $semesters = Semester::lists('semester_name', 'semester_id');
     return view('courses.create')->with('instructors', $instructors)->with('semesters', $semesters)->with('course_times', $course_times);
 }
Ejemplo n.º 2
0
 public static function checkinator()
 {
     //dd(Course_time::getCurrentTimeBlock());
     $currentBlock = Course_time::getCurrentTimeBlock()->course_time_name;
     $currentBlockID = Course_time::getCurrentTimeBlock()->course_time_id;
     echo "We are currently in the " . $currentBlock . " Course block. <br>";
     $enrolled = Auth::user()->course_checkin();
     echo "You are now able to checkin to course: " . $enrolled->course_name;
     //return var_dump($enrolled->first()->course_name);
 }
Ejemplo n.º 3
0
 public function course_checkin()
 {
     if (isset(Course_time::getCurrentTimeBlock()->course_time_id)) {
         $timeBlock = Course_time::getCurrentTimeBlock()->course_time_id;
         $enrolled = DB::table('courses')->leftJoin('rosters', 'rosters.course_id', '=', 'courses.course_id')->where('rosters.user_id', '=', Auth::user()->user_id)->where('courses.course_time_id', '=', $timeBlock)->first();
         return $enrolled;
     } else {
         return false;
     }
 }