public function showModuleFeedback()
 {
     $modules = WingmanModule::all();
     //return $modules;
     $entries = DB::table('propel_wingmanJournals as A')->join('User as B', 'B.id', '=', 'A.wingman_id')->join('Student as C', 'C.id', '=', 'A.student_id')->join('Center as D', 'D.id', '=', 'C.center_id')->join('City as E', 'E.id', '=', 'D.city_id')->select('A.id as id', 'A.title as title', 'B.name as wingman_name', 'E.name as city_name', 'A.on_date as on_date', 'A.module_id as module_id')->distinct()->where('A.type', '=', 'module_feedback')->get();
     return View::make('feedback/module_feedback')->with('entries', $entries)->with('modules', $modules);
 }
Esempio n. 2
0
 public function showCalendar($wingman_id, $student_id)
 {
     $this->setGroup();
     $city = Wingman::find($wingman_id)->city()->first();
     $volunteers = Group::where('name', $this->asvGroupName)->first()->volunteer()->where('city_id', '=', $city->id)->where('status', '=', 1)->where('user_type', '=', 'volunteer')->groupby('id')->get();
     //return $volunteers;
     $subjects = Wingman::find($wingman_id)->city()->first()->subject()->get();
     $wingman_modules = WingmanModule::all();
     /*$calendarEvents = DB::table('propel_calendarEvents as P')->select('P.id','P.type as title','P.start_time as start','P.end_time as end')->where('student_id','=',$student_id)->get();
      */
     $calendarEvents = DB::table('propel_calendarEvents as P')->leftJoin('propel_cancelledCalendarEvents as Q', 'P.id', '=', 'Q.calendar_event_id')->leftJoin('propel_wingmanTimes as R', 'R.calendar_event_id', '=', 'P.id')->leftJoin('propel_volunteerTimes as S', 'S.calendar_event_id', '=', 'P.id')->leftJoin('User as T', 'T.id', '=', 'S.volunteer_id')->leftJoin('User as U', 'U.id', '=', 'R.wingman_id')->leftJoin('propel_wingmanModules as V', 'V.id', '=', 'R.wingman_module_id')->leftJoin('propel_subjects as W', 'W.id', '=', 'S.subject_id')->select('P.id', 'P.type as title', 'P.start_time as start', 'P.end_time as end', 'P.status', 'Q.reason as reason', 'Q.comment as comment', 'U.name as wingman_name', 'T.name as volunteer_name', 'S.volunteer_id as volunteer_id', 'R.wingman_id as wingman_id', 'V.id as module_id', 'W.id as subject_id', 'V.name as module_name', 'W.name as subject_name')->where('student_id', '=', $student_id)->get();
     foreach ($calendarEvents as $calendarEvent) {
         $calendarEvent->title = str_replace('_', ' ', $calendarEvent->title);
         $calendarEvent->title = ucwords($calendarEvent->title);
         $calendarEvent->reason = str_replace('_', ' ', $calendarEvent->reason);
         $calendarEvent->reason = ucwords($calendarEvent->reason);
     }
     $calendarEvents = json_encode($calendarEvents);
     $student_name = Student::where('id', '=', $student_id)->first();
     $GLOBALS['student_id'] = $student_id;
     return View::make('calendar.calendar-view')->with('volunteers', $volunteers)->with('subjects', $subjects)->with('wingman_modules', $wingman_modules)->with('student_id', $student_id)->with('wingman_id', $wingman_id)->with('calendarEvents', $calendarEvents)->with('student_name', $student_name->name);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $journal_entry = WingmanJournal::find($id);
     $wingman_id = $journal_entry->wingman_id;
     $students = Wingman::find($wingman_id)->student()->get();
     $moduleList = WingmanModule::all();
     foreach ($moduleList as $module) {
         if ($module->id == $journal_entry->module_id) {
         }
     }
     return View::make('journal-entry.edit')->with('journal_entry', $journal_entry)->with('students', $students)->with('modules', $moduleList);
 }