Search Flights By Flight Type (#987)

Flight Controller : Added flight_type to return

Flight Repository : Made flight_type searchable and added its where criteria

Flight.Search.Blade : Added the flight types in a reasonable order as a dropdown (like schedule pax,charter pax,cargo,others)

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
pull/979/head^2
B.Fatih KOZ 4 years ago committed by GitHub
parent 29ff0758a7
commit a5b83185f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -120,6 +120,7 @@ class FlightController extends Controller
'saved' => $saved_flights,
'subfleets' => $this->subfleetRepo->selectBoxList(true),
'flight_number' => $request->input('flight_number'),
'flight_type' => $request->input('flight_type'),
'arr_icao' => $request->input('arr_icao'),
'dep_icao' => $request->input('dep_icao'),
'subfleet_id' => $request->input('subfleet_id'),

@ -20,6 +20,7 @@ class FlightRepository extends Repository implements CacheableInterface
'arr_airport_id',
'distance',
'dpt_airport_id',
'flight_type',
'flight_number' => 'like',
'route_code' => 'like',
'route_leg' => 'like',
@ -93,6 +94,10 @@ class FlightRepository extends Repository implements CacheableInterface
$where['flight_number'] = $request->input('flight_number');
}
if ($request->filled('flight_type')) {
$where['flight_type'] = $request->input('flight_type');
}
if ($request->filled('route_code')) {
$where['route_code'] = $request->input('route_code');
}

@ -11,7 +11,29 @@
<p>@lang('common.airline')</p>
{{ Form::select('airline_id', $airlines, null , ['class' => 'form-control select2']) }}
</div>
<div class="form-group">
<label>@lang('flights.flighttype')</label>
<select id="flight_type" name="flight_type" class="custom-select select2">
<option value=""></option>
<option value="J">@lang('flights.type.pass_scheduled')</option>
<option value="G">@lang('flights.type.pass_addtl')</option>
<option value="C">@lang('flights.type.charter_pass_only')</option>
<option value="O">@lang('flights.type.charter_special')</option>
<option value="E">@lang('flights.type.special_vip')</option>
<option value="F">@lang('flights.type.cargo_scheduled')</option>
<option value="A">@lang('flights.type.addtl_cargo_mail')</option>
<option value="H">@lang('flights.type.charter_cargo')</option>
<option value="M">@lang('flights.type.mail_service')</option>
<option value="I">@lang('flights.type.ambulance')</option>
<option value="K">@lang('flights.type.training_flight')</option>
<option value="P">@lang('flights.type.positioning')</option>
<option value="T">@lang('flights.type.technical_test')</option>
<option value="X">@lang('flights.type.technical_stop')</option>
<option value="W">@lang('flights.type.military')</option>
</select>
</div>
<div>
<p>@lang('flights.flightnumber')</p>
{{ Form::text('flight_number', null, ['class' => 'form-control']) }}

Loading…
Cancel
Save