Skip to content

Commit

Permalink
Faulty Runway Identification
Browse files Browse the repository at this point in the history
  • Loading branch information
FatihKoz committed Jan 11, 2022
1 parent 8aa1549 commit 724ae81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Http/Controllers/DB_AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function health_check()
$airports_pirep_arr = DB::table('pireps')->whereNotIn('arr_airport_id', $current_airports)->groupBy('arr_airport_id')->pluck('arr_airport_id')->toArray();
$airports_flight_dep = DB::table('flights')->whereNotIn('dpt_airport_id', $current_airports)->groupBy('dpt_airport_id')->pluck('dpt_airport_id')->toArray();
$airports_flight_arr = DB::table('flights')->whereNotIn('arr_airport_id', $current_airports)->groupBy('arr_airport_id')->pluck('arr_airport_id')->toArray();
// Additional Checks
$rwy_ident_errors = DB::table('pirep_field_values')->where('slug', 'arrival-heading-deviation')->whereBetween('value', [160, 200])->pluck('pirep_id')->toArray();

$missing_airports = array_merge($airports_pirep_dep, $airports_pirep_arr, $airports_flight_dep, $airports_flight_arr);
$missing_airports = array_unique($missing_airports, SORT_STRING);
Expand All @@ -112,6 +114,7 @@ public function health_check()
'pirep_acft' => $pirep_acft,
'users_comp' => $users_comp,
'users_field' => $users_field,
'rwy_errors' => $rwy_ident_errors,
]);
}
}
14 changes: 14 additions & 0 deletions Resources/views/admin/health_check.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,26 @@
@endif
</div>
</div>
</div>
{{-- Not Harmfull Problems --}}
<div class="row text-center" style="margin-left:5px; margin-right:5px;">
<div class="col-sm-3">
<div class="card border-blue-bottom" style="padding:10px;">
{{ count($acars_pirep) }}
<br>
<span class="text-danger"><b>Acars data entries associated with MISSING pireps</b></span>
</div>
</div>
<div class="col-sm-3">
<div class="card border-blue-bottom" style="padding:10px;">
{{ count($rwy_errors) }}
<br>
<span class="text-danger" title="Which are opposite to the actual landing runway"><b>False Landing Runway Detections</b></span>
@if(count($rwy_errors) > 0)
<hr>
@foreach($rwy_errors as $list){{ $list }}@if(!$loop->last){{ ', ' }}@endif @endforeach
@endif
</div>
</div>
</div>
@endsection

0 comments on commit 724ae81

Please sign in to comment.