Пример #1
0
 static function batchesByClassIdSeasonId($classId, $seasonId)
 {
     return Batches::with('LeadInstructors')->where('season_id', '=', $seasonId)->where('class_id', '=', $classId)->where('franchisee_id', '=', Session::get('franchiseId'))->get();
     //   return Batches:://where('season_id','=',$seasonId)
     //                ->where('class_id', '=', $classId)
     //                ->where('franchisee_id', '=', Session::get('franchiseId'))
     //                                   get();
     //return Batches::with('Classes')->where('class_id', '=', $classId)->get();
 }
Пример #2
0
 public function attendance($id)
 {
     if (Auth::check()) {
         $currentPage = "BATCHES";
         $mainMenu = "COURSES_MAIN";
         $studentsInBatch = StudentClasses::with('Students')->where('batch_id', '=', $id)->count();
         $batch = Batches::where('id', '=', $id)->first();
         $attendanceArray = BatchSchedule::getAttendanceTable($id);
         $lead = Batches::with('LeadInstructors')->find($id);
         $alternate = Batches::with('AlternateInstructors')->find($id);
         if (isset($lead->LeadInstructors)) {
             $leadInstructor = $lead->LeadInstructors->first_name . ' ' . $lead->LeadInstructors->last_name;
         } else {
             $leadInstructor = "";
         }
         if (isset($alternate->AlternateInstructors)) {
             $alternateInstructor = $alternate->AlternateInstructors->first_name . ' ' . $alternate->AlternateInstructors->last_name;
         } else {
             $alternateInstructor = "";
         }
         $dataToView = array('currentPage', 'mainMenu', 'attendanceArray', 'batch', 'studentsInBatch', 'leadInstructor', 'alternateInstructor');
         return View::make('pages.batches.attendance', compact($dataToView));
     } else {
         return Redirect::to("/");
     }
 }