} elseif (isset($_POST['add_availability_work'])) { kicker::add_availability($_POST['add_availability_work'], kicker::AFTER_WORK); } elseif (isset($_POST['remove_availability'])) { kicker::remove_availability($_POST['remove_availability']); } if (isset($_POST['new_games'])) { $matches = []; for ($i = 0; $i < $_POST['new_games']; $i++) { $matches[$i]['home_goals'] = $_POST['home_goals'][$i]; $matches[$i]['away_goals'] = $_POST['away_goals'][$i]; if (!isset($_POST['match_type'][$i])) { $_POST['match_type'][$i] = 10; } $matches[$i]['match_type'] = $_POST['match_type'][$i]; } 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']));