#14 initial scaffolding for adding flights/schedules

This commit is contained in:
Nabeel Shahzad
2017-06-17 17:25:36 -05:00
parent d52f1cec05
commit f4e7eef40c
15 changed files with 697 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Create Flight</h1>
</section>
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::open(['route' => 'admin.flights.store']) !!}
@include('admin.flights.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,21 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Edit {!! $flight->airline->name !!}{!! $flight->number !!}</h1>
</section>
<div class="content">
@include('adminlte-templates::common.errors')
<div class="box box-primary">
<div class="box-body">
<div class="row">
{!! Form::model($flight, ['route' => ['admin.flights.update', $flight->id], 'method' => 'patch']) !!}
@include('admin.flights.fields')
{!! Form::close() !!}
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,77 @@
<!-- Airline Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('airline_id', 'Airline:') !!}
{!! Form::text('airline_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Flight Number Field -->
<div class="form-group col-sm-6">
{!! Form::label('flight_number', 'Flight Number:') !!}
{!! Form::text('flight_number', null, ['class' => 'form-control']) !!}
</div>
<!-- Route Code Field -->
<div class="form-group col-sm-6">
{!! Form::label('route_code', 'Route Code:') !!}
{!! Form::text('route_code', null, ['class' => 'form-control']) !!}
</div>
<!-- Route Leg Field -->
<div class="form-group col-sm-6">
{!! Form::label('route_leg', 'Route Leg:') !!}
{!! Form::text('route_leg', null, ['class' => 'form-control']) !!}
</div>
<!-- Dpt Airport Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('dpt_airport_id', 'Dpt Airport Id:') !!}
{!! Form::text('dpt_airport_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Arr Airport Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('arr_airport_id', 'Arr Airport Id:') !!}
{!! Form::text('arr_airport_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Alt Airport Id Field -->
<div class="form-group col-sm-6">
{!! Form::label('alt_airport_id', 'Alt Airport Id:') !!}
{!! Form::text('alt_airport_id', null, ['class' => 'form-control']) !!}
</div>
<!-- Route Field -->
<div class="form-group col-sm-6">
{!! Form::label('route', 'Route:') !!}
{!! Form::text('route', null, ['class' => 'form-control']) !!}
</div>
<!-- Dpt Time Field -->
<div class="form-group col-sm-6">
{!! Form::label('dpt_time', 'Dpt Time:') !!}
{!! Form::text('dpt_time', null, ['class' => 'form-control']) !!}
</div>
<!-- Arr Time Field -->
<div class="form-group col-sm-6">
{!! Form::label('arr_time', 'Arr Time:') !!}
{!! Form::text('arr_time', null, ['class' => 'form-control']) !!}
</div>
<!-- Notes Field -->
<div class="form-group col-sm-6">
{!! Form::label('notes', 'Notes:') !!}
{!! Form::text('notes', null, ['class' => 'form-control']) !!}
</div>
<!-- Active Field -->
<div class="form-group col-sm-6">
{!! Form::label('active', 'Active:') !!}
{!! Form::text('active', null, ['class' => 'form-control']) !!}
</div>
<!-- Submit Field -->
<div class="form-group col-sm-12">
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
<a href="{!! route('admin.flights.index') !!}" class="btn btn-default">Cancel</a>
</div>

View File

@@ -0,0 +1,23 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1 class="pull-left">Flights</h1>
<h1 class="pull-right">
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('admin.flights.create') !!}">Add New</a>
</h1>
</section>
<div class="content">
<div class="clearfix"></div>
@include('flash::message')
<div class="clearfix"></div>
<div class="box box-primary">
<div class="box-body">
@include('admin.flights.table')
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,17 @@
@extends('admin.app')
@section('content')
<section class="content-header">
<h1>Flights</h1>
</section>
<div class="content">
<div class="box box-primary">
<div class="box-body">
<div class="row" style="padding-left: 20px">
@include('admin.flights.show_fields')
<a href="{!! route('admin.flights.index') !!}" class="btn btn-default">Back</a>
</div>
</div>
</div>
</div>
@endsection

View File

@@ -0,0 +1,90 @@
<!-- Id Field -->
<div class="form-group">
{!! Form::label('id', 'Id:') !!}
<p>{!! $flight->id !!}</p>
</div>
<!-- Airline Id Field -->
<div class="form-group">
{!! Form::label('airline_id', 'Airline Id:') !!}
<p>{!! $flight->airline_id !!}</p>
</div>
<!-- Flight Number Field -->
<div class="form-group">
{!! Form::label('flight_number', 'Flight Number:') !!}
<p>{!! $flight->flight_number !!}</p>
</div>
<!-- Route Code Field -->
<div class="form-group">
{!! Form::label('route_code', 'Route Code:') !!}
<p>{!! $flight->route_code !!}</p>
</div>
<!-- Route Leg Field -->
<div class="form-group">
{!! Form::label('route_leg', 'Route Leg:') !!}
<p>{!! $flight->route_leg !!}</p>
</div>
<!-- Dpt Airport Id Field -->
<div class="form-group">
{!! Form::label('dpt_airport_id', 'Dpt Airport Id:') !!}
<p>{!! $flight->dpt_airport_id !!}</p>
</div>
<!-- Arr Airport Id Field -->
<div class="form-group">
{!! Form::label('arr_airport_id', 'Arr Airport Id:') !!}
<p>{!! $flight->arr_airport_id !!}</p>
</div>
<!-- Alt Airport Id Field -->
<div class="form-group">
{!! Form::label('alt_airport_id', 'Alt Airport Id:') !!}
<p>{!! $flight->alt_airport_id !!}</p>
</div>
<!-- Route Field -->
<div class="form-group">
{!! Form::label('route', 'Route:') !!}
<p>{!! $flight->route !!}</p>
</div>
<!-- Dpt Time Field -->
<div class="form-group">
{!! Form::label('dpt_time', 'Dpt Time:') !!}
<p>{!! $flight->dpt_time !!}</p>
</div>
<!-- Arr Time Field -->
<div class="form-group">
{!! Form::label('arr_time', 'Arr Time:') !!}
<p>{!! $flight->arr_time !!}</p>
</div>
<!-- Notes Field -->
<div class="form-group">
{!! Form::label('notes', 'Notes:') !!}
<p>{!! $flight->notes !!}</p>
</div>
<!-- Active Field -->
<div class="form-group">
{!! Form::label('active', 'Active:') !!}
<p>{!! $flight->active !!}</p>
</div>
<!-- Created At Field -->
<div class="form-group">
{!! Form::label('created_at', 'Created At:') !!}
<p>{!! $flight->created_at !!}</p>
</div>
<!-- Updated At Field -->
<div class="form-group">
{!! Form::label('updated_at', 'Updated At:') !!}
<p>{!! $flight->updated_at !!}</p>
</div>

View File

@@ -0,0 +1,41 @@
<table class="table table-responsive" id="flights-table">
<thead>
<th>Flight #</th>
<th>Dep</th>
<th>Arr</th>
<th>Alt</th>
<th>Route</th>
<th>Dpt Time</th>
<th>Arr Time</th>
<th>Notes</th>
<th>Active</th>
<th colspan="3">Action</th>
</thead>
<tbody>
@foreach($flights as $flight)
<tr>
<td>
{!! $flight->airline_id !!}/{!! $flight->flight_number !!}
(C: {!! $flight->route_code !!} L: {!! $flight->route_leg !!})
</td>
<td>{!! $flight->dpt_airport->icao !!}</td>
<td>{!! $flight->arr_airport->icao !!}</td>
<td>{!! $flight->alt_airport->icao !!}</td>
<td>{!! $flight->route !!}</td>
<td>{!! $flight->dpt_time !!}</td>
<td>{!! $flight->arr_time !!}</td>
<td>{!! $flight->notes !!}</td>
<td>{!! $flight->active !!}</td>
<td>
{!! Form::open(['route' => ['admin.flights.destroy', $flight->id], 'method' => 'delete']) !!}
<div class='btn-group'>
<a href="{!! route('admin.flights.show', [$flight->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
<a href="{!! route('admin.flights.edit', [$flight->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>
{!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}
</div>
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
</table>

View File

@@ -7,6 +7,7 @@
<span data-toggle="tooltip" title="3 New" class="badge bg-light-blue pull-right">3</span>
</a>
</li>
<li><a href="{!! url('/admin/flights') !!}"><i class="fa fa-map"></i>&nbsp;flights</a></li>
<li><a href="{!! url('/admin/aircraft') !!}"><i class="fa fa-plane" aria-hidden="true"></i>&nbsp;fleet</a></li>
<li><a href="{!! url('/admin/fares') !!}"><i class="fa fa-dollar"></i>&nbsp;fares</a></li>