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!
|
|
|
|
|
|
|
|
--}}
|
|
|
|
@if($read_only)
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
|
|
@component("layouts.${SKIN_NAME}.components.info")
|
|
|
|
Once a PIREP has been accepted/rejected, certain fields go into read-only mode.
|
|
|
|
@endcomponent
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endif
|
2017-08-17 07:18:47 +08:00
|
|
|
<div class="row">
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="col-12">
|
|
|
|
<table class="table table-full-width">
|
|
|
|
<thead>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2017-08-24 03:19:05 +08:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td>Airline</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>{!! $pirep->airline->name !!}</p>
|
|
|
|
{!! Form::hidden('airline_id') !!}
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group form-group">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::select('airline_id', $airline_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'readonly' => $read_only]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td>Flight Number/Code/Leg</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>{!! $pirep->ident !!}
|
|
|
|
{!! Form::hidden('flight_number') !!}
|
|
|
|
{!! Form::hidden('flight_code') !!}
|
|
|
|
{!! Form::hidden('flight_leg') !!}
|
|
|
|
</p>
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group form-group" style="max-width: 400px;">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::text('flight_number', null, [
|
|
|
|
'placeholder' => 'Flight Number',
|
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => $read_only]) !!}
|
|
|
|
|
|
|
|
{!! Form::text('route_code', null, [
|
|
|
|
'placeholder' => 'Code (optional)',
|
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => $read_only]) !!}
|
|
|
|
|
|
|
|
{!! Form::text('route_leg', null, [
|
|
|
|
'placeholder' => 'Leg (optional)',
|
|
|
|
'class' => 'form-control',
|
|
|
|
'readonly' => $read_only]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<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>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td>Aircraft</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>{!! $pirep->aircraft->name !!}</p>
|
|
|
|
{!! Form::hidden('aircraft_id') !!}
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group form-group">
|
2018-02-25 05:38:25 +08:00
|
|
|
{{-- 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',
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'readonly' => $read_only
|
|
|
|
]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td>Origin Airport</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>{!! $pirep->dpt_airport->id !!} - {!! $pirep->dpt_airport->name !!}</p>
|
|
|
|
{!! Form::hidden('dpt_airport_id') !!}
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group form-group">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::select('dpt_airport_id', $airport_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'readonly' => $read_only
|
|
|
|
]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td>Arrival Airport</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>{!! $pirep->arr_airport->id !!}
|
|
|
|
- {!! $pirep->arr_airport->name !!}</p>
|
|
|
|
{!! Form::hidden('arr_airport_id') !!}
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group form-group">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::select('arr_airport_id', $airport_list, null, [
|
|
|
|
'class' => 'custom-select select2',
|
|
|
|
'readonly' => $read_only
|
|
|
|
]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-17 07:18:47 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
<tr>
|
|
|
|
<td class="align-text-top">Flight Time</td>
|
|
|
|
<td>
|
|
|
|
@if($read_only)
|
|
|
|
<p>
|
|
|
|
{!! $pirep->hours !!} hours, {!! $pirep->minutes !!} minutes
|
|
|
|
{!! Form::hidden('hours') !!}
|
|
|
|
{!! Form::hidden('minutes') !!}
|
|
|
|
</p>
|
|
|
|
@else
|
2017-08-24 03:19:05 +08:00
|
|
|
<div class="input-group" style="max-width: 200px;">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::number('hours', null, [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'placeholder' => 'hours',
|
|
|
|
'min' => '0',
|
|
|
|
'readonly' => $read_only
|
|
|
|
]) !!}
|
|
|
|
|
|
|
|
{!! Form::number('minutes', null, [
|
|
|
|
'class' => 'form-control',
|
|
|
|
'placeholder' => 'minutes',
|
|
|
|
'min' => 0,
|
|
|
|
'readonly' => $read_only
|
|
|
|
]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-01-24 05:48:30 +08:00
|
|
|
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
|
|
|
<p class="text-danger">{{ $errors->first('minutes') }}</p>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
2018-01-24 05:48:30 +08:00
|
|
|
|
2018-02-25 05:38:25 +08:00
|
|
|
{{--
|
|
|
|
Write out the custom fields, and label if they're required
|
|
|
|
--}}
|
|
|
|
@foreach($pirep_fields as $field)
|
2017-08-24 03:19:05 +08:00
|
|
|
<tr>
|
|
|
|
<td>
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! $field->name !!}
|
|
|
|
@if($field->required === true)
|
|
|
|
<span class="text-danger">*</span>
|
|
|
|
@endif
|
2017-08-24 03:19:05 +08:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group form-group">
|
2018-02-25 05:38:25 +08:00
|
|
|
{!! Form::text($field->slug, null, [
|
|
|
|
'class' => 'form-control'
|
|
|
|
]) !!}
|
2017-08-24 03:19:05 +08:00
|
|
|
</div>
|
2018-02-25 05:38:25 +08:00
|
|
|
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
2017-08-24 03:19:05 +08:00
|
|
|
</td>
|
|
|
|
</tr>
|
2018-02-25 05:38:25 +08:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="align-text-top">Route</td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group form-group">
|
|
|
|
{!! Form::textarea('route', null, ['class' => 'form-control', 'placeholder' => 'Route']) !!}
|
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('route') }}</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="align-text-top"><p class="">Notes</p></td>
|
|
|
|
<td>
|
|
|
|
<div class="input-group form-group">
|
|
|
|
{!! Form::textarea('notes', null, ['class' => 'form-control', 'placeholder' => 'Notes']) !!}
|
|
|
|
</div>
|
|
|
|
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2017-08-24 03:19:05 +08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-08-17 07:18:47 +08:00
|
|
|
</div>
|
2018-02-25 05:38:25 +08:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
{{-- You don't want to change this ID unless you don't want the fares form to work :) --}}
|
|
|
|
<div id="fares_container" class="col-sm-12">
|
|
|
|
@include("layouts.${SKIN_NAME}.pireps.fares")
|
|
|
|
</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">
|
|
|
|
{!! Form::submit('Save PIREP', ['class' => 'btn btn-primary']) !!}
|
|
|
|
</div>
|
2017-08-17 07:18:47 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|