...
This commit is contained in:
parent
09b75172d8
commit
64e4959884
9 changed files with 91 additions and 67 deletions
|
|
@ -114,8 +114,7 @@ class RoundsController extends Controller
|
|||
|
||||
// Validate form
|
||||
$this->validate(request(), [
|
||||
'round_id' => 'required',
|
||||
'report' => 'required'
|
||||
'round_id' => 'required'
|
||||
]);
|
||||
|
||||
$seasonId = Season::getCurrent()->id;
|
||||
|
|
@ -124,8 +123,10 @@ class RoundsController extends Controller
|
|||
|
||||
//Log::info("Report = ".request("report"));
|
||||
|
||||
|
||||
$round->report = request("report");
|
||||
$round->report="";
|
||||
if (request("report")){
|
||||
$round->report = request("report");
|
||||
}
|
||||
$round->save();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,22 @@ use Log;
|
|||
class UsersController extends Controller
|
||||
{
|
||||
public function main() {
|
||||
$roundname="";
|
||||
$report="";
|
||||
|
||||
return view('main');
|
||||
$currentSeason=Season::getCurrent();
|
||||
|
||||
if ($currentSeason) {
|
||||
$round_id = Round::getLastLockedRoundId();
|
||||
if ($round_id > -1) {
|
||||
$round = Round::where("id", "=", $round_id)->first();
|
||||
$report = $round->report;
|
||||
Log::info("Loaded report:".$report." round-id=".$round_id);
|
||||
$roundname = $round->name;
|
||||
} else { Log::info("No round identified. Last Locked=".$round_id); }
|
||||
} else {Log::info("No current season");}
|
||||
|
||||
return view('main',compact('roundname','report'));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
|
@ -87,6 +101,8 @@ class UsersController extends Controller
|
|||
return redirect('/users');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function ranking($round_id) {
|
||||
Log::info("Start ranking");
|
||||
|
||||
|
|
@ -166,9 +182,6 @@ class UsersController extends Controller
|
|||
if (!array_key_exists($key,$tendencies)) { $tendencies[$key]=0; }
|
||||
$tendencies[$key]+=1;
|
||||
|
||||
if ($user->id==1) {
|
||||
Log::info("Triggered tendency bonus for userid ".$user->id." gameid ".$game->id." roundid ".$round->id." tippid ".$tipp->id." tendency=". $tendencies[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$user->totalScore += $score;
|
||||
|
|
@ -185,7 +198,7 @@ class UsersController extends Controller
|
|||
// Increase score here
|
||||
if (array_key_exists($key,$tendencies)) {
|
||||
if ($tendencies[$key] == 4) {
|
||||
Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]);
|
||||
//Log::info("Increasing score ! userid=" . $user->id . ", gameid " . $game->id . ", roundid " . $round->id . ", tippid " . $tipp->id . ", tendency=" . $tendencies[$key]);
|
||||
$user->totalScore += 2;
|
||||
$user->dayScore+=2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
@endif
|
||||
|
||||
<div class="container text-center">
|
||||
<p>Anfragen aller Art bitte an Volker Geissler.</p>
|
||||
<p>Tel. 0172xxxxxxx, vg@aol.com</p>
|
||||
<p>Anfragen aller Art bitte an Volker Geißler.</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" href="../../favicon.ico">
|
||||
<title>Hoschis Vollpfosten</title>
|
||||
<title>Hoschis Tippspiel</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<!-- Custom styles for this template -->
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
<div class="container">
|
||||
<div class="navbar">
|
||||
<div class="container text-center">
|
||||
|
||||
|
||||
<a class="lead" href="/">Start</a>
|
||||
@if (Auth::check())
|
||||
@if (Auth::user()->admin)
|
||||
<a class="lead" href="/seasons">Saison</a>
|
||||
|
|
|
|||
|
|
@ -14,23 +14,19 @@
|
|||
<div><p></p><p></p><p></p></div>
|
||||
</div>
|
||||
<a href="/register" class="btn btn-primary">Registrieren</a>
|
||||
</div>
|
||||
@endif
|
||||
@if (Auth::check())
|
||||
|
||||
<div class="lead"> </div>
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</section>
|
||||
@if (Auth::check())
|
||||
|
||||
<div class="container-fluid jumbotron col-md-12">
|
||||
<span class="col-md-2"></span>
|
||||
<span class="text-center col-md-8">
|
||||
<p> {{ $roundname }}</p>
|
||||
<p> {!! $report !!}</p>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
|
||||
<div class="container-fluid" style="width:800px;">
|
||||
<p>! </p>
|
||||
<p> </p>
|
||||
|
||||
|
||||
<p>Berichterstattung</p>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
@extends('layouts.layout')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-8">
|
||||
<div>
|
||||
|
||||
<h1>Spieltipp:</h1>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<div class="lead">{{ $game->team1 }} : {{ $game->team2 }}</div>
|
||||
|
||||
<div style="float:left;width:250px" class="lead">{{ $game->team1 }} : {{ $game->team2 }}</div>
|
||||
<div style="float:left;width:150px" >
|
||||
<div >
|
||||
<form method="POST" action="/tipps/store">
|
||||
{{ csrf_field() }}
|
||||
<div class="form-group">
|
||||
|
|
@ -17,24 +18,25 @@
|
|||
<p style="float:left; width:25px;"> : </p>
|
||||
<input style="float:left; width:50px;" type="text" class="lead" id="name" name="score2" value="{{ $tipp->score2==-1? '': $tipp->score2 }}" required>
|
||||
|
||||
<label class="lead" style="float:left; width:50px;">Joker: </label>
|
||||
|
||||
<div style="float:left;width:300px;">
|
||||
<label class="lead" style="float:left; width:50px;"> Joker </label>
|
||||
|
||||
<span >
|
||||
@if (App\Round::hasLockedGame($game->round_id))
|
||||
{{ Form::checkbox('joker', 'yes', $tipp->joker, array('disabled') ) }} <!-- name, value, checked -->
|
||||
<label style="float:left;width:500px;color:red;">Joker kann nicht verändert werden, weil die Runde bereits begonnen hat</label>
|
||||
@else
|
||||
{{ Form::checkbox('joker', 'yes', $tipp->joker) }} <!-- name, value, checked -->
|
||||
@endif
|
||||
</div>
|
||||
</span>
|
||||
|
||||
|
||||
<input type="hidden" name="id" value="{{ $tipp->id }}">
|
||||
<input type="hidden" name="round_id" value="{{ $game->round_id }}">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<p> </p>
|
||||
<button type="submit" class="btn btn-primary">Ok</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -2,64 +2,73 @@
|
|||
|
||||
@section('content')
|
||||
<section class="jumbotron text-center">
|
||||
<div class="container" style="float:left; width:800px">
|
||||
<div class="container">
|
||||
|
||||
@if ($activeSeason)
|
||||
<label>Aktive Saison:{{ $activeSeason->name }}</label>
|
||||
@endif
|
||||
|
||||
<p class="lead">Tipps</p>
|
||||
|
||||
<p class="lead" style="font-size: 32px;">Tipps</p>
|
||||
<p> </p>
|
||||
|
||||
</div>
|
||||
<span class="container-fluid col-md-12">
|
||||
@if ($activeSeason)
|
||||
<div>
|
||||
|
||||
@foreach($rounds->reverse() as $round)
|
||||
|
||||
<div><label class="text lead">{{ $round->name }} </label></div>
|
||||
<table class="table-bordered">
|
||||
<tr class="table-bordered">
|
||||
<td class="table-bordered">Spiel</td>
|
||||
<td class="table-bordered">Anstoss</td>
|
||||
<td class="table-bordered">Ergebnis</td>
|
||||
|
||||
<td class="table-bordered">Tipp</td>
|
||||
<td class="table-bordered"> Joker </td>
|
||||
<td class="table-bordered">Punkte</td>
|
||||
</tr>
|
||||
<span class="col-md-12">
|
||||
|
||||
@foreach($round->games as $game)
|
||||
<tr class="table-bordered">
|
||||
<td class="table-bordered" style="width:600px;"><label class="text" href="/games/edit/{{ $game->id }}">{{ $game->team1 }} : {{ $game->team2 }}</label> </td>
|
||||
<td class="table-bordered" style="width:600px;"><label class="text" > {{ App\User::toGermanDate($game->kickoff) }}</label></td>
|
||||
<span class="col-md-4"></span>
|
||||
|
||||
<td class="table-bordered" style="width:350px;">{{ $game->hasResult() ? $game->score1 . ' : ' . $game->score2 : ' Tippen ' }}</td>
|
||||
<span class="col-md-5">
|
||||
<table class="table-bordered">
|
||||
<tr class="table-bordered">
|
||||
<td class="table-bordered">Spiel</td>
|
||||
<td class="table-bordered">Anstoss</td>
|
||||
<td class="table-bordered">Ergebnis</td>
|
||||
|
||||
<td class="table-bordered" style="width:75px;">
|
||||
@if(App\Round::hasLockedGame($round->id)==true)
|
||||
<span>{{ App\Tipp::resultString(App\Tipp::getTipp( $user->id,$game->id)->id) }} </span>
|
||||
@else
|
||||
<a href="/tipps/edit/{{App\Tipp::getTipp($user->id,$game->id)->id}}">{{ App\Tipp::getTipp($user->id,$game->id)->score1== -1 ? 'Tippen': App\Tipp::resultString(App\Tipp::getTipp($user->id,$game->id)->id) }} </a>
|
||||
@endif
|
||||
<td class="table-bordered">Tipp</td>
|
||||
<td class="table-bordered"> Joker </td>
|
||||
<td class="table-bordered">Punkte</td>
|
||||
</tr>
|
||||
|
||||
</td>
|
||||
<td class="table-bordered"><img src="/img/joker.png" style="{{ (App\Tipp::getTipp($user->id,$game->id)->joker==true ? 'float:left;width:32px;height:32px' : 'display: none;') }}"></td>
|
||||
<td class="table-bordered">{{App\Tipp::getScore(App\Tipp::getTipp($user->id,$game->id)->id)}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@foreach($round->games as $game)
|
||||
<tr class="table-bordered">
|
||||
<td class="table-bordered" style="width:600px;"><label class="text" href="/games/edit/{{ $game->id }}">{{ $game->team1 }} : {{ $game->team2 }}</label> </td>
|
||||
<td class="table-bordered" style="width:600px;"><label class="text" > {{ App\User::toGermanDate($game->kickoff) }}</label></td>
|
||||
|
||||
<td class="table-bordered" style="width:350px;">{{ $game->hasResult() ? $game->score1 . ' : ' . $game->score2 : ' Tippen ' }}</td>
|
||||
|
||||
<td class="table-bordered" style="width:75px;">
|
||||
@if(App\Round::hasLockedGame($round->id)==true)
|
||||
<span>{{ App\Tipp::resultString(App\Tipp::getTipp( $user->id,$game->id)->id) }} </span>
|
||||
@else
|
||||
<a href="/tipps/edit/{{App\Tipp::getTipp($user->id,$game->id)->id}}">{{ App\Tipp::getTipp($user->id,$game->id)->score1== -1 ? 'Tippen': App\Tipp::resultString(App\Tipp::getTipp($user->id,$game->id)->id) }} </a>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
<td class="table-bordered"><img src="/img/joker.png" style="{{ (App\Tipp::getTipp($user->id,$game->id)->joker==true ? 'float:left;width:32px;height:32px' : 'display: none;') }}"></td>
|
||||
<td class="table-bordered">{{App\Tipp::getScore(App\Tipp::getTipp($user->id,$game->id)->id)}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
</span>
|
||||
</span>
|
||||
<p> </p>
|
||||
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</span>
|
||||
|
||||
</section>
|
||||
@endsection
|
||||
Loading…
Add table
Add a link
Reference in a new issue