Beispiel #1
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::user()->is_admin) {
         $usuario = User::where('id', $id)->first();
         $sucursales = Account::find(Auth::user()->account_id)->branches;
         $sucs = array();
         $ubras = UserBranch::where('user_id', $usuario->id)->get();
         foreach ($ubras as $ubra) {
             array_push($sucs, $ubra->branch_id);
         }
         $prices = PriceType::get();
         $groups = Group::get();
         $grus = array();
         $grupos_s = explode(",", $usuario->group_ids);
         foreach ($grupos_s as $g) {
             array_push($grus, $g);
         }
         $data = ['usuario' => $usuario, 'sucursales' => $sucursales, 'precios' => $prices, 'grupos' => $groups, 'sucs' => $sucs, 'grus' => $grus, 'bbr' => 1];
         return View::make('users.edit', $data);
     }
     return Redirect::to('/inicio');
 }
Beispiel #2
0
 public function index()
 {
     $prices = PriceType::get();
     $data = ['precios' => $prices];
     return View::make('precios.index', $data);
 }