Ejemplo n.º 1
0
 /**
  *Generate the Weekly Project Report for the user
  *@return View
  */
 public function postWeeklyProject()
 {
     //Get the user id of the currently logged in user
     $userId = Sentry::getUser()->id;
     //Get the date
     $date = \Input::get('weekprojectdate_submit');
     //Get the project Id
     $projectId = \Input::get('project');
     //Geneerate Week
     $week = \DateAndTime::getWeek($date);
     $dates = array();
     foreach ($week as $day) {
         $dates[] = $day['date'];
     }
     //Get Data
     $data = $this->report->generateWeeklyProjectReport($dates, $projectId, $userId);
     $tempDates = array();
     foreach ($dates as $day) {
         $tempDay = new \ExpressiveDate($day);
         $tempDates[] = $tempDay->format('jS F, Y');
     }
     //Chart Labels
     $chartWeek = json_encode($tempDates);
     //Chart Data
     $chartWeekData = json_encode($data['dayTime'], JSON_NUMERIC_CHECK);
     return \View::make('dashboard.reports.weeklyproject')->with('dates', $dates)->with('week', $week)->with('data', $data)->with('chartWeek', $chartWeek)->with('chartWeekData', $chartWeekData);
 }