<?php


	require_once ("../../../loader.php");

	$db = new Conexion;
	$user = new User;
	$core = new Core;
	$userData = $user->cdp_getUserData();

	$year = date('Y');
	
	$curr = "$";

	$data = array();


	for ($month = 1; $month <= 12; $month ++){

    	$sql="SELECT IFNULL(SUM(expense_amount), 0) as total FROM expenses_master WHERE month(created_date)='$month' AND year(created_date)='$year' and currency='$curr'"; 
	       
        $db->cdp_query($sql); 
        $total_data= $db->cdp_registro();

		$data[] = number_format($total_data->total, 2,'.','');
        
    }
	echo json_encode($data);
