@@ -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; |
@@ -74,14 +74,14 @@ |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if(count($allPoints) == 1){ |
| 77 | - DB::table('users')->where('id',Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 77 | + DB::table('users')->where('id',Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $codeCount = CodeCount::getCodeCount(); |
| 81 | 81 | |
| 82 | - if(count($allPoints) == $codeCount){ |
|
| 83 | - DB::table('users')->where('id',Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 84 | - } |
|
| 82 | + if(count($allPoints) == $codeCount){ |
|
| 83 | + DB::table('users')->where('id',Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 84 | + } |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -73,14 +73,14 @@ |
||
| 73 | 73 | DB::update('UPDATE users SET total_points = ? WHERE name_gen = ?;', [$totalPoints, $name_gen]); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if(count($allPoints) == 1){ |
|
| 77 | - DB::table('users')->where('id',Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 76 | + if (count($allPoints) == 1) { |
|
| 77 | + DB::table('users')->where('id', Auth::User()->id)->limit(1)->update(['start' => Carbon::now()->toDateTimeString()]); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $codeCount = CodeCount::getCodeCount(); |
| 81 | 81 | |
| 82 | - if(count($allPoints) == $codeCount){ |
|
| 83 | - DB::table('users')->where('id',Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 82 | + if (count($allPoints) == $codeCount) { |
|
| 83 | + DB::table('users')->where('id', Auth::User()->id)->update(['end' => Carbon::now()->toDateTimeString()]); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public function showRanking() |
| 13 | 13 | { |
| 14 | - $this->setRank(); |
|
| 14 | + $this->setRank(); |
|
| 15 | 15 | |
| 16 | 16 | $rankObj = DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
| 17 | 17 | $rankArray = json_decode(json_encode($rankObj), true); |
@@ -21,6 +21,6 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | private function setRank(){ |
| 24 | - DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
|
| 24 | + DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | return view('leader.ranking', ['rankArray' => $rankArray, 'userRank' => $userRank]); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - private function setRank(){ |
|
| 23 | + private function setRank() { |
|
| 24 | 24 | DB::select('SELECT first_name,scoutname,last_name,rank,total_points,start,end FROM users WHERE total_points > 0 ORDER BY rank DESC, total_points DESC;'); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -7,23 +7,23 @@ |
||
| 7 | 7 | |
| 8 | 8 | class CodeCount extends Controller |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Anzahl codes in DB hinterlegen. |
|
| 12 | - * |
|
| 13 | - * @param $codeCount |
|
| 14 | - * |
|
| 15 | - * @return int |
|
| 16 | - */ |
|
| 17 | - public static function setCodeCount($codeCount) |
|
| 18 | - { |
|
| 19 | - DB::table('game_admin')->insert(['code_count' => $codeCount]); |
|
| 10 | + /** |
|
| 11 | + * Anzahl codes in DB hinterlegen. |
|
| 12 | + * |
|
| 13 | + * @param $codeCount |
|
| 14 | + * |
|
| 15 | + * @return int |
|
| 16 | + */ |
|
| 17 | + public static function setCodeCount($codeCount) |
|
| 18 | + { |
|
| 19 | + DB::table('game_admin')->insert(['code_count' => $codeCount]); |
|
| 20 | 20 | |
| 21 | - return intval($codeCount); |
|
| 22 | - } |
|
| 21 | + return intval($codeCount); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public static function getCodeCount(){ |
|
| 25 | - $codeCount = DB::table('game_admin')->select('code_count')->first()->code_count; |
|
| 24 | + public static function getCodeCount(){ |
|
| 25 | + $codeCount = DB::table('game_admin')->select('code_count')->first()->code_count; |
|
| 26 | 26 | |
| 27 | - return $codeCount; |
|
| 28 | - } |
|
| 27 | + return $codeCount; |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | return intval($codeCount); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public static function getCodeCount(){ |
|
| 24 | + public static function getCodeCount() { |
|
| 25 | 25 | $codeCount = DB::table('game_admin')->select('code_count')->first()->code_count; |
| 26 | 26 | |
| 27 | 27 | return $codeCount; |