From 9bf11f1cdc007988cbca3e2e11dcd191090c99d6 Mon Sep 17 00:00:00 2001 From: Brandon Wening Date: Mon, 11 Mar 2024 14:38:32 -0400 Subject: [PATCH] Added rating hours reporting --- app/Models/User.php | 4 ++++ resources/views/mgt/controller/parts/summary.blade.php | 4 ++-- resources/views/my/profile.blade.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 60fb34d5..eef74c2b 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -415,15 +415,19 @@ public function transferEligible( $ratingHours = VATSIMApi2Helper::fetchRatingHours($this->cid); if($this->rating == Helper::ratingIntFromShort("S1") && $ratingHours['s1'] < 50){ $checks['50hrs'] = 0; + $checks['ratingHours'] = $ratingHours['s1']; } if($this->rating == Helper::ratingIntFromShort("S2") && $ratingHours['s2'] < 50){ $checks['50hrs'] = 0; + $checks['ratingHours'] = $ratingHours['s2']; } if($this->rating == Helper::ratingIntFromShort("S3") && $ratingHours['s3'] < 50){ $checks['50hrs'] = 0; + $checks['ratingHours'] = $ratingHours['s3']; } if($this->rating == Helper::ratingIntFromShort("C1") && $ratingHours['c1'] < 50){ $checks['50hrs'] = 0; + $checks['ratingHours'] = $ratingHours['c1']; } if (!in_array($this->facility, ["ZAE", "ZZI"])) { diff --git a/resources/views/mgt/controller/parts/summary.blade.php b/resources/views/mgt/controller/parts/summary.blade.php index fab50a76..c8456439 100644 --- a/resources/views/mgt/controller/parts/summary.blade.php +++ b/resources/views/mgt/controller/parts/summary.blade.php @@ -168,7 +168,7 @@ class="fa fa-envelope text-primary"> @elseif($checks['50hrs'] == 1) @else - + {!! "(".$checks['ratingHours']." hours)" !!} @endif @@ -222,7 +222,7 @@ class="fa fa-envelope text-primary"> 50 controlling hours since promotion to S1, S2, S3, or C1? - {!! ($checks['50hrs'])?'':'' !!} + {!! ($checks['50hrs'])?'':'('.$checks['ratingHours'].' hours)' !!} Are they eligible? diff --git a/resources/views/my/profile.blade.php b/resources/views/my/profile.blade.php index 98bee4e3..270af095 100644 --- a/resources/views/my/profile.blade.php +++ b/resources/views/my/profile.blade.php @@ -233,7 +233,7 @@ class="fas fa-unlink"> @elseif($checks['50hrs'] == 1) @else - + {!! "(".$checks['ratingHours']." hours)" !!} @endif @@ -288,7 +288,7 @@ class="fas fa-unlink"> You have controlled 50 hours since promotion to S1, S2, S3, or C1 - {!! ($checks['50hrs'])?'':'' !!} + {!! ($checks['50hrs'])?'':'('.$checks['ratingHours'].' hours)' !!} If all of the above are green, you are eligible to visit within VATUSA. Are you