Compare commits

..
72 changed files with 683 additions and 1113 deletions
+6 -11
View File
@@ -1,11 +1,8 @@
FROM php:8.0.9-fpm-alpine3.14
FROM php:7.4-fpm-alpine
WORKDIR /var/www/
# Setup composer
COPY --from=composer:2.1.5 /usr/bin/composer /usr/local/bin/composer
RUN apk add gmp-dev icu-dev zlib-dev libpng-dev libzip-dev zip
RUN apk add gmp-dev icu-dev zlib-dev libpng-dev
RUN curl --silent --show-error https://getcomposer.org/installer | php
# Copy any config files in
@@ -19,19 +16,17 @@ RUN docker-php-ext-install \
pdo_mysql \
gd \
gmp \
bcmath \
opcache \
zip && \
docker-php-ext-enable pdo_mysql opcache bcmath zip
opcache && \
docker-php-ext-enable pdo_mysql opcache
COPY . /var/www/
RUN composer install \
RUN php composer.phar install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
#RUN chown -R www-data:www-data /var/www
RUN chown -R www-data:www-data /var/www
EXPOSE 9000
+1 -1
View File
@@ -102,7 +102,7 @@ reset-installer:
.PHONY: docker-test
docker-test:
@docker compose -f docker-compose.yml -f docker-compose.local.yml up
@docker-compose -f docker-compose.yml -f docker-compose.local.yml up
.PHONY: docker-clean
docker-clean:
-39
View File
@@ -1,39 +0,0 @@
<?php
namespace App\Events;
use App\Contracts\Event;
use App\Models\Pirep;
/**
* This event is dispatched when the fares for a flight report
* are collected. Your listeners should return a list of Fare
* models. Don't call save on the model!
*
* Example return:
*
* new Fare([
* 'name' => '', # displayed as the memo
* 'type' => [INTEGER], # from FareType enum class
* 'price' => [DECIMAL],
* 'cost' => [DECIMAL], # optional
* 'notes' => '', # used as Transaction Group
* ]);
*
* The event caller will check the 'type' to make sure that it
* will filter out fares that only apply to the current process
*
* The event will have a copy of the PIREP model, if it's applicable
*/
class Fares extends Event
{
public $pirep;
/**
* @param Pirep|null $pirep
*/
public function __construct(Pirep $pirep = null)
{
$this->pirep = $pirep;
}
}
@@ -35,23 +35,22 @@ class AirportController extends Controller
public function show($id, Request $request)
{
$id = strtoupper($id);
$with_flights = ['airline', 'arr_airport', 'dpt_airport'];
$airport = $this->airportRepo->with('files')->where('id', $id)->first();
$airport = $this->airportRepo->where('id', $id)->first();
if (!$airport) {
Flash::error('Airport not found!');
return redirect(route('frontend.dashboard.index'));
}
$inbound_flights = $this->flightRepo
->with($with_flights)
->with(['dpt_airport', 'arr_airport', 'airline'])
->findWhere([
'arr_airport_id' => $id,
'active' => 1,
])->all();
$outbound_flights = $this->flightRepo
->with($with_flights)
->with(['dpt_airport', 'arr_airport', 'airline'])
->findWhere([
'dpt_airport_id' => $id,
'active' => 1,
@@ -28,15 +28,14 @@ class DashboardController extends Controller
*/
public function index()
{
//dd(config('backup'));
$last_pirep = null;
$with_pirep = ['aircraft', 'arr_airport', 'comments', 'dpt_airport'];
/** @var \App\Models\User $user */
$user = Auth::user();
$user->loadMissing('journal');
try {
$last_pirep = $this->pirepRepo->with($with_pirep)->find($user->last_pirep_id);
$last_pirep = $this->pirepRepo->find($user->last_pirep_id);
} catch (\Exception $e) {
}
@@ -88,7 +88,6 @@ class FlightController extends Controller
/** @var \App\Models\User $user */
$user = Auth::user();
$user->loadMissing('current_airport');
if (setting('pilots.restrict_to_company')) {
$where['airline_id'] = $user->airline_id;
@@ -128,11 +127,9 @@ class FlightController extends Controller
$flights = $this->flightRepo->searchCriteria($request)
->with([
'airline',
'alt_airport',
'arr_airport',
'dpt_airport',
'subfleets.airline',
'arr_airport',
'airline',
'simbrief' => function ($query) use ($user) {
$query->where('user_id', $user->id);
}, ])
@@ -218,19 +215,7 @@ class FlightController extends Controller
*/
public function show($id)
{
$user_id = Auth::id();
$with_flight = [
'airline',
'alt_airport',
'arr_airport',
'dpt_airport',
'subfleets.airline',
'simbrief' => function ($query) use ($user_id) {
$query->where('user_id', $user_id);
},
];
$flight = $this->flightRepo->with($with_flight)->find($id);
$flight = $this->flightRepo->find($id);
if (empty($flight)) {
Flash::error('Flight not found!');
return redirect(route('frontend.dashboard.index'));
@@ -239,7 +224,7 @@ class FlightController extends Controller
$map_features = $this->geoSvc->flightGeoJson($flight);
// See if the user has a bid for this flight
$bid = Bid::where(['user_id' => $user_id, 'flight_id' => $flight->id])->first();
$bid = Bid::where(['user_id' => Auth::id(), 'flight_id' => $flight->id])->first();
return view('flights.show', [
'flight' => $flight,
@@ -16,7 +16,7 @@ class HomeController extends Controller
public function index()
{
try {
$users = User::with('home_airport')->where('state', '!=', UserState::DELETED)->orderBy('created_at', 'desc')->take(4)->get();
$users = User::where('state', '!=', UserState::DELETED)->orderBy('created_at', 'desc')->take(4)->get();
} catch (\PDOException $e) {
Log::emergency($e);
return view('system/errors/database_error', [
@@ -182,7 +182,7 @@ class PirepController extends Controller
$where = [['user_id', $user->id]];
$where[] = ['state', '<>', PirepState::CANCELLED];
$with = ['aircraft', 'airline', 'arr_airport', 'comments', 'dpt_airport'];
$with = ['airline', 'aircraft', 'dpt_airport', 'arr_airport', 'fares', 'comments'];
$this->pirepRepo->with($with)
->pushCriteria(new WhereCriteria($request, $where));
@@ -201,20 +201,7 @@ class PirepController extends Controller
*/
public function show($id)
{
$with = [
'acars_logs',
'aircraft.airline',
'airline.journal',
'arr_airport',
'comments',
'dpt_airport',
'fares.fare',
'transactions',
'simbrief',
'user.rank',
];
$pirep = $this->pirepRepo->with($with)->find($id);
$pirep = $this->pirepRepo->with(['simbrief'])->find($id);
if (empty($pirep)) {
Flash::error('Pirep not found');
return redirect(route('frontend.pirep.index'));
@@ -80,19 +80,22 @@ class ProfileController extends Controller
public function show($id)
{
/** @var \App\Models\User $user */
$with = ['airline', 'awards', 'current_airport', 'fields.field', 'home_airport', 'last_pirep', 'rank'];
$user = User::with($with)->where('id', $id)->first();
$user = User::with(['awards', 'fields', 'fields.field'])
->where('id', $id)
->first();
if (empty($user)) {
Flash::error('User not found!');
return redirect(route('frontend.dashboard.index'));
}
$airports = $this->airportRepo->all();
$userFields = $this->userRepo->getUserFields($user, true);
return view('profile.index', [
'user' => $user,
'userFields' => $userFields,
'airports' => $airports,
'acars' => $this->acarsEnabled(),
]);
}
@@ -109,7 +112,9 @@ class ProfileController extends Controller
public function edit(Request $request)
{
/** @var \App\Models\User $user */
$user = User::with('fields.field')->where('id', Auth::id())->first();
$user = User::with(['fields', 'fields.field'])
->where('id', Auth::user()->id)
->first();
if (empty($user)) {
Flash::error('User not found!');
@@ -62,7 +62,7 @@ class SimBriefController
$aircraft_id = $request->input('aircraft_id');
/** @var Flight $flight */
$flight = $this->flightRepo->with(['airline', 'arr_airport', 'dpt_airport', 'fares', 'subfleets'])->find($flight_id);
$flight = $this->flightRepo->with(['fares', 'subfleets'])->find($flight_id);
if (!$flight) {
flash()->error('Unknown flight');
@@ -136,7 +136,7 @@ class SimBriefController
// SimBrief profile does not exists and everything else is ok
// Select aircraft which will be used for calculations and details
/** @var Aircraft $aircraft */
$aircraft = Aircraft::with(['airline'])->where('id', $aircraft_id)->first();
$aircraft = Aircraft::where('id', $aircraft_id)->first();
// Figure out the proper fares to use for this flight/aircraft
$all_fares = $this->fareSvc->getFareWithOverrides($aircraft->subfleet->fares, $flight->fares);
@@ -263,7 +263,7 @@ class SimBriefController
$user = Auth::user();
/** @var SimBrief $simbrief */
$simbrief = SimBrief::with(['flight.airline', 'pirep.airline'])->find($id);
$simbrief = SimBrief::with(['flight'])->find($id);
if (!$simbrief) {
flash()->error('SimBrief briefing not found');
return redirect(route('frontend.flights.index'));
@@ -30,9 +30,6 @@ class UserController extends Controller
*/
public function index(Request $request)
{
$with = ['airline', 'current_airport', 'fields.field', 'home_airport', 'rank'];
$with_count = ['awards'];
$where = [];
if (setting('pilots.hide_inactive')) {
@@ -46,8 +43,7 @@ class UserController extends Controller
}
$users = $this->userRepo
->withCount($with_count)
->with($with)
->with(['airline', 'current_airport'])
->orderBy('pilot_id', 'asc')
->paginate();
+1 -3
View File
@@ -4,8 +4,6 @@ namespace App\Listeners;
use App\Contracts\Listener;
use App\Events\Expenses;
use App\Models\Enums\ExpenseType;
use App\Models\Expense;
class ExpenseListener extends Listener
{
@@ -25,7 +23,7 @@ class ExpenseListener extends Listener
// The transaction group is how it will show as a line item
/*$expenses[] = new Expense([
'type' => ExpenseType::FLIGHT,
'amount' => 150, # $150
'amount' => 15000, # $150
'transaction_group' => '',
'charge_to_user' => true|false
]);*/
-39
View File
@@ -1,39 +0,0 @@
<?php
namespace App\Listeners;
use App\Contracts\Listener;
use App\Events\Fares;
use App\Models\Enums\FareType;
use App\Models\Fare;
class FareListener extends Listener
{
/**
* Return a list of additional fares/income items
*
* @param Fares $event
*
* @return mixed
*/
public function handle(Fares $event)
{
$fares = [];
// This is an example of a fare to return
// You have the pirep on $event->pirep and any associated data
// Cost may be skipped at all if not needed
// Notes will be used as transaction group and it is how it will show as a line item
/*
$fares[] = new Fare([
'name' => 'Duty Free Sales',
'type' => FareType::PASSENGER,
'price' => 985,
'cost' => 126,
'notes' => 'InFlight Sales',
]);
*/
return $fares;
}
}
-29
View File
@@ -7,7 +7,6 @@ use App\Models\Enums\AircraftStatus;
use App\Models\Traits\ExpensableTrait;
use App\Models\Traits\FilesTrait;
use Carbon\Carbon;
use Znck\Eloquent\Traits\BelongsToThrough;
/**
* @property int id
@@ -32,7 +31,6 @@ class Aircraft extends Model
{
use ExpensableTrait;
use FilesTrait;
use BelongsToThrough;
public $table = 'aircraft';
@@ -102,41 +100,14 @@ class Aircraft extends Model
$this->attributes['icao'] = strtoupper($icao);
}
/**
* Return the landing time in carbon format if provided
*
* @return Carbon|null
*/
public function getLandingTimeAttribute()
{
if (array_key_exists('landing_time', $this->attributes) && filled($this->attributes['landing_time'])) {
return new Carbon($this->attributes['landing_time']);
}
}
/**
* foreign keys
*/
public function airline()
{
return $this->belongsToThrough(Airline::class, Subfleet::class);
}
public function airport()
{
return $this->belongsTo(Airport::class, 'airport_id');
}
public function pireps()
{
return $this->hasMany(Pirep::class, 'aircraft_id');
}
public function simbriefs()
{
return $this->hasMany(SimBrief::class, 'aircraft_id');
}
public function subfleet()
{
return $this->belongsTo(Subfleet::class, 'subfleet_id');
-5
View File
@@ -103,11 +103,6 @@ class Airline extends Model
return $this->hasMany(Subfleet::class, 'airline_id');
}
public function aircraft()
{
return $this->hasManyThrough(Aircraft::class, Subfleet::class);
}
public function flights()
{
return $this->belongsTo(Flight::class, 'airline_id');
-2
View File
@@ -7,7 +7,6 @@ use App\Contracts\Enum;
class AircraftStatus extends Enum
{
public const ACTIVE = 'A';
public const MAINTENANCE = 'M';
public const STORED = 'S';
public const RETIRED = 'R';
public const SCRAPPED = 'C';
@@ -15,7 +14,6 @@ class AircraftStatus extends Enum
public static $labels = [
self::ACTIVE => 'aircraft.status.active',
self::MAINTENANCE => 'aircraft.status.maintenance',
self::STORED => 'aircraft.status.stored',
self::RETIRED => 'aircraft.status.retired',
self::SCRAPPED => 'aircraft.status.scrapped',
+4 -4
View File
@@ -136,19 +136,19 @@ class Flight extends Model
}
/**
* Get the flight ident, e.,g JBU1900/C.nn/L.yy
* Get the flight ident, e.,g JBU1900
*/
public function getIdentAttribute(): string
{
$flight_id = optional($this->airline)->code;
$flight_id = $this->airline->code;
$flight_id .= $this->flight_number;
if (filled($this->route_code)) {
$flight_id .= '/C.'.$this->route_code;
$flight_id .= '-'.$this->route_code;
}
if (filled($this->route_leg)) {
$flight_id .= '/L.'.$this->route_leg;
$flight_id .= '-'.$this->route_leg;
}
return $flight_id;
+7 -5
View File
@@ -215,19 +215,21 @@ class Pirep extends Model
}
/**
* Get the flight ident, e.,g JBU1900/C.nn/L.yy
* Get the flight ident, e.,g JBU1900
*
* @return string
*/
public function getIdentAttribute(): string
{
$flight_id = optional($this->airline)->code;
$flight_id .= $this->flight_number;
//$flight_id = $this->airline->code;
$flight_id = $this->flight_number;
if (filled($this->route_code)) {
$flight_id .= '/C.'.$this->route_code;
$flight_id .= '/C'.$this->route_code;
}
if (filled($this->route_leg)) {
$flight_id .= '/L.'.$this->route_leg;
$flight_id .= '/L'.$this->route_leg;
}
return $flight_id;
+1 -1
View File
@@ -126,7 +126,7 @@ class User extends Authenticatable
{
$length = setting('pilots.id_length');
return optional($this->airline)->icao.str_pad($this->pilot_id, $length, '0', STR_PAD_LEFT);
return $this->airline->icao.str_pad($this->pilot_id, $length, '0', STR_PAD_LEFT);
}
/**
-8
View File
@@ -22,14 +22,6 @@ class UserFieldValue extends Model
public static $rules = [];
/**
* Return related field's name along with field values
*/
public function getNameAttribute(): string
{
return optional($this->field)->name;
}
/**
* Foreign Keys
*/
+2 -2
View File
@@ -48,9 +48,9 @@ class PirepPrefiled extends Notification implements ShouldQueue
return null;
}
$title = 'Flight '.$pirep->ident.' Prefiled';
$title = 'Flight '.$pirep->airline->code.$pirep->ident.' Prefiled';
$fields = [
'Flight' => $pirep->ident,
'Flight' => $pirep->airline->code.$pirep->ident,
'Departure Airport' => $pirep->dpt_airport_id,
'Arrival Airport' => $pirep->arr_airport_id,
'Equipment' => $pirep->aircraft->ident,
@@ -77,10 +77,10 @@ class PirepStatusChanged extends Notification implements ShouldQueue
return null;
}
$title = 'Flight '.$pirep->ident.' '.self::$verbs[$pirep->status];
$title = 'Flight '.$pirep->airline->code.$pirep->ident.' '.self::$verbs[$pirep->status];
$fields = [
'Flight' => $pirep->ident,
'Flight' => $pirep->airline->code.$pirep->ident,
'Departure Airport' => $pirep->dpt_airport_id,
'Arrival Airport' => $pirep->arr_airport_id,
'Equipment' => $pirep->aircraft->ident,
@@ -102,12 +102,12 @@ class PirepStatusChanged extends Notification implements ShouldQueue
$planned_distance = new Distance($pirep->planned_distance, $unit);
$pd = $planned_distance[$planned_distance->unit];
$fields['Distance'] .= '/'.$pd;
} catch (NonNumericValue|NonStringUnitName $e) {
} catch (NonNumericValue | NonStringUnitName $e) {
}
}
$fields['Distance'] .= ' '.$planned_distance->unit;
} catch (NonNumericValue|NonStringUnitName $e) {
} catch (NonNumericValue | NonStringUnitName $e) {
}
}
@@ -55,9 +55,9 @@ class PirepSubmitted extends Notification implements ShouldQueue
return null;
}
$title = 'Flight '.$pirep->ident.' Filed';
$title = 'Flight '.$pirep->airline->code.$pirep->ident.' Filed';
$fields = [
'Flight' => $pirep->ident,
'Flight' => $pirep->airline->code.$pirep->ident,
'Departure Airport' => $pirep->dpt_airport_id,
'Arrival Airport' => $pirep->arr_airport_id,
'Equipment' => $pirep->aircraft->ident,
@@ -73,7 +73,7 @@ class PirepSubmitted extends Notification implements ShouldQueue
$pd = $planned_distance[$planned_distance->unit].' '.$planned_distance->unit;
$fields['Distance (Planned)'] = $pd;
} catch (NonNumericValue|NonStringUnitName $e) {
} catch (NonNumericValue | NonStringUnitName $e) {
}
}
-6
View File
@@ -3,13 +3,11 @@
namespace App\Providers;
use App\Events\Expenses;
use App\Events\Fares;
use App\Events\PirepFiled;
use App\Events\UserStatsChanged;
use App\Listeners\AwardHandler;
use App\Listeners\BidEventHandler;
use App\Listeners\ExpenseListener;
use App\Listeners\FareListener;
use App\Listeners\FinanceEventHandler;
use App\Listeners\PirepEventsHandler;
use App\Listeners\UserStateListener;
@@ -27,10 +25,6 @@ class EventServiceProvider extends ServiceProvider
ExpenseListener::class,
],
Fares::class => [
FareListener::class,
],
PirepFiled::class => [
UserStateListener::class,
],
-16
View File
@@ -18,10 +18,8 @@ class FlightRepository extends Repository implements CacheableInterface
protected $fieldSearchable = [
'arr_airport_id',
'callsign',
'distance',
'dpt_airport_id',
'flight_time',
'flight_type',
'flight_number' => 'like',
'route_code' => 'like',
@@ -96,10 +94,6 @@ class FlightRepository extends Repository implements CacheableInterface
$where['flight_number'] = $request->input('flight_number');
}
if ($request->filled('callsign')) {
$where['callsign'] = $request->input('callsign');
}
if ($request->filled('flight_type') && $request->input('flight_type') !== '0') {
$where['flight_type'] = $request->input('flight_type');
}
@@ -134,16 +128,6 @@ class FlightRepository extends Repository implements CacheableInterface
$where[] = ['distance', '<=', $request->input('dlt')];
}
// Time, greater than
if ($request->filled('tgt')) {
$where[] = ['flight_time', '>=', $request->input('tgt')];
}
// Time, less than
if ($request->filled('tlt')) {
$where[] = ['flight_time', '<=', $request->input('tlt')];
}
// Do a special query for finding the child subfleets
if ($request->filled('subfleet_id')) {
$relations['subfleets'] = [
@@ -4,7 +4,6 @@ namespace App\Services\Finance;
use App\Contracts\Service;
use App\Events\Expenses as ExpensesEvent;
use App\Events\Fares as FaresEvent;
use App\Models\Aircraft;
use App\Models\Airport;
use App\Models\Enums\ExpenseType;
@@ -14,7 +13,6 @@ use App\Models\Enums\PirepSource;
use App\Models\Enums\PirepState;
use App\Models\Enums\PirepStatus;
use App\Models\Expense;
use App\Models\Fare;
use App\Models\Pirep;
use App\Models\Subfleet;
use App\Repositories\ExpenseRepository;
@@ -83,7 +81,6 @@ class PirepFinanceService extends Service
// Now start and pay from scratch
$this->payFuelCosts($pirep);
$this->payFaresForPirep($pirep);
$this->payFaresEventsForPirep($pirep);
$this->payExpensesForSubfleet($pirep);
$this->payExpensesForPirep($pirep);
$this->payAirportExpensesForPirep($pirep);
@@ -148,53 +145,6 @@ class PirepFinanceService extends Service
}
}
/**
* Collect all of the fares from listeners and apply those to the journal
*
* @param Pirep $pirep
*
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
* @throws \Prettus\Validator\Exceptions\ValidatorException
*/
public function payFaresEventsForPirep(Pirep $pirep): void
{
// Throw an event and collect any fares returned from it
$gathered_fares = event(new FaresEvent($pirep));
if (!\is_array($gathered_fares)) {
return;
}
foreach ($gathered_fares as $event_fare) {
if (!\is_array($event_fare)) {
continue;
}
foreach ($event_fare as $fare) {
// Make sure it's of type Fare Model
if (!($fare instanceof Fare)) {
Log::info('Finance: Event Fare is not an instance of Fare Model, aborting process!');
continue;
}
$credit = Money::createFromAmount($fare->price);
$debit = Money::createFromAmount($fare->cost);
Log::info('Finance: Income From Listener N='.$fare->name.', C='.$credit.', D='.$debit);
$this->journalRepo->post(
$pirep->airline->journal,
$credit,
$debit,
$pirep,
$fare->name,
null,
$fare->notes,
'additional-sales'
);
}
}
}
/**
* Calculate the fuel used by the PIREP and add those costs in
*
@@ -25,11 +25,9 @@ class AircraftImporter extends ImportExport
'subfleet' => 'required',
'iata' => 'nullable',
'icao' => 'nullable',
'airport_id' => 'nullable',
'name' => 'required',
'registration' => 'required',
'hex_code' => 'nullable',
'mtow' => 'nullable|numeric',
'zfw' => 'nullable|numeric',
'status' => 'nullable',
];
+1 -7
View File
@@ -29,7 +29,6 @@ class FlightImporter extends ImportExport
'airline' => 'required',
'flight_number' => 'required',
'route_code' => 'nullable',
'callsign' => 'nullable',
'route_leg' => 'nullable',
'dpt_airport' => 'required',
'arr_airport' => 'required',
@@ -46,8 +45,6 @@ class FlightImporter extends ImportExport
'pilot_pay' => 'nullable',
'route' => 'nullable',
'notes' => 'nullable',
'start_date' => 'nullable|date',
'end_date' => 'nullable|date',
'active' => 'nullable|boolean',
'subfleets' => 'nullable',
'fares' => 'nullable',
@@ -222,10 +219,7 @@ class FlightImporter extends ImportExport
$subfleet = Subfleet::firstOrCreate(
['type' => $subfleet_type],
[
'name' => $subfleet_type,
'airline_id' => $flight->airline_id,
]
['name' => $subfleet_type]
);
$subfleet->save();
@@ -20,14 +20,15 @@ class SubfleetImporter extends ImportExport
*/
public static $columns = [
'airline' => 'required',
'hub_id' => 'nullable',
'type' => 'required',
'simbrief_type' => 'nullable',
'name' => 'required',
'fuel_type' => 'nullable',
'cost_block_hour' => 'nullable',
'cost_delay_minute' => 'nullable',
'ground_handling_multiplier' => 'nullable',
'cargo_capacity' => 'nullable',
'fuel_capacity' => 'nullable',
'gross_weight' => 'nullable',
'fares' => 'nullable',
];
+14 -19
View File
@@ -206,7 +206,7 @@ class PirepService extends Service
/**
* Create a new PIREP with some given fields
*
* @param Pirep $pirep
* @param Pirep $pirep
* @param array PirepFieldValue[] $field_values
*
* @return Pirep
@@ -460,6 +460,19 @@ class PirepService extends Service
*/
public function submit(Pirep $pirep)
{
// Figure out what default state should be. Look at the default
// behavior from the rank that the pilot is assigned to
$default_state = PirepState::PENDING;
if ($pirep->source === PirepSource::ACARS) {
if ($pirep->user->rank->auto_approve_acars) {
$default_state = PirepState::ACCEPTED;
}
} else {
if ($pirep->user->rank->auto_approve_manual) {
$default_state = PirepState::ACCEPTED;
}
}
// Check if there is a simbrief_id, change it to be set to the PIREP
// at the end of the flight when it's been submitted finally.
// Prefile, Save (as draft) and File already have this but the Submit button
@@ -476,24 +489,6 @@ class PirepService extends Service
Log::info('New PIREP filed', [$pirep]);
event(new PirepFiled($pirep));
$pirep->refresh();
// Figure out what pirep state should be, if nothing provided yet.
if ($pirep->state != PirepState::ACCEPTED && $pirep->state != PirepState::REJECTED) {
$default_state = PirepState::PENDING;
} else {
$default_state = $pirep->state;
}
// If pirep is still at PENDING state decide the default behavior by looking at rank settings
if ($pirep->state === PirepState::PENDING) {
if ($pirep->source === PirepSource::ACARS && $pirep->user->rank->auto_approve_acars) {
$default_state = PirepState::ACCEPTED;
} elseif ($pirep->source === PirepSource::MANUAL && $pirep->user->rank->auto_approve_manual) {
$default_state = PirepState::ACCEPTED;
}
}
// only update the pilot last state if they are accepted
if ($default_state === PirepState::ACCEPTED) {
$pirep = $this->accept($pirep);
+1 -1
View File
@@ -23,7 +23,7 @@ class LatestNews extends Widget
return view('widgets.latest_news', [
'config' => $this->config,
'news' => $newsRepo->with('user')->recent($this->config['count']),
'news' => $newsRepo->recent($this->config['count']),
]);
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ class LatestPilots extends Widget
public function run()
{
$userRepo = app(UserRepository::class);
$userRepo = $userRepo->with('home_airport')->where('state', '!=', UserState::DELETED)->orderby('created_at', 'desc')->take($this->config['count'])->get();
$userRepo = $userRepo->where('state', '!=', UserState::DELETED)->orderby('created_at', 'desc')->take($this->config['count'])->get();
return view('widgets.latest_pilots', [
'config' => $this->config,
+1 -2
View File
@@ -69,8 +69,7 @@
"wildbit/swiftmailer-postmark": "^3.3",
"queueworker/sansdaemon": "^1.2",
"jpkleemans/attribute-events": "^1.1",
"akaunting/laravel-money": "^1.2",
"staudenmeir/belongs-to-through": "^2.5"
"akaunting/laravel-money": "^1.2"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.5",
Generated
+429 -610
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -24,8 +24,9 @@ services:
- ./tests:/var/www/tests
- ./composer.json:/var/www/composer.json
- ./composer-lock.json:/var/www/composer-lock.json
#- ./env.php:/var/www/env.php
- ./env.php:/var/www/env.php
- ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./vendor:/var/www/vendor
depends_on:
- mysql
- redis
+15 -15
View File
@@ -1,5 +1,5 @@
{
"name": "npm-proj-1637278668440-0.3155840252673714Cj2SAC",
"name": "npm-proj-1630530959563-0.3771552149793951CYCCrG",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -12,7 +12,7 @@
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",
"ckeditor4": "^4.17.0",
"ckeditor4": "4.14.0",
"cookieconsent": "^3.1.0",
"cross-env": "^5.1.6",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
@@ -40,7 +40,7 @@
"rivets": "^0.9.6",
"select2": "^4.0.13",
"ssri": "^8.0.1",
"tar": ">=4.4.2",
"tar": "^6.1.9",
"webpack": "^5.45.1",
"webpack-cli": "^3.3.12",
"x-editable": "1.5.1"
@@ -3030,9 +3030,9 @@
}
},
"node_modules/ckeditor4": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.17.0.tgz",
"integrity": "sha512-csrwImc6il06rHIxE7SqfOBZE5kWk1u/J+yMJP4HwTikaWOmqGGoYnSajhSJk0/tbDQrWGUInwV428QzKcHyww=="
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.14.0.tgz",
"integrity": "sha512-g5p3bhbxbwB094bE7ss0rOyvG/azYdRjLTyngnPM2+fKZhnPrMVaFDx3SiiWKB+zyvndT3Deu54VTv/z2MQJCA=="
},
"node_modules/class-utils": {
"version": "0.3.6",
@@ -12802,9 +12802,9 @@
}
},
"node_modules/tar": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz",
"integrity": "sha512-XjLaMNl76o07zqZC/aW4lwegdY07baOH1T8w3AEfrHAdyg/oYO4ctjzEBq9Gy9fEP9oHqLIgvx6zuGDGe+bc8Q==",
"dependencies": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
@@ -16466,9 +16466,9 @@
}
},
"ckeditor4": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.17.0.tgz",
"integrity": "sha512-csrwImc6il06rHIxE7SqfOBZE5kWk1u/J+yMJP4HwTikaWOmqGGoYnSajhSJk0/tbDQrWGUInwV428QzKcHyww=="
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/ckeditor4/-/ckeditor4-4.14.0.tgz",
"integrity": "sha512-g5p3bhbxbwB094bE7ss0rOyvG/azYdRjLTyngnPM2+fKZhnPrMVaFDx3SiiWKB+zyvndT3Deu54VTv/z2MQJCA=="
},
"class-utils": {
"version": "0.3.6",
@@ -23866,9 +23866,9 @@
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
},
"tar": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.9.tgz",
"integrity": "sha512-XjLaMNl76o07zqZC/aW4lwegdY07baOH1T8w3AEfrHAdyg/oYO4ctjzEBq9Gy9fEP9oHqLIgvx6zuGDGe+bc8Q==",
"requires": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",
+2 -2
View File
@@ -17,7 +17,7 @@
"bootstrap": "~4.3",
"bootstrap-sass": "^3.4.1",
"bootstrap3": "npm:bootstrap@~3.4",
"ckeditor4": "4.17.0",
"ckeditor4": "4.14.0",
"cookieconsent": "^3.1.0",
"cross-env": "^5.1.6",
"eonasdan-bootstrap-datetimepicker": "^4.17.47",
@@ -45,7 +45,7 @@
"rivets": "^0.9.6",
"select2": "^4.0.13",
"ssri": "^8.0.1",
"tar": ">=4.4.2",
"tar": ">=6.1.9",
"webpack": "^5.45.1",
"webpack-cli": "^3.3.12",
"x-editable": "1.5.1"
+5 -6
View File
@@ -2,11 +2,10 @@
return [
'status' => [
'active' => 'Aktiv',
'maintenance' => 'Instandhaltung',
'stored' => 'Gelagert',
'retired' => 'Außer Dienst',
'scrapped' => 'Verschrottet',
'written' => 'Abgeschrieben',
'active' => 'Aktiv',
'stored' => 'Gelagert',
'retired' => 'Außer Dienst',
'scrapped' => 'Verschrottet',
'written' => 'Abgeschrieben',
],
];
+8 -8
View File
@@ -23,17 +23,17 @@ return [
'departuretime' => 'Abflugzeit',
'arrivaltime' => 'Ankunftszeit',
'type' => [
'pass_scheduled' => 'Passagier (Planmäßig)',
'cargo_scheduled' => 'Fracht (Planmäßig)',
'charter_pass_only' => 'Passagier (Charter)',
'addtl_cargo_mail' => 'Fracht (Zusätzliche)',
'special_vip' => 'Spezieller VIP-Flug',
'pass_addtl' => 'Passagier (Zusätzlich)',
'charter_cargo' => 'Fracht (Charter)',
'pass_scheduled' => 'Passagier - planmäßig',
'cargo_scheduled' => 'Fracht - planmäßig',
'charter_pass_only' => 'Charter - Nur Passagier',
'addtl_cargo_mail' => 'Zusätzliche Fracht/Post',
'special_vip' => 'Spezieller VIP-Flug (FAA/Behörde)',
'pass_addtl' => 'Passagier - Zusätzlich',
'charter_cargo' => 'Charter - Fracht/Post',
'ambulance' => 'Ambulanzflug',
'training_flight' => 'Trainingsflug',
'mail_service' => 'Postdienst',
'charter_special' => 'Passagier (Charter mit Sonderbehandlung)',
'charter_special' => 'Charter mit Sonderbehandlung',
'positioning' => 'Positionierung (Fähre/Lieferung/Demo)',
'technical_test' => 'Technischer Test',
'military' => 'Militär',
-1
View File
@@ -19,7 +19,6 @@ return [
'nometar' => 'METAR/TAF Daten konnten nicht abgerufen werden',
'conditions' => 'Bedingungen',
'visibility' => 'Sichtbarkeit',
'temp' => 'Temperatur',
'humidity' => 'Feuchtigkeit',
'dewpoint' => 'Taupunkt',
'barometer' => 'Barometer',
+5 -6
View File
@@ -2,11 +2,10 @@
return [
'status' => [
'active' => 'Active',
'maintenance' => 'Maintenance',
'stored' => 'Stored',
'retired' => 'Retired',
'scrapped' => 'Scrapped',
'written' => 'Written Off',
'active' => 'Active',
'stored' => 'Stored',
'retired' => 'Retired',
'scrapped' => 'Scrapped',
'written' => 'Written Off',
],
];
+12 -12
View File
@@ -23,20 +23,20 @@ return [
'departuretime' => 'Departure Time',
'arrivaltime' => 'Arrival Time',
'type' => [
'pass_scheduled' => 'Passenger (Scheduled)',
'pass_addtl' => 'Passenger (Additional)',
'charter_pass_only' => 'Passenger (Charter)',
'charter_special' => 'Passenger (Special Charter)',
'cargo_scheduled' => 'Cargo (Scheduled)',
'addtl_cargo_mail' => 'Cargo (Additional)',
'charter_cargo' => 'Cargo (Charter)',
'pass_scheduled' => 'Passenger - Scheduled',
'cargo_scheduled' => 'Cargo - Scheduled',
'charter_pass_only' => 'Charter - Passenger Only',
'addtl_cargo_mail' => 'Additional Cargo/Mail',
'special_vip' => 'Special VIP Flight (FAA/Government)',
'pass_addtl' => 'Passenger - Additional',
'charter_cargo' => 'Charter - Cargo/Mail',
'ambulance' => 'Ambulance Flight',
'training_flight' => 'Training Flight',
'mail_service' => 'Mail Service',
'special_vip' => 'VIP Flight',
'ambulance' => 'Ambulance',
'training_flight' => 'Training',
'military' => 'Military',
'positioning' => 'Positioning',
'charter_special' => 'Charter w/ Special Handling',
'positioning' => 'Positioning (Ferry/Delivery/Demo)',
'technical_test' => 'Technical Test',
'military' => 'Military',
'technical_stop' => 'Technical Stop',
],
];
-1
View File
@@ -19,7 +19,6 @@ return [
'nometar' => 'METAR/TAF data could not be retrieved',
'conditions' => 'Conditions',
'visibility' => 'visibility',
'temp' => 'Temperature',
'humidity' => 'humidity',
'dewpoint' => 'dew point',
'barometer' => 'Barometer',
+5 -6
View File
@@ -2,11 +2,10 @@
return [
'status' => [
'active' => 'Activo',
'maintenance' => 'Mantenimiento',
'stored' => 'Guardado',
'retired' => 'Retirado',
'scrapped' => 'Desguazado',
'written' => 'Dado de baja',
'active' => 'Activo',
'stored' => 'Guardado',
'retired' => 'Retirado',
'scrapped' => 'Desguazado',
'written' => 'Dado de baja',
],
];
+3 -3
View File
@@ -19,14 +19,14 @@ return [
'download' => 'Descarga|Descargas',
'from' => 'de',
'to' => 'a',
'state' => 'Situación',
'status' => 'Estado',
'state' => 'Estado',
'status' => 'Estatus',
'departure' => 'Salida',
'arrival' => 'Llegada',
'aircraft' => 'Aeronave',
'airline' => 'Aerolínea',
'subfleet' => 'Subfleet',
'distance' => 'Distancia',
'distance' => 'Distancía',
'fuel' => 'Combustible',
'metar' => 'METAR',
'hour' => 'Hora|Horas',
+1 -1
View File
@@ -2,7 +2,7 @@
return [
'type' => [
'flight' => 'Por vuelo',
'flight' => 'Vuelo',
'daily' => 'Diario',
'monthly' => 'Mensual',
],
+9 -9
View File
@@ -23,18 +23,18 @@ return [
'departuretime' => 'Hora de salida',
'arrivaltime' => 'Hora de llegada',
'type' => [
'pass_scheduled' => 'Pasajero (Programado)',
'cargo_scheduled' => 'Carga (Programado)',
'charter_pass_only' => 'Pasajero (Charter)',
'addtl_cargo_mail' => 'Carga (Adicional)',
'special_vip' => 'Vuelo VIP especial',
'pass_addtl' => 'Pasajero (Adicional)',
'charter_cargo' => 'Carga (Charter)',
'pass_scheduled' => 'Pasajero - Programado',
'cargo_scheduled' => 'Carga - Programado',
'charter_pass_only' => 'Charter - Solo pasajeros',
'addtl_cargo_mail' => 'Carga/correo adicional',
'special_vip' => 'Vuelo VIP especial (Autoridad de Aviación Civil)',
'pass_addtl' => 'Pasajero - Adicional',
'charter_cargo' => 'Charter - Carga/Correo',
'ambulance' => 'Vuelo ambulancia',
'training_flight' => 'Vuelo de entrenamiento',
'mail_service' => 'Servicio postal',
'charter_special' => 'Pasajero (Charter con cargas especiales)',
'positioning' => 'Posicionamiento',
'charter_special' => 'Charter con cargas especiales',
'positioning' => 'Posicionamiento (Ferry/Entrega/Demo)',
'technical_test' => 'Prueba técnica',
'military' => 'Militar',
'technical_stop' => 'Parada técnica',
+1 -1
View File
@@ -6,7 +6,7 @@ return [
'pending' => 'Pendiente',
'active' => 'Activo',
'rejected' => 'Rechazado',
'on_leave' => 'En excedencia',
'on_leave' => 'De vacaciones',
'suspended' => 'Suspendido',
'deleted' => 'Borrar',
],
+4 -5
View File
@@ -11,17 +11,16 @@ return [
'altitude' => 'Altitud',
'heading' => 'Rumbo',
'distance' => 'Distancía',
'noflights' => 'No hay vuelos',
'noflights' => 'No hay vuelos.',
'gs' => 'GS',
],
'weather' => [
'nometar' => 'No se han encontrado datos METAR/TAF',
'conditions' => 'Condiciones',
'visibility' => 'Visibilidad',
'temp' => 'Temperatura',
'humidity' => 'Humedad',
'dewpoint' => 'Punto de rocío',
'visibility' => 'visibilidad',
'humidity' => 'humedad',
'dewpoint' => 'punto de rocío',
'barometer' => 'Barometro',
'clouds' => 'Nubes',
'wind' => 'Viento',
+5 -6
View File
@@ -2,11 +2,10 @@
return [
'status' => [
'active' => 'Attivo',
'maintenance' => 'Manutenzione',
'stored' => 'Immagazzinato',
'retired' => 'Ritirato',
'scrapped' => 'Rottamato',
'written' => 'Stornato',
'active' => 'Attivo',
'stored' => 'Immagazzinato',
'retired' => 'Ritirato',
'scrapped' => 'Rottamato',
'written' => 'Stornato',
],
];
+9 -9
View File
@@ -22,18 +22,18 @@ return [
'departuretime' => 'Ora di Partenza',
'arrivaltime' => 'Ora di Arrivo',
'type' => [
'pass_scheduled' => 'Passeggeri (Programmato)',
'cargo_scheduled' => 'Cargo (Programmato)',
'charter_pass_only' => 'Passeggeri (Charter)',
'addtl_cargo_mail' => 'Cargo (Addizionale)',
'special_vip' => 'Volo VIP Speciale',
'pass_addtl' => 'Passeggeri (Addizionale)',
'charter_cargo' => 'Cargo (Charter)',
'pass_scheduled' => 'Passeggeri - Programmato',
'cargo_scheduled' => 'Cargo - Programmato',
'charter_pass_only' => 'Charter - Solo Passeggeri',
'addtl_cargo_mail' => 'Cargo/Posta Addizionale',
'special_vip' => 'Volo VIP Speciale (FAA/Governo)',
'pass_addtl' => 'Passeggeri - Addizionale',
'charter_cargo' => 'Charter - Cargo/Posta',
'ambulance' => 'Volo Ambulanza',
'training_flight' => 'Volo di Addestramento',
'mail_service' => 'Servizio Postale',
'charter_special' => 'Passeggeri (Charter Speciale)',
'positioning' => 'Posizionamento',
'charter_special' => 'Charter con Manutenzione Speciale',
'positioning' => 'Posizionamento (Traghetto/Consegna/Dimostrazione)',
'technical_test' => 'Prova Tecnica',
'military' => 'Militare',
'technical_stop' => 'Fermo Tecnico',
+3 -4
View File
@@ -18,10 +18,9 @@ return [
'weather' => [
'nometar' => 'I dati METAR/TAF non possono essere recuperati',
'conditions' => 'Condizioni',
'visibility' => 'Visibilità',
'temp' => 'Temperatura',
'humidity' => 'Umidità',
'dewpoint' => 'Punto di rugiada',
'visibility' => 'visibilità',
'humidity' => 'umidità',
'dewpoint' => 'punto di rugiada',
'barometer' => 'Barometro',
'clouds' => 'Nuvole',
'wind' => 'Vento',
+5 -6
View File
@@ -2,11 +2,10 @@
return [
'status' => [
'active' => 'Ativa',
'maintenance' => 'Manutencao',
'stored' => 'Armazenada',
'retired' => 'Retirada',
'scrapped' => 'Sucateada',
'written' => 'Eliminada',
'active' => 'Ativa',
'stored' => 'Armazenada',
'retired' => 'Retirada',
'scrapped' => 'Sucateada',
'written' => 'Eliminada',
],
];
+9 -9
View File
@@ -23,18 +23,18 @@ return [
'departuretime' => 'Hora de partida',
'arrivaltime' => 'Hora de chegada',
'type' => [
'pass_scheduled' => 'Passageiro (Programado)',
'cargo_scheduled' => 'Carga (Programado)',
'charter_pass_only' => 'Passageire (Charter)',
'addtl_cargo_mail' => 'Carga (Adicional)',
'special_vip' => 'Voo VIP especial',
'pass_addtl' => 'Passageiro (Adicional)',
'charter_cargo' => 'Carga (Charter)',
'pass_scheduled' => 'Passageiro - Programado',
'cargo_scheduled' => 'Carga - Programado',
'charter_pass_only' => 'Charter - Somente passageiros',
'addtl_cargo_mail' => 'Carga/Mail Adicional',
'special_vip' => 'Voo VIP especial (FAA/Governo)',
'pass_addtl' => 'Passageiro - Adicional',
'charter_cargo' => 'Charter - Carga/Mail',
'ambulance' => 'Voo de emergência',
'training_flight' => 'Voo de treinamento',
'mail_service' => 'Serviço de correio',
'charter_special' => 'Passageire (Charter Especial)',
'positioning' => 'Posicionamento',
'charter_special' => 'Charter c/ Handling Especial',
'positioning' => 'Posicionamento (Ferry/Delivery/Demo)',
'technical_test' => 'Teste Técnico',
'military' => 'Militar',
'technical_stop' => 'Parada Técnica',
-1
View File
@@ -19,7 +19,6 @@ return [
'nometar' => 'METAR/TAF não podem ser identificados.',
'conditions' => 'Condições',
'visibility' => 'Visibilidade',
'temp' => 'Temperatura',
'humidity' => 'Umidade',
'dewpoint' => 'Ponto de orvalho',
'barometer' => 'Barômetro',
@@ -38,15 +38,12 @@
<td style="text-align: center;">{{ $atf->code }}</td>
<td>
<a href="#" data-pk="{{ $atf->id }}" data-name="capacity">{{ $atf->pivot->capacity }}</a>
<span class="small background-color-grey-light">({{ $atf->capacity }})</span>
</td>
<td>
<a href="#" data-pk="{{ $atf->id }}" data-name="price">{{ $atf->pivot->price }}</a>
<span class="small background-color-grey-light">({{ $atf->price }})</span>
</td>
<td>
<a href="#" data-pk="{{ $atf->id }}" data-name="cost">{{ $atf->pivot->cost }}</a>
<span class="small background-color-grey-light">({{ $atf->cost }})</span>
</td>
<td style="text-align: center; width:3%;">
{{ Form::open(['url' => '/admin/flights/'.$flight->id.'/fares',
+16 -18
View File
@@ -1,27 +1,25 @@
<div class="content">
{{ Form::open(['route' => 'admin.flights.index', 'method' => 'GET', 'class'=>'form-group']) }}
<div class="row">
<div class="form-group col-sm-2">
{{ Form::label('airline_id', 'Airline:') }}
<div class="row">
<div class="col-sm-12">
<div class="form-group">
{{ Form::open(['route' => 'admin.flights.index', 'method' => 'GET', 'class'=>'form-inline pull-right']) }}
&nbsp;&nbsp;
{{ Form::label('airlines', 'Airline:') }}
{{ Form::select('airline_id', $airlines, null , ['class' => 'form-control select2']) }}
</div>
<div class="form-group input-group-sm col-sm-2">
{{ Form::label('flight_number', 'Flight Number:') }}
{{ Form::text('flight_number', null, ['class' => 'form-control']) }}
</div>
<div class="form-group col-sm-3">
&nbsp;
{{ Form::label('dpt_airport_id', 'Departure:') }}
{{ Form::select('dpt_airport_id', $airports, null , ['class' => 'form-control select2']) }}
</div>
<div class="form-group col-sm-3">
{{ Form::select('dpt_airport_id', $airports, null , ['class' => 'form-control']) }}
&nbsp;
{{ Form::label('arr_airport_id', 'Arrival:') }}
{{ Form::select('arr_airport_id', $airports, null , ['class' => 'form-control select2']) }}
</div>
<div class="form-group col-sm-2 text-center">
<br>
{{ Form::submit('Find', ['class' => 'btn btn-primary']) }}
<a href="{{ route('admin.flights.index') }}" class="btn btn-secondary ml-2">Clear</a>
{{ Form::select('arr_airport_id', $airports, null , ['class' => 'form-control']) }}
&nbsp;
{{ Form::submit('find', ['class' => 'btn btn-primary']) }}
&nbsp;
<a href="{{ route('admin.flights.index') }}">clear</a>
{{ Form::close() }}
</div>
</div>
{{ Form::close() }}
</div>
</div>
+21 -18
View File
@@ -1,7 +1,7 @@
<table class="table" style="border-style: hidden; margin-bottom: 0px;">
<tr style="border-style: hidden;">
@if ($pirep->state === PirepState::PENDING || $pirep->state === PirepState::REJECTED)
<td>
<table class="">
<tr>
<td>
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::REJECTED)
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
'method' => 'post',
'name' => 'accept_'.$pirep->id,
@@ -11,10 +11,11 @@
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
{{ Form::button('Accept', ['type' => 'submit', 'class' => 'btn btn-success']) }}
{{ Form::close() }}
</td>
@endif
@if ($pirep->state === PirepState::PENDING || $pirep->state === PirepState::ACCEPTED)
<td>
@endif
</td>
<td>&nbsp;</td>
<td>
@if($pirep->state === PirepState::PENDING || $pirep->state === PirepState::ACCEPTED)
{{ Form::open(['url' => route('admin.pirep.status', [$pirep->id]),
'method' => 'post',
'name' => 'reject_'.$pirep->id,
@@ -24,8 +25,8 @@
'class' => $on_edit_page ? 'pirep_change_status': 'pirep_submit_status']) }}
{{ Form::button('Reject', ['type' => 'submit', 'class' => 'btn btn-warning']) }}
{{ Form::close() }}
</td>
@endif
@endif
</td>
<td>
{{ Form::open(['url' => route('admin.pireps.destroy', [$pirep->id]),
'method' => 'delete',
@@ -39,18 +40,20 @@
@if ($on_edit_page === false)
<td>
<form action="{{ route('admin.pireps.edit', [$pirep->id]) }}">
<button type="submit" class='btn btn-info'>
<button type="submit"
class='btn btn-info'>
<i class="fas fa-pencil-alt"></i>&nbsp;&nbsp;Edit
</button>
</form>
</td>
@endif
<td>
<form action="{{ route('frontend.pireps.show', [$pirep->id]) }}" target="_blank">
<button type="submit" class='btn btn-success'>
<i class="fas fa-eye"></i>&nbsp;&nbsp; View Pirep
</button>
</form>
</td>
<td>
<form action="{{ route('frontend.pireps.show', [$pirep->id]) }}" target="_blank">
<button type="submit"
class='btn btn-success'>
<i class="fas fa-eye"></i>&nbsp;&nbsp; View Pirep
</button>
</form>
</td>
</tr>
</table>
@@ -2,7 +2,7 @@
<div class="card-block" style="min-height: 0px">
<div class="row">
<div class="col-sm-2 text-center">
<h5><a class="text-c" href="{{ route('admin.pireps.edit', [$pirep->id]) }}">{{ $pirep->ident }}</a></h5>
<h5><a class="text-c" href="{{ route('admin.pireps.edit', [$pirep->id]) }}">{{ $pirep->airline->code }}{{ $pirep->ident }}</a></h5>
<div id="pirep_{{ $pirep->id }}_status_container">
@php
$PirepStateClass = "badge badge-info" ;
@@ -18,7 +18,7 @@
<div class="col-sm-6">
<div>
<span class="description">
<b>Pilot</b>&nbsp;{{ '('.$pirep->user_id.') '.optional($pirep->user)->name }}
<b>Pilot</b>&nbsp;{{ $pirep->user->name }}&nbsp;
</span>
</div>
<div>
@@ -35,11 +35,11 @@
@if($pirep->aircraft)
<div>
<span class="description">
<b>Aircraft</b>&nbsp;{{ $pirep->aircraft->registration }} @if($pirep->aircraft->registration != $pirep->aircraft->name) '{{ $pirep->aircraft->name }}' @endif
<b>Aircraft</b>&nbsp;{{ $pirep->aircraft->registration }} ({{ $pirep->aircraft->name }})
</span>
</div>
@endif
@if(filled($pirep->level) && $pirep->level > 10)
@if(filled($pirep->level))
<div>
<span class="description">
<b>Flight Level</b>&nbsp;{{ $pirep->level }}
@@ -20,7 +20,7 @@
<div class="form-group col-sm-3">
{{ Form::label('hub_id', 'Main Hub:') }}
{{ Form::select('hub_id', $hubs, null , ['class' => 'form-control select2', 'placeholder' => '']) }}
{{ Form::select('hub_id', $hubs, null , ['class' => 'form-control select2']) }}
<p class="text-danger">{{ $errors->first('hub_id') }}</p>
</div>
@@ -2,7 +2,8 @@
<div class="row">
<div class="col-sm-10">
<p>
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">{{ $pirep->ident }}</a>
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">
{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
-
{{ $pirep->dpt_airport->name }}
(<a href="{{route('frontend.airports.show', [
@@ -4,7 +4,8 @@
@section('content')
<div class="row">
<div class="col-sm-8">
<h2>{{ $pirep->ident }} : {{ $pirep->dpt_airport_id }} to {{ $pirep->arr_airport_id }}</h2>
<h2>{{ $pirep->airline->icao }}{{ $pirep->ident }}
: {{ $pirep->dpt_airport_id }} to {{ $pirep->arr_airport_id }}</h2>
</div>
<div class="col-sm-4">
@@ -17,7 +17,8 @@
@foreach($pireps as $pirep)
<tr>
<td>
<a href="{{ route('frontend.pireps.show', [$pirep->id]) }}">{{ $pirep->ident }}</a>
<a href="{{ route('frontend.pireps.show', [
$pirep->id]) }}">{{ $pirep->airline->code }}{{ $pirep->ident }}</a>
</td>
<td>
@if($pirep->dpt_airport){{ $pirep->dpt_airport->name }}@endif
@@ -2,15 +2,15 @@
@foreach($pireps as $p)
<tr>
<td style="padding-right: 10px;">
<span class="title">{{ $p->ident }}</span>
<span class="title">{{ $p->airline->code }} {{ $p->flight_number }}</span>
</td>
<td>
<a href="{{route('frontend.airports.show', [$p->dpt_airport_id])}}">{{$p->dpt_airport_id}}</a>
&nbsp;-&nbsp;
<a href="{{route('frontend.airports.show', [$p->arr_airport_id])}}">{{$p->arr_airport_id}}</a>
</td>
<td>
{{ optional($p->aircraft)->ident }}
<a href="{{route('frontend.airports.show', [$p->arr_airport_id])}}">{{$p->arr_airport_id}}</a>&nbsp;
@if(!empty($p->aircraft))
{{ optional($p->aircraft)->registration }} ({{ $p->aircraft->icao }})
@endif
</td>
</tr>
@endforeach
@@ -90,7 +90,7 @@ and being mindful of the rivets bindings
</thead>
<tbody>
<tr rv-each-pirep="pireps">
<td><a href="#top_anchor" rv-on-click="controller.focusMarker">{ pirep.ident }</a></td>
<td><a href="#top_anchor" rv-on-click="controller.focusMarker">{ pirep.airline.icao }{ pirep.ident}</a></td>
{{-- Show the full airport name on hover --}}
<td><span rv-title="pirep.dpt_airport.name">{ pirep.dpt_airport.icao }</span></td>
<td><span rv-title="pirep.arr_airport.name">{ pirep.arr_airport.icao }</span></td>
@@ -13,7 +13,7 @@ https://api.checkwx.com/#metar-decoded
<tr>
<td>@lang('widgets.weather.wind')</td>
<td>
@if($metar['wind_speed'] < '1') Calm @else {{ $metar['wind_speed'] }} kts @lang('common.from') {{ $metar['wind_direction_label'] }} ({{ $metar['wind_direction']}}&deg;) @endif
@if($metar['wind_speed'] < '1') Calm @else {{ $metar['wind_speed'] }} kts @lang('common.from') {{ $metar['wind_direction_label'] }} ({{ $metar['wind_direction']}}°) @endif
@if($metar['wind_gust_speed']) @lang('widgets.weather.guststo') {{ $metar['wind_gust_speed'] }} @endif
</td>
</tr>
@@ -49,10 +49,10 @@ https://api.checkwx.com/#metar-decoded
</tr>
@endif
<tr>
<td>@lang('widgets.weather.temp')</td>
<td>Temperature</td>
<td>
@if($metar['temperature'][$unit_temp]) {{ $metar['temperature'][$unit_temp] }} @else 0 @endif &deg;{{strtoupper($unit_temp)}}
@if($metar['dew_point']), @lang('widgets.weather.dewpoint') @if($metar['dew_point'][$unit_temp]) {{ $metar['dew_point'][$unit_temp] }} @else 0 @endif &deg;{{strtoupper($unit_temp)}} @endif
@if($metar['temperature'][$unit_temp]) {{ $metar['temperature'][$unit_temp] }} @else 0 @endif °{{strtoupper($unit_temp)}}
@if($metar['dew_point']), @lang('widgets.weather.dewpoint') @if($metar['dew_point'][$unit_temp]) {{ $metar['dew_point'][$unit_temp] }} @else 0 @endif °{{strtoupper($unit_temp)}} @endif
@if($metar['humidity']), @lang('widgets.weather.humidity') {{ $metar['humidity'] }}% @endif
</td>
</tr>
+3 -3
View File
@@ -1,3 +1,3 @@
subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status
A32X,A320,320,,A320-211,N309US,,,,S
74X,747 400, ,,,
subfleet,iata, icao, name,registration,hex_code,zfw,status
A32X,A320,320,A320-211,N309US,,,S
74X,747 400, ,,
1 subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status subfleet,iata, icao, name,registration,hex_code,zfw,status
2 A32X,A320,320,,A320-211,N309US,,,,S A32X,A320,320,A320-211,N309US,,,S
3 74X,747 400, ,,, 74X,747 400, ,,
+3 -3
View File
@@ -1,3 +1,3 @@
subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status
A32X,A320,320,,A320-211,N309US,,,,A
74X,747 400,, ,,
subfleet,iata, icao, name,registration,hex_code,zfw,status
A32X,A320,320,A320-211,N309US,,,A
74X,747 400, ,,
1 subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status subfleet,iata, icao, name,registration,hex_code,zfw,status
2 A32X,A320,320,,A320-211,N309US,,,,A A32X,A320,320,A320-211,N309US,,,A
3 74X,747 400,, ,, 74X,747 400, ,,
+3 -3
View File
@@ -1,3 +1,3 @@
subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status
A32X,A320-211,,N309US,,,
, B744-GE,, N304,,,
subfleet,name,registration,hex_code,status
A32X,A320-211,N309US,,
, B744-GE, N304,,
1 subfleet,iata, icao,airport_id, name,registration,hex_code,mtow,zfw,status subfleet name registration hex_code status
2 A32X,A320-211,,N309US,,, A32X A320-211 N309US
3 , B744-GE,, N304,,, B744-GE N304
+5 -5
View File
@@ -1,5 +1,5 @@
airline,flight_number,route_code,callsign,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,pilot_pay,route,notes,start_date,end-date,active,subfleets,fares,fields
VMS,1972,,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0,100, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",,,1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
" ",1972,,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,100,10, ,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",,,1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
VMS,113,,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,70,2,,,"Empty distance",,,1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
VMS,999,,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0,100, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",,,1,A32X;B737,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,pilot_pay,route,notes,active,subfleets,fares,fields
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0,100, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
" ",1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,100,10, ,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
VMS,113,,,KJFK,KAUS,KDFW,15,0810 EST,1035 CST,350,,207,J,70,2,,,"Empty distance",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=C41;Arrival Gate=2
VMS,999,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,85,0,100, ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X;B737,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,Departure Gate=4;Arrival Gate=C41
1 airline flight_number route_code callsign route_leg dpt_airport arr_airport alt_airport days dpt_time arr_time level distance flight_time flight_type load_factor load_factor_variance pilot_pay route notes active start_date subfleets end-date fares fields
2 VMS 1972 KAUS KJFK KLGA 15 0810 CST 1235 EST 350 1477 207 J 85 0 100 ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6 Just a flight 1 A32X Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B? Departure Gate=4;Arrival Gate=C41
3 1972 KAUS KJFK KLGA 15 0810 CST 1235 EST 350 1477 207 J 100 10 ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6 Just a flight 1 A32X Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B? Departure Gate=4;Arrival Gate=C41
4 VMS 113 KJFK KAUS KDFW 15 0810 EST 1035 CST 350 207 J 70 2 Empty distance 1 A32X Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B? Departure Gate=C41;Arrival Gate=2
5 VMS 999 KAUS KJFK KLGA 15 0810 CST 1235 EST 350 1477 207 J 85 0 100 ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6 Just a flight 1 A32X;B737 Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B? Departure Gate=4;Arrival Gate=C41
+2 -2
View File
@@ -1,2 +1,2 @@
airline,flight_number,route_code,callsign,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,pilot_pay,route,notes,start_date,end-date,active,subfleets,fares,fields
VMS,1972,,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,,,,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",,,1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
airline,flight_number,route_code,route_leg,dpt_airport,arr_airport,alt_airport,days,dpt_time,arr_time,level,distance,flight_time,flight_type,load_factor, load_factor_variance,pilot_pay,route,notes,active,subfleets,fares,fields
VMS,1972,,,KAUS,KJFK,KLGA,15,0810 CST,1235 EST,350,1477,207,J,,,,ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6,"Just a flight",1,A32X,Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?,
1 airline flight_number route_code callsign route_leg dpt_airport arr_airport alt_airport days dpt_time arr_time level distance flight_time flight_type load_factor load_factor_variance pilot_pay route notes active start_date subfleets end-date fares fields
2 VMS 1972 KAUS KJFK KLGA 15 0810 CST 1235 EST 350 1477 207 J ILEXY2 ZENZI LFK ELD J29 MEM Q29 JHW J70 STENT J70 MAGIO J70 LVZ LENDY6 Just a flight 1 A32X Y?price=300&cost=100&capacity=130;F?price=600&cost=400;B?
+3 -3
View File
@@ -1,3 +1,3 @@
airline,hub_id,type,simbrief_type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,fares
VMS,KAUS,A32X,,"Airbus A320",,1000,0,200,Y;B?capacity=100&price=500%
VMS,EGPH, ,,"Boeing 747-400",,1000,0,200,Y;B?capacity=100&price=500%
airline,type,name,fuel_type,cost_block_hour,cost_delay_minute,ground_handling_multiplier,cargo_capacity,fuel_capacity,gross_weight,fares
VMS,A32X,"Airbus A320",,1000,0,200,,,,Y;B?capacity=100&price=500%
VMS, ,"Boeing 747-400",,1000,0,200,,,,Y;B?capacity=100&price=500%
1 airline hub_id type name simbrief_type fuel_type cost_block_hour cost_delay_minute ground_handling_multiplier cargo_capacity fuel_capacity gross_weight fares
2 VMS KAUS A32X Airbus A320 1000 0 200 Y;B?capacity=100&price=500%
3 VMS EGPH Boeing 747-400 1000 0 200 Y;B?capacity=100&price=500%