Esempio n. 1
0
 /**
  *	Return the stats message for a User
  * 
  * @return Array(Stats)
  */
 public static function getStats()
 {
     $messages = UserController::getUser(Auth::user())->messages();
     $inbox = $messages->where('from', '!=', Auth::id())->where('archived', false)->count();
     $sent = $messages->where('from', Auth::id())->where('archived', false)->count();
     $archived = $messages->where('archived', true)->count();
     return array('inbox' => $inbox, 'unread' => count(MessageController::unReadMessages("all")), 'sent' => $sent, 'archived' => $archived, 'approve' => PendingEnrollment::where('teacher_id', Auth::id())->count(), 'join' => PendingGroup::where('teamleader_id', Auth::id())->count());
 }
 public function showEnrollSection()
 {
     $sections = SectionCode::whereIn('students_id', array(Auth::id()))->where('status', true)->get();
     $pending = PendingEnrollment::where('student_id', Auth::id())->get();
     return View::make('student.show_all_enrollment')->with(array('sections' => $sections, 'pending' => $pending));
 }
Esempio n. 3
0
 public function showApprovalStudentView()
 {
     $pending = PendingEnrollment::where('teacher_id', Auth::id())->get();
     if (count($pending) > 0) {
         return View::make('teacher.approval_student')->with(array('pending' => $pending, 'stats' => MessageController::getStats()));
     } else {
         return Redirect::to(Lang::get('routes.' . Auth::user()->rank));
     }
 }