Fix create pirep errors
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
@component('admin.components.info')
|
@component('admin.components.info')
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ an impact on your stats and financials, and will require a recalculation of all
|
|||||||
flight reports that have been filed. You've been warned!
|
flight reports that have been filed. You've been warned!
|
||||||
|
|
||||||
--}}
|
--}}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
@component('components.info')
|
@component('components.info')
|
||||||
@@ -27,7 +27,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
{{ Form::label('airline_id', 'Airline') }}
|
{{ Form::label('airline_id', 'Airline') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<p>{{ $pirep->airline->name }}</p>
|
<p>{{ $pirep->airline->name }}</p>
|
||||||
{{ Form::hidden('airline_id') }}
|
{{ Form::hidden('airline_id') }}
|
||||||
@else
|
@else
|
||||||
@@ -35,14 +35,15 @@ flight reports that have been filed. You've been warned!
|
|||||||
{{ Form::select('airline_id', $airline_list, null, [
|
{{ Form::select('airline_id', $airline_list, null, [
|
||||||
'class' => 'custom-select select2',
|
'class' => 'custom-select select2',
|
||||||
'style' => 'width: 100%',
|
'style' => 'width: 100%',
|
||||||
'readonly' => $pirep->read_only]) }}
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
{{ Form::label('flight_number', 'Flight Number/Code/Leg') }}
|
{{ Form::label('flight_number', 'Flight Number/Code/Leg') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<p>{{ $pirep->ident }}
|
<p>{{ $pirep->ident }}
|
||||||
{{ Form::hidden('flight_number') }}
|
{{ Form::hidden('flight_number') }}
|
||||||
{{ Form::hidden('flight_code') }}
|
{{ Form::hidden('flight_code') }}
|
||||||
@@ -51,19 +52,22 @@ flight reports that have been filed. You've been warned!
|
|||||||
@else
|
@else
|
||||||
<div class="input-group input-group-sm mb3">
|
<div class="input-group input-group-sm mb3">
|
||||||
{{ Form::text('flight_number', null, [
|
{{ Form::text('flight_number', null, [
|
||||||
'placeholder' => 'Flight Number',
|
'placeholder' => 'Flight Number',
|
||||||
'class' => 'form-control',
|
'class' => 'form-control',
|
||||||
'readonly' => $pirep->read_only]) }}
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
|
]) }}
|
||||||
|
|
||||||
{{ Form::text('route_code', null, [
|
{{ Form::text('route_code', null, [
|
||||||
'placeholder' => 'Code (optional)',
|
'placeholder' => 'Code (optional)',
|
||||||
'class' => 'form-control',
|
'class' => 'form-control',
|
||||||
'readonly' => $pirep->read_only]) }}
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
|
]) }}
|
||||||
|
|
||||||
{{ Form::text('route_leg', null, [
|
{{ Form::text('route_leg', null, [
|
||||||
'placeholder' => 'Leg (optional)',
|
'placeholder' => 'Leg (optional)',
|
||||||
'class' => 'form-control',
|
'class' => 'form-control',
|
||||||
'readonly' => $pirep->read_only]) }}
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('flight_number') }}</p>
|
<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_code') }}</p>
|
||||||
@@ -72,7 +76,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
{{ Form::label('flight_type', 'Flight Type') }}
|
{{ Form::label('flight_type', 'Flight Type') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<p>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</p>
|
<p>{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}</p>
|
||||||
{{ Form::hidden('flight_type') }}
|
{{ Form::hidden('flight_type') }}
|
||||||
@else
|
@else
|
||||||
@@ -81,7 +85,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
\App\Models\Enums\FlightType::select(), null, [
|
\App\Models\Enums\FlightType::select(), null, [
|
||||||
'class' => 'custom-select select2',
|
'class' => 'custom-select select2',
|
||||||
'style' => 'width: 100%',
|
'style' => 'width: 100%',
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
])
|
])
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
@@ -93,7 +97,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ Form::label('hours', 'Flight Time') }}
|
{{ Form::label('hours', 'Flight Time') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<p>
|
<p>
|
||||||
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
||||||
{{ Form::hidden('hours') }}
|
{{ Form::hidden('hours') }}
|
||||||
@@ -105,14 +109,14 @@ flight reports that have been filed. You've been warned!
|
|||||||
'class' => 'form-control',
|
'class' => 'form-control',
|
||||||
'placeholder' => 'hours',
|
'placeholder' => 'hours',
|
||||||
'min' => '0',
|
'min' => '0',
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
]) }}
|
]) }}
|
||||||
|
|
||||||
{{ Form::number('minutes', null, [
|
{{ Form::number('minutes', null, [
|
||||||
'class' => 'form-control',
|
'class' => 'form-control',
|
||||||
'placeholder' => 'minutes',
|
'placeholder' => 'minutes',
|
||||||
'min' => 0,
|
'min' => 0,
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
]) }}
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
||||||
@@ -160,7 +164,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('dpt_airport_id', 'Departure Airport') }}
|
{{ Form::label('dpt_airport_id', 'Departure Airport') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
{{ $pirep->dpt_airport->name }}
|
{{ $pirep->dpt_airport->name }}
|
||||||
(<a href="{{route('frontend.airports.show', [
|
(<a href="{{route('frontend.airports.show', [
|
||||||
'id' => $pirep->dpt_airport->icao
|
'id' => $pirep->dpt_airport->icao
|
||||||
@@ -171,8 +175,8 @@ flight reports that have been filed. You've been warned!
|
|||||||
{{ Form::select('dpt_airport_id', $airport_list, null, [
|
{{ Form::select('dpt_airport_id', $airport_list, null, [
|
||||||
'class' => 'custom-select select2',
|
'class' => 'custom-select select2',
|
||||||
'style' => 'width: 100%',
|
'style' => 'width: 100%',
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
]) }}
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
||||||
@endif
|
@endif
|
||||||
@@ -180,7 +184,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
|
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('arr_airport_id', 'Arrival Airport') }}
|
{{ Form::label('arr_airport_id', 'Arrival Airport') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
{{ $pirep->arr_airport->name }}
|
{{ $pirep->arr_airport->name }}
|
||||||
(<a href="{{route('frontend.airports.show', [
|
(<a href="{{route('frontend.airports.show', [
|
||||||
'id' => $pirep->arr_airport->icao
|
'id' => $pirep->arr_airport->icao
|
||||||
@@ -191,8 +195,8 @@ flight reports that have been filed. You've been warned!
|
|||||||
{{ Form::select('arr_airport_id', $airport_list, null, [
|
{{ Form::select('arr_airport_id', $airport_list, null, [
|
||||||
'class' => 'custom-select select2',
|
'class' => 'custom-select select2',
|
||||||
'style' => 'width: 100%',
|
'style' => 'width: 100%',
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
]) }}
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
||||||
@endif
|
@endif
|
||||||
@@ -209,7 +213,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
{{ Form::label('aircraft_id', 'Aircraft') }}
|
{{ Form::label('aircraft_id', 'Aircraft') }}
|
||||||
@if($pirep->read_only)
|
@if(!empty($pirep) && $pirep->read_only)
|
||||||
<p>{{ $pirep->aircraft->name }}</p>
|
<p>{{ $pirep->aircraft->name }}</p>
|
||||||
{{ Form::hidden('aircraft_id') }}
|
{{ Form::hidden('aircraft_id') }}
|
||||||
@else
|
@else
|
||||||
@@ -218,7 +222,7 @@ flight reports that have been filed. You've been warned!
|
|||||||
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
||||||
'id' => 'aircraft_select',
|
'id' => 'aircraft_select',
|
||||||
'class' => 'custom-select select2',
|
'class' => 'custom-select select2',
|
||||||
'readonly' => $pirep->read_only
|
'readonly' => (!empty($pirep) && $pirep->read_only),
|
||||||
]) }}
|
]) }}
|
||||||
</div>
|
</div>
|
||||||
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
||||||
@@ -228,6 +232,22 @@ flight reports that have been filed. You've been warned!
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-container">
|
||||||
|
<h6><i class="far fa-comments"></i>
|
||||||
|
Route
|
||||||
|
</h6>
|
||||||
|
<div class="form-container-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<div class="input-group input-group-sm form-group">
|
||||||
|
{{ Form::textarea('route', null, ['class' => 'form-control', 'placeholder' => 'Route']) }}
|
||||||
|
<p class="text-danger">{{ $errors->first('route') }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-container">
|
<div class="form-container">
|
||||||
<h6><i class="far fa-comments"></i>
|
<h6><i class="far fa-comments"></i>
|
||||||
Remarks
|
Remarks
|
||||||
@@ -235,20 +255,10 @@ flight reports that have been filed. You've been warned!
|
|||||||
<div class="form-container-body">
|
<div class="form-container-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
{{ Form::label('route', 'Route') }}
|
|
||||||
<div class="input-group input-group-sm form-group">
|
|
||||||
{{ Form::textarea('route', null, ['class' => 'form-control', 'placeholder' => 'Route']) }}
|
|
||||||
<p class="text-danger">{{ $errors->first('route') }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
|
||||||
{{ Form::label('notes', 'Notes') }}
|
|
||||||
<div class="input-group input-group-sm form-group">
|
<div class="input-group input-group-sm form-group">
|
||||||
{{ Form::textarea('notes', null, ['class' => 'form-control', 'placeholder' => 'Notes']) }}
|
{{ Form::textarea('notes', null, ['class' => 'form-control', 'placeholder' => 'Notes']) }}
|
||||||
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user