コード例 #1
0
                $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)) {
            $show = true;
            $table .= '<tr>' . '<td style="text-align:right;">' . esc_html($row->name_home) . '</td>';
            $table .= '<td class="check-column">' . $fct->input('array[' . $count . '][goal_home]', $row->goal_home == $sport->get_forfeit_code() ? FORFEIT_INPUT : $row->goal_home, array('size' => 2)) . '</td>';
            $table .= '<td class="check-column">' . $fct->input('array[' . $count . '][goal_away]', $row->goal_away == $sport->get_forfeit_code() ? FORFEIT_INPUT : $row->goal_away, array('size' => 2)) . '</td>';
            $table .= '<td>' . esc_html($row->name_away) . '</td>';
            $table .= '<td class="check-column">' . $fct->input('array[' . $count . '][date]', esc_html($row->played), array('size' => 18, 'class' => 'masked-full', 'type' => 'hidden')) . $fct->input('array[' . $count . '][id_match]', (int) $row->match_id, array('type' => 'hidden')) . '</td>';
            $table .= '<td class="check-column">' . $button_players . '</td></tr>';
        }
    }