Пример #1
0
 /**
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function createTask()
 {
     $task_name = $this->request->input('activity_type');
     $args = ['name' => $task_name, 'due_date' => Carbon::parse($this->request->input('due_date')), 'user_id' => $this->request->input('user_id'), 'completed' => $this->request->input('completed'), 'recruit_id' => $this->request->input('recruit_id'), 'note' => $this->request->input('note')];
     $task = $this->taskRepo->createTask($args);
     $this->isTaskAssignedFromOtherUser($args['user_id'], $task);
     Flash::success("A new {$task_name} was successfully added");
     return redirect('admin/recruiting/' . $this->request->input('recruit_id'));
 }
Пример #2
0
 public function dashboard(TaskRepo $taskRepo)
 {
     $recruits = Recruits::where('user_id', Auth::user()->id)->orderBy('last_name')->get();
     $overDueTasks = Task::userOverDueTasks();
     $tasks = Task::userActiveTasks();
     $appointments = $taskRepo->actionsThisMonth(Auth::user()->id, 'Appointment');
     $calls = $taskRepo->actionsThisMonth(Auth::user()->id, 'Call');
     $experienced_agents = Recruits::where('user_id', Auth::user()->id)->where('experience_level', 'Experienced Agent')->where('is_hired', 1)->whereBetween('updated_at', [Carbon::now()->startOfYear(), Carbon::now()])->count();
     $new_agents = Recruits::where('user_id', Auth::user()->id)->where('experience_level', '!=', 'Experienced Agent')->where('is_hired', 1)->whereBetween('updated_at', [Carbon::now()->startOfYear(), Carbon::now()])->count();
     return view('admin.pages.my_dashboard', compact('recruits', 'tasks', 'overDueTasks', 'user', 'appointments', 'calls', 'experienced_agents', 'new_agents', 'leads'));
 }
Пример #3
0
 public function adminDashboard(TaskRepo $taskRepo)
 {
     if (Auth::user()->can('can_view_dashboard')) {
         $leads = Lead::newestLeads();
         $users = User::where('can_recruit', 1)->get();
         $overdue_tasks = $taskRepo->getLateTasksBySystem();
         $appointments = $taskRepo->actionsThisMonthSystem('Appointment');
         $calls = $taskRepo->actionsThisMonthSystem('Call');
         $experienced_agents = Recruits::where('experience_level', 'Experienced Agent')->where('is_hired', 1)->whereBetween('updated_at', [Carbon::now()->startOfYear(), Carbon::now()])->count();
         $new_agents = Recruits::where('experience_level', '!=', 'Experienced Agent')->where('is_hired', 1)->whereBetween('updated_at', [Carbon::now()->startOfYear(), Carbon::now()])->count();
         return view('admin.pages.dashboard', compact('leads', 'users', 'overdue_tasks', 'calls', 'appointments', 'experienced_agents', 'new_agents'));
     }
     return redirect('admin/recruiting/dashboard');
 }