Exemplo n.º 1
0
        }
    }
    // Player mod is enabled, so check if we have anything to add in the database
    if ($setting->player_mod === 'yes') {
        // Secure data
        $players = !empty($_POST['players']) ? $_POST['players'] : 0;
        if (is_array($players)) {
            foreach ($players as $key => $item) {
                // Remove old match data
                $db->remove_players_data_match($key);
                foreach ($item as $row) {
                    // TODO - Show a message that we intercept a duplicata try
                    // $key = id_match, $row = id_player_team
                    // Check that the player is real and not already once in the match
                    if ($row > 0 && $db->player_data_already_match($row, $key) === FALSE) {
                        $db->add_player_data(255, $row, $key, 1);
                    }
                }
            }
        }
    }
}
$output .= $fct->form_open(admin_url($page_url));
$output .= '<div class="tablenav"><div class="alignleft actions">' . $fct->input('results', __('Save', 'phpleague'), array('type' => 'submit', 'class' => 'button')) . '</div></div>';
$nb_fixtures = $db->nb_fixtures_league($id_league);
$count = 0;
for ($fixture_number = 1; $fixture_number <= $nb_fixtures; $fixture_number++) {
    $show = false;
    $table = '<table class="widefat"><thead><tr><th colspan="6">' . __(' - Fixture: ', 'phpleague') . $fixture_number . '</th></tr></thead><tbody>';
    foreach ($db->get_results_by_fixture($fixture_number, $id_league) as $key => $row) {
        if (in_array($row->home_id, $my_club_ids) || in_array($row->away_id, $my_club_ids)) {