コード例 #1
0
ファイル: CustomerController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #2
0
ファイル: LineController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #3
0
 /**
  * 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>&nbsp;' . '<a href="/employees/' . $employee->EmployeeID . '/edit" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Edit</a>&nbsp;';
     })->make(true);
 }
コード例 #4
0
ファイル: PlanController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #5
0
ファイル: PlanController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #6
0
ファイル: RecordUpdateComposer.php プロジェクト: rob1121/qdn
 /**
  * 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());
 }
コード例 #7
0
ファイル: SaleController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #8
0
ファイル: EmployeeController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #9
0
ファイル: CoverageController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #10
0
ファイル: DashboardController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #11
0
 /**
  * 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');
 }
コード例 #12
0
ファイル: ReportController.php プロジェクト: m-gamal/crm
 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);
 }
コード例 #13
-1
ファイル: ProductController.php プロジェクト: m-gamal/crm
 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);
 }