@{
    ViewBag.Title = "Statistiky";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Statistiky hráče @ViewBag.playerName</h2>

<table>
    <tr>
        <th>K</th>
        <th>Datum</th>
        <th>Zápas</th>
        <th>Výsledek</th>
        <th>Min.</th>
        <th>G</th>
        <th>ŽK</th>
        <th>ČK</th>
    </tr>

    @{int minutes = 0; int goals = 0; int yellowCards = 0; int redCards = 0;}

    @foreach (var item in ViewBag.stats)
    {
        minutes += item.minutes;
        goals += item.goals;
        yellowCards += item.yellowCards;
        redCards += item.redCards;
        <tr>
            <td>@item.round</td>
            <td>@item.date</td>
            <td><span>@item.homeClub</span> - <span>@item.visitorClub</span></td>
            <td>@item.result</td>
            <td>@item.minutes</td>
            <td>@item.goals</td>
            <td>@item.yellowCards</td>
            <td>@item.redCards</td>
        </tr>
    }

    <tr>
        <th colspan="4">Celkem</th>
        <th>@minutes</th>
        <th>@goals</th>
        <th>@yellowCards</th>
        <th>@redCards</th>
    </tr>

</table>
