示例#1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($society)
 {
     if (Helpers::perm('admin', $society) or Helpers::perm('edit', $society)) {
         $data['society'] = $society;
         $data['rosters'] = Roster::where('society_id', '=', $society)->orderBy('rostername')->get();
         return View::make('rosters.index', $data);
     } else {
         return view('shared.unauthorised');
     }
 }
示例#2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     if (Helpers::perm('admin', $id)) {
         $data['page_title'] = "Edit society";
         $data['page_description'] = Helpers::getSetting('circuit_name') . " Circuit";
         $data['society'] = Society::with('service')->find($id);
         $data['latitude'] = $data['society']->latitude;
         $data['longitude'] = $data['society']->longitude;
         $data['indivs'] = Individual::socindiv($data['society']->id)->get();
         $data['groups'] = Group::where('society_id', '=', $data['society']->id)->orderBy('groupname')->get();
         $data['rosters'] = Roster::where('society_id', '=', $data['society']->id)->orderBy('rostername')->get();
         $data['provideropts'] = array('none' => '', 'bulksms' => 'Bulk SMS', 'smsfactory' => 'SMS Factory');
         return View::make('societies.edit', $data);
     } else {
         return view('shared.unauthorised');
     }
 }