/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function bancaIndex() { // $events = Event::orderBy('name')->get(); $professors = Participant::where('type', 'like', 'professor')->orderBy('name')->get(); $boards = BancaAvaliadora::orderBy('created_at')->get(); return view('crud.banca', compact('events', 'professors', 'boards')); }
public function searchMaterial(Request $request) { $this->validate($request, ['valueSearch' => 'required', 'radioSearch' => 'required']); $param = Input::get('radioSearch'); $searchText = Input::get('valueSearch'); if ($param == "Title") { $results = Material::where('title', 'LIKE', $searchText . '%')->orderBy('title')->get(); } else { if ($param == "Category") { $results = Material::where('category', 'LIKE', $searchText . '%')->orderBy('category')->get(); } else { $results = Participant::where('keyword', 'LIKE', '%' . $searchText . '%')->orderBy('keyword')->get(); } } return view('crud.material', compact('results')); }
public function subscribing() { $activities = Activity::orderBy('name')->get(); $id_activity = '1'; $partSubscribed = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->orderBy('pName')->get(); $partNotSubscribed = Participant::WhereNotIn('id', function ($query) use($id_activity) { $query->select('id_participant')->from('activitiesparticipants')->where('id_activity', '=', $id_activity); })->orderBy('name')->get(); $speakers = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->where('activitiesparticipants.role_participant', '=', 'speaker')->orderBy('pName')->get(); $judges = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->where('activitiesparticipants.role_participant', '=', 'judge')->orderBy('pName')->get(); $responsability = "Palestrantes"; return view('lista.atividade', compact('activities', 'partSubscribed', 'partNotSubscribed', 'speakers', 'judges', 'responsability')); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return Participant::create(['cpf' => $data['cpf'], 'password' => $data['password']]); }
public function subscribing() { $participants = Participant::orderBy('name')->get(); $id_participant = '2'; $lectures = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'lecture')->orderBy('aName')->get(); $mini_courses = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'mini_course')->orderBy('aName')->get(); $technical_visits = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'technical_visit')->orderBy('aName')->get(); return view('lista.participantes', compact('lectures', 'mini_courses', 'technical_visits')); }