Files
tippspiel/tippspiel/resources/views/dashboard.blade.php
2018-06-02 01:53:24 +02:00

62 lines
2.8 KiB
PHP

@extends('layouts.app')
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Dashboard</div>
<div class="card-body">
Ihr momentaner Punktestand: {!! ($temp = $tipps->sum('score')) ? $temp : '-' !!}
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Spiele</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Datum</th>
<th scope="col">Team A</th>
<th scope="col">Team B</th>
<th scope="col">Ergebnis</th>
<th scope="col">Tipp</th>
<th scope="col">Edit</th>
</tr>
</thead>
<tbody>
@foreach($matches as $match)
<tr>
<td>{!! $match->date !!}</td>
<td>{!! $teams->find($match->teama)->name !!}</td>
<td>{!! $teams->find($match->teamb)->name !!}</td>
<td>{!! $match->resulta . ':' . $match->resultb !!}</td>
<td>{!! $tipps->where('matchid', 1)->pluck('resulta')->first() . ':' . $tipps->where('matchid', 1)->pluck('resultb')->first() !!}</td>
<td>
@if($tipps->where('matchid', $match->id)->pluck('resulta')->first() == null)
<!-- Edit -->
{!! Form::model($match, ['method' => 'GET', 'action' => ['PagesController@createTipp', $match->id], 'style' => 'display:inline-block;']) !!}
<button class="btn btn-primary" type="submit">Tipp<button>
{!! Form::close() !!}
@endif
</td>
</tr>
</tbody>
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
@endsection