diff --git a/pfosten/app/Http/Controllers/UsersController.php b/pfosten/app/Http/Controllers/UsersController.php index d04d8b55..6de560e3 100755 --- a/pfosten/app/Http/Controllers/UsersController.php +++ b/pfosten/app/Http/Controllers/UsersController.php @@ -462,6 +462,18 @@ class UsersController extends Controller $user->gets_reminders=false; } + if (request()->has('iban')) { + $user->iban = request('iban'); + } + if (request()->has('blz')) { + $user->blz=request('blz'); + } + if (request()->has('bankname')) { + $user->bankname=request('bankname'); + } + if (request()->has('kontonr')) { + $user->kontonr=request('kontonr'); + } Log::info("Setting gets_reminders to: " . request('gets_reminders')); $user->save(); return redirect('/'); diff --git a/pfosten/app/Quota.php b/pfosten/app/Quota.php index d48eaa28..c13b691a 100644 --- a/pfosten/app/Quota.php +++ b/pfosten/app/Quota.php @@ -99,12 +99,13 @@ class Quota extends Model $quota->save(); } -/* + public static function getQuota($quota_name) { + $season_id=Season::getCurrent()->id; $quota=Quota::all()->where('season_id','=', $season_id)->where('name','=', $quota_name)->first(); return $quota['prc']; } -*/ + public static function getQuotas() { $season_id = Season::getCurrent()->id; $quotas=Quota::all()->where('season_id','=', $season_id); diff --git a/pfosten/app/Season.php b/pfosten/app/Season.php index c8e2acf4..beb1b22d 100644 --- a/pfosten/app/Season.php +++ b/pfosten/app/Season.php @@ -71,5 +71,15 @@ class Season extends Model return false; } + public static function hasGreenShirtGame($seasonId=-1) { + $season=null; + if ($seasonId==-1) { + $season = Season::getCurrent(); + if (!$season) return false; + $seasonId=$season->id; + } + $quota=Quota::getQuota("Gruenes Trikot"); + return $quota>0; + } } diff --git a/pfosten/resources/views/layouts/nav.blade.php b/pfosten/resources/views/layouts/nav.blade.php index 41fb3bc2..5389de6b 100644 --- a/pfosten/resources/views/layouts/nav.blade.php +++ b/pfosten/resources/views/layouts/nav.blade.php @@ -36,7 +36,9 @@