public function listAll() { $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $customers = Customer::whereIn('mr_id', $employees)->get(); $dataView = ['customers' => $customers]; return view('am.customer.list', $dataView); }
public function achievement() { $AMIds = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $MRs = Employee::whereIn('manager_id', $AMIds)->get(); $dataView = ['MRs' => $MRs]; return view('sm.line.history.search', $dataView); }
/** * Fetch all inactive employee records. * * @return \Illuminate\Http\JsonResponse */ public function fetchInactive() { $employees = App\Employee::select('EmployeeID', DB::raw('CONCAT(LastName, ", ", FirstName, " ",MiddleName) AS FullName'), 'EmailAddress')->where('Status', '=', '0')->orderBy('LastName')->get(); return Datatables::of($employees)->addColumn('action', function ($employee) { return '<a href="/employees/' . $employee->EmployeeID . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-search"></i> View</a> ' . '<a href="/employees/' . $employee->EmployeeID . '/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Edit</a> '; })->make(true); }
public function search() { $AMs = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $MRs = Employee::whereIn('manager_id', $AMs)->get(); $dataView = ['MRs' => $MRs]; return view('sm.search.plans.search', $dataView); }
public function create() { $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $doctors = Customer::whereIn('mr_id', $employees)->get(); $dataView = ['doctors' => $doctors]; return view('am.plan.create', $dataView); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $view->with('disposition_check', ['use as is', 'ncmr#', 'rework', 'split lot', 'shutdown', 'shipback']); $view->with('cod_check', ['production', 'process', 'maintenance', 'facilities', 'quality assurance', 'others']); $view->with('approvers', ['production', 'process', 'quality assurance', 'others']); $view->with('names', Employee::select('name')->orderBy('name')->where('name', '<>', Auth::User()->employee->name)->get()); }
public function search() { $employeesLines = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get(); $products = Product::where('line_id', $employeesLines)->get(); $MRs = Employee::where('manager_id', \Auth::user()->id)->get(); $dataView = ['products' => $products, 'MRs' => $MRs]; return view('am.search.sales.search', $dataView); }
public function listAll() { $AMsIds = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $MRs = Employee::whereIn('manager_id', $AMsIds)->get(); $AMs = Employee::where('manager_id', \Auth::user()->id)->get(); $dataView = ['MRs' => $MRs, 'AMs' => $AMs]; return view('sm.employee.list', $dataView); }
public function search() { $classes = VisitClass::all(); $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $specialties = Customer::select('specialty')->whereIn('mr_id', $employees)->distinct()->get(); $MRs = Employee::where('manager_id', \Auth::user()->id)->get(); $dataView = ['classes' => $classes, 'specialties' => $specialties, 'MRs' => $MRs]; return view('am.search.coverage.search', $dataView); }
public function index() { $employees = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get(); $products = Product::whereIn('line_id', $employees)->get(); $employees = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $customers = Customer::whereIn('mr_id', $employees)->get(); $employees = Employee::where('manager_id', \Auth::user()->id)->get(); $dataView = ['productsCount' => count($products), 'plansCount' => AMPlan::where('month', \Config::get('app.current_month'))->count(), 'reportsCount' => AMReport::where('month', \Config::get('app.current_month'))->count(), 'customersCount' => count($customers), 'employeesCount' => count($employees)]; return view('am.index', $dataView); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function mis($months) { Excel::create('MIS&IT报销_' . $months, function ($excel) use($months) { $companies = Company::where('name', 'CROP')->get(); foreach ($companies as $company) { $excel->sheet('new Sheet', function ($sheet) use($company, $months) { $sheet->setAllBorders('thin'); // Set border for cells $sheet->setBorder('A1', 'thin'); // Font family $sheet->setFontFamily('Comic Sans MS'); $sheet->setStyle(array('font' => array('name' => 'Calibri', 'size' => 11, 'bold' => false))); $employees_id = Employee::select('id')->where('department_name', 'MIS')->orWhere('department_name', 'IT')->get(); $sum = \App\MobileFees::where('company_id', 6)->wherein('employee_id', $employees_id)->where('months', $months)->with('company', 'employee')->sum('fee'); $mobilefees = \App\MobileFees::where('company_id', 6)->wherein('employee_id', $employees_id)->where('months', $months)->with('company', 'employee')->get(); $sheet->loadView('report.mis')->with('mobilefees', $mobilefees)->with('sum', $sum)->with('company_name', $company->name); }); } })->download('xls'); }
public function listAllPendingLeaveRequests() { $AMsId = Employee::select('id')->where('manager_id', \Auth::user()->id)->get(); $pendingLeaveRequests = AMLeaveRequest::pending()->whereIn('am_id', $AMsId)->get(); $dataView = ['pendingLeaveRequests' => $pendingLeaveRequests]; return view('sm.leave_request.pending', $dataView); }
public function listAll() { $employees = Employee::select('line_id')->where('manager_id', \Auth::user()->id)->get(); $products = Product::whereIn('line_id', $employees)->get(); $dataView = ['products' => $products]; return view('am.product.list', $dataView); }