get(T_PAYMENTS); $total_earnings_tm = $db->where('date',"$month/$year")->get(T_PAYMENTS); $total_sales = count($total_earnings); $year_sales = array('01' => 0 ,'02' => 0 ,'03' => 0 ,'04' => 0 ,'05' => 0 ,'06' => 0 ,'07' => 0 ,'08' => 0 ,'09' => 0 ,'10' => 0 ,'11' => 0 ,'12' => 0); for($i=1; $i < 13; $i++) { $pro_sales_static = $db->where('date',"$i/$year")->getValue(T_PAYMENTS, 'count(*)'); $code = $i; if ($i < 10) { $code = '0'.$i; } if (in_array($code, array_keys($year_sales))) { $year_sales[$code] = $pro_sales_static; } $json_static_dump[] = array( 'month' => $pt->months[$i], 'pro_sales' => $pro_sales_static ); } $pt->year_sales = implode(', ', $year_sales); $json_static_dump = json_encode($json_static_dump); foreach ($total_earnings as $amount) { $total_earnings_sum += $amount->amount; } foreach ($total_earnings_tm as $amount) { $total_earnings_tms += $amount->amount; } ?>

Recent payments

TOTAL EARNINGS
attach_money
PAID SALES
EARNINGS THIS MONTH
attach_money
STATICS