示例#1
0
            }
        }
        if ($success) {
            $message[] = __('Match(es) updated successfully.', 'phpleague');
        } else {
            $message[] = __('An error occurred during the results generation.', 'phpleague');
        }
    }
    // 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);