示例#1
0
 public function absences($id)
 {
     $class_id = substr($id, 0, 1);
     $student_id = substr($id, 1);
     $student = Student::find($student_id);
     $absences = StudentAttendance::where('student_id', '=', $student_id)->where('class_id', '=', $class_id)->orderBy('date', 'ASC')->get();
     $class = DB::table('classes')->where('id', $class_id)->pluck('name');
     $page_data = array('student' => $student, 'absences' => $absences, 'class' => $class);
     $this->layout->title = 'Absences';
     $this->layout->content = View::make('admin.absences', $page_data);
 }