Exemplo n.º 1
0
$matches = kicker::get_matches();
list($matches_highest_elo_points, $ten_zero_matches, $matches_highest_exp_values) = kicker::get_hall_of_fame($matches);
$smarty->assign('matches_highest_elo_points', $matches_highest_elo_points);
$smarty->assign('ten_zero_matches', $ten_zero_matches);
$smarty->assign('matches_highest_exp_values', $matches_highest_exp_values);
$players = kicker::get_player_info('elo');
$smarty->assign('players', $players);
$player_names = kicker::get_player_names();
$smarty->assign('player_names', $player_names);
$result_count = kicker::get_result_count();
$chart_js_result = "\n\t\t\t<script type='text/javascript'>\n\n\t\t\t\tgoogle.load('visualization', '1', {'packages': ['corechart']});\n\t\t\t\tgoogle.setOnLoadCallback(drawChartResults);\n\n\t\t\t\tfunction drawChartResults() {\n\t\t\t\t\tvar data = google.visualization.arrayToDataTable([\n\t\t\t\t\t\t['Results', 'Count'],\n\t\t\t\t\t\t['10:0'," . $result_count['10:0'] . "],\n\t\t\t\t\t\t['10:1'," . $result_count['10:1'] . "],\n\t\t\t\t\t\t['10:2'," . $result_count['10:2'] . "],\n\t\t\t\t\t\t['10:3'," . $result_count['10:3'] . "],\n\t\t\t\t\t\t['10:4'," . $result_count['10:4'] . "],\n\t\t\t\t\t\t['10:5'," . $result_count['10:5'] . "],\n\t\t\t\t\t\t['10:6'," . $result_count['10:6'] . "],\n\t\t\t\t\t\t['10:7'," . $result_count['10:7'] . "],\n\t\t\t\t\t\t['10:8'," . $result_count['10:8'] . "],\n\t\t\t\t\t\t['10:9'," . $result_count['10:9'] . "]\n\t\t\t\t\t]);\n\n\t\t\t\t\toptions = {\n\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\tposition: 'none'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tvAxis: {\n\t\t\t\t\t\t\ttitle: 'Count'\n\t\t\t\t\t\t},\n\t\t\t\t\t\thAxis: {\n\t\t\t\t\t\t\ttitle: 'Result',\n\t\t\t\t\t\t\ttextPosition: 'in'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar chart = new google.visualization.ColumnChart(document.getElementById('result_chart'));\n\t\t\t\t\tchart.draw(data, options);\n\t\t\t\t}\n\t\t\t</script>\n\t";
//page_footer::add_raw_code($chart_js_result);
$charts = [];
array_push($charts, $chart_js_result);
$first_match_date = kicker::get_first_match_date();
$last_match_date = kicker::get_last_match_date();
$smarty->assign('first_match_date', $first_match_date);
$smarty->assign('last_match_date', $last_match_date);
$player_names = kicker::get_player_names();
list($elo_trend, $avg_exp, $team_stats, $team_trend_java) = kicker::calculate_elostats();
$chart_js_trend = "<script type='text/javascript'>\n\n\t\t\tgoogle.load('visualization', '1', {'packages': ['corechart']});\n\t\t\tgoogle.setOnLoadCallback(initChartTrend);\n\n\t\t\tvar options_trend = {};\n\t\t\tvar chart_trend;\n\t\t\tvar data_trend_date;\n\t\t\tvar data_trend_string;\n\t\t\tvar data_trend;\n\t\t\tvar data_trend_bool = 1;\n\t\t\tvar columns_trend = [];\n\t\t\tvar series = {};\n\n\t\t\tfunction initChartTrend() {\n\n\t\t\t\tchart_trend = new google.visualization.LineChart(document.getElementById('trend_chart'));";
/*
$chart_js_trend .= 'data_trend_date = google.visualization.arrayToDataTable([";
	$chart_js_trend .= "['date'";
	ksort($player_names);
	foreach($player_names as $id => $name) {
		$chart_js_trend .= ", '" . $name . "'";
	}
	$chart_js_trend .= "]";
	foreach($elo_trend as $date => $id_elo) {
		$ymd = explode('-', $date);