예제 #1
0
 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $data = Afg::groupYear();
     foreach ($data as $sets => $values) {
         foreach ($values as $key => $value) {
             $collection[$sets][$key] = $value;
         }
     }
     $group = [];
     foreach ($collection as $value) {
         $group[$value['year']][] = $value;
     }
     $total = [];
     $runningTotal = 0;
     foreach ($group as $key => $value) {
         foreach ($value as $line) {
             $runningTotal = $runningTotal + $line['subTotal'];
         }
         $total[$key] = $runningTotal;
         $runningTotal = 0;
     }
     //        dd($total);
     return view('home')->withData($group)->withTotal($total);
 }
예제 #2
0
 public function projectAll($id)
 {
     return Afg::with('categories', 'clients', 'locations', 'priorities', 'regions', 'managers', 'tracking', 'tracking.invoices')->find($id);
 }
예제 #3
0
 /**
  * Get a list of years currently used from the afg table
  * @return mixed
  */
 protected function years()
 {
     return Afg::groupBy('year')->lists('year');
 }