Rounds: Spielergebnisse können gelöscht werden, Spielmaske kann ohne Ergebnis Eingabe verlassen werden
This commit is contained in:
parent
4d045b6472
commit
5a90bb2c8a
3 changed files with 12 additions and 8 deletions
|
|
@ -25,17 +25,23 @@ class GamesController extends Controller
|
||||||
'id' => 'required',
|
'id' => 'required',
|
||||||
'team1' => 'required',
|
'team1' => 'required',
|
||||||
'team2' => 'required',
|
'team2' => 'required',
|
||||||
'score1' => 'required',
|
|
||||||
'score2' => 'required',
|
|
||||||
'kickoff' => 'required'
|
'kickoff' => 'required'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$score1=-1;
|
||||||
|
$score2=-1;
|
||||||
|
|
||||||
|
if (request("score1") && request("score2")) {
|
||||||
|
$score1=request("score1");
|
||||||
|
$score2=request("score2");
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch, modify, save game
|
// Fetch, modify, save game
|
||||||
$game = Game::where('id', request('id'))->first(); // Only for editing existing. New games get created in RoundsController.
|
$game = Game::where('id', request('id'))->first(); // Only for editing existing. New games get created in RoundsController.
|
||||||
$game->team1 = request('team1');
|
$game->team1 = request('team1');
|
||||||
$game->team2 = request('team2');
|
$game->team2 = request('team2');
|
||||||
$game->score1= request('score1');
|
$game->score1= $score1;
|
||||||
$game->score2= request('score2');
|
$game->score2= $score2;
|
||||||
$game->kickoff=User::toDBDate(request('kickoff'));
|
$game->kickoff=User::toDBDate(request('kickoff'));
|
||||||
$game->save();
|
$game->save();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,6 @@ class TippsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function store() {
|
public function store() {
|
||||||
// Validate form
|
// Validate form
|
||||||
$this->validate(request(), [
|
$this->validate(request(), [
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div style="float:left; width:25px"> </div>
|
<div style="float:left; width:25px"> </div>
|
||||||
<div style="float:left; width:40px">
|
<div style="float:left; width:40px">
|
||||||
<input type="text" class="form-control" id="score1" name="score1" value="{{ $game->score1==-1?'':$game->score1 }}" required>
|
<input type="text" class="form-control" id="score1" name="score1" value="{{ $game->score1==-1?'':$game->score1 }}" >
|
||||||
</div>
|
</div>
|
||||||
<div style="float:left; width:15px"> : </div>
|
<div style="float:left; width:15px"> : </div>
|
||||||
<div style="float:left; width:40px">
|
<div style="float:left; width:40px">
|
||||||
<input type="text" class="form-control" id="score2" name="score2" value="{{ $game->score2==-1?'':$game->score2 }}" required>
|
<input type="text" class="form-control" id="score2" name="score2" value="{{ $game->score2==-1?'':$game->score2 }}" >
|
||||||
</div>
|
</div>
|
||||||
<div style="float:left; width:25px"> </div>
|
<div style="float:left; width:25px"> </div>
|
||||||
<!--<div style="float:left; width:175px">-->
|
<!--<div style="float:left; width:175px">-->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue