@model IEnumerable<SportsDivision.Application.DTOs.ReportDtos.StudentPointsReportDto>
@{
    ViewData["Title"] = "Student Points";
}

<div class="d-flex justify-content-between align-items-center mb-3">
    <h2 class="mb-0">Student Points</h2>
    <div class="d-flex gap-2">
        <a asp-action="StudentPointsExcel" asp-route-tournamentId="@ViewBag.TournamentId" asp-route-schoolId="@ViewBag.SchoolId" asp-route-zoneId="@ViewBag.ZoneId" class="btn btn-success"><i class="bi bi-file-earmark-excel"></i> Export to Excel</a>
        <a asp-action="StudentPointsPdf" asp-route-tournamentId="@ViewBag.TournamentId" asp-route-schoolId="@ViewBag.SchoolId" asp-route-zoneId="@ViewBag.ZoneId" class="btn btn-outline-danger"><i class="bi bi-file-earmark-pdf"></i> PDF</a>
    </div>
</div>
<hr />

<table class="table table-striped table-hover">
    <thead class="table-dark">
        <tr><th>Student</th><th>School</th><th>Sex</th><th class="text-center">Events</th><th class="text-center">Total Points</th></tr>
    </thead>
    <tbody>
        @foreach (var s in Model)
        {
            <tr>
                <td>@s.StudentName</td>
                <td>@s.SchoolName</td>
                <td><span class="badge @(s.Sex == "Male" ? "bg-primary" : "bg-danger")">@s.Sex</span></td>
                <td class="text-center">@s.EventCount</td>
                <td class="text-center"><strong>@s.TotalPlacementPoints</strong></td>
            </tr>
        }
    </tbody>
</table>

<a asp-action="Index" class="btn btn-secondary">Back to Reports</a>
