Exemplo n.º 1
0
 public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
 {
     if ($section == ACCOUNT_DETAILS) {
         $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'industries' => Industry::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'timezones' => Timezone::remember(DEFAULT_QUERY_CACHE)->orderBy('location')->get(), 'dateFormats' => DateFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'datetimeFormats' => DatetimeFormat::remember(DEFAULT_QUERY_CACHE)->get(), 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'taxRates' => TaxRate::orderBy('name')->get()];
         return View::make('accounts.details', $data);
     } else {
         if ($section == ACCOUNT_NOTIFICATIONS) {
             $data = ['account' => Account::with('users')->findOrFail(Auth::user()->account_id)];
             return View::make('accounts.notifications', $data);
         } else {
             if ($section == ACCOUNT_IMPORT_EXPORT) {
                 return View::make('accounts.import_export');
             } else {
                 if ($section == ACCOUNT_ADVANCED_SETTINGS) {
                     $data = ['account' => Auth::user()->account, 'feature' => $subSection];
                     return View::make("accounts.{$subSection}", $data);
                 } else {
                     if ($section == ACCOUNT_PRODUCTS) {
                         $data = ['account' => Auth::user()->account];
                         return View::make('accounts.products', $data);
                     } else {
                         if ($section == ACCOUNT_BRANCHES) {
                             $data = ['account' => Auth::user()->account];
                             return View::make('accounts.branches', $data);
                         } else {
                             if ($section == ACCOUNT_GROUPS) {
                                 $data = ['account' => Auth::user()->account];
                                 return View::make('accounts.groups', $data);
                             } else {
                                 if ($section == ACCOUNT_USERS) {
                                     $data = ['account' => Auth::user()->account];
                                     return View::make('accounts.user_management', $data);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }