phpvms/resources/views/layouts/default/pireps/show.blade.php

240 lines
8.4 KiB
PHP
Raw Normal View History

@extends('app')
@section('title', 'PIREP '.$pirep->ident)
@section('content')
2018-04-05 06:42:43 +08:00
<div class="row">
2018-04-05 06:42:43 +08:00
<div class="col-8">
<div class="row">
<div class="col-12">
<p>
<h2 style="margin-bottom: 5px;">{{$pirep->airline->code}}{{ $pirep->ident }}</h2>
2018-05-02 09:58:05 +08:00
<p>
@if($pirep->state === PirepState::IN_PROGRESS)
@else
Arrived {{$pirep->created_at->diffForHumans()}}
@endif
</p>
2018-04-05 06:42:43 +08:00
</p>
2018-04-04 11:44:11 +08:00
2018-04-05 06:42:43 +08:00
</div>
</div>
<div class="row">
{{--
DEPARTURE INFO
--}}
<div class="col-6 text-left">
<h4>
{{$pirep->dpt_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', ['id' => $pirep->dpt_airport_id])}}">
{{ $pirep->dpt_airport->full_name }} ({{ $pirep->dpt_airport_id }})</a>
<br/>
2018-04-07 06:25:57 +08:00
@if($pirep->block_off_time)
2018-04-05 06:42:43 +08:00
{{ $pirep->block_off_time->toDayDateTimeString() }}
@endif
</p>
</div>
{{--
ARRIVAL INFO
--}}
<div class="col-6 text-right">
<h4>
{{$pirep->arr_airport->location}}
</h4>
<p>
<a href="{{route('frontend.airports.show', ['id' => $pirep->arr_airport_id])}}">
{{ $pirep->arr_airport->full_name }} ({{ $pirep->arr_airport_id }})</a>
<br/>
@if($pirep->block_on_time)
{{ $pirep->block_on_time->toDayDateTimeString() }}
@endif
</p>
</div>
</div>
2018-04-05 06:42:43 +08:00
<div class="row">
<div class="col-12">
<div class="progress" style="margin: 20px 0;">
<div class="progress-bar progress-bar-success" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100"
2018-05-02 09:58:05 +08:00
style="width: {{$pirep->progress_percent}}%;">
{{--<p style="padding: 10px">
{{ Utils::minutesToTimeString($pirep->flight_time) }}
</p>--}}
2018-04-05 06:42:43 +08:00
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
@include('pireps.map')
</div>
</div>
</div>
2018-04-05 06:42:43 +08:00
{{--
2018-04-07 06:10:45 +08:00
RIGHT SIDEBAR
2018-04-05 06:42:43 +08:00
--}}
<div class="col-4">
2018-04-07 06:10:45 +08:00
<h2>&nbsp;</h2>
2018-05-02 09:58:05 +08:00
<table class="table table-striped">
{{--<tr>
2018-04-05 06:42:43 +08:00
<td width="30%">Status</td>
<td>
2018-04-05 06:42:43 +08:00
@php
if($pirep->state === PirepState::PENDING)
$badge = 'warning';
elseif ($pirep->state === PirepState::ACCEPTED)
$badge = 'success';
elseif ($pirep->state === PirepState::REJECTED)
$badge = 'danger';
else
$badge = 'info';
@endphp
<div class="badge badge-{{$badge}}">
{{ PirepState::label($pirep->state) }}
</div>
</td>
2018-05-02 09:58:05 +08:00
</tr>--}}
<tr>
<td width="30%">State</td>
<td>
<div class="badge badge-info">
{{ PirepStatus::label($pirep->status) }}
</div>
</td>
</tr>
2018-04-05 06:42:43 +08:00
<tr>
2018-04-05 06:42:43 +08:00
<td>Source</td>
<td>{{ PirepSource::label($pirep->source) }}</td>
</tr>
2018-04-05 06:42:43 +08:00
{{--<tr>--}}
{{--<td>Departure/Arrival</td>--}}
{{--<td>--}}
{{--{{ $pirep->dpt_airport->name }}--}}
{{--(<a href="{{route('frontend.airports.show', [--}}
{{--'id' => $pirep->dpt_airport->icao--}}
{{--])}}">{{$pirep->dpt_airport->icao}}</a>)--}}
{{--<span class="description">to</span>--}}
{{--{{ $pirep->arr_airport->name }}--}}
{{--(<a href="{{route('frontend.airports.show', [--}}
{{--'id' => $pirep->arr_airport->icao--}}
{{--])}}">{{$pirep->arr_airport->icao}}</a>)--}}
{{--</td>--}}
{{--</tr>--}}
<tr>
<td>Flight Type</td>
<td>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</td>
</tr>
<tr>
2017-12-24 01:58:17 +08:00
<td>Filed Route</td>
<td>
{{ $pirep->route }}
</td>
</tr>
<tr>
<td>Notes</td>
<td>
{{ $pirep->notes }}
</td>
</tr>
2017-12-24 01:58:17 +08:00
<tr>
<td>Filed On</td>
<td>
{{ show_datetime($pirep->created_at) }}
2017-12-24 01:58:17 +08:00
</td>
</tr>
</table>
2018-04-05 06:42:43 +08:00
@if(count($pirep->fields) > 0 || count($pirep->fares) > 0)
<div class="separator"></div>
@endif
@if(count($pirep->fields) > 0)
2018-04-04 08:21:42 +08:00
<h5>fields</h5>
<table class="table table-hover table-condensed">
<thead>
<th>Name</th>
<th>Value</th>
</thead>
<tbody>
@foreach($pirep->fields as $field)
<tr>
<td>{{ $field->name }}</td>
<td>{{ $field->value }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
2018-04-05 06:42:43 +08:00
@if(count($pirep->fares) > 0)
<div class="separator"></div>
@endif
2018-04-04 08:21:42 +08:00
{{--
Show the fares that have been entered
--}}
@if(count($pirep->fares) > 0)
<div class="row">
<div class="col-12">
<h5>fares</h5>
<table class="table table-hover table-condensed">
<thead>
<th>Class</th>
<th>Count</th>
</thead>
<tbody>
@foreach($pirep->fares as $fare)
<tr>
<td>{{ $fare->fare->name }} ({{ $fare->fare->code }})</td>
<td>{{ $fare->count }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
2018-04-04 08:21:42 +08:00
</div>
@if(count($pirep->acars_logs) > 0)
2018-04-04 08:21:42 +08:00
<div class="separator"></div>
<div class="row">
<div class="col-12">
2018-04-04 08:21:42 +08:00
<h5>flight log</h5>
</div>
<div class="col-12">
2018-04-04 08:21:42 +08:00
<table class="table table-hover table-condensed" id="users-table">
<tbody>
@foreach($pirep->acars_logs as $log)
<tr>
<td nowrap="true">{{ show_datetime($log->created_at) }}</td>
<td>{{ $log->log }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
@endsection