@extends('layouts.app')

@section('content')
<div class="container">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3>
            Car Show Winners
          </h3>
        </div>
        <div class="panel-body">
          @if($carshowwinner_results)
          <table align='center' class='table table-striped table-condensed table-hover table-bordered'>
            <tr>
              <th>
                Award Category:
              </th>
              <th>
                Place:
              </th>
              <th>
                Vehicle Number:
              </th>
              <th>
                Year:
              </th>
              <th>
                Make:
              </th>
              <th>
                Model:
              </th>
              <th>
                Owner:
              </th>
            </tr>
            @foreach($carshowwinner_results as $carshowwinner_result)
            <tr>
              <td>
                {{ $carshowwinner_result->awardCategory[0]->category_name }}
              </td>
              <td>
                {{ $carshowwinner_result->place }}
              </td>
              <td>
                {{ $carshowwinner_result->awardVehicle[0]->owner }}
              </td>
              <td>
                {{ $carshowwinner_result->awardVehicle[0]->year }}
              </td>
              <td>
                {{ $carshowwinner_result->awardVehicle[0]->make }}
              </td>
              <td>
                {{ $carshowwinner_result->awardVehicle[0]->model }}
              </td>
              <td>
                
                {{ $carshowwinner_result->awardVehicle[0]->vehicleOwner->bidder_fname }} {{ $carshowwinner_result->awardVehicle[0]->vehicleOwner->bidder_lname }}
              </td>                            
            </tr>
            @endforeach
          </table>
          @else
          <h3>
            No Car Show Winners!
          </h3>
          @endif
        </div>
      </div>
    </div>
  </div>
</div>
@endsection