public function getlist()
 {
     $rules = ['class' => 'required', 'section' => 'required', 'shift' => 'required', 'session' => 'required', 'exam' => 'required', 'subject' => 'required'];
     $validator = \Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('/mark/list/')->withErrors($validator);
     } else {
         $classes2 = ClassModel::orderby('code', 'asc')->lists('name', 'code');
         $subjects = Subject::where('class', Input::get('class'))->lists('name', 'code');
         $marks = DB::table('Marks')->join('Student', 'Marks.regiNo', '=', 'Student.regiNo')->select('Marks.id', 'Marks.regiNo', 'Student.rollNo', 'Student.firstName', 'Student.middleName', 'Student.lastName', 'Marks.written', 'Marks.mcq', 'Marks.practical', 'Marks.ca', 'Marks.total', 'Marks.grade', 'Marks.point', 'Marks.Absent')->where('Marks.class', '=', Input::get('class'))->where('Marks.section', '=', Input::get('section'))->Where('Marks.shift', '=', Input::get('shift'))->where('Marks.session', '=', trim(Input::get('session')))->where('Marks.subject', '=', Input::get('subject'))->where('Marks.exam', '=', Input::get('exam'))->get();
         $formdata = new formfoo();
         $formdata->class = Input::get('class');
         $formdata->section = Input::get('section');
         $formdata->shift = Input::get('shift');
         $formdata->session = Input::get('session');
         $formdata->subject = Input::get('subject');
         $formdata->exam = Input::get('exam');
         if (count($marks) == 0) {
             $noResult = array("noresult" => "No Results Found!!");
             //return Redirect::to('/mark/list')->with("noresult","No Results Found!!");
             return View::Make('app.markList', compact('classes2', 'subjects', 'marks', 'noResult', 'formdata'));
         }
         return View::Make('app.markList', compact('classes2', 'subjects', 'marks', 'formdata'));
     }
 }
 public function getlist()
 {
     $rules = ['class' => 'required', 'section' => 'required', 'shift' => 'required', 'session' => 'required', 'date' => 'required', 'subject' => 'required'];
     $validator = \Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('/attendance/list/')->withErrors($validator);
     } else {
         $classes2 = ClassModel::orderby('code', 'asc')->lists('name', 'code');
         $subjects = Subject::where('class', Input::get('class'))->lists('name', 'code');
         $attendance = DB::table('Attendance')->join('Student', 'Attendance.regiNo', '=', 'Student.regiNo')->select('Attendance.id', 'Attendance.regiNo', 'Student.rollNo', 'Student.firstName', 'Student.middleName', 'Student.lastName', 'Attendance.status')->where('Attendance.class', '=', Input::get('class'))->where('Attendance.section', '=', Input::get('section'))->Where('Attendance.shift', '=', Input::get('shift'))->where('Attendance.session', '=', trim(Input::get('session')))->where('Attendance.subject', '=', Input::get('subject'))->where('Attendance.date', '=', $this->parseAppDate(Input::get('date')))->get();
         $formdata = new formfoo();
         $formdata->class = Input::get('class');
         $formdata->section = Input::get('section');
         $formdata->shift = Input::get('shift');
         $formdata->session = Input::get('session');
         $formdata->subject = Input::get('subject');
         $formdata->date = Input::get('date');
         if (count($attendance) == 0) {
             $noResult = array("noresult" => "No Attendance Found!!");
             return View::Make('app.attendanceList', compact('classes2', 'attendance', 'subjects', 'formdata', 'noResult'));
             //return Redirect::to('/attendance/list')->withInput(Input::all())->with("noresult","No Attendance Found!!");
         }
         return View::Make('app.attendanceList', compact('classes2', 'attendance', 'subjects', 'formdata'));
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function show()
 {
     $Classes = ClassModel::orderby('code', 'asc')->get();
     return View::Make('app.classList', compact('Classes'));
 }