@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -HTML::macro('image_link', function ($url = '', $img = '', $alt = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 3 | +HTML::macro('image_link', function($url = '', $img = '', $alt = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 4 | 4 | $url = $ssl == true ? URL::to_secure($url) : URL::to($url); |
| 5 | 5 | $img = HTML::image($img, $alt); |
| 6 | 6 | $img .= $link_name; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | return $link; |
| 11 | 11 | }); |
| 12 | 12 | |
| 13 | -HTML::macro('icon_link', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 13 | +HTML::macro('icon_link', function($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 14 | 14 | $url = $ssl == true ? URL::to_secure($url) : URL::to($url); |
| 15 | 15 | $icon = '<i class="'.$icon.'" aria-hidden="true"></i>'.$link_name; |
| 16 | 16 | $link = $active == true ? HTML::link($url, '#', $param) : $icon; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | return $link; |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | -HTML::macro('icon_btn', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 22 | +HTML::macro('icon_btn', function($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { |
|
| 23 | 23 | $url = $ssl == true ? URL::to_secure($url) : URL::to($url); |
| 24 | 24 | $icon = $link_name.' <i class="'.$icon.'" aria-hidden="true"></i>'; |
| 25 | 25 | $link = $active == true ? HTML::link($url, '#', $param) : $icon; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | }); |
| 30 | 30 | |
| 31 | 31 | // SHOW USERNAME |
| 32 | -HTML::macro('show_username', function () { |
|
| 32 | +HTML::macro('show_username', function() { |
|
| 33 | 33 | $the_username = (Auth::user()->name === Auth::user()->email) ? ((is_null(Auth::user()->first_name)) ? (Auth::user()->name) : (Auth::user()->first_name)) : (((is_null(Auth::user()->name)) ? (Auth::user()->email) : (Auth::user()->name))); |
| 34 | 34 | |
| 35 | 35 | return $the_username; |
@@ -27,11 +27,11 @@ |
||
| 27 | 27 | DB::table('users_codes')->insert(['fk_users' => Auth::user()->id, 'fk_game_codes' => $rawQR[0]->id]); |
| 28 | 28 | $checkExists = DB::select('SELECT * FROM users RIGHT JOIN users_codes ON users.id = users_codes.fk_users RIGHT JOIN game_codes ON users_codes.fk_game_codes = game_codes.id WHERE name_gen = ? AND game_code = ?;', [Auth::user()->name_gen, $param]); |
| 29 | 29 | $checkExists = json_decode(json_encode($checkExists)); |
| 30 | - $view = view('user.scan', ['checkExists' => $checkExists,'maxPoints' => $maxPoints,'first' => 1]); |
|
| 30 | + $view = view('user.scan', ['checkExists' => $checkExists, 'maxPoints' => $maxPoints, 'first' => 1]); |
|
| 31 | 31 | } else { |
| 32 | 32 | $checkExists = DB::select('SELECT * FROM users RIGHT JOIN users_codes ON users.id = users_codes.fk_users RIGHT JOIN game_codes ON users_codes.fk_game_codes = game_codes.id WHERE name_gen = ? AND game_code = ?;', [Auth::user()->name_gen, $param]); |
| 33 | 33 | $checkExists = json_decode(json_encode($checkExists)); |
| 34 | - $view = view('user.scan', ['checkExists' => $checkExists,'maxPoints' => $maxPoints])->withErrors('Der Code wurde bereits gezählt.'); |
|
| 34 | + $view = view('user.scan', ['checkExists' => $checkExists, 'maxPoints' => $maxPoints])->withErrors('Der Code wurde bereits gezählt.'); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $this->calcTotalPoints(Auth::user()->name_gen); |