Esempio n. 1
0
 public static function enrolmentToGrade($enrolment)
 {
     return SessionData::getYear() - $enrolment + 1;
 }
Esempio n. 2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $this->validate($request, ['subject_id' => 'required|exists:subject,id', 'grade' => 'required|numeric|min:3|max:13']);
     $circle = Circle::create(['subject_id' => $request->subject_id, 'grade' => $request->grade, 'year' => SessionData::getYear()]);
     return redirect('circle');
 }
Esempio n. 3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $school = School::findOrFail($id);
     $registrations = Pupil::join('registration', 'pupil.id', '=', 'registration.pupil_id')->join('circle', 'registration.circle_id', '=', 'circle.id')->join('subject', 'circle.subject_id', '=', 'subject.id')->where('pupil.school_id', $school->id)->where('circle.year', SessionData::getYear())->get();
     return view('school.show', ['school' => $school, 'registrations' => $registrations]);
 }
Esempio n. 4
0
 public function index()
 {
     return view('schoolyear.index', ['year' => SessionData::getYear()]);
 }