예제 #1
0
 /**
  * Show the form for creating a user profile.
  *
  * @return $this
  */
 public function edit()
 {
     $describes = Skill::orderBy('name')->lists('name', 'id')->all();
     // We want other to be at the bottom
     $other = array_search('Other', $describes);
     unset($describes[$other]);
     $describes[$other] = 'Other';
     $skills = Tag::orderBy('name')->lists('name', 'id')->all();
     $professions = Profession::orderBy('name')->lists('name', 'id')->all();
     $professions[] = 'Other';
     return view('profile.edit')->with('user', Auth::user())->with('describes', $describes)->with('skills', $skills)->with('route', Route::currentRouteName())->with('professions', $professions);
 }
예제 #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($society, $hid, $id)
 {
     if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) {
         $data['society'] = $society;
         $data['individual'] = Individual::with('group', 'skill')->find($id);
         if (!$data['individual']->photo) {
             $data['individual']->photo = "/public/images/profile.png";
         }
         if (count($data['individual']->currentgroups) != 0) {
             foreach ($data['individual']->currentgroups as $group) {
                 $groupmembers[] = $group->id;
             }
             $data['groupmembers'] = $groupmembers;
         }
         $data['groups'] = Group::where('society_id', '=', $society)->orderBy('groupname')->get();
         if (count($data['individual']->skill) != 0) {
             foreach ($data['individual']->skill as $skill) {
                 $skillmembers[] = $skill->id;
             }
             $data['skillmembers'] = $skillmembers;
         }
         $data['household_id'] = $data['individual']->household_id;
         $data['skills'] = Skill::orderBy('skill')->get();
         $data['pgadmin'] = Society::find($society)->pgadmin;
         return View::make('individuals.edit', $data);
     } else {
         //
     }
 }