示例#1
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $data['groups'] = Group::orderBy('groupname')->get();
     $data['setting'] = Setting::find($id);
     $data['themes'] = array('cerulean' => 'cerulean', 'cosmo' => 'cosmo', 'cyborg' => 'cyborg', 'darkly' => 'darkly', 'flatly' => 'flatly', 'journal' => 'journal', 'lumen' => 'lumen', 'paper' => 'paper', 'readable' => 'readable', 'sandstone' => 'sandstone', 'simplex' => 'simplex', 'slate' => 'slate', 'spacelab' => 'spacelab', 'superhero' => 'superhero', 'united' => 'united', 'yeti' => 'yeti');
     return View::make('settings.edit', $data);
 }
示例#2
0
 public function index()
 {
     $groups = Group::orderBy('position')->get();
     $group = new Group();
     if (Request::isMethod('post')) {
         $validator = Validator::make(Request::all(), $this->rules, $this->messages);
         if ($validator->passes()) {
             $group->title = Request::input('title');
             $group->titleEng = Request::input('titleEng');
             $group->text = Request::input('text');
             $group->eng = Request::input('eng');
             $group->link = Request::input('link');
             $group->position = Request::input('position');
             $group->enabled = Request::has('enabled');
             if ($file = Request::file('photo')) {
                 $group->photo = $this->upload($file, 'photo');
             }
             if ($file = Request::file('partners')) {
                 $group->partners = $this->upload($file, 'photo');
             }
             $group->save();
             return redirect('admin/group')->with('msg', 'Агентство было успешно создано');
         } else {
             return redirect('admin/group')->withInput()->withErrors($validator);
         }
     }
     return view('admin.group', ['groups' => $groups, 'group' => $group]);
 }
示例#3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getList()
 {
     $groups = Group::orderBy('id', 'asc')->get();
     return view('group.list', ['title' => '组列表', 'groups' => $groups]);
 }
示例#4
0
 function getStudentModal(Student $student)
 {
     $data['student'] = $student;
     $data['groups'] = [0 => ''] + Group::orderBy('id')->pluck('name', 'id')->all();
     return $this->modal('Student bewerken', 'modals.student', $data);
 }
示例#5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($society, $id)
 {
     if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) {
         $data['society'] = $society;
         $data['roster'] = Roster::with(array('group' => function ($query) {
             $query->orderBy('groupname', 'asc');
         }))->find($id);
         if (count($data['roster']->group) != 0) {
             foreach ($data['roster']->group as $group) {
                 $rostergroup[] = $group->id;
             }
             $data['rostergroup'] = $rostergroup;
         }
         $data['groups'] = Group::orderBy('groupname')->get();
         if ($data['roster']->extrainfo) {
             $extra = explode(',', $data['roster']->extrainfo);
             foreach ($extra as $exx) {
                 $rosterextra[] = intval($exx);
             }
             $data['rosterextra'] = $rosterextra;
         } else {
             $data['rosterextra'] = array();
         }
         if ($data['roster']->multichoice) {
             $multi = explode(',', $data['roster']->multichoice);
             foreach ($multi as $mul) {
                 $rostermulti[] = intval($mul);
             }
             $data['rostermulti'] = $rostermulti;
         } else {
             $data['rostermulti'] = array();
         }
         return View::make('rosters.edit', $data);
     } else {
         return view('shared.unauthorised');
     }
 }
 public function groups_roles()
 {
     $data['title'] = "Associate Roles to Groups";
     $data['groups'] = Group::orderBy('display_name')->paginate(PAGINATION);
     $data['roles'] = Role::orderBy('display_name')->get();
     return view('groups/groups_roles', $data);
 }
示例#7
-1
 public function getEdit($id)
 {
     $user = User::find($id);
     $departments = Department::orderBy('dw', 'asc')->get();
     $majors = Major::orderBy('zy', 'asc')->get();
     $groups = Group::orderBy('id', 'asc')->get();
     return view('user.edit', ['title' => '编辑用户', 'user' => $user, 'departments' => $departments, 'majors' => $majors, 'groups' => $groups]);
 }