Пример #1
0
if (empty($lid)) {
    $lids = $m->getLeagueIds(FALSE);
    if (!$lids) {
        echo 'Error: Unable to find league ids for you.', PHP_EOL;
        exit;
    }
    echo "<h3>Choose a League ID</h3>";
    echo "<ul>";
    foreach ($lids as $lid) {
        echo "<li>";
        echo '<a href="transactions.php?lid=' . $lid['league_key'] . '">' . $lid['name'] . ' (' . $lid['season'] . ')</a>';
        echo "</li>";
    }
    exit;
}
$transactions = $m->getTransactions($lid);
echo "<h3>Transactions for league id '{$lid}'</h3>";
echo '<table border="1">';
echo '<tr><th>Player</th><th>Type</th><th>Manager</th><th>Date</th></tr>';
$i = 0;
foreach ($transactions as $transaction) {
    $bgcolor = ++$i & 1 ? '#cccccc' : '#ffffff';
    echo "<tr bgcolor='{$bgcolor}'>";
    echo '<td>', $transaction['player_name'], ' (', $transaction['team'], ')</td>';
    echo '<td>', $transaction['vtype'], '</td>';
    echo '<td>', $m->teamnames[$transaction['manager']], '</td>';
    echo '<td>', date('Y m d', $transaction['timestamp']), '</td>';
    echo '</tr>';
}
echo '</table>';
require './inc/footer.php';