4in1 Tipp

This commit is contained in:
tschneider 2020-12-30 10:13:34 +01:00
parent bf5af4722c
commit 557050d05f
4 changed files with 285 additions and 2 deletions

View file

@ -0,0 +1,126 @@
@extends('layouts.layout')
@section('content')
<div>
<h1>{{$round->name}}</h1>
<p>&nbsp;</p>
<div >
<form method="POST" action="/tipps/store4">
{{ csrf_field() }}
<!-- 1 -->
<div>
<h3>
<span style="float:left; width:200px;">{{ $game1->team1 }} &nbsp; : &nbsp; </span>
<span style="float:left; width:200px;">{{ $game1->team2 }}</span>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score1_1" value="{{ $tipp1->score1==-1? '': $tipp1->score1 }}" required>
<p style="float:left; width:25px;">&nbsp; : &nbsp;</p>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score2_1" value="{{ $tipp1->score2==-1? '': $tipp1->score2 }}" required>
<label class="lead" style="float:left; width:50px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Joker &nbsp;</label>
</h3>
</div>
<span >
@if (App\Round::hasLockedGame($game1->round_id))
{{ Form::checkbox('joker', 'yes', $tipp1->joker, array('disabled') ) }} <!-- name, value, checked -->
@else
{{ Form::checkbox('joker', 'yes', $tipp1->joker) }} <!-- name, value, checked -->
@endif
</span>
<input type="hidden" name="tipp_id_1" value="{{ $tipp1->id }}">
<input type="hidden" name="game_id_1" value="{{ $game1->id }}">
<!-- round_id is the same for all 4 games. -->
<input type="hidden" name="round_id" value="{{ $game1->round_id }}">
<!-- 2 -->
<h1>&nbsp;</h1>
<div>
<h3>
<span style="float:left; width:200px;">{{ $game2->team1 }} &nbsp; : &nbsp; </span>
<span style="float:left; width:200px;">{{ $game2->team2 }}</span>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score1_2" value="{{ $tipp2->score1==-1? '': $tipp2->score1 }}" required>
<p style="float:left; width:25px;">&nbsp; : &nbsp;</p>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score2_2" value="{{ $tipp2->score2==-1? '': $tipp2->score2 }}" required>
<label class="lead" style="float:left; width:50px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Joker &nbsp;</label>
</h3>
</div>
<span >
@if (App\Round::hasLockedGame($game2->round_id))
{{ Form::checkbox('joker', 'yes', $tipp2->joker, array('disabled') ) }} <!-- name, value, checked -->
@else
{{ Form::checkbox('joker', 'yes', $tipp2->joker) }} <!-- name, value, checked -->
@endif
</span>
<input type="hidden" name="tipp_id_2" value="{{ $tipp2->id }}">
<input type="hidden" name="game_id_2" value="{{ $game2->id }}">
<!-- 3 -->
<h1>&nbsp;</h1>
<div>
<h3>
<span style="float:left; width:200px;">{{ $game3->team1 }} &nbsp; : &nbsp; </span>
<span style="float:left; width:200px;">{{ $game3->team2 }}</span>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score1_3" value="{{ $tipp3->score1==-1? '': $tipp3->score1 }}" required>
<p style="float:left; width:25px;">&nbsp; : &nbsp;</p>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score2_3" value="{{ $tipp3->score2==-1? '': $tipp3->score2 }}" required>
<label class="lead" style="float:left; width:50px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Joker &nbsp;</label>
</h3>
</div>
<span >
@if (App\Round::hasLockedGame($game3->round_id))
{{ Form::checkbox('joker', 'yes', $tipp3->joker, array('disabled') ) }} <!-- name, value, checked -->
@else
{{ Form::checkbox('joker', 'yes', $tipp3->joker) }} <!-- name, value, checked -->
@endif
</span>
<input type="hidden" name="tipp_id_3" value="{{ $tipp3->id }}">
<input type="hidden" name="game_id_3" value="{{ $game3->id }}">
<!-- 4 -->
<h1>&nbsp;</h1>
<div>
<h3>
<span style="float:left; width:200px;">{{ $game4->team1 }} &nbsp; : &nbsp; </span>
<span style="float:left; width:200px;">{{ $game4->team2 }}</span>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score1_4" value="{{ $tipp4->score1==-1? '': $tipp4->score1 }}" required>
<p style="float:left; width:25px;">&nbsp; : &nbsp;</p>
<input style="float:left; width:50px;" type="text" class="lead" id="" name="score2_4" value="{{ $tipp4->score2==-1? '': $tipp4->score2 }}" required>
<label class="lead" style="float:left; width:50px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Joker &nbsp;</label>
</h3>
</div>
<span >
@if (App\Round::hasLockedGame($game4->round_id))
{{ Form::checkbox('joker', 'yes', $tipp4->joker, array('disabled') ) }} <!-- name, value, checked -->
@else
{{ Form::checkbox('joker', 'yes', $tipp4->joker) }} <!-- name, value, checked -->
@endif
</span>
<input type="hidden" name="tipp_id_4" value="{{ $tipp4->id }}">
<input type="hidden" name="game_id_4" value="{{ $game4->id }}">
<div class="form-group">
<p>&nbsp;</p>
<button type="submit" class="btn btn-primary">Ok</button>
</div>
</form>
</div>
</div>
@endsection

View file

@ -66,6 +66,14 @@
@endforeach
</table>
<!-- 4 in 1 functionality -->
@if (Auth::user()->admin)
@if(App\Round::hasLockedGame($round->id)!=true)
<a href="/tipps/edit4/{{$game->round_id}}">Runde Tippen</a>
@endif
@endif
</span>
</span>
<p>&nbsp;</p>