public function __construct() { $count = Employee::count(); $countProj = Project::count(); $data = Employee::all(); $YourRole = ""; if (count(Auth::user()) > 0) { $YourRole = Auth::user()->UserRoles->role; } $Role2 = $this->Role1; // Count Unconfirmed $cc = 0; foreach ($data as $da) { if ($da->confirm == 0) { $cc++; } } $countConf = $cc; // Count Confirmed $cc1 = 0; foreach ($data as $dat) { if ($dat->confirm == 1) { $cc1++; } } $countConfirmed = $cc1; View::share('countConf', $countConf); View::share('YourRole', $YourRole); View::share('countConfirmed', $countConfirmed); View::share('count', $count); View::share('countProj', $countProj); }
public function home() { $stats['employees'] = \App\Employee::count(); $stats['assets'] = \App\Asset::count(); $stats['users'] = \App\User::count(); $stats['vendors'] = \App\Vendor::count(); return View('pages.dashboard', compact('stats')); }
public function __construct() { $count = Employee::count(); $countProj = Project::count(); $data = Employee::all(); $DataEm = ""; $YourRole = ""; $undisplayRoleAcc = ""; if (count(Auth::user()) > 0) { $YourRole = Auth::user()->UserRoles->role; if (Auth::user()->id_employees > 0) { $DataEm = Employee::where('id', Auth::user()->id_employees)->get(); } } if ($YourRole == 11) { $undisplayRoleAcc = "undisplayRole"; } $Role2 = $this->Role1; // Count Unconfirmed $cc = 0; foreach ($data as $da) { if ($da->confirm == 0) { $cc++; } } $countConf = $cc; // Count Confirmed $cc1 = 0; foreach ($data as $dat) { if ($dat->confirm == 1) { $cc1++; } } $countConfirmed = $cc1; View::share('countConf', $countConf); View::share('DataEm', $DataEm); View::share('undisplayRoleAcc', $undisplayRoleAcc); View::share('YourRole', $YourRole); View::share('countConfirmed', $countConfirmed); View::share('count', $count); View::share('countProj', $countProj); }
public function totalEmployee() { $result = Employee::count(); return $result; }
public function index() { $dataView = ['productsCount' => Product::count(), 'plansCount' => Plan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => Report::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => Customer::count(), 'employeesCount' => Employee::count()]; return view('admin.index', $dataView); }