@extends('layouts.app', ['page' => __('User Management'), 'pageSlug' => 'users'])

@section('content')
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header">
                    <div class = "row">
                        <div class="col-sm-6 text-left">
                            <h5 class="card-category">Aginēēk Clubs</h5>
                            <h2 class="card-title">Club Performance</h2>
                        </div>
                        <!-- Currently, this selector does NOT change the content displayed on the table. It is a placeholder for the time being -->
                            <div class="col-sm-6">
                                <select class="browser-default custom-select main-select float-right">
                                    <option class="dropdown-select" selected value="All">Select A Game Type</option>
                                    <option class="dropdown-option" value="#">3-side Speed</option>
                                    <option class="dropdown-option" value="#">Rondo</option>
                                    <option class="dropdown-option" value="#">North South West</option>
                                    <option class="dropdown-option" value="#">Corners</option>
                                    <option class="dropdown-option" value="#">Transition</option>
                                    <option class="dropdown-option" value="#">90 Degrees</option>
                                </select>
                            </div>
                    </div>
                    <table id="tableHorizontalWrapper" class="table table-hover table-sm text-center" cellspacing="0"width="50%">
                    <thead>
                        <tr>
                            <td><strong>Club ID</strong></td>
                            <td><strong>Club Name</strong></td>
                            <td><strong>Game Type</strong></td>
                            <td><strong>Top Player</strong></td>
                            <td><strong>Performance (H/M)</strong></td>
                        </tr>
                    </thead>
                    @foreach ($clubs as $club)
                    <tr>
                        <td>{{ $club->club_id }}</td>
                        <td>{{ $club->club_name }}</td>
                        @if($club->game_type == null)
                            <td>No Type Given</td>
                        @else
                            <td>{{ $club->game_type }}</td>
                        @endif
                        <td>
                            <a href='{{ action("PlayerController@index", ["playerid" => $club->player_id]) }}'>{{ $club->first_name }} {{ $club->last_name }}</a>
                        </td>
                        <td>{{ $club->hits }}/{{ $club->misses }}</td>
                    </tr> 
                    @endforeach
                    
                    </table>
                    <div>
                        {{ $clubs->links()}}
                    </div>
                </div>
            </div>
        </div>
    </div>

    
@endsection
