Edit user PIREP
This commit is contained in:
2
.idea/runConfigurations/UtilsTest.xml
generated
2
.idea/runConfigurations/UtilsTest.xml
generated
@@ -1,6 +1,6 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="UtilsTest" type="PHPUnitRunConfigurationType" factoryName="PHPUnit" singleton="true">
|
||||
<TestRunner class="PIREPTest" configuration_file="$PROJECT_DIR$/phpunit.xml" file="$PROJECT_DIR$/tests/UtilsTest.php" scope="Class" use_alternative_configuration_file="true" />
|
||||
<TestRunner class="UtilsTest" configuration_file="$PROJECT_DIR$/phpunit.xml" file="$PROJECT_DIR$/tests/UtilsTest.php" scope="Class" use_alternative_configuration_file="true" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Requests\CreatePirepRequest;
|
||||
use App\Http\Requests\UpdatePirepRequest;
|
||||
use App\Repositories\AircraftRepository;
|
||||
use App\Repositories\AirlineRepository;
|
||||
use App\Repositories\AirportRepository;
|
||||
use App\Repositories\PirepRepository;
|
||||
use App\Services\PIREPService;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -12,16 +14,26 @@ use Flash;
|
||||
use Log;
|
||||
use Prettus\Repository\Criteria\RequestCriteria;
|
||||
use Response;
|
||||
use App\Facades\Utils;
|
||||
|
||||
|
||||
class PirepController extends BaseController
|
||||
{
|
||||
private $pirepRepo, $aircraftRepo, $pirepSvc;
|
||||
private $airportRepo,
|
||||
$airlineRepo,
|
||||
$pirepRepo,
|
||||
$aircraftRepo,
|
||||
$pirepSvc;
|
||||
|
||||
public function __construct(
|
||||
AirportRepository $airportRepo,
|
||||
AirlineRepository $airlineRepo,
|
||||
AircraftRepository $aircraftRepo,
|
||||
PirepRepository $pirepRepo,
|
||||
PIREPService $pirepSvc
|
||||
) {
|
||||
$this->airportRepo = $airportRepo;
|
||||
$this->airlineRepo = $airlineRepo;
|
||||
$this->aircraftRepo = $aircraftRepo;
|
||||
$this->pirepRepo = $pirepRepo;
|
||||
$this->pirepSvc = $pirepSvc;
|
||||
@@ -128,15 +140,20 @@ class PirepController extends BaseController
|
||||
public function edit($id)
|
||||
{
|
||||
$pirep = $this->pirepRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($pirep)) {
|
||||
Flash::error('Pirep not found');
|
||||
return redirect(route('admin.pireps.index'));
|
||||
}
|
||||
|
||||
$hms = Utils::secondsToTimeParts($pirep->flight_time);
|
||||
$pirep->hours = $hms['h'];
|
||||
$pirep->minutes = $hms['m'];
|
||||
|
||||
return view('admin.pireps.edit', [
|
||||
'pirep' => $pirep,
|
||||
'aircraft' => $this->aircraftList(),
|
||||
'airports' => $this->airportRepo->selectBoxList(),
|
||||
'airlines' => $this->airlineRepo->selectBoxList(),
|
||||
'aircraft' => $this->aircraftRepo->selectBoxList(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -150,6 +167,9 @@ class PirepController extends BaseController
|
||||
{
|
||||
$pirep = $this->pirepRepo->findWithoutFail($id);
|
||||
|
||||
$pirep->flight_time = ((int)$request['hours'] * 60 * 60)
|
||||
+ ((int)$request['minutes'] * 60);
|
||||
|
||||
if (empty($pirep)) {
|
||||
Flash::error('Pirep not found');
|
||||
return redirect(route('admin.pireps.index'));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Frontend;
|
||||
|
||||
use App\Services\PIREPService;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -22,29 +23,31 @@ class PirepController extends Controller
|
||||
$aircraftRepo,
|
||||
$pirepRepo,
|
||||
$airportRepo,
|
||||
$pirepFieldRepo;
|
||||
$pirepFieldRepo,
|
||||
$pirepSvc;
|
||||
|
||||
public function __construct(
|
||||
AirlineRepository $airlineRepo,
|
||||
PirepRepository $pirepRepo,
|
||||
AircraftRepository $aircraftRepo,
|
||||
AirportRepository $airportRepo,
|
||||
PirepFieldRepository $pirepFieldRepo
|
||||
PirepFieldRepository $pirepFieldRepo,
|
||||
PIREPService $pirepSvc
|
||||
) {
|
||||
$this->airlineRepo = $airlineRepo;
|
||||
$this->aircraftRepo = $aircraftRepo;
|
||||
$this->pirepRepo = $pirepRepo;
|
||||
$this->airportRepo = $airportRepo;
|
||||
$this->pirepFieldRepo = $pirepFieldRepo;
|
||||
$this->pirepSvc = $pirepSvc;
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$pireps = $this->pirepRepo
|
||||
->where('user_id', $user->id)
|
||||
$pireps = Pirep::where('user_id', $user->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
->paginate();
|
||||
|
||||
return $this->view('pireps.index', [
|
||||
'user' => $user,
|
||||
@@ -54,11 +57,9 @@ class PirepController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
$aircraft = $this->aircraftList();
|
||||
|
||||
return $this->view('pireps.create', [
|
||||
'airports' => $this->airportRepo->selectBoxList(),
|
||||
'airlines' => $this->airlineRepo->all()->pluck('name', 'id'),
|
||||
'airlines' => $this->airlineRepo->selectBoxList(),
|
||||
'aircraft' => $this->aircraftRepo->selectBoxList(),
|
||||
'pirepfields' => $this->pirepFieldRepo->all(),
|
||||
'fieldvalues' => [],
|
||||
@@ -95,8 +96,7 @@ class PirepController extends Controller
|
||||
];
|
||||
}
|
||||
|
||||
$pirepSvc = app('\App\Services\PIREPService');
|
||||
$pirep = $pirepSvc->create($pirep, $custom_fields);
|
||||
$pirep = $this->pirepSvc->create($pirep, $custom_fields);
|
||||
|
||||
//Flash::success('PIREP submitted successfully!');
|
||||
return redirect(route('frontend.pireps.index'));
|
||||
|
||||
@@ -67,6 +67,21 @@ class Pirep extends Model
|
||||
'arr_airport_id' => 'required',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getFlightId()
|
||||
{
|
||||
$flight_id = $this->airline->code;
|
||||
if($this->flight_id) {
|
||||
$flight_id .= $this->flight->flight_number;
|
||||
} else {
|
||||
$flight_id .= $this->flight_number;
|
||||
}
|
||||
|
||||
return $flight_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Foreign Keys
|
||||
*/
|
||||
|
||||
@@ -169,7 +169,9 @@ input[type="file"] > input[type="button"]::-moz-focus-inner {
|
||||
.navbar-toggle,
|
||||
input:focus,
|
||||
button:focus {
|
||||
outline: 0 !important; }
|
||||
outline: 0 !important;
|
||||
-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||
box-shadow: inset 0 -2px 0 #2196f3; }
|
||||
|
||||
/* Animations */
|
||||
.form-control,
|
||||
@@ -816,6 +818,10 @@ hr {
|
||||
margin-top: -1px;
|
||||
right: 8px; }
|
||||
|
||||
input {
|
||||
margin-top: 5px;
|
||||
border: none; }
|
||||
|
||||
.form-control::-moz-placeholder {
|
||||
color: #DDDDDD;
|
||||
opacity: 1;
|
||||
@@ -837,21 +843,34 @@ hr {
|
||||
filter: alpha(opacity=100); }
|
||||
|
||||
.form-control {
|
||||
background-color: #fffcf5;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
line-height: 1.846;
|
||||
color: #666666;
|
||||
border: medium none;
|
||||
border-radius: 4px;
|
||||
color: #66615b;
|
||||
font-size: 14px;
|
||||
transition: background-color 0.3s ease 0s;
|
||||
/*-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);*/
|
||||
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
|
||||
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
padding: 7px 18px;
|
||||
height: 40px;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none; }
|
||||
/*background-color: $gray-input-bg;
|
||||
border: medium none;
|
||||
border-radius: $border-radius-base;
|
||||
color: $font-color;
|
||||
font-size: $font-size-base;
|
||||
transition: background-color 0.3s ease 0s;
|
||||
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||
@include box-shadow(none);*/ }
|
||||
.form-control:focus {
|
||||
background-color: #FFFFFF;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
outline: 0 !important; }
|
||||
outline: 0 !important;
|
||||
border-bottom: 2px solid #2196f3;
|
||||
/*-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||
box-shadow: inset 0 -2px 0 #2196f3;*/ }
|
||||
.has-success .form-control, .has-error .form-control, .has-success .form-control:focus, .has-error .form-control:focus {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none; }
|
||||
@@ -884,7 +903,10 @@ hr {
|
||||
|
||||
.input-lg {
|
||||
height: 55px;
|
||||
padding: 11px 30px; }
|
||||
padding: 11px 30px;
|
||||
font-size: 17px;
|
||||
line-height: 1.3333333;
|
||||
border-radius: 3px; }
|
||||
|
||||
.has-error .form-control-feedback, .has-error .control-label {
|
||||
color: #EB5E28; }
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,39 +1,61 @@
|
||||
input {
|
||||
margin-top: 5px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.form-control::-moz-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
.form-control:-moz-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
}
|
||||
.form-control::-webkit-input-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
.form-control:-ms-input-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
|
||||
.form-control {
|
||||
background-color: $gray-input-bg;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.846;
|
||||
color: #666666;
|
||||
border: medium none;
|
||||
border-radius: $border-radius-base;
|
||||
/*-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);*/
|
||||
-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
|
||||
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
|
||||
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||
|
||||
/*background-color: $gray-input-bg;
|
||||
border: medium none;
|
||||
border-radius: $border-radius-base;
|
||||
color: $font-color;
|
||||
font-size: $font-size-base;
|
||||
transition: background-color 0.3s ease 0s;
|
||||
@include input-size($padding-base-vertical, $padding-base-horizontal, $height-base);
|
||||
@include box-shadow(none);
|
||||
|
||||
@include box-shadow(none);*/
|
||||
|
||||
&:focus{
|
||||
background-color: $white-bg;
|
||||
@include box-shadow(none);
|
||||
outline: 0 !important;
|
||||
//@include box-shadow(none);
|
||||
outline: 0 !important;
|
||||
border-bottom: 2px solid #2196f3;
|
||||
/*-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||
box-shadow: inset 0 -2px 0 #2196f3;*/
|
||||
}
|
||||
|
||||
|
||||
.has-success &,
|
||||
.has-error &,
|
||||
.has-success &:focus,
|
||||
.has-error &:focus{
|
||||
@include box-shadow(none);
|
||||
}
|
||||
|
||||
|
||||
.has-success &{
|
||||
background-color: $success-input-bg;
|
||||
color: $success-color;
|
||||
@@ -54,7 +76,7 @@
|
||||
.has-error &:focus{
|
||||
background-color: $white-bg;
|
||||
}
|
||||
|
||||
|
||||
& + .form-control-feedback{
|
||||
border-radius: $border-radius-large;
|
||||
font-size: $font-size-base;
|
||||
@@ -75,6 +97,9 @@
|
||||
.input-lg{
|
||||
height: 55px;
|
||||
padding: $padding-large-vertical $padding-large-horizontal;
|
||||
font-size: 17px;
|
||||
line-height: 1.3333333;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.has-error{
|
||||
@@ -93,8 +118,7 @@
|
||||
background-color: $gray-input-bg;
|
||||
border: medium none;
|
||||
border-radius: $border-radius-base;
|
||||
|
||||
|
||||
|
||||
.has-success &,
|
||||
.has-error &{
|
||||
background-color: $white-color;
|
||||
@@ -110,7 +134,7 @@
|
||||
background-color: $white-color;
|
||||
}
|
||||
}
|
||||
.border-input{
|
||||
.border-input{
|
||||
.input-group-addon{
|
||||
border: solid 1px $table-line-color;
|
||||
}
|
||||
@@ -123,15 +147,15 @@
|
||||
background-color: $light-gray;
|
||||
}
|
||||
}
|
||||
.input-group .form-control:first-child,
|
||||
.input-group-addon:first-child,
|
||||
.input-group-btn:first-child > .dropdown-toggle,
|
||||
.input-group .form-control:first-child,
|
||||
.input-group-addon:first-child,
|
||||
.input-group-btn:first-child > .dropdown-toggle,
|
||||
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
|
||||
border-right: 0 none;
|
||||
}
|
||||
.input-group .form-control:last-child,
|
||||
.input-group-addon:last-child,
|
||||
.input-group-btn:last-child > .dropdown-toggle,
|
||||
.input-group .form-control:last-child,
|
||||
.input-group-addon:last-child,
|
||||
.input-group-btn:last-child > .dropdown-toggle,
|
||||
.input-group-btn:first-child > .btn:not(:first-child) {
|
||||
border-left: 0 none;
|
||||
}
|
||||
@@ -145,10 +169,10 @@
|
||||
}
|
||||
.form-control[disabled]:-moz-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
}
|
||||
.form-control[disabled]::-webkit-input-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
.form-control[disabled]:-ms-input-placeholder{
|
||||
@include placeholder($medium-gray,1);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ input[type="file"] > input[type="button"]::-moz-focus-inner{
|
||||
input:focus,
|
||||
button:focus {
|
||||
outline : 0 !important;
|
||||
-webkit-box-shadow: inset 0 -2px 0 #2196f3;
|
||||
box-shadow: inset 0 -2px 0 #2196f3;
|
||||
}
|
||||
|
||||
/* Animations */
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<link href="/assets/admin/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link href="/assets/admin/css/animate.min.css" rel="stylesheet"/>
|
||||
<link href="/assets/admin/css/paper-dashboard.css" rel="stylesheet"/>
|
||||
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.0/bootstrap3-editable/css/bootstrap-editable.css"
|
||||
rel="stylesheet"/>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="card">
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="card">
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="header">
|
||||
<h4 class="title">Announcements</h4>
|
||||
<p class="category">just updated</p>
|
||||
|
||||
@@ -5,21 +5,44 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-users')
|
||||
@slot('type', 'Pilots')
|
||||
@slot('pending', 5)
|
||||
@slot('total', 60)
|
||||
@endcomponent
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-users')
|
||||
@slot('type', 'Pilots')
|
||||
@slot('pending', 5)
|
||||
@slot('total', 60)
|
||||
@endcomponent
|
||||
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-cloud-upload')
|
||||
@slot('type', 'PIREPs')
|
||||
@slot('pending', $pending_pireps)
|
||||
@slot('link', route('admin.pireps.index').'?search=status:0')
|
||||
@endcomponent
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-users')
|
||||
@slot('type', 'Pilots')
|
||||
@slot('pending', 5)
|
||||
@slot('total', 60)
|
||||
@endcomponent
|
||||
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-cloud-upload')
|
||||
@slot('type', 'PIREPs')
|
||||
@slot('pending', $pending_pireps)
|
||||
@slot('link', route('admin.pireps.index').'?search=status:0')
|
||||
@endcomponent
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('admin.dashboard.announcements')
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
@component('admin.components.infobox')
|
||||
@slot('icon', 'pe-7s-cloud-upload')
|
||||
@slot('type', 'PIREPs')
|
||||
@slot('pending', $pending_pireps)
|
||||
@slot('link', route('admin.pireps.index').'?search=status:0')
|
||||
@endcomponent
|
||||
@include('admin.dashboard.pirep_chart')
|
||||
</div>
|
||||
|
||||
{{--<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
@@ -44,10 +67,10 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@include('admin.dashboard.announcements')
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@include('admin.dashboard.pirep_chart')
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('title', 'Edit ' . $pirep->getFlightId() )
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
$MODEL_NAME_HUMAN$
|
||||
</h1>
|
||||
</section>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) !!}
|
||||
|
||||
@include('admin.pireps.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
{!! Form::model($pirep, ['route' => ['admin.pireps.update', $pirep->id], 'method' => 'patch']) !!}
|
||||
@include('admin.pireps.fields')
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('admin.pireps.field_values')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('admin.pireps.script')
|
||||
|
||||
@@ -1,47 +1,80 @@
|
||||
<!-- Flight Id Field -->
|
||||
{{--<div class="form-group col-sm-6">
|
||||
{!! Form::label('flight_id', 'Flight ID:') !!}
|
||||
{!! Form::text('flight_id', null, ['class' => 'form-control']) !!}
|
||||
</div>--}}
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-12">
|
||||
{{--<div class="avatar">
|
||||
<img src="{!! $pirep->pilot->gravatar() !!}" />
|
||||
</div>--}}
|
||||
Filed By: <a href="{!! route('admin.users.edit', [$pirep->pilot->id]) !!}" target="_blank">
|
||||
{!! $pirep->pilot->pilot_id() !!} {!! $pirep->pilot->name !!}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Aircraft Id Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('aircraft_id', 'Aircraft ID:') !!}
|
||||
{!! Form::select('aircraft_id', $aircraft, null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<div>
|
||||
{!! Form::label('airline_id', 'Airline') !!}
|
||||
{!! Form::select('airline_id', $airlines, null, ['class' => 'form-control select2']) !!}
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
{!! Form::label('aircraft_id', 'Aircraft:') !!}
|
||||
{!! Form::select('aircraft_id', $aircraft, null, ['class' => 'form-control select2']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flight Time Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('flight_time', 'Flight Time:') !!}
|
||||
{!! Form::text('flight_time', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('flight_number', 'Flight Number/Route Code/Leg') !!}
|
||||
{!! Form::text('flight_number', null, ['placeholder' => 'Flight Number', 'class' => 'form-control']) !!}
|
||||
{!! Form::text('route_code', null, ['placeholder' => 'Code (optional)', 'class' => 'form-control']) !!}
|
||||
{!! Form::text('route_leg', null, ['placeholder' => 'Leg (optional)', 'class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Level Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('level', 'Flight Level:') !!}
|
||||
{!! Form::text('level', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('dpt_airport_id', 'Departure Airport:') !!}
|
||||
{!! Form::select('dpt_airport_id', $airports, null, ['class' => 'form-control select2']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Route Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('route', 'Route:') !!}
|
||||
{!! Form::text('route', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('arr_airport_id', 'Arrival Airport:') !!}
|
||||
{!! Form::select('arr_airport_id', $airports, null, ['class' => 'form-control select2']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Notes Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('notes', 'Notes:') !!}
|
||||
{!! Form::text('notes', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Flight Time Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('flight_time', 'Flight Time (hours & minutes):') !!}
|
||||
<div class="">
|
||||
{!! Form::number('hours', null, ['class' => 'form-control', 'placeholder' => 'hours']) !!}
|
||||
{!! Form::number('minutes', null, ['class' => 'form-control', 'placeholder' => 'minutes']) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Raw Data Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('raw_data', 'Raw Data:') !!}
|
||||
{!! Form::text('raw_data', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
<!-- Level Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('level', 'Flight Level:') !!}
|
||||
{!! Form::text('level', 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>
|
||||
|
||||
<!-- Notes Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('notes', 'Notes:') !!}
|
||||
{!! Form::textarea('notes', null, ['class' => 'form-control']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Raw Data Field -->
|
||||
<div class="form-group col-sm-6">
|
||||
{!! Form::label('raw_data', 'Raw Data:') !!}
|
||||
{!! Form::textarea('raw_data', null, ['class' => 'form-control', 'disabled']) !!}
|
||||
</div>
|
||||
|
||||
<!-- Submit Field -->
|
||||
<div class="form-group col-sm-12">
|
||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||
<a href="{!! route('admin.pireps.index') !!}" class="btn btn-default">Cancel</a>
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
|
||||
<a href="{!! route('admin.pireps.index') !!}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,12 +6,7 @@
|
||||
<h5>
|
||||
<a class="text-c"
|
||||
href="{!! route('admin.pireps.show', [$pirep->id]) !!}">
|
||||
{!! $pirep->airline->code !!}
|
||||
@if($pirep->flight_id)
|
||||
{!! $pirep->flight->flight_number !!}
|
||||
@else
|
||||
{!! $pirep->flight_number !!}
|
||||
@endif
|
||||
{!! $pirep->getFlightId() !!}
|
||||
</a>
|
||||
</h5>
|
||||
<div>
|
||||
@@ -61,31 +56,41 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12 ">
|
||||
<table class="pull-right">
|
||||
<tr><td>
|
||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||
|| $pirep->status == config('enums.pirep_status.REJECTED'))
|
||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||
'name' => 'accept_'.$pirep->id,
|
||||
'id' => $pirep->id.'_accept',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => config('enums.pirep_status.ACCEPTED'),
|
||||
'class' => 'pirep_submit_status']) !!}
|
||||
{!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!}
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
</td><td> </td><td>
|
||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||
|| $pirep->status == config('enums.pirep_status.ACCEPTED'))
|
||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||
'name' => 'reject_'.$pirep->id,
|
||||
'id' => $pirep->id.'_reject',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => config('enums.pirep_status.REJECTED'),
|
||||
'class' => 'pirep_submit_status']) !!}
|
||||
{!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!}
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td>
|
||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||
|| $pirep->status == config('enums.pirep_status.REJECTED'))
|
||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||
'name' => 'accept_'.$pirep->id,
|
||||
'id' => $pirep->id.'_accept',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => config('enums.pirep_status.ACCEPTED'),
|
||||
'class' => 'pirep_submit_status']) !!}
|
||||
{!! Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-info']) !!}
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
@if($pirep->status == config('enums.pirep_status.PENDING')
|
||||
|| $pirep->status == config('enums.pirep_status.ACCEPTED'))
|
||||
{!! Form::open(['url' => '/admin/pireps/'.$pirep->id.'/status', 'method' => 'post',
|
||||
'name' => 'reject_'.$pirep->id,
|
||||
'id' => $pirep->id.'_reject',
|
||||
'pirep_id' => $pirep->id,
|
||||
'new_status' => config('enums.pirep_status.REJECTED'),
|
||||
'class' => 'pirep_submit_status']) !!}
|
||||
{!! Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-danger']) !!}
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
</td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="{!! route('admin.pireps.edit', [$pirep->id]) !!}"
|
||||
class='btn btn-sm btn-success btn-icon'>
|
||||
<i class="fa fa-pencil-square-o"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user