phpvms/resources/views/layouts/default/pireps/show.blade.php
lordwilbur ba8a819c7d - fixed an error on finance in admin panel
- flight ident now use this format: VA IATA(if empty ICAO) + Flight Number + - + Flight Code (without C) + - + Flight Leg (without L)
- added function __trans_choice in helpers.php for translation
- fixed error in flight edit/insert panel not showing/inserting Tuesday in days
- fixed an error occurring when metar retrieved is empty
- edited now-ui-kit.css to align login fields correctly
- added /public/assets/frontend/js/core/jquery-3.3.1.min.js to fix a missed resource error in authentication pages
- added translations file for en and it locales
- translated all the frontend templates
2018-05-21 09:53:08 -05:00

221 lines
7.7 KiB
PHP

@extends('app')
@section('title', __trans_choice('PIREP', 1).' '.$pirep->ident)
@section('content')
<div class="row">
<div class="col-8">
<div class="row">
<div class="col-12">
<p>
<h2 style="margin-bottom: 5px;">{{$pirep->airline->code}}{{ $pirep->ident }}</h2>
<p>
@if($pirep->state === PirepState::IN_PROGRESS)
@else
__('Arrived') {{$pirep->created_at->diffForHumans()}}
@endif
</p>
</p>
</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/>
@if($pirep->block_off_time)
{{ $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>
<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"
style="width: {{$pirep->progress_percent}}%;">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
@include('pireps.map')
</div>
</div>
</div>
{{--
RIGHT SIDEBAR
--}}
<div class="col-4">
<h2>&nbsp;</h2>
{{-- Show the link to edit if it can be edited --}}
@if(!$pirep->read_only)
<div class="float-right" style="margin-bottom: 10px;">
<form method="get"
action="{{ route('frontend.pireps.edit', ['id' => $pirep->id]) }}"
style="display: inline">
@csrf
<button class="btn btn-info">{{ __('Edit') }}</button>
</form>
&nbsp;
<form method="post"
action="{{ route('frontend.pireps.submit', ['id' => $pirep->id]) }}"
style="display: inline">
@csrf
<button class="btn btn-success">{{ __('Submit') }}</button>
</form>
</div>
@endif
<table class="table table-striped">
<tr>
<td width="30%">{{ __('Status') }}</td>
<td>
<div class="badge badge-info">
{{ PirepStatus::label($pirep->status) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('Source') }}</td>
<td>{{ PirepSource::label($pirep->source) }}</td>
</tr>
<tr>
<td>{{ __('Flight Type') }}</td>
<td>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</td>
</tr>
<tr>
<td>{{ __('Filed Route') }}</td>
<td>
{{ $pirep->route }}
</td>
</tr>
<tr>
<td>{{ __('Notes') }}</td>
<td>
{{ $pirep->notes }}
</td>
</tr>
<tr>
<td>{{ __('Filed On') }}</td>
<td>
{{ show_datetime($pirep->created_at) }}
</td>
</tr>
</table>
@if(count($pirep->fields) > 0 || count($pirep->fares) > 0)
<div class="separator"></div>
@endif
@if(count($pirep->fields) > 0)
<h5>{{ __trans_choice('Field', 2) }}</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
@if(count($pirep->fares) > 0)
<div class="separator"></div>
@endif
{{--
Show the fares that have been entered
--}}
@if(count($pirep->fares) > 0)
<div class="row">
<div class="col-12">
<h5>{{ __trans_choice('Fare', 2) }}</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>
</div>
@if(count($pirep->acars_logs) > 0)
<div class="separator"></div>
<div class="row">
<div class="col-12">
<h5>{{ __('Flight Log') }}</h5>
</div>
<div class="col-12">
<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