diff --git a/app/Http/Controllers/Admin/FlightController.php b/app/Http/Controllers/Admin/FlightController.php index 3a1a00fa..3ed98236 100644 --- a/app/Http/Controllers/Admin/FlightController.php +++ b/app/Http/Controllers/Admin/FlightController.php @@ -246,13 +246,12 @@ class FlightController extends BaseController } /** + * @param $id * @param Request $request * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View */ - public function subfleets(Request $request) + public function subfleets($id, Request $request) { - $id = $request->id; - $flight = $this->flightRepo->findWithoutFail($id); if (empty($flight)) { Flash::error('Flight not found'); diff --git a/resources/views/admin/flights/create.blade.php b/resources/views/admin/flights/create.blade.php index d3b041c8..a106c46c 100644 --- a/resources/views/admin/flights/create.blade.php +++ b/resources/views/admin/flights/create.blade.php @@ -10,3 +10,4 @@ @endsection +@include('admin.flights.scripts') diff --git a/resources/views/admin/flights/edit.blade.php b/resources/views/admin/flights/edit.blade.php index 7a8aeaae..e5440f79 100644 --- a/resources/views/admin/flights/edit.blade.php +++ b/resources/views/admin/flights/edit.blade.php @@ -11,47 +11,16 @@ -
| Name | @@ -16,7 +16,7 @@
{!! Form::open(['url' => '/admin/flights/'.$flight->id.'/fields',
'method' => 'delete',
- 'class' => 'pjax_form flight_fields'
+ 'class' => 'pjax_form pjax_flight_fields'
]) !!}
{!! Form::hidden('field_id', $field->id) !!}
@@ -32,27 +32,27 @@
|
|---|
| Type | -Name | -Actions | - - - @foreach($flight->subfleets as $sf) -||||||
|---|---|---|---|---|---|---|---|---|
| {!! $sf->type !!} | -{!! $sf->name !!} | -
- {!! Form::open(['url' => '/admin/flights/'.$flight->id.'/subfleets', 'method' => 'delete', 'class' => 'flight_subfleet']) !!}
- {!! Form::hidden('subfleet_id', $sf->id) !!}
-
- {!! Form::button('',
- ['type' => 'submit',
- 'class' => 'btn btn-danger btn-xs'])
- !!}
-
+ assigned subfleets++ +
+
+
+
+ {!! Form::open([
+ 'url' => '/admin/flights/'.$flight->id.'/subfleets',
+ 'method' => 'post',
+ 'class' => 'pjax_form form-inline pjax_subfleet_form'
+ ])
+ !!}
+ {!! Form::select('subfleet_id', $avail_subfleets, null, [
+ 'placeholder' => 'Select Subfleet',
+ 'class' => 'select2_dropdown form-control input-lg',
+ ])
+ !!}
+ {!! Form::button(' add',
+ ['type' => 'submit',
+ 'class' => 'btn btn-success btn-s']) !!}
{!! Form::close() !!}
- |
-