public function index()
 {
     //check user session
     if (!$this->validSession) {
         $logo = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-company-logo')->first()->value;
         $company_name = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-company-name')->first()->value;
         $bg = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-login-bg-image')->first()->value;
         $home_url = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-home-url')->first()->value;
         $title = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-login-title')->first()->value;
         //return view ...
         return view('backend.common.loginv1')->with('logo', $logo)->with('bg', $bg)->with('title', $title)->with('company_name', $company_name);
     }
     $home_url = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-home-url')->first()->value;
     //redirect to inner site
     return Redirect::intended($home_url);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sys_icons = SysConfig::where('type', 'Icons')->get();
     return view('backend.sysconfig.sys_icon_index')->with('content_title', 'System Icons')->with('sys_icons', $sys_icons)->with('module', $this->module);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     try {
         $inputs = $request->all();
         unset($inputs['_method']);
         unset($inputs['_token']);
         foreach ($inputs as $key => $value) {
             SysConfig::where('type', 'SystemPermissionPositionType')->where('key', $key)->update(['value' => $value]);
         }
         return Redirect::to('/crm/permission_pos_type')->withMessage(Generate::success_message('Success', 'Updated Successfully.'));
     } catch (Exception $e) {
         return Redirect::to('/crm/permission_pos_type')->withMessage(Generate::error_message('Fail', 'Failed to update.'));
     }
 }
Esempio n. 4
0
 public static function getNavTop($id)
 {
     $home_url = "";
     $company_name = "";
     $company_logo = "";
     $return = [];
     $home_url = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-home-url')->first()->value;
     $company_name = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-company-name')->first()->value;
     $company_logo = SysConfig::where('type', 'SystemSettings')->where('key', 'crm-company-logo-sm')->first()->value;
     //get user
     $user = User::find($id);
     $member_since = date_format($user->created_at, 'Y-M-d');
     $profile_functions = '/crm/profile';
     //for the data schema for the top navigation
     $return = ['home_url' => $home_url, 'company_name' => $company_name, 'company_logo' => $company_logo, 'user_image' => $user->display_image, 'user_name' => $user->display_name, 'member_since' => $member_since, 'profile_functions' => $profile_functions];
     return Generate::returnMsg('200', 'Success', $return);
 }