<?php
 namespace VnChocola\Module\Master\MasterView;
 use TCMS\Controller;
 use Model;
 class IndexController extends Controller {
 public function index() {
 view()->addStyle(asset('/adminlte/dist/css/AdminLTE.min.css'), false);
 view()->addStyle(asset('style/devexpress/dx.common.css'), false);
 view()->addStyle(asset('style/devexpress/dx.light.css'), false);
 view()->addScript(asset('script/jquery.min.js'));
 view()->addScript(asset('script/admin-layout-default/admin-layout-default.js'));
 view()->addScript(asset('script/devexpress/dx.all.js'));
 view()->addScript(asset('script/globals.js'));
 view()->addScript(asset('script/master-view/data.js'));
 view()->addScript(asset('script/master-view/index.js'));
 $auth = load_auth();
 $user = $auth->getUser();
 $model = Model::load('BranchsModel');
 $model->where("storeID", $user->storeID);
 $branchCount = $model->count();
 $model = Model::load('StaffsModel');
 $model->where("branchID", $user->branchID);
 $staffCount = $model->count();
 $model = Model::load('CustomersModel');
 $model->where("branchID", $user->branchID);
 $customerCount = $model->count();
 $model = Model::load('ReservesModel');
 $model->where("branchID", $user->branchID);
 $model->where("fromDate", date("Y-m-d 00:00:00"), '>=');
 $model->where("fromDate", date("Y-m-d 23:59:59"), '<=');
 $reserveCount = $model->count();
 return view([ 'branchCount' => $branchCount, 'staffCount' => $staffCount, 'customerCount' => $customerCount, 'reserveCount' => $reserveCount, ]);
 }
 }
 