if (isset($sales_sum[date("Y-m-") . sprintf('%02d', $i)])) { $sales_money[] = number_format($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['total'], 2, '.', ''); $user_money[] = number_format($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['receive'], 2, '.', ''); if (isset($referal_sum[date("Y-m-") . sprintf('%02d', $i)]['receive'])) { $sales_sum[date("Y-m-") . sprintf('%02d', $i)]['referal'] = $referal_sum[date("Y-m-") . sprintf('%02d', $i)]['receive']; } if (!isset($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['referal'])) { $sales_sum[date("Y-m-") . sprintf('%02d', $i)]['referal'] = 0; } $sales_num[] = $sales_sum[date("Y-m-") . sprintf('%02d', $i)]['num']; $win_money[] = number_format(floatval($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['total']) - floatval($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['receive']) - floatval($sales_sum[date("Y-m-") . sprintf('%02d', $i)]['referal']), 2, '.', ''); } else { $sales_money[] = 0; $user_money[] = 0; $win_money[] = 0; $sales_num[] = 0; } $days[] = $i; } $new_array = array(); //$new_array[] = array('name' => $langArray['referal_money_this_month_short'], 'data' => $referal_money); $new_array[] = array('name' => $langArray['win'], 'data' => $sales_money); $new_array[] = array('name' => $langArray['user_win_this_month'], 'data' => $user_money); $new_array[] = array('name' => $langArray['grid_win'], 'data' => $win_money); $new_array2 = array(); $new_array2[] = array('name' => $langArray['sales'], 'data' => $sales_num); abr('finance_array', javascript::encode($new_array)); abr('sales_array', javascript::encode($new_array2)); abr('days', json_encode($days)); abr('valuta', html_entity_decode($currency['symbol'], ENT_QUOTES, 'utf-8')); require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';