示例#1
0
if (isset($_GET['reset_elo'])) {
    kicker::reset_elo_points();
}
// Calculates new elo-points
if (isset($_GET['calc_elo_new'])) {
    kicker::calculate_elostats(true);
}
//if (isset($_GET['calc_elo_today'])) {
//	kicker::calculate_elostats(date('Y-m-d'));
//}
if (isset($_POST['add_availability_lunch'])) {
    kicker::add_availability($_POST['add_availability_lunch'], kicker::AFTER_LUNCH);
} 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();