@@ -1,41 +1,42 @@
|
||||
<table class="">
|
||||
<tr>
|
||||
<td>
|
||||
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::REJECTED)
|
||||
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'accept_'.$pirep->id,
|
||||
'id' => $pirep->id.'_accept',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => PirepState::ACCEPTED,
|
||||
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
|
||||
{{ Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::ACCEPTED)
|
||||
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'reject_'.$pirep->id,
|
||||
'id' => $pirep->id.'_reject',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => PirepState::REJECTED,
|
||||
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
|
||||
{{ Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
@if ($on_edit_page === false)
|
||||
<td>
|
||||
<form action="{{ route('admin.pireps.edit', [$pirep->id]) }}">
|
||||
<button type="submit"
|
||||
class='btn btn-info'>
|
||||
<i class="fas fa-pencil-alt"></i> Edit</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::REJECTED)
|
||||
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'accept_'.$pirep->id,
|
||||
'id' => $pirep->id.'_accept',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => PirepState::ACCEPTED,
|
||||
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
|
||||
{{ Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::ACCEPTED)
|
||||
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
|
||||
'method' => 'post',
|
||||
'name' => 'reject_'.$pirep->id,
|
||||
'id' => $pirep->id.'_reject',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => PirepState::REJECTED,
|
||||
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
|
||||
{{ Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
@if ($on_edit_page === false)
|
||||
<td>
|
||||
<form action="{{ route('admin.pireps.edit', [$pirep->id]) }}">
|
||||
<button type="submit"
|
||||
class='btn btn-info'>
|
||||
<i class="fas fa-pencil-alt"></i> Edit
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
<div id="pirep_comments_wrapper" class="col-12">
|
||||
<table class="table table-responsive" id="pireps-comments-table">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pirep->comments as $comment)
|
||||
<tr>
|
||||
<td width="1%" nowrap="" style="vertical-align: text-top">
|
||||
<a href="{{ route('admin.users.show', [$comment->user_id]) }}">
|
||||
{{ $comment->user->name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ $comment->comment }}</p>
|
||||
<p class="small">{{ show_datetime($comment->created_at) }}</p>
|
||||
</td>
|
||||
<td align="right">
|
||||
{{ Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'delete', 'class' => 'pjax_form form-inline']) }}
|
||||
{{ Form::hidden('comment_id', $comment->id) }}
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
||||
'class' => 'btn btn-danger btn-small',
|
||||
'onclick' => "return confirm('Are you sure?')",
|
||||
]) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="text-right">
|
||||
{{ Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'post', 'class' => 'pjax_form form-inline']) }}
|
||||
{{ Form::input('text', 'comment', null, ['class' => 'form-control input-sm']) }}
|
||||
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
||||
'class' => 'btn btn-success btn-small']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-responsive" id="pireps-comments-table">
|
||||
<thead>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($pirep->comments as $comment)
|
||||
<tr>
|
||||
<td width="1%" nowrap="" style="vertical-align: text-top">
|
||||
<a href="{{ route('admin.users.show', [$comment->user_id]) }}">
|
||||
{{ $comment->user->name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<p>{{ $comment->comment }}</p>
|
||||
<p class="small">{{ show_datetime($comment->created_at) }}</p>
|
||||
</td>
|
||||
<td align="right">
|
||||
{{ Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'delete', 'class' => 'pjax_form form-inline']) }}
|
||||
{{ Form::hidden('comment_id', $comment->id) }}
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
||||
'class' => 'btn btn-danger btn-small',
|
||||
'onclick' => "return confirm('Are you sure?')",
|
||||
]) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="text-right">
|
||||
{{ Form::open(['url' => url('/admin/pireps/'.$pirep->id.'/comments'),
|
||||
'method' => 'post', 'class' => 'pjax_form form-inline']) }}
|
||||
{{ Form::input('text', 'comment', null, ['class' => 'form-control input-sm']) }}
|
||||
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
||||
'class' => 'btn btn-success btn-small']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
@section('title', 'Create PIREP')
|
||||
|
||||
<div class="content">
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{{ Form::open(['route' => 'admin.pireps.store']) }}
|
||||
@include('admin.pireps.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{{ Form::open(['route' => 'admin.pireps.store']) }}
|
||||
@include('admin.pireps.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -2,59 +2,60 @@
|
||||
@section('title', 'Edit ' . $pirep->ident )
|
||||
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
|
||||
{{-- pulled out to here otherwise the form::close() within a form undo it --}}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h5 style="margin-top: 0px;">
|
||||
Filed By: <a href="{{ route('admin.users.edit', [$pirep->user_id]) }}" target="_blank">
|
||||
{{ $pirep->user->ident }} {{ $pirep->user->name }}
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="pull-right">
|
||||
@include('admin.pireps.actions', ['pirep' => $pirep, 'on_edit_page' => true])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) }}
|
||||
@include('admin.pireps.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>comments</h4>
|
||||
@include('admin.pireps.comments')
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>flight log</h4>
|
||||
@include('admin.pireps.flight_log')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{{-- pulled out to here otherwise the form::close() within a form undo it --}}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h5 style="margin-top: 0px;">
|
||||
Filed By: <a href="{{ route('admin.users.edit', [$pirep->user_id]) }}" target="_blank">
|
||||
{{ $pirep->user->ident }} {{ $pirep->user->name }}
|
||||
</a>
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="pull-right">
|
||||
<button id="recalculate-finances"
|
||||
class="btn btn-success"
|
||||
data-pirep-id="{{ $pirep->id }}">Recalcuate Finances</button>
|
||||
@include('admin.pireps.actions', ['pirep' => $pirep, 'on_edit_page' => true])
|
||||
</div>
|
||||
<h4>transactions</h4>
|
||||
@include('admin.pireps.transactions')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) }}
|
||||
@include('admin.pireps.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>comments</h4>
|
||||
@include('admin.pireps.comments')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>flight log</h4>
|
||||
@include('admin.pireps.flight_log')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<div class="pull-right">
|
||||
<button id="recalculate-finances"
|
||||
class="btn btn-success"
|
||||
data-pirep-id="{{ $pirep->id }}">Recalcuate Finances
|
||||
</button>
|
||||
</div>
|
||||
<h4>transactions</h4>
|
||||
@include('admin.pireps.transactions')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
@if($aircraft)
|
||||
<table class="table table-hover table-responsive">
|
||||
<table class="table table-hover table-responsive">
|
||||
<thead>
|
||||
<th>Fare</th>
|
||||
<th>Count</th>
|
||||
<th>Fare</th>
|
||||
<th>Count</th>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($aircraft->subfleet->fares as $fare)
|
||||
<tr>
|
||||
<tr>
|
||||
<td>{{ $fare->name }} ({{ $fare->code }})</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
@if(isset($pirep) && $pirep->read_only)
|
||||
<p>{{ $pirep->{'fare_'.$fare->id} }}</p>
|
||||
{{ Form::hidden('fare_'.$fare->id) }}
|
||||
@else
|
||||
{{ Form::number('fare_'.$fare->id, null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01',
|
||||
]) }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@if(isset($pirep) && $pirep->read_only)
|
||||
<p>{{ $pirep->{'fare_'.$fare->id} }}</p>
|
||||
{{ Form::hidden('fare_'.$fare->id) }}
|
||||
@else
|
||||
{{ Form::number('fare_'.$fare->id, null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01',
|
||||
]) }}
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
@endif
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
<table class="table table-responsive table-hover" id="flight-fields-table">
|
||||
@if(count($pirep->fields))
|
||||
@if(count($pirep->fields))
|
||||
<thead>
|
||||
<th></th>
|
||||
<th>Value</th>
|
||||
<th>Source</th>
|
||||
</thead>
|
||||
@endif
|
||||
<tbody>
|
||||
@foreach($pirep->fields as $field)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $field->name }}
|
||||
@if($field->required === true)
|
||||
<span class="text-danger">*</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
@if(!$field->read_only)
|
||||
{{ Form::text($field->slug, $field->value, [
|
||||
'class' => 'form-control'
|
||||
]) }}
|
||||
@else
|
||||
<p>{{ $field->value }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
||||
</td>
|
||||
<td>
|
||||
{{ PirepSource::label($field->source) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endif
|
||||
<tbody>
|
||||
@foreach($pirep->fields as $field)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $field->name }}
|
||||
@if($field->required === true)
|
||||
<span class="text-danger">*</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-group">
|
||||
@if(!$field->read_only)
|
||||
{{ Form::text($field->slug, $field->value, [
|
||||
'class' => 'form-control'
|
||||
]) }}
|
||||
@else
|
||||
<p>{{ $field->value }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first($field->slug) }}</p>
|
||||
</td>
|
||||
<td>
|
||||
{{ PirepSource::label($field->source) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,248 +1,248 @@
|
||||
@if(!empty($pirep) && $pirep->read_only)
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@component('admin.components.info')
|
||||
Once a PIREP has been accepted/rejected, certain fields go into read-only mode.
|
||||
@endcomponent
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@component('admin.components.info')
|
||||
Once a PIREP has been accepted/rejected, certain fields go into read-only mode.
|
||||
@endcomponent
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
Flight Information
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div class="col-xl-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
Flight Information
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('flight_number', 'Flight Number/Route Code/Leg') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->ident }}
|
||||
{{ Form::hidden('flight_number') }}
|
||||
{{ Form::hidden('flight_code') }}
|
||||
{{ Form::hidden('flight_leg') }}
|
||||
</p>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('flight_number', null, [
|
||||
'placeholder' => 'Flight Number',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('flight_number') }}</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('route_code', null, [
|
||||
'placeholder' => 'Code (optional)',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route_code') }}</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('route_leg', null, [
|
||||
'placeholder' => 'Leg (optional)',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route_leg') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('flight_type', 'Flight Type') }}
|
||||
{{ Form::select('flight_type',
|
||||
\App\Models\Enums\FlightType::select(),
|
||||
null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only
|
||||
])
|
||||
}}
|
||||
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
<p class="description">Filed Via:</p>
|
||||
{{ PirepSource::label($pirep->source) }}
|
||||
@if(filled($pirep->source_name))
|
||||
({{ $pirep->source_name }})
|
||||
@endif
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('flight_number', 'Flight Number/Route Code/Leg') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->ident }}
|
||||
{{ Form::hidden('flight_number') }}
|
||||
{{ Form::hidden('flight_code') }}
|
||||
{{ Form::hidden('flight_leg') }}
|
||||
</p>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('flight_number', null, [
|
||||
'placeholder' => 'Flight Number',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('flight_number') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('route_code', null, [
|
||||
'placeholder' => 'Code (optional)',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route_code') }}</p>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::text('route_leg', null, [
|
||||
'placeholder' => 'Leg (optional)',
|
||||
'class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route_leg') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('flight_type', 'Flight Type') }}
|
||||
{{ Form::select('flight_type',
|
||||
\App\Models\Enums\FlightType::select(),
|
||||
null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only
|
||||
])
|
||||
}}
|
||||
<p class="text-danger">{{ $errors->first('flight_type') }}</p>
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
<p class="description">Filed Via:</p>
|
||||
{{ PirepSource::label($pirep->source) }}
|
||||
@if(filled($pirep->source_name))
|
||||
({{ $pirep->source_name }})
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xl-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
Flight Information
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div class="col-xl-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
Flight Information
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('airline_id', 'Airline') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->airline->name }}</p>
|
||||
{{ Form::hidden('airline_id') }}
|
||||
@else
|
||||
{{ Form::select('airline_id', $airlines_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('aircraft_id', 'Aircraft:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->aircraft->name }}</p>
|
||||
{{ Form::hidden('aircraft_id') }}
|
||||
@else
|
||||
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
||||
'id' => 'aircraft_select',
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('dpt_airport_id', 'Departure Airport:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->dpt_airport_id }}@if($pirep->dpt_airport->name) - {{ $pirep->dpt_airport->name }}@endif
|
||||
</p>
|
||||
{{ Form::hidden('dpt_airport_id') }}
|
||||
@else
|
||||
{{ Form::select('dpt_airport_id', $airports_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('airline_id', 'Airline') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->airline->name }}</p>
|
||||
{{ Form::hidden('airline_id') }}
|
||||
@else
|
||||
{{ Form::select('airline_id', $airlines_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('airline_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('aircraft_id', 'Aircraft:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->aircraft->name }}</p>
|
||||
{{ Form::hidden('aircraft_id') }}
|
||||
@else
|
||||
{{ Form::select('aircraft_id', $aircraft_list, null, [
|
||||
'id' => 'aircraft_select',
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('aircraft_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('dpt_airport_id', 'Departure Airport:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->dpt_airport_id }}@if($pirep->dpt_airport->name) - {{ $pirep->dpt_airport->name }}@endif
|
||||
</p>
|
||||
{{ Form::hidden('dpt_airport_id') }}
|
||||
@else
|
||||
{{ Form::select('dpt_airport_id', $airports_list, null, [
|
||||
'class' => 'form-control select2',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
<p class="text-danger">{{ $errors->first('dpt_airport_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('arr_airport_id', 'Arrival Airport:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->arr_airport->id }}@if($pirep->arr_airport->name) - {{ $pirep->arr_airport->name }}@endif
|
||||
</p>
|
||||
{{ Form::hidden('arr_airport_id') }}
|
||||
@else
|
||||
{{ Form::select('arr_airport_id', $airports_list, null, ['class' => 'form-control select2']) }}
|
||||
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- Flight Time Field -->
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('flight_time', 'Flight Time (hours & minutes):') }}
|
||||
@if($pirep->read_only)
|
||||
<p>
|
||||
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
||||
{{ Form::hidden('hours') }}
|
||||
{{ Form::hidden('minutes') }}
|
||||
</p>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{{ Form::number('hours', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'hours',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ Form::number('minutes', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'minutes',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('minutes') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Block Fuel Field -->
|
||||
<div class="form-group col-sm-2">
|
||||
{{ Form::label('block_fuel', 'Block Fuel:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('block_fuel', null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01',
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('block_fuel') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Fuel Used Field -->
|
||||
<div class="form-group col-sm-2">
|
||||
{{ Form::label('fuel_used', 'Fuel Used:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('fuel_used', null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01'
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('fuel_used') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Level Field -->
|
||||
<div class="form-group col-sm-5">
|
||||
{{ Form::label('level', 'Flight Level:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('level', null, ['class' => 'form-control', 'min' => 0]) }}
|
||||
<p class="text-danger">{{ $errors->first('level') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- Route Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('route', 'Route:') }}
|
||||
{{ Form::textarea('route', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route') }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Notes Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('notes', 'Notes:') }}
|
||||
{{ Form::textarea('notes', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('arr_airport_id', 'Arrival Airport:') }}
|
||||
@if($pirep->read_only)
|
||||
<p>{{ $pirep->arr_airport->id }}@if($pirep->arr_airport->name) - {{ $pirep->arr_airport->name }}@endif
|
||||
</p>
|
||||
{{ Form::hidden('arr_airport_id') }}
|
||||
@else
|
||||
{{ Form::select('arr_airport_id', $airports_list, null, ['class' => 'form-control select2']) }}
|
||||
<p class="text-danger">{{ $errors->first('arr_airport_id') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- Flight Time Field -->
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('flight_time', 'Flight Time (hours & minutes):') }}
|
||||
@if($pirep->read_only)
|
||||
<p>
|
||||
{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes
|
||||
{{ Form::hidden('hours') }}
|
||||
{{ Form::hidden('minutes') }}
|
||||
</p>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{{ Form::number('hours', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'hours',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ Form::number('minutes', null, [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'minutes',
|
||||
'readonly' => $pirep->read_only]) }}
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('hours') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('minutes') }}</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Block Fuel Field -->
|
||||
<div class="form-group col-sm-2">
|
||||
{{ Form::label('block_fuel', 'Block Fuel:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('block_fuel', null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01',
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('block_fuel') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Fuel Used Field -->
|
||||
<div class="form-group col-sm-2">
|
||||
{{ Form::label('fuel_used', 'Fuel Used:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('fuel_used', null, [
|
||||
'class' => 'form-control',
|
||||
'min' => 0,
|
||||
'step' => '0.01'
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('fuel_used') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Level Field -->
|
||||
<div class="form-group col-sm-5">
|
||||
{{ Form::label('level', 'Flight Level:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::number('level', null, ['class' => 'form-control', 'min' => 0]) }}
|
||||
<p class="text-danger">{{ $errors->first('level') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- Route Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('route', 'Route:') }}
|
||||
{{ Form::textarea('route', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('route') }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Notes Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{{ Form::label('notes', 'Notes:') }}
|
||||
{{ Form::textarea('notes', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('notes') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--
|
||||
FARES
|
||||
--}}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
fares
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div id="fares_container">
|
||||
@include('admin.pireps.fares')
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
fares
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div id="fares_container">
|
||||
@include('admin.pireps.fares')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--
|
||||
@@ -250,24 +250,24 @@
|
||||
--}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
fields
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
{{-- You don't want to change this ID unless you don't want the fares form to work :) --}}
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-info-circle"></i>
|
||||
fields
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
{{-- You don't want to change this ID unless you don't want the fares form to work :) --}}
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
<a href="{{ route('admin.pireps.index') }}" class="btn btn-warn">Cancel</a>
|
||||
</div>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
<a href="{{ route('admin.pireps.index') }}" class="btn btn-warn">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
@if(count($pirep->acars_logs) > 0)
|
||||
<div class="col-12">
|
||||
<div class="col-12">
|
||||
<table class="table table-hover" 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>
|
||||
<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
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
@section('title', 'Pilot Reports')
|
||||
@section('actions')
|
||||
<li><a href="{{ route('admin.pirepfields.index') }}"><i class="ti-menu-alt"></i>PIREP Fields</a></li>
|
||||
<li><a href="{{ route('admin.pireps.index') }}?search=status:0"><i class="ti-plus"></i>Pending</a></li>
|
||||
<li><a href="{{ route('admin.pireps.index') }}"><i class="ti-plus"></i>View All</a></li>
|
||||
<li><a href="{{ route('admin.pirepfields.index') }}"><i class="ti-menu-alt"></i>PIREP Fields</a></li>
|
||||
<li><a href="{{ route('admin.pireps.index') }}?search=status:0"><i class="ti-plus"></i>Pending</a></li>
|
||||
<li><a href="{{ route('admin.pireps.index') }}"><i class="ti-plus"></i>View All</a></li>
|
||||
@endsection
|
||||
@section('content')
|
||||
@include('admin.pireps.table')
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
{{ $pireps->links('admin.pagination.default') }}
|
||||
</div>
|
||||
@include('admin.pireps.table')
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
{{ $pireps->links('admin.pagination.default') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
<div id="pirep_{{ $pirep->id }}_container">
|
||||
<div class="card border-blue-bottom pirep_card_container">
|
||||
<div class="card border-blue-bottom pirep_card_container">
|
||||
<div class="card-block" style="min-height: 0px">
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-center">
|
||||
<h5>
|
||||
<a class="text-c"
|
||||
href="{{ route('admin.pireps.edit', [$pirep->id]) }}">
|
||||
{{ $pirep->airline->code }}{{ $pirep->ident }}
|
||||
</a>
|
||||
</h5>
|
||||
<div>
|
||||
@if($pirep->state === PirepState::PENDING)
|
||||
<div class="badge badge-warning">
|
||||
@elseif($pirep->state === PirepState::ACCEPTED)
|
||||
<div class="badge badge-success">
|
||||
<div class="row">
|
||||
<div class="col-sm-2 text-center">
|
||||
<h5>
|
||||
<a class="text-c"
|
||||
href="{{ route('admin.pireps.edit', [$pirep->id]) }}">
|
||||
{{ $pirep->airline->code }}{{ $pirep->ident }}
|
||||
</a>
|
||||
</h5>
|
||||
<div>
|
||||
@if($pirep->state === PirepState::PENDING)
|
||||
<div class="badge badge-warning">
|
||||
@elseif($pirep->state === PirepState::ACCEPTED)
|
||||
<div class="badge badge-success">
|
||||
@elseif($pirep->state === PirepState::REJECTED)
|
||||
<div class="badge badge-danger">
|
||||
@else
|
||||
<div class="badge badge-info">
|
||||
@endif
|
||||
{{ PirepState::label($pirep->state) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="badge badge-danger">
|
||||
@else
|
||||
<div class="badge badge-info">
|
||||
@endif
|
||||
{{ PirepState::label($pirep->state) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div>
|
||||
<span class="description">
|
||||
<b>DEP</b>
|
||||
@@ -39,25 +39,25 @@
|
||||
</span>
|
||||
</div>
|
||||
@if($pirep->aircraft)
|
||||
<div><span class="description"><b>Aircraft</b>
|
||||
<div><span class="description"><b>Aircraft</b>
|
||||
{{ $pirep->aircraft->registration }}
|
||||
({{ $pirep->aircraft->name }})
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if(filled($pirep->level))
|
||||
<div>
|
||||
<div>
|
||||
<span class="description"><b>Flight Level</b>
|
||||
{{ $pirep->level }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
<span class="description"><b>Filed Using</b>
|
||||
{{ PirepSource::label($pirep->source) }}
|
||||
@if(filled($pirep->source_name))
|
||||
({{ $pirep->source_name }})
|
||||
@endif
|
||||
@if(filled($pirep->source_name))
|
||||
({{ $pirep->source_name }})
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
@@ -65,20 +65,20 @@
|
||||
{{ show_datetime($pirep->created_at) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div id="pirep_{{ $pirep->id }}_actionbar" class="pull-right">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div id="pirep_{{ $pirep->id }}_actionbar" class="pull-right">
|
||||
@include('admin.pireps.actions', ['pirep' => $pirep, 'on_edit_page' => false])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
const changeStatus = async (values, fn) => {
|
||||
console.log('Changing PIREP ' + values.pirep_id + ' to state ' + values.new_status);
|
||||
<script>
|
||||
const changeStatus = async (values, fn) => {
|
||||
console.log('Changing PIREP ' + values.pirep_id + ' to state ' + values.new_status);
|
||||
|
||||
const opts = {
|
||||
const opts = {
|
||||
method: 'POST',
|
||||
url: '{{url('/admin/pireps')}}/' + values.pirep_id + '/status',
|
||||
data: values,
|
||||
};
|
||||
|
||||
const response = await phpvms.request(opts);
|
||||
fn(response.data);
|
||||
};
|
||||
|
||||
const response = await phpvms.request(opts);
|
||||
fn(response.data);
|
||||
};
|
||||
$(document).ready(() => {
|
||||
const select_id = "select#aircraft_select";
|
||||
const destContainer = $('#fares_container');
|
||||
|
||||
$(document).ready(() => {
|
||||
const select_id = "select#aircraft_select";
|
||||
const destContainer = $('#fares_container');
|
||||
|
||||
$(select_id).change(async (e) => {
|
||||
$(select_id).change(async (e) => {
|
||||
const aircraft_id = $(select_id + " option:selected").val();
|
||||
console.log('aircraft select change: ', aircraft_id);
|
||||
|
||||
const response = await phpvms.request("{{ url('/admin/pireps/fares') }}?aircraft_id=" + aircraft_id);
|
||||
console.log('returned new fares', response.data);
|
||||
destContainer.html(response.data);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pjax_form', (event) => {
|
||||
$(document).on('submit', 'form.pjax_form', (event) => {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#pirep_comments_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
$(document).on('pjax:complete', function () {
|
||||
initPlugins();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Recalculate finances button is clicked
|
||||
*/
|
||||
$('button#recalculate-finances').on('click', async (event) => {
|
||||
/**
|
||||
* Recalculate finances button is clicked
|
||||
*/
|
||||
$('button#recalculate-finances').on('click', async (event) => {
|
||||
event.preventDefault();
|
||||
console.log('Sending recalculate finances request');
|
||||
const pirep_id = $(event.currentTarget).attr('data-pirep-id');
|
||||
|
||||
const opts = {
|
||||
method: 'POST',
|
||||
url: '{{url('/api/pireps')}}/' + pirep_id + '/finances/recalculate',
|
||||
method: 'POST',
|
||||
url: '{{url('/api/pireps')}}/' + pirep_id + '/finances/recalculate',
|
||||
};
|
||||
|
||||
const response = await phpvms.request(opts);
|
||||
console.log(response.data);
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pirep_submit_status', (event) => {
|
||||
$(document).on('submit', 'form.pirep_submit_status', (event) => {
|
||||
event.preventDefault();
|
||||
const values = {
|
||||
pirep_id: $(event.currentTarget).attr('pirep_id'),
|
||||
new_status: $(event.currentTarget).attr('new_status')
|
||||
pirep_id: $(event.currentTarget).attr('pirep_id'),
|
||||
new_status: $(event.currentTarget).attr('new_status')
|
||||
};
|
||||
|
||||
console.log('change status', values);
|
||||
|
||||
changeStatus(values, (data) => {
|
||||
const destContainer = '#pirep_' + values.pirep_id + '_actionbar';
|
||||
$(destContainer).html(data);
|
||||
const destContainer = '#pirep_' + values.pirep_id + '_actionbar';
|
||||
$(destContainer).html(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pirep_change_status', (event) => {
|
||||
$(document).on('submit', 'form.pirep_change_status', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const values = {
|
||||
pirep_id: $(event.currentTarget).attr('pirep_id'),
|
||||
new_status: $(event.currentTarget).attr('new_status')
|
||||
pirep_id: $(event.currentTarget).attr('pirep_id'),
|
||||
new_status: $(event.currentTarget).attr('new_status')
|
||||
};
|
||||
|
||||
console.log('change status', values);
|
||||
|
||||
changeStatus(values, (data) => {
|
||||
location.reload();
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -2,30 +2,30 @@
|
||||
@section('title', 'pilot report')
|
||||
|
||||
@section('content')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.show_fields')
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.show_fields')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>custom fields</h4>
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>custom fields</h4>
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>comments</h4>
|
||||
@include('admin.pireps.comments')
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<h4>comments</h4>
|
||||
@include('admin.pireps.comments')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.map')
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.map')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.scripts')
|
||||
|
||||
@@ -1,84 +1,84 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-4">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('dpt_airport_id', 'Dep ICAO') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">
|
||||
{{ $pirep->dpt_airport->icao }} - {{ $pirep->dpt_airport->name }}
|
||||
</p></div>
|
||||
</div>
|
||||
<div class="form-group col-sm-4">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('dpt_airport_id', 'Dep ICAO') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">
|
||||
{{ $pirep->dpt_airport->icao }} - {{ $pirep->dpt_airport->name }}
|
||||
</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-5">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('arr_airport_id', 'Arrival ICAO') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">
|
||||
{{ $pirep->arr_airport->icao }} - {{ $pirep->arr_airport->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-sm-5">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('arr_airport_id', 'Arrival ICAO') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">
|
||||
{{ $pirep->arr_airport->icao }} - {{ $pirep->arr_airport->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
<div id="pirep_{{ $pirep->id }}_actionbar" class="pull-right">
|
||||
@include('admin.pireps.actions')
|
||||
</div>
|
||||
<div class="form-group col-sm-3">
|
||||
<div id="pirep_{{ $pirep->id }}_actionbar" class="pull-right">
|
||||
@include('admin.pireps.actions')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td>Pilot</td>
|
||||
<td><a href="{{ route('admin.users.show', [$pirep->pilot->id]) }}"
|
||||
target="_blank">{{ $pirep->user->name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.flights.show', [$pirep->flight_id]) }}"
|
||||
target="_blank">
|
||||
{{ $pirep->ident }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aircraft</td>
|
||||
<td>{{ $pirep->aircraft->subfleet->name }}, {{ $pirep->aircraft->name }}
|
||||
({{ $pirep->aircraft->registration }})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight Time</td>
|
||||
<td>{{ Utils::minutesToTimeString($pirep->flight_time) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight Level</td>
|
||||
<td>{{ $pirep->level }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>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>
|
||||
<div class="col-md-12">
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td>Pilot</td>
|
||||
<td><a href="{{ route('admin.users.show', [$pirep->pilot->id]) }}"
|
||||
target="_blank">{{ $pirep->user->name }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.flights.show', [$pirep->flight_id]) }}"
|
||||
target="_blank">
|
||||
{{ $pirep->ident }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aircraft</td>
|
||||
<td>{{ $pirep->aircraft->subfleet->name }}, {{ $pirep->aircraft->name }}
|
||||
({{ $pirep->aircraft->registration }})
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight Time</td>
|
||||
<td>{{ Utils::minutesToTimeString($pirep->flight_time) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Flight Level</td>
|
||||
<td>{{ $pirep->level }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>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>
|
||||
|
||||
<tr>
|
||||
<td>Updated On</td>
|
||||
<td>{{ show_datetime($pirep->updated_at) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<tr>
|
||||
<td>Updated On</td>
|
||||
<td>{{ show_datetime($pirep->updated_at) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
<div class="col-12">
|
||||
@if(count($journal['transactions']) > 0)
|
||||
@if(count($journal['transactions']) > 0)
|
||||
<table class="table table-hover" id="users-table">
|
||||
<tbody>
|
||||
@foreach($journal['transactions'] as $entry)
|
||||
<tr>
|
||||
<td>{{ $entry->memo }}</td>
|
||||
<td>
|
||||
@if($entry->credit)
|
||||
{{ money($entry->credit, config('phpvms.currency')) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($entry->debit)
|
||||
{{ money($entry->debit, config('phpvms.currency')) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
{{-- show sums --}}
|
||||
<tbody>
|
||||
@foreach($journal['transactions'] as $entry)
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
{{ $journal['credits'] }}
|
||||
</td>
|
||||
<td>
|
||||
<i>{{ $journal['debits'] }}</i>
|
||||
</td>
|
||||
<td>{{ $entry->memo }}</td>
|
||||
<td>
|
||||
@if($entry->credit)
|
||||
{{ money($entry->credit, config('phpvms.currency')) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($entry->debit)
|
||||
{{ money($entry->debit, config('phpvms.currency')) }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
{{-- final total --}}
|
||||
<tr style="border-top: 3px; border-top-style: double;">
|
||||
<td></td>
|
||||
<td align="right">
|
||||
<b>Total</b>
|
||||
</td>
|
||||
<td>
|
||||
{{ $journal['credits']->subtract($journal['debits']) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
{{-- show sums --}}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
{{ $journal['credits'] }}
|
||||
</td>
|
||||
<td>
|
||||
<i>{{ $journal['debits'] }}</i>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{-- final total --}}
|
||||
<tr style="border-top: 3px; border-top-style: double;">
|
||||
<td></td>
|
||||
<td align="right">
|
||||
<b>Total</b>
|
||||
</td>
|
||||
<td>
|
||||
{{ $journal['credits']->subtract($journal['debits']) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user