Skip to content

Commit

Permalink
Added rating hours reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
BMWENING committed Mar 11, 2024
1 parent dc51112 commit 9bf11f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"])) {
Expand Down
4 changes: 2 additions & 2 deletions resources/views/mgt/controller/parts/summary.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class="fa fa-envelope text-primary"></i></a></li>
@elseif($checks['50hrs'] == 1)
<td><i class="fa fa-check text-success"></i></td>
@else
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i>{!! "(".$checks['ratingHours']." hours)" !!}</td>
@endif
</tr>
<tr>
Expand Down Expand Up @@ -222,7 +222,7 @@ class="fa fa-envelope text-primary"></i></a></li>
</tr>
<tr>
<td>50 controlling hours since promotion to S1, S2, S3, or C1?</td>
<td>{!! ($checks['50hrs'])?'<i class="fa fa-check text-success"></i>':'<i class="fa fa-times text-danger"></i>' !!}</td>
<td>{!! ($checks['50hrs'])?'<i class="fa fa-check text-success"></i>':'<i class="fa fa-times text-danger"></i>('.$checks['ratingHours'].' hours)' !!}</td>
</tr>
<tr>
<td>Are they eligible?</td>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/my/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class="fas fa-unlink"></i>
@elseif($checks['50hrs'] == 1)
<td><i class="fa fa-check text-success"></i></td>
@else
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i>{!! "(".$checks['ratingHours']." hours)" !!}</td>
@endif
</tr>
<tr>
Expand Down Expand Up @@ -288,7 +288,7 @@ class="fas fa-unlink"></i>
</tr>
<tr>
<td>You have controlled 50 hours since promotion to S1, S2, S3, or C1</td>
<td>{!! ($checks['50hrs'])?'<i class="fa fa-check text-success"></i>':'<i class="fa fa-times text-danger"></i>' !!}</td>
<td>{!! ($checks['50hrs'])?'<i class="fa fa-check text-success"></i>':'<i class="fa fa-times text-danger"></i>('.$checks['ratingHours'].' hours)' !!}</td>
</tr>
<tr>
<td>If all of the above are green, you are eligible to visit within VATUSA. Are you
Expand Down

0 comments on commit 9bf11f1

Please sign in to comment.