Exemple #1
0
<?php

// load Smarty library
require 'Smarty.class.php';
require 'classes/db_conn.inc';
require 'classes/kicker.inc';
$smarty = new Smarty();
$smarty->template_dir = 'C:\\Users\\Sven\\Projekte\\Lakitu\\templates';
$smarty->config_dir = ' C:\\Users\\Sven\\Projekte\\smarty\\config';
$smarty->cache_dir = 'C:\\Users\\Sven\\Projekte\\smarty\\cache';
$smarty->compile_dir = 'C:\\Users\\Sven\\Projekte\\smarty\\templates_c';
// Show player stats
$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();
Exemple #2
0
    kicker::insert_new_matches($_POST['home1'], $_POST['home2'], $_POST['away1'], $_POST['away2'], $matches);
    //	header("HTTP/1.1 301 Moved Permanently");
    //	header("Location: index.php");
    //	exit();
}
$smarty->assign('IS_MOBILE', $is_mobile);
list($elo_trend, $avg_exp, $team_stats, $team_trend_java) = kicker::calculate_elostats();
$smarty->assign('elo_trend', $elo_trend);
$smarty->assign('avg_exp', $avg_exp);
$smarty->assign('team_stats', $team_stats);
$smarty->assign('team_trend_java', $team_trend_java);
//var_dump($team_stats);
$players = kicker::get_player_info('elo', 'noalumni');
$smarty->assign('players', $players);
//page_footer::add_php_var_to_js('players', $players);
$matches = kicker::get_matches(!isset($_GET['show_all']), !isset($_GET['sort_desc']));
$smarty->assign('matches', $matches);
$total_goals = kicker::get_total_goals();
$smarty->assign('total_goals', $total_goals);
$player_names = kicker::get_player_names();
$smarty->assign('player_names', $player_names);
list($player_streaks_c, $player_streaks) = kicker::get_5game_streaks();
$player_form = kicker::get_form($player_streaks);
$substring = 10 * 35;
// how many streaks should be shown
$smarty->assign('player_streaks', $player_streaks);
$smarty->assign('player_streaks_c', $player_streaks_c);
$smarty->assign('player_form', $player_form);
//$smarty->assign('colored', $colored);
$smarty->assign('substring', $substring);
$availabilities = kicker::get_availabilities();