public function index()
 {
     //  get signed in admin
     Cas::getCurrentUser();
     $user = session('cas_user');
     $response = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/staff/getStaff/' . $user);
     $staffInformation = json_decode($response, true);
     $students = DB::table('students')->join('cleared_by', 'students.studentNo', '=', 'cleared_by.students_studentNo')->select('students.*', 'cleared_by.games_cleared_by')->where('cleared_by.games_cleared_by', '=', 'N/A')->paginate(10);
     return view('staff/games', compact('students', 'staffInformation', 'message'));
 }
 public function index()
 {
     //  get signed in admin
     Cas::getCurrentUser();
     $user = session('cas_user');
     $response = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/staff/getStaff/' . $user);
     $staffInformation = json_decode($response, true);
     $message = "Please Attend to the following students Requesting to be cleared";
     $students = DB::table('students')->join('charge', 'students.studentNo', '=', 'charge.students_studentNo')->join('cleared_by', 'students.studentNo', '=', 'cleared_by.students_studentNo')->select('students.*', 'cleared_by.finance_cleared_by')->where('cleared_by.finance_cleared_by', '=', 'N/A')->where('charge.queueFlag', '=', '6')->paginate(10);
     $pending = DB::table('students')->join('charge', 'students.studentNo', '=', 'charge.students_studentNo')->select('students.*', 'charge.*')->where('charge.total', '>', '0')->where('charge.queueFlag', '=', '7')->paginate(15);
     return view('staff/finance', compact('students', 'pending', 'staffInformation', 'message'));
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     Cas::getCurrentUser();
     $user = session('cas_user');
     $std = student::where('studentNo', '=', $user)->first();
     $charge = charges::where('students_studentNo', '=', $user)->first();
     $serial = Serial::where('students_studentNo', '=', $user)->first();
     if ($charge->total == 0) {
         $html = PDF::make($std, $serial);
     } else {
         $html = PDF::create($std, $charge, $serial);
     }
     $mpdf = new mpdf();
     $mpdf->WriteHTML($html);
     $mpdf->Output();
 }
Example #4
0
 public function loginSso()
 {
     \Cas::authenticate();
     $api = new ApiController();
     $user = $api->_getUserAttributes(\Cas::getCurrentUser());
     $_user = User::where('username', $user->username)->first();
     if (!$_user) {
         $_user = new User();
         $_user->email = $user->email;
         $_user->nip = $user->nip;
         $_user->username = $user->username;
         $_user->save();
     }
     \Auth::login($_user);
     return redirect('/');
 }