@@ -1,17 +1,17 @@
|
||||
@extends('admin.app')
|
||||
@section('title', 'Add Aircraft')
|
||||
@section('content')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@if(!filled($subfleets))
|
||||
<p class="text-center">
|
||||
You must add a subfleet before you can add an aircraft!
|
||||
</p>
|
||||
@else
|
||||
{{ Form::open(['route' => 'admin.aircraft.store']) }}
|
||||
@include('admin.aircraft.fields')
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@if(!filled($subfleets))
|
||||
<p class="text-center">
|
||||
You must add a subfleet before you can add an aircraft!
|
||||
</p>
|
||||
@else
|
||||
{{ Form::open(['route' => 'admin.aircraft.store']) }}
|
||||
@include('admin.aircraft.fields')
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
@extends('admin.app')
|
||||
@section('title', "Edit \"$aircraft->name\"")
|
||||
@section('content')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{{ Form::model($aircraft, ['route' => ['admin.aircraft.update', $aircraft->id], 'method' => 'patch']) }}
|
||||
@include('admin.aircraft.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{{ Form::model($aircraft, ['route' => ['admin.aircraft.update', $aircraft->id], 'method' => 'patch']) }}
|
||||
@include('admin.aircraft.fields')
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.aircraft.expenses')
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.aircraft.expenses')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.common.file_upload', ['model' => $aircraft])
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.common.file_upload', ['model' => $aircraft])
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('admin.aircraft.script')
|
||||
|
||||
@@ -1,78 +1,78 @@
|
||||
<div id="expenses-wrapper" class="col-12">
|
||||
<div class="header">
|
||||
<h3>expenses</h3>
|
||||
@component('admin.components.info')
|
||||
These expenses are only applied to this aircraft.
|
||||
@endcomponent
|
||||
</div>
|
||||
<div class="header">
|
||||
<h3>expenses</h3>
|
||||
@component('admin.components.info')
|
||||
These expenses are only applied to this aircraft.
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
@if(count($aircraft->expenses) === 0)
|
||||
@include('admin.common.none_added', ['type' => 'expenses'])
|
||||
@if(count($aircraft->expenses) === 0)
|
||||
@include('admin.common.none_added', ['type' => 'expenses'])
|
||||
@endif
|
||||
|
||||
<table class="table table-responsive" id="expenses">
|
||||
@if(count($aircraft->expenses) > 0)
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Cost <span class="small">{{ currency(config('phpvms.currency')) }}</span></th>
|
||||
<th>Type</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
@endif
|
||||
|
||||
<table class="table table-responsive" id="expenses">
|
||||
@if(count($aircraft->expenses) > 0)
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Cost <span class="small">{{ currency(config('phpvms.currency')) }}</span></th>
|
||||
<th>Type</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
@endif
|
||||
<tbody>
|
||||
@foreach($aircraft->expenses as $expense)
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<a class="text" href="#" data-pk="{{ $expense->id }}"
|
||||
data-name="name">{{ $expense->name }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<a class="text" href="#" data-pk="{{ $expense->id }}"
|
||||
data-name="amount">{{ $expense->amount }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="#"
|
||||
class="dropdown"
|
||||
data-pk="{{ $expense->id }}"
|
||||
data-name="type">{{ \App\Models\Enums\ExpenseType::label($expense->type) }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td align="right">
|
||||
{{ Form::open(['url' => url('/admin/aircraft/'.$aircraft->id.'/expenses'),
|
||||
'method' => 'delete', 'class' => 'modify_expense form-inline']) }}
|
||||
{{ Form::hidden('expense_id', $expense->id) }}
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
||||
'class' => 'btn btn-sm btn-danger btn-icon',
|
||||
'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/aircraft/'.$aircraft->id.'/expenses'),
|
||||
'method' => 'post', 'class' => 'modify_expense form-inline']) }}
|
||||
{{ Form::input('text', 'name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) }}
|
||||
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount', 'step' => '0.01']) }}
|
||||
{{ Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) }}
|
||||
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
||||
'class' => 'btn btn-success btn-small']) }}
|
||||
{{ Form::close() }}
|
||||
|
||||
<tbody>
|
||||
@foreach($aircraft->expenses as $expense)
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<a class="text" href="#" data-pk="{{ $expense->id }}"
|
||||
data-name="name">{{ $expense->name }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<a class="text" href="#" data-pk="{{ $expense->id }}"
|
||||
data-name="amount">{{ $expense->amount }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
<a href="#"
|
||||
class="dropdown"
|
||||
data-pk="{{ $expense->id }}"
|
||||
data-name="type">{{ \App\Models\Enums\ExpenseType::label($expense->type) }}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td align="right">
|
||||
{{ Form::open(['url' => url('/admin/aircraft/'.$aircraft->id.'/expenses'),
|
||||
'method' => 'delete', 'class' => 'modify_expense form-inline']) }}
|
||||
{{ Form::hidden('expense_id', $expense->id) }}
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit',
|
||||
'class' => 'btn btn-sm btn-danger btn-icon',
|
||||
'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/aircraft/'.$aircraft->id.'/expenses'),
|
||||
'method' => 'post', 'class' => 'modify_expense form-inline']) }}
|
||||
{{ Form::input('text', 'name', null, ['class' => 'form-control input-sm', 'placeholder' => 'Name']) }}
|
||||
{{ Form::number('amount', null, ['class' => 'form-control input-sm', 'placeholder' => 'Amount', 'step' => '0.01']) }}
|
||||
{{ Form::select('type', \App\Models\Enums\ExpenseType::select(), null, ['class' => 'select2']) }}
|
||||
{{ Form::button('<i class="fa fa-plus"></i> Add', ['type' => 'submit',
|
||||
'class' => 'btn btn-success btn-small']) }}
|
||||
{{ Form::close() }}
|
||||
|
||||
<p class="text-danger">{{ $errors->first('name') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('amount') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-danger">{{ $errors->first('name') }}</p>
|
||||
<p class="text-danger">{{ $errors->first('amount') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-clock"></i>
|
||||
Subfleet and Status
|
||||
</h6>
|
||||
<div class="form-container-body row">
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('subfleet_id', 'Subfleet:') }}
|
||||
{{ Form::select('subfleet_id', $subfleets, $subfleet_id ?? null, [
|
||||
'class' => 'form-control select2',
|
||||
'placeholder' => 'Select Subfleet'
|
||||
])
|
||||
}}
|
||||
<p class="text-danger">{{ $errors->first('subfleet_id') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('status', 'Status:') }}
|
||||
{{ Form::select('status', $statuses, null, ['class' => 'form-control select2', 'placeholder' => 'Select Status']) }}
|
||||
<p class="text-danger">{{ $errors->first('subfleet_id') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('airport_id', 'Location:') }}
|
||||
{{ Form::select('airport_id', $airports, null, [
|
||||
'class' => 'form-control select2'
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('airport_id') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="form-container">
|
||||
<h6><i class="fas fa-clock"></i>
|
||||
Subfleet and Status
|
||||
</h6>
|
||||
<div class="form-container-body row">
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('subfleet_id', 'Subfleet:') }}
|
||||
{{ Form::select('subfleet_id', $subfleets, $subfleet_id ?? null, [
|
||||
'class' => 'form-control select2',
|
||||
'placeholder' => 'Select Subfleet'
|
||||
])
|
||||
}}
|
||||
<p class="text-danger">{{ $errors->first('subfleet_id') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('status', 'Status:') }}
|
||||
{{ Form::select('status', $statuses, null, ['class' => 'form-control select2', 'placeholder' => 'Select Status']) }}
|
||||
<p class="text-danger">{{ $errors->first('subfleet_id') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('airport_id', 'Location:') }}
|
||||
{{ Form::select('airport_id', $airports, null, [
|
||||
'class' => 'form-control select2'
|
||||
]) }}
|
||||
<p class="text-danger">{{ $errors->first('airport_id') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="form-container">
|
||||
<h6>
|
||||
<div class="col-12">
|
||||
<div class="form-container">
|
||||
<h6>
|
||||
<span style="float:right">
|
||||
View list of
|
||||
<a href="https://en.wikipedia.org/wiki/List_of_ICAO_aircraft_type_designators"
|
||||
@@ -44,47 +44,47 @@
|
||||
IATA and ICAO Type Designators
|
||||
</a>
|
||||
</span>
|
||||
<i class="fas fa-plane"></i>
|
||||
Aircraft Information
|
||||
<i class="fas fa-plane"></i>
|
||||
Aircraft Information
|
||||
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
{{ Form::label('name', 'Name:') }} <span class="required">*</span>
|
||||
{{ Form::text('name', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('name') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('iata', 'IATA:') }}
|
||||
{{ Form::text('iata', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('iata') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('icao', 'ICAO:') }}
|
||||
{{ Form::text('icao', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('icao') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('registration', 'Registration:') }}
|
||||
{{ Form::text('registration', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('registration') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</h6>
|
||||
<div class="form-container-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
{{ Form::label('name', 'Name:') }} <span class="required">*</span>
|
||||
{{ Form::text('name', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('name') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('iata', 'IATA:') }}
|
||||
{{ Form::text('iata', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('iata') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('icao', 'ICAO:') }}
|
||||
{{ Form::text('icao', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('icao') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-sm-3">
|
||||
{{ Form::label('registration', 'Registration:') }}
|
||||
{{ Form::text('registration', null, ['class' => 'form-control']) }}
|
||||
<p class="text-danger">{{ $errors->first('registration') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
<a href="{{ route('admin.aircraft.index') }}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
<a href="{{ route('admin.aircraft.index') }}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@extends('admin.app')
|
||||
@section('title', 'Import Aircraft')
|
||||
@section('content')
|
||||
@include('admin.common.import', ['route' => 'admin.aircraft.import'])
|
||||
@include('admin.common.import', ['route' => 'admin.aircraft.import'])
|
||||
@endsection
|
||||
|
||||
@@ -2,18 +2,19 @@
|
||||
@section('title', 'Aircraft')
|
||||
|
||||
@section('actions')
|
||||
<li><a href="{{ route('admin.aircraft.export') }}"><i class="ti-plus"></i>Export to CSV</a></li>
|
||||
<li><a href="{{ route('admin.aircraft.import') }}"><i class="ti-plus"></i>Import from CSV</a></li>
|
||||
{{--<li><a href="{{ url('/admin/subfleets') }}"><i class="ti-files"></i>Subfleets</a></li>--}}
|
||||
<li><a href="{{ route('admin.aircraft.create') }}?subfleet={{$subfleet_id}}">
|
||||
<i class="ti-plus"></i>New Aircraft</a></li>
|
||||
<li><a href="{{ route('admin.aircraft.export') }}"><i class="ti-plus"></i>Export to CSV</a></li>
|
||||
<li><a href="{{ route('admin.aircraft.import') }}"><i class="ti-plus"></i>Import from CSV</a></li>
|
||||
{{--<li><a href="{{ url('/admin/subfleets') }}"><i class="ti-files"></i>Subfleets</a></li>--}}
|
||||
<li><a href="{{ route('admin.aircraft.create') }}?subfleet={{$subfleet_id}}">
|
||||
<i class="ti-plus"></i>New Aircraft</a>
|
||||
</li>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.aircraft.table')
|
||||
</div>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.aircraft.table')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
function setEditable() {
|
||||
const token = $('meta[name="csrf-token"]').attr('content');
|
||||
const api_key = $('meta[name="api-key"]').attr('content');
|
||||
<script>
|
||||
function setEditable() {
|
||||
const token = $('meta[name="csrf-token"]').attr('content');
|
||||
const api_key = $('meta[name="api-key"]').attr('content');
|
||||
|
||||
@if(isset($aircraft))
|
||||
$('#expenses a.text').editable({
|
||||
@if(isset($aircraft))
|
||||
$('#expenses a.text').editable({
|
||||
emptytext: '0',
|
||||
url: '{{ url('/admin/aircraft/'.$aircraft->id.'/expenses') }}',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: {
|
||||
type: 'post',
|
||||
headers: {
|
||||
'x-api-key': api_key,
|
||||
'X-CSRF-TOKEN': token,
|
||||
}
|
||||
type: 'post',
|
||||
headers: {
|
||||
'x-api-key': api_key,
|
||||
'X-CSRF-TOKEN': token,
|
||||
}
|
||||
},
|
||||
params: function (params) {
|
||||
return {
|
||||
_method: 'put',
|
||||
expense_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
return {
|
||||
_method: 'put',
|
||||
expense_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#expenses a.dropdown').editable({
|
||||
$('#expenses a.dropdown').editable({
|
||||
type: 'select',
|
||||
emptytext: '0',
|
||||
source: {!! json_encode(list_to_editable(\App\Models\Enums\ExpenseType::select())) !!},
|
||||
url: '{{ url('/admin/aircraft/'.$aircraft->id.'/expenses') }}',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: {
|
||||
type: 'post',
|
||||
headers: {
|
||||
'x-api-key': api_key,
|
||||
'X-CSRF-TOKEN': token,
|
||||
}
|
||||
type: 'post',
|
||||
headers: {
|
||||
'x-api-key': api_key,
|
||||
'X-CSRF-TOKEN': token,
|
||||
}
|
||||
},
|
||||
params: function (params) {
|
||||
return {
|
||||
_method: 'put',
|
||||
expense_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
return {
|
||||
_method: 'put',
|
||||
expense_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
@endif
|
||||
}
|
||||
});
|
||||
@endif
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
|
||||
setEditable();
|
||||
setEditable();
|
||||
|
||||
$(document).on('submit', 'form.modify_expense', function (event) {
|
||||
$(document).on('submit', 'form.modify_expense', function (event) {
|
||||
event.preventDefault();
|
||||
console.log(event);
|
||||
$.pjax.submit(event, '#expenses-wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
initPlugins();
|
||||
setEditable();
|
||||
$(document).on('pjax:complete', function () {
|
||||
initPlugins();
|
||||
setEditable();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<section class="content-header">
|
||||
<h1 class="pull-left">{{ $aircraft->name }}</h1>
|
||||
<h1 class="pull-right">
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{{ route('admin.aircraft.edit', $aircraft->id) }}">Edit</a>
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px"
|
||||
href="{{ route('admin.aircraft.edit', $aircraft->id) }}">Edit</a>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="clearfix"></div>
|
||||
<div class="row">
|
||||
@include('admin.aircraft.show_fields')
|
||||
@include('admin.aircraft.show_fields')
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
@endsection
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(".ac-fare-dropdown").select2();
|
||||
$('#aircraft_fares a').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: 'default',
|
||||
url: '/admin/aircraft/{{ $aircraft->id }}/fares',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: { 'type': 'put'},
|
||||
params: function(params) {
|
||||
ajaxOptions: {'type': 'put'},
|
||||
params: function (params) {
|
||||
return {
|
||||
fare_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
fare_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.rm_fare', function(event) {
|
||||
$(document).on('submit', 'form.rm_fare', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#aircraft_fares_wrapper', {push: false});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
<!-- Icao Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ Form::label('airport_id', 'Location') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p class="lead">
|
||||
@if($aircraft->airport)
|
||||
{{ $aircraft->airport->icao }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ Form::label('airport_id', 'Location') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p class="lead">
|
||||
@if($aircraft->airport)
|
||||
{{ $aircraft->airport->icao }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Name Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('name', 'Name') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">{{ $aircraft->name }}</p></div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('name', 'Name') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">{{ $aircraft->name }}</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Registration Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('registration', 'Registration') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">{{ $aircraft->registration }}</p></div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('registration', 'Registration') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">{{ $aircraft->registration }}</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Active Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('active', 'Active:') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">@if ($aircraft->active == '1') yes @else no @endif</p></div>
|
||||
<div class="box box-solid">
|
||||
<div class="box-header with-border">
|
||||
{{--<i class="fa fa-text-width"></i>--}}
|
||||
<h3 class="box-title">{{ Form::label('active', 'Active:') }}</h3>
|
||||
</div>
|
||||
<div class="box-body"><p class="lead">@if ($aircraft->active == '1') yes @else no @endif</p></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
<table class="table table-hover table-responsive" id="aircrafts-table">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th style="text-align: center;">Registration</th>
|
||||
<th>Subfleet</th>
|
||||
<th style="text-align: center;">Location</th>
|
||||
<th style="text-align: center;">Hours</th>
|
||||
<th style="text-align: center;">Active</th>
|
||||
<th style="text-align: right;"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($aircraft as $ac)
|
||||
<tr>
|
||||
<td><a href="{{ route('admin.aircraft.edit', [$ac->id]) }}">{{ $ac->name }}</a></td>
|
||||
<td style="text-align: center;">{{ $ac->registration }}</td>
|
||||
<td>
|
||||
@if($ac->subfleet_id && $ac->subfleet)
|
||||
<a href="{{ route('admin.subfleets.edit', [$ac->subfleet_id]) }}">
|
||||
{{ $ac->subfleet->name }}
|
||||
</a>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td style="text-align: center;">{{ $ac->airport_id }}</td>
|
||||
<td style="text-align: center;">
|
||||
{{ Utils::minutesToTimeString($ac->flight_hours) }}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
@if($ac->status == \App\Models\Enums\AircraftStatus::ACTIVE)
|
||||
<span class="label label-success">{{ \App\Models\Enums\AircraftStatus::label($ac->status) }}</span>
|
||||
@else
|
||||
<span class="label label-default">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th style="text-align: center;">Registration</th>
|
||||
<th>Subfleet</th>
|
||||
<th style="text-align: center;">Location</th>
|
||||
<th style="text-align: center;">Hours</th>
|
||||
<th style="text-align: center;">Active</th>
|
||||
<th style="text-align: right;"></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($aircraft as $ac)
|
||||
<tr>
|
||||
<td><a href="{{ route('admin.aircraft.edit', [$ac->id]) }}">{{ $ac->name }}</a></td>
|
||||
<td style="text-align: center;">{{ $ac->registration }}</td>
|
||||
<td>
|
||||
@if($ac->subfleet_id && $ac->subfleet)
|
||||
<a href="{{ route('admin.subfleets.edit', [$ac->subfleet_id]) }}">
|
||||
{{ $ac->subfleet->name }}
|
||||
</a>
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
<td style="text-align: center;">{{ $ac->airport_id }}</td>
|
||||
<td style="text-align: center;">
|
||||
{{ Utils::minutesToTimeString($ac->flight_hours) }}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
@if($ac->status == \App\Models\Enums\AircraftStatus::ACTIVE)
|
||||
<span class="label label-success">{{ \App\Models\Enums\AircraftStatus::label($ac->status) }}</span>
|
||||
@else
|
||||
<span class="label label-default">
|
||||
{{ \App\Models\Enums\AircraftStatus::label($ac->status) }}
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td style="width: 10%; text-align: right;">
|
||||
{{ Form::open(['route' => ['admin.aircraft.destroy', $ac->id], 'method' => 'delete']) }}
|
||||
<a href="{{ route('admin.aircraft.edit', [$ac->id]) }}" class='btn btn-sm btn-success btn-icon'>
|
||||
<i class="fas fa-pencil-alt"></i>
|
||||
</a>
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon', 'onclick' => "return confirm('Are you sure?')"]) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endif
|
||||
</td>
|
||||
<td style="width: 10%; text-align: right;">
|
||||
{{ Form::open(['route' => ['admin.aircraft.destroy', $ac->id], 'method' => 'delete']) }}
|
||||
<a href="{{ route('admin.aircraft.edit', [$ac->id]) }}" class='btn btn-sm btn-success btn-icon'>
|
||||
<i class="fas fa-pencil-alt"></i>
|
||||
</a>
|
||||
{{ Form::button('<i class="fa fa-times"></i>', ['type' => 'submit', 'class' => 'btn btn-sm btn-danger btn-icon', 'onclick' => "return confirm('Are you sure?')"]) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user