2018-02-25 05:38:25 +08:00
|
|
|
{{--
|
|
|
|
|
|
|
|
NOTE ABOUT THIS VIEW
|
|
|
|
|
|
|
|
The fields that are marked "read-only", make sure the read-only status doesn't change!
|
|
|
|
If you make those fields editable, after they're in a read-only state, it can have
|
|
|
|
an impact on your stats and financials, and will require a recalculation of all the
|
|
|
|
flight reports that have been filed. You've been warned!
|
|
|
|
|
|
|
|
--}}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-02-25 05:38:25 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
2018-04-07 06:10:45 +08:00
|
|
|
@component('components.info')
|
2018-05-19 03:45:52 +08:00
|
|
|
@lang('pireps.fieldsreadonly')
|
2018-02-25 05:38:25 +08:00
|
|
|
@endcomponent
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2017-08-17 07:18:47 +08:00
|
|
|
<div class="row">
|
2018-04-07 06:10:45 +08:00
|
|
|
<div class="col-8">
|
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="fas fa-info-circle"></i>
|
2018-05-19 03:45:52 +08:00
|
|
|
@lang('pireps.flightinformations')
|
2018-04-07 06:10:45 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
2018-05-19 03:30:59 +08:00
|
|
|
{{ Form::label('airline_id', __('common.airline')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
<p>{{ $pirep->airline->name }}</p>
|
|
|
|
{{ Form::hidden('airline_id') }}
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group form-group">
|
|
|
|
{{ Form::select('airline_id', $airline_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'style' => 'width: 100%',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
2018-05-19 03:45:52 +08:00
|
|
|
{{ Form::label('flight_number', __('pireps.flightident')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
<p>{{ $pirep->ident }}
|
|
|
|
{{ Form::hidden('flight_number') }}
|
|
|
|
{{ Form::hidden('flight_code') }}
|
|
|
|
{{ Form::hidden('flight_leg') }}
|
|
|
|
</p>
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm mb3">
|
|
|
|
{{ Form::text('flight_number', null, [
|
2018-05-22 00:55:40 +08:00
|
|
|
'placeholder' => __('flights.flightnumber'),
|
2018-04-10 20:22:21 +08:00
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
|
|
|
|
{{ Form::text('route_code', null, [
|
2018-05-19 03:45:52 +08:00
|
|
|
'placeholder' => __('pireps.codeoptional'),
|
2018-04-10 20:22:21 +08:00
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
|
|
|
|
{{ Form::text('route_leg', null, [
|
2018-05-19 03:45:52 +08:00
|
|
|
'placeholder' => __('pireps.legoptional'),
|
2018-04-10 20:22:21 +08:00
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('flight_number') }}</p>
|
|
|
|
<p class="text-danger">{{ $errors->first('route_code') }}</p>
|
|
|
|
<p class="text-danger">{{ $errors->first('route_leg') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{ Form::label('flight_type', __('flights.flighttype')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
<p>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</p>
|
|
|
|
{{ Form::hidden('flight_type') }}
|
|
|
|
@else
|
|
|
|
<div class="form-group">
|
|
|
|
{{ Form::select('flight_type',
|
|
|
|
\App\Models\Enums\FlightType::select(), null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'style' => 'width: 100%',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
2018-04-07 06:10:45 +08:00
|
|
|
])
|
|
|
|
}}
|
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-3">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{ Form::label('hours', __('flights.flighttime')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
<p>
|
2018-05-19 03:18:12 +08:00
|
|
|
{{ $pirep->hours.' '.trans_choice('common.hour', $pirep->hours) }}, {{ $pirep->minutes.' '.trans_choice('common.minute', $pirep->minutes) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ Form::hidden('hours') }}
|
|
|
|
{{ Form::hidden('minutes') }}
|
|
|
|
</p>
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm" style="max-width: 200px;">
|
|
|
|
{{ Form::number('hours', null, [
|
|
|
|
'class' => 'form-control',
|
2018-05-19 03:18:12 +08:00
|
|
|
'placeholder' => trans_choice('common.hour', 2),
|
2018-04-07 06:10:45 +08:00
|
|
|
'min' => '0',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-02-25 05:38:25 +08:00
|
|
|
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ Form::number('minutes', null, [
|
2018-02-25 05:38:25 +08:00
|
|
|
'class' => 'form-control',
|
2018-05-19 03:18:12 +08:00
|
|
|
'placeholder' => trans_choice('common.minute', 2),
|
2018-04-07 06:10:45 +08:00
|
|
|
'min' => 0,
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
2018-03-13 06:58:12 +08:00
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
|
|
|
<p class="text-danger">{{ $errors->first('minutes') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-3">
|
2018-05-19 03:45:52 +08:00
|
|
|
{{--{{ Form::label('submitted_date', __('pireps.dateflown')) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ Form::text('submmitted_date', null, [
|
2018-05-19 03:45:52 +08:00
|
|
|
'placeholder' => __('pireps.departuredate'),
|
2018-04-07 06:10:45 +08:00
|
|
|
'class' => 'form-control',
|
2018-04-10 11:04:59 +08:00
|
|
|
'readonly' => $pirep->read_only]) }}--}}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-3">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{--{{ Form::label('departure_time', __('flights.departuretime')) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ Form::text('departure_time', null, [
|
2018-05-22 00:55:40 +08:00
|
|
|
'placeholder' => __('flights.departuretime'),
|
2018-04-07 06:10:45 +08:00
|
|
|
'class' => 'form-control',
|
2018-04-10 11:04:59 +08:00
|
|
|
'readonly' => $pirep->read_only]) }}--}}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-3">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{--{{ Form::label('arrival_time', __('flights.arrivaltime')) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ Form::text('arrival_time', null, [
|
2018-05-22 00:55:40 +08:00
|
|
|
'placeholder' => __('flights.arrivaltime'),
|
2018-04-07 06:10:45 +08:00
|
|
|
'class' => 'form-control',
|
2018-04-10 11:04:59 +08:00
|
|
|
'readonly' => $pirep->read_only]) }}--}}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="fas fa-globe"></i>
|
2018-05-19 03:45:52 +08:00
|
|
|
@lang('pireps.deparrinformations')
|
2018-04-07 06:10:45 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-6">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{ Form::label('dpt_airport_id', __('airports.departure')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ $pirep->dpt_airport->name }}
|
|
|
|
(<a href="{{route('frontend.airports.show', [
|
|
|
|
'id' => $pirep->dpt_airport->icao
|
|
|
|
])}}">{{$pirep->dpt_airport->icao}}</a>)
|
|
|
|
{{ Form::hidden('dpt_airport_id') }}
|
|
|
|
@else
|
|
|
|
<div class="form-group">
|
|
|
|
{{ Form::select('dpt_airport_id', $airport_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'style' => 'width: 100%',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-6">
|
2018-05-22 00:55:40 +08:00
|
|
|
{{ Form::label('arr_airport_id', __('airports.arrival')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
{{ $pirep->arr_airport->name }}
|
|
|
|
(<a href="{{route('frontend.airports.show', [
|
|
|
|
'id' => $pirep->arr_airport->icao
|
|
|
|
])}}">{{$pirep->arr_airport->icao}}</a>)
|
|
|
|
{{ Form::hidden('arr_airport_id') }}
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm form-group">
|
|
|
|
{{ Form::select('arr_airport_id', $airport_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'style' => 'width: 100%',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="fab fa-avianex"></i>
|
2018-05-19 03:45:52 +08:00
|
|
|
@lang('pireps.aircraftinformations')
|
2018-04-07 06:10:45 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
|
|
|
<div class="row">
|
2019-06-20 03:28:25 +08:00
|
|
|
<div class="col-4">
|
2018-05-19 03:30:59 +08:00
|
|
|
{{ Form::label('aircraft_id', __('common.aircraft')) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
2018-04-07 06:10:45 +08:00
|
|
|
<p>{{ $pirep->aircraft->name }}</p>
|
|
|
|
{{ Form::hidden('aircraft_id') }}
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm form-group">
|
|
|
|
{{-- You probably don't want to change this ID if you want the fare select to work --}}
|
|
|
|
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
|
|
|
'id' => 'aircraft_select',
|
2018-02-25 05:38:25 +08:00
|
|
|
'class' => 'custom-select select2',
|
2018-04-10 20:22:21 +08:00
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
2018-03-13 06:58:12 +08:00
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
2019-07-23 20:41:20 +08:00
|
|
|
<div class="col-4">
|
|
|
|
{{ Form::label('block_fuel', __('pireps.block_fuel')) }} ({{config('phpvms.internal_units.fuel')}})
|
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
|
|
|
<p>{{ $pirep->block_fuel }}</p>
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm form-group">
|
|
|
|
{{ Form::number('block_fuel', null, [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'min' => '0',
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('block_fuel') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
2019-06-20 03:28:25 +08:00
|
|
|
<div class="col-4">
|
2019-06-20 04:05:29 +08:00
|
|
|
{{ Form::label('fuel_used', __('pireps.fuel_used')) }} ({{config('phpvms.internal_units.fuel')}})
|
2019-06-20 03:28:25 +08:00
|
|
|
@if(!empty($pirep) && $pirep->read_only)
|
|
|
|
<p>{{ $pirep->fuel_used }}</p>
|
|
|
|
@else
|
|
|
|
<div class="input-group input-group-sm form-group">
|
|
|
|
{{ Form::number('fuel_used', null, [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'min' => '0',
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('fuel_used') }}</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-06-20 03:28:25 +08:00
|
|
|
<div id="fares_container" class="form-container">
|
|
|
|
@include('pireps.fares')
|
|
|
|
</div>
|
|
|
|
|
2018-04-07 06:10:45 +08:00
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="far fa-comments"></i>
|
2018-05-22 00:55:40 +08:00
|
|
|
@lang('flights.route')
|
2018-04-07 06:10:45 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<div class="input-group input-group-sm form-group">
|
2018-05-31 03:00:20 +08:00
|
|
|
{{ Form::textarea('route', null, [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'placeholder' => __('flights.route'),
|
|
|
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
|
|
|
]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('route') }}</p>
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-02-25 05:38:25 +08:00
|
|
|
</div>
|
2018-04-10 20:22:21 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-04-07 06:10:45 +08:00
|
|
|
|
2018-04-10 20:22:21 +08:00
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="far fa-comments"></i>
|
2018-05-19 03:18:12 +08:00
|
|
|
{{ trans_choice('common.remark', 2) }}
|
2018-04-10 20:22:21 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
|
|
|
<div class="row">
|
2018-04-07 06:10:45 +08:00
|
|
|
<div class="col">
|
|
|
|
<div class="input-group input-group-sm form-group">
|
2018-05-19 03:18:12 +08:00
|
|
|
{{ Form::textarea('notes', null, ['class' => 'form-control', 'placeholder' => trans_choice('common.note', 2)]) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
|
|
|
</div>
|
2018-02-25 05:38:25 +08:00
|
|
|
</div>
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-17 07:18:47 +08:00
|
|
|
</div>
|
2018-04-07 06:10:45 +08:00
|
|
|
|
2019-08-02 01:13:11 +08:00
|
|
|
{{--
|
|
|
|
Write out the custom fields, and label if they're required
|
|
|
|
--}}
|
2018-04-07 06:10:45 +08:00
|
|
|
<div class="col-4">
|
|
|
|
<div class="form-container">
|
|
|
|
<h6><i class="fab fa-wpforms"></i>
|
2018-05-19 03:18:12 +08:00
|
|
|
{{ trans_choice('common.field', 2) }}
|
2018-04-07 06:10:45 +08:00
|
|
|
</h6>
|
|
|
|
<div class="form-container-body">
|
2019-08-02 01:13:11 +08:00
|
|
|
@if(isset($pirep) && $pirep->fields)
|
|
|
|
@each('pireps.custom_fields', $pirep->fields, 'field')
|
|
|
|
@else
|
|
|
|
@each('pireps.custom_fields', $pirep_fields, 'field')
|
|
|
|
@endif
|
2018-04-07 06:10:45 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-02-25 05:38:25 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2017-08-17 07:18:47 +08:00
|
|
|
|
|
|
|
<div class="col-sm-12">
|
|
|
|
<div class="float-right">
|
2018-02-25 05:38:25 +08:00
|
|
|
<div class="form-group">
|
2018-05-10 23:35:10 +08:00
|
|
|
|
|
|
|
@if(isset($pirep) && !$pirep->read_only)
|
2018-05-19 03:45:52 +08:00
|
|
|
{{ Form::button(__('pireps.deletepirep'), [
|
2018-05-10 23:35:10 +08:00
|
|
|
'name' => 'submit',
|
2018-05-16 14:47:31 +08:00
|
|
|
'value' => 'Delete',
|
2018-05-10 23:35:10 +08:00
|
|
|
'class' => 'btn btn-warning',
|
|
|
|
'type' => 'submit'])
|
|
|
|
}}
|
|
|
|
@endif
|
|
|
|
|
2018-05-31 03:00:20 +08:00
|
|
|
{{ Form::button(__('pireps.savepirep'), [
|
2018-05-10 23:35:10 +08:00
|
|
|
'name' => 'submit',
|
2018-05-16 14:47:31 +08:00
|
|
|
'value' => 'Save',
|
2018-05-10 23:35:10 +08:00
|
|
|
'class' => 'btn btn-info',
|
|
|
|
'type' => 'submit'])
|
|
|
|
}}
|
|
|
|
|
2018-05-31 03:00:20 +08:00
|
|
|
@if(!isset($pirep) || (filled($pirep) && !$pirep->read_only))
|
2018-05-19 03:45:52 +08:00
|
|
|
{{ Form::button(__('pireps.submitpirep'), [
|
2018-05-10 23:35:10 +08:00
|
|
|
'name' => 'submit',
|
2018-05-16 14:47:31 +08:00
|
|
|
'value' => 'Submit',
|
2018-05-10 23:35:10 +08:00
|
|
|
'class' => 'btn btn-success',
|
|
|
|
'type' => 'submit'])
|
|
|
|
}}
|
|
|
|
@endif
|
2018-02-25 05:38:25 +08:00
|
|
|
</div>
|
2017-08-17 07:18:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|