<commit_before><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Log;
use DB;
use App\Http\Requests;

class ReportsController extends Controller
{
    public function __construct()
    {
        $this->middleware('role:admin');
    }


	public function DonationReporting()
	{
      Log::info('ReportsController: ');
      $donors= DB::table('donors')
            ->join('donations','donors.id','=','donations.donor_id')
            ->select(DB::raw('donors.last_name as lastname,donors.first_name as firstname, 
                              donations.amount as amount,donations.status as status,donations.created_at'))
            
            ->orderBy('donations.created_at', 'DESC')
            ->get();

        $donation_sum= DB::table('donations')
            ->select(DB::raw('SUM(donations.amount) as sum,month(donations.created_at) as month'))
            // ->where('year(donations.created_at)','=','2016')
              // ->where('year(donations.created_at)','=','2016')
            ->whereMonth('donations.created_at','=','10')
            ->groupBy('month')

            ->get();

          



        return view('reports.donation',compact('donors','donation_sum'));
    }


}


// $users = DB::table('orders')
//                 ->select('department', DB::raw('SUM(price) as total_sales'))<commit_msg>update to donation reports 3<commit_after><?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Log;
use DB;
use App\Http\Requests;

class ReportsController extends Controller
{
    public function __construct()
    {
        $this->middleware('role:admin');
    }


	public function DonationReporting()
	{
      Log::info('ReportsController: ');
      $donors= DB::table('donors')
            ->join('donations','donors.id','=','donations.donor_id')
            ->select(DB::raw('donors.last_name as lastname,donors.first_name as firstname, 
                              donations.amount as amount,donations.status as status,donations.created_at'))
            
            ->orderBy('donations.created_at', 'DESC')
            ->get();

        // $donation_sum= DB::table('donations')
        //     ->select(DB::raw('SUM(donations.amount) as sum,month(donations.created_at) as month'))
        //     // ->where('year(donations.created_at)','=','2016')
        //       // ->where('year(donations.created_at)','=','2016')
        //     ->whereMonth('donations.created_at','=','10')
        //     ->groupBy('month')

        //     ->get();

          



        return view('reports.donation',compact('donors','donation_sum'));
    }


}


// $users = DB::table('orders')
//                 ->select('department', DB::raw('SUM(price) as total_sales'))
{'fraction_non_alphanumeric': 0.17426470588235293, 'fraction_numerical': 0.007720588235294118, 'mean_word_length': 2.533766233766234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '965150', 'n_tokens_mistral': 854, 'n_tokens_neox': 811, 'n_words': 121}