flight search and pagination (in admin), schema changes to accomodate
This commit is contained in:
parent
a82b8878d3
commit
e1b0b92f83
@ -7,6 +7,8 @@ use App\Models\FlightFields;
|
||||
use App\Models\Airport;
|
||||
use App\Http\Requests\CreateFlightRequest;
|
||||
use App\Http\Requests\UpdateFlightRequest;
|
||||
use App\Repositories\AirlineRepository;
|
||||
use App\Repositories\AirportRepository;
|
||||
use App\Repositories\FlightRepository;
|
||||
use App\Repositories\SubfleetRepository;
|
||||
use Illuminate\Http\Request;
|
||||
@ -16,15 +18,15 @@ use Response;
|
||||
|
||||
class FlightController extends BaseController
|
||||
{
|
||||
/** @var FlightRepository */
|
||||
private $flightRepository, $subfleetRepo;
|
||||
|
||||
public function __construct(
|
||||
AirlineRepository $airlineRepo,
|
||||
AirportRepository $airportRepo,
|
||||
FlightRepository $flightRepo,
|
||||
SubfleetRepository $subfleetRepo
|
||||
)
|
||||
{
|
||||
$this->flightRepository = $flightRepo;
|
||||
) {
|
||||
$this->airlineRepo = $airlineRepo;
|
||||
$this->airportRepo = $airportRepo;
|
||||
$this->flightRepo = $flightRepo;
|
||||
$this->subfleetRepo = $subfleetRepo;
|
||||
}
|
||||
|
||||
@ -51,8 +53,8 @@ class FlightController extends BaseController
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->flightRepository->pushCriteria(new RequestCriteria($request));
|
||||
$flights = $this->flightRepository->all();
|
||||
$this->flightRepo->pushCriteria(new RequestCriteria($request));
|
||||
$flights = $this->flightRepo->paginate(10);
|
||||
return view('admin.flights.index', [
|
||||
'flights' => $flights,
|
||||
]);
|
||||
@ -79,7 +81,7 @@ class FlightController extends BaseController
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$flight = $this->flightRepository->create($input);
|
||||
$flight = $this->flightRepo->create($input);
|
||||
|
||||
Flash::success('Flight saved successfully.');
|
||||
return redirect(route('admin.flights.index'));
|
||||
@ -94,7 +96,7 @@ class FlightController extends BaseController
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
@ -117,7 +119,7 @@ class FlightController extends BaseController
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
@ -127,8 +129,8 @@ class FlightController extends BaseController
|
||||
$avail_subfleets = $this->getAvailSubfleets($flight);
|
||||
return view('admin.flights.edit', [
|
||||
'flight' => $flight,
|
||||
'airlines' => Airline::all()->pluck('name', 'id'),
|
||||
'airports' => Airport::all()->pluck('icao', 'id'),
|
||||
'airlines' => $this->airlineRepo->all()->pluck('name', 'id'),
|
||||
'airports' => $this->airportRepo->all()->pluck('icao', 'icao'),
|
||||
'avail_subfleets' => $avail_subfleets,
|
||||
]);
|
||||
}
|
||||
@ -143,14 +145,14 @@ class FlightController extends BaseController
|
||||
*/
|
||||
public function update($id, UpdateFlightRequest $request)
|
||||
{
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
return redirect(route('admin.flights.index'));
|
||||
}
|
||||
|
||||
$flight = $this->flightRepository->update($request->all(), $id);
|
||||
$flight = $this->flightRepo->update($request->all(), $id);
|
||||
|
||||
Flash::success('Flight updated successfully.');
|
||||
return redirect(route('admin.flights.index'));
|
||||
@ -165,14 +167,14 @@ class FlightController extends BaseController
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
return redirect(route('admin.flights.index'));
|
||||
}
|
||||
|
||||
$this->flightRepository->delete($id);
|
||||
$this->flightRepo->delete($id);
|
||||
|
||||
Flash::success('Flight deleted successfully.');
|
||||
return redirect(route('admin.flights.index'));
|
||||
@ -190,7 +192,7 @@ class FlightController extends BaseController
|
||||
{
|
||||
$id = $request->id;
|
||||
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
return redirect(route('admin.flights.index'));
|
||||
@ -233,7 +235,7 @@ class FlightController extends BaseController
|
||||
{
|
||||
$id = $request->id;
|
||||
|
||||
$flight = $this->flightRepository->findWithoutFail($id);
|
||||
$flight = $this->flightRepo->findWithoutFail($id);
|
||||
if (empty($flight)) {
|
||||
Flash::error('Flight not found');
|
||||
return redirect(route('admin.flights.index'));
|
||||
|
@ -5,15 +5,15 @@ namespace App\Http\Controllers\Frontend;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models\Airline;
|
||||
use App\Models\Airport;
|
||||
use App\Models\Pirep;
|
||||
use App\Models\PirepField;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\AirlineRepository;
|
||||
use App\Repositories\AircraftRepository;
|
||||
use App\Repositories\AirportRepository;
|
||||
use App\Repositories\PirepRepository;
|
||||
use App\Repositories\PirepFieldRepository;
|
||||
|
||||
|
||||
class PirepController extends Controller
|
||||
@ -21,20 +21,25 @@ class PirepController extends Controller
|
||||
public function __construct(
|
||||
AirlineRepository $airlineRepo,
|
||||
PirepRepository $pirepRepo,
|
||||
AircraftRepository $aircraftRepo)
|
||||
{
|
||||
AircraftRepository $aircraftRepo,
|
||||
AirportRepository $airportRepo,
|
||||
PirepFieldRepository $pirepFieldRepo
|
||||
) {
|
||||
parent::__construct();
|
||||
$this->airlineRepo = $airlineRepo;
|
||||
$this->aircraftRepo = $aircraftRepo;
|
||||
$this->pirepRepo = $pirepRepo;
|
||||
$this->airportRepo = $airportRepo;
|
||||
$this->pirepFieldRepo = $pirepFieldRepo;
|
||||
}
|
||||
|
||||
public function airportList()
|
||||
{
|
||||
# TODO: Cache
|
||||
$retval = [];
|
||||
$airports = Airport::all();
|
||||
$airports = $this->airportRepo->all();
|
||||
foreach($airports as $airport) {
|
||||
$retval[$airport->id] = $airport->icao.' - '.$airport->name;
|
||||
$retval[$airport->icao] = $airport->icao.' - '.$airport->name;
|
||||
}
|
||||
|
||||
return $retval;
|
||||
@ -55,9 +60,10 @@ class PirepController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$pireps = Pirep::where('user_id', $user->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
$pireps = $this->pirepRepo
|
||||
->where('user_id', $user->id)
|
||||
->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
|
||||
return $this->view('pireps.index', [
|
||||
'user' => $user,
|
||||
@ -72,9 +78,9 @@ class PirepController extends Controller
|
||||
|
||||
return $this->view('pireps.create', [
|
||||
'airports' => $airports,
|
||||
'airlines' => Airline::all()->pluck('name', 'id'),
|
||||
'airlines' => $this->airlineRepo->all()->pluck('name', 'id'),
|
||||
'aircraft' => $aircraft,
|
||||
'pirepfields' => PirepField::all(),
|
||||
'pirepfields' => $this->pirepFieldRepo->all(),
|
||||
'fieldvalues' => [],
|
||||
]);
|
||||
}
|
||||
|
@ -11,9 +11,10 @@ use Eloquent as Model;
|
||||
class Airport extends Model
|
||||
{
|
||||
public $table = 'airports';
|
||||
protected $dates = ['deleted_at'];
|
||||
public $timestamps = false;
|
||||
|
||||
public $fillable = [
|
||||
'id',
|
||||
'icao',
|
||||
'name',
|
||||
'location',
|
||||
@ -24,30 +25,28 @@ class Airport extends Model
|
||||
'fuel_mogas_cost',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
|
||||
];
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $rules = [
|
||||
'icao' => 'required|unique:airports'
|
||||
#'icao' => 'required|unique:airports'
|
||||
];
|
||||
|
||||
public function save(array $options = [])
|
||||
{
|
||||
if(in_array('icao', $options)) {
|
||||
$options['icao'] = strtoupper($options['icao']);
|
||||
}
|
||||
/**
|
||||
* Some fancy callbacks
|
||||
*/
|
||||
protected static function boot() {
|
||||
|
||||
return parent::save($options);
|
||||
parent::boot();
|
||||
|
||||
/**
|
||||
* Make sure the ID is set to the ICAO
|
||||
*/
|
||||
static::creating(function (Airport $model) {
|
||||
$model->icao = strtoupper($model->icao);
|
||||
$model->id = $model->icao;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,13 @@
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Aircraft;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
class AircraftRepository extends BaseRepository
|
||||
class AircraftRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -3,9 +3,14 @@
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Airline;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
class AirlineRepository extends BaseRepository
|
||||
|
||||
class AirlineRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -3,10 +3,14 @@
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Airport;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
|
||||
class AirportRepository extends BaseRepository
|
||||
class AirportRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@ -21,4 +25,10 @@ class AirportRepository extends BaseRepository
|
||||
{
|
||||
return Airport::class;
|
||||
}
|
||||
|
||||
public function create(array $attributes)
|
||||
{
|
||||
//$attributes['id'] = $attributes['icao'];
|
||||
return parent::create($attributes);
|
||||
}
|
||||
}
|
||||
|
@ -3,15 +3,22 @@
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Flight;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
class FlightRepository extends BaseRepository
|
||||
class FlightRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $fieldSearchable = [
|
||||
'arr_airport_id',
|
||||
'dpt_airport_id',
|
||||
'arr_airport_id'
|
||||
'flight_number' => 'like',
|
||||
'route' => 'like',
|
||||
'notes' => 'like',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -3,9 +3,13 @@
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Rank;
|
||||
use Prettus\Repository\Contracts\CacheableInterface;
|
||||
use Prettus\Repository\Traits\CacheableRepository;
|
||||
|
||||
class RankRepository extends BaseRepository
|
||||
class RankRepository extends BaseRepository implements CacheableInterface
|
||||
{
|
||||
use CacheableRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
@ -20,8 +20,8 @@ class CreateUsersTable extends Migration
|
||||
$table->string('password');
|
||||
$table->integer('airline_id')->nullable()->unsigned();
|
||||
$table->integer('rank_id')->nullable()->unsigned();
|
||||
$table->integer('home_airport_id')->nullable()->unsigned();
|
||||
$table->integer('curr_airport_id')->nullable()->unsigned();
|
||||
$table->string('home_airport_id', 5)->nullable();
|
||||
$table->string('curr_airport_id', 5)->nullable();
|
||||
$table->uuid('last_pirep_id')->nullable();
|
||||
$table->bigInteger('flights')->unsigned()->default(0);
|
||||
$table->bigInteger('flight_time')->unsigned()->default(0);
|
||||
|
@ -10,7 +10,7 @@ class CreateAircraftsTable extends Migration
|
||||
Schema::create('aircraft', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('subfleet_id')->unsigned();
|
||||
$table->integer('airport_id')->unsigned()->nullable();
|
||||
$table->string('airport_id', 5)->nullable();
|
||||
$table->string('hex_code', 10)->nullable();
|
||||
$table->string('name', 50);
|
||||
$table->string('registration', 10)->nullable();
|
||||
|
@ -14,19 +14,17 @@ class CreateAirportsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::create('airports', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('icao', 5)->unique();
|
||||
// $table->bigIncrements('id');
|
||||
$table->string('id', 5)->primary();
|
||||
$table->string('icao', 5);
|
||||
$table->string('name', 50);
|
||||
$table->string('location', 50)->nullable();
|
||||
$table->string('country', 50)->nullable();
|
||||
$table->double('fuel_100ll_cost', 19, 2)->default(0);
|
||||
$table->double('fuel_jeta_cost', 19, 2)->default(0);
|
||||
$table->double('fuel_mogas_cost', 19, 2)->default(0);
|
||||
$table->float('lat', 7, 4)->default(0.0);
|
||||
$table->float('lon', 7, 4)->default(0.0);
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('icao');
|
||||
$table->float('lat', 7, 4)->default(0.0)->nullable();
|
||||
$table->float('lon', 7, 4)->default(0.0)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@ class CreateFlightsTable extends Migration
|
||||
$table->string('flight_number', 10);
|
||||
$table->string('route_code', 5)->nullable();
|
||||
$table->string('route_leg', 5)->nullable();
|
||||
$table->integer('dpt_airport_id')->unsigned();
|
||||
$table->integer('arr_airport_id')->unsigned();
|
||||
$table->integer('alt_airport_id')->unsigned()->nullable();
|
||||
$table->string('dpt_airport_id', 5);
|
||||
$table->string('arr_airport_id', 5);
|
||||
$table->string('alt_airport_id', 5)->nullable();
|
||||
$table->text('route')->nullable();
|
||||
$table->text('dpt_time', 10)->nullable();
|
||||
$table->text('arr_time', 10)->nullable();
|
||||
|
@ -22,8 +22,8 @@ class CreatePirepsTable extends Migration
|
||||
$table->string('flight_number', 10)->nullable();
|
||||
$table->string('route_code', 5)->nullable();
|
||||
$table->string('route_leg', 5)->nullable();
|
||||
$table->integer('dpt_airport_id')->unsigned();
|
||||
$table->integer('arr_airport_id')->unsigned();
|
||||
$table->string('dpt_airport_id', 5)->unsigned();
|
||||
$table->string('arr_airport_id', 5)->unsigned();
|
||||
$table->double('flight_time', 19, 2)->unsigned();
|
||||
$table->double('gross_weight', 19, 2)->nullable();
|
||||
$table->double('fuel_used', 19, 2)->nullable();
|
||||
|
@ -13,6 +13,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$env = App::environment();
|
||||
$path = database_path('seeds/'.$env.'.yml');
|
||||
print "Seeding seeds/$env.yml";
|
||||
if(!file_exists($path)) {
|
||||
$path = database_path('seeds/prod.yml');
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ users:
|
||||
password: admin
|
||||
rank_id: 1
|
||||
airline_id: 1
|
||||
home_airport_id: 1
|
||||
curr_airport_id: 2
|
||||
home_airport_id: KAUS
|
||||
curr_airport_id: KJFK
|
||||
flights: 1
|
||||
flight_time: 43200
|
||||
created_at: now
|
||||
@ -27,8 +27,8 @@ users:
|
||||
password: admin
|
||||
rank_id: 1
|
||||
airline_id: 1
|
||||
home_airport_id: 2
|
||||
curr_airport_id: 2
|
||||
home_airport_id: KJFK
|
||||
curr_airport_id: KJFK
|
||||
flights: 1
|
||||
flight_time: 43200
|
||||
created_at: now
|
||||
@ -40,8 +40,8 @@ users:
|
||||
password: admin
|
||||
rank_id: 1
|
||||
airline_id: 1
|
||||
home_airport_id: 2
|
||||
curr_airport_id: 2
|
||||
home_airport_id: KJFK
|
||||
curr_airport_id: KAUS
|
||||
flights: 1
|
||||
flight_time: 43200
|
||||
created_at: now
|
||||
@ -88,19 +88,19 @@ airlines:
|
||||
updated_at: now
|
||||
|
||||
airports:
|
||||
- id: 1
|
||||
- id: KAUS
|
||||
icao: KAUS
|
||||
name: Austin-Bergstrom
|
||||
location: Austin, Texas, USA
|
||||
lat: 30.1945278
|
||||
lon: -97.6698889
|
||||
- id: 2
|
||||
- id: KJFK
|
||||
icao: KJFK
|
||||
name: John F Kennedy
|
||||
location: New York, New York, USA
|
||||
lat: 40.6399257
|
||||
lon: -73.7786950
|
||||
- id: 3
|
||||
- id: EGLL
|
||||
icao: EGLL
|
||||
name: London Heathrow
|
||||
location: London, England
|
||||
@ -186,27 +186,123 @@ flights:
|
||||
- id: flightid_1
|
||||
airline_id: 1
|
||||
flight_number: 100
|
||||
dpt_airport_id: 1
|
||||
arr_airport_id: 2
|
||||
dpt_airport_id: KAUS
|
||||
arr_airport_id: KJFK
|
||||
route: KAUS KJFK
|
||||
dpt_time: 6PM CST
|
||||
arr_time: 11PM EST
|
||||
- id: flightid_2
|
||||
airline_id: 1
|
||||
flight_number: 101
|
||||
dpt_airport_id: 2
|
||||
arr_airport_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 9AM EST
|
||||
arr_time: 12PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_3
|
||||
airline_id: 1
|
||||
flight_number: 200
|
||||
dpt_airport_id: 2
|
||||
arr_airport_id: 3
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 9AM EST
|
||||
arr_time: 12PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_4
|
||||
airline_id: 1
|
||||
flight_number: 201
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 10AM EST
|
||||
arr_time: 1PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_5
|
||||
airline_id: 1
|
||||
flight_number: 202
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 11AM EST
|
||||
arr_time: 2PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_6
|
||||
airline_id: 1
|
||||
flight_number: 203
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 12PM EST
|
||||
arr_time: 3PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_7
|
||||
airline_id: 1
|
||||
flight_number: 204
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 1PM EST
|
||||
arr_time: 4PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_8
|
||||
airline_id: 1
|
||||
flight_number: 205
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 2PM EST
|
||||
arr_time: 5PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_9
|
||||
airline_id: 1
|
||||
flight_number: 206
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 3PM EST
|
||||
arr_time: 6PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_10
|
||||
airline_id: 1
|
||||
flight_number: 207
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 4PM EST
|
||||
arr_time: 7PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_11
|
||||
airline_id: 1
|
||||
flight_number: 208
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 5PM EST
|
||||
arr_time: 8PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_12
|
||||
airline_id: 1
|
||||
flight_number: 209
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 6PM EST
|
||||
arr_time: 9PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_13
|
||||
airline_id: 1
|
||||
flight_number: 210
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 7PM EST
|
||||
arr_time: 10PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_14
|
||||
airline_id: 1
|
||||
flight_number: 211
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 8PM EST
|
||||
arr_time: 11PM CST
|
||||
route: KJFK KAUS
|
||||
- id: flightid_15
|
||||
airline_id: 1
|
||||
flight_number: 212
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
dpt_time: 9PM EST
|
||||
arr_time: 12AM CST
|
||||
route: KJFK KAUS
|
||||
|
||||
flight_fields:
|
||||
- id: 1
|
||||
@ -232,8 +328,8 @@ pireps:
|
||||
airline_id: 1
|
||||
flight_id: flightid_1
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: 1
|
||||
arr_airport_id: 2
|
||||
dpt_airport_id: KAUS
|
||||
arr_airport_id: KJFK
|
||||
flight_time: 21600 # 6 hours
|
||||
status: -1
|
||||
notes: just a pilot report
|
||||
@ -242,8 +338,8 @@ pireps:
|
||||
airline_id: 1
|
||||
flight_id: flightid_2
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: 2
|
||||
arr_airport_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
flight_time: 21600 # 6 hours
|
||||
status: -1
|
||||
notes: just a pilot report
|
||||
|
@ -1,22 +1,12 @@
|
||||
@extends('admin.app')
|
||||
|
||||
@section('title', "Add Airport")
|
||||
@section('content')
|
||||
<section class="content-header">
|
||||
<h1>Add Airport</h1>
|
||||
</section>
|
||||
<div class="card border-blue-bottom">
|
||||
<div class="content">
|
||||
@include('adminlte-templates::common.errors')
|
||||
<div class="box box-primary">
|
||||
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
{!! Form::open(['route' => 'admin.airports.store']) !!}
|
||||
|
||||
@include('admin.airports.fields')
|
||||
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::open(['route' => 'admin.airports.store']) !!}
|
||||
@include('admin.airports.fields')
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@ -10,8 +10,19 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="card">
|
||||
@include('admin.flights.search')
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
@include('admin.flights.table')
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
{{ $flights->links('admin.pagination.default') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
13
resources/views/admin/flights/search.blade.php
Normal file
13
resources/views/admin/flights/search.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
<div class="content">
|
||||
<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']) !!}
|
||||
{!! Form::label('search', 'search:') !!}
|
||||
{!! Form::text('search', null, ['class' => 'form-control']) !!}
|
||||
{!! Form::submit('find', ['class' => 'btn btn-primary']) !!}
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
34
resources/views/admin/pagination/bootstrap-4.blade.php
Normal file
34
resources/views/admin/pagination/bootstrap-4.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled"><span class="page-link">«</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Pagination Elements -->
|
||||
@foreach ($elements as $element)
|
||||
<!-- "Three Dots" Separator -->
|
||||
@if (is_string($element))
|
||||
<li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
<!-- Array Of Links -->
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="page-item active"><span class="page-link">{{ $page }}</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="page-item disabled"><span class="page-link">»</span></li>
|
||||
@endif
|
||||
</ul>
|
34
resources/views/admin/pagination/default.blade.php
Normal file
34
resources/views/admin/pagination/default.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled"><span>«</span></li>
|
||||
@else
|
||||
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Pagination Elements -->
|
||||
@foreach ($elements as $element)
|
||||
<!-- "Three Dots" Separator -->
|
||||
@if (is_string($element))
|
||||
<li class="disabled"><span>{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
<!-- Array Of Links -->
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="active"><span>{{ $page }}</span></li>
|
||||
@else
|
||||
<li><a href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="disabled"><span>»</span></li>
|
||||
@endif
|
||||
</ul>
|
36
resources/views/admin/pagination/semantic-ui.blade.php
Normal file
36
resources/views/admin/pagination/semantic-ui.blade.php
Normal file
@ -0,0 +1,36 @@
|
||||
@if ($paginator->hasPages())
|
||||
<div class="ui pagination menu">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<a class="icon item disabled"> <i class="left chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev"> <i class="left chevron icon"></i> </a>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<a class="icon item disabled">{{ $element }}</a>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<a class="item active" href="{{ $url }}">{{ $page }}</a>
|
||||
@else
|
||||
<a class="item" href="{{ $url }}">{{ $page }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next"> <i class="right chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item disabled"> <i class="right chevron icon"></i> </a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
@ -0,0 +1,15 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled"><span class="page-link">«</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="page-item disabled"><span class="page-link">»</span></li>
|
||||
@endif
|
||||
</ul>
|
15
resources/views/admin/pagination/simple-default.blade.php
Normal file
15
resources/views/admin/pagination/simple-default.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled"><span>«</span></li>
|
||||
@else
|
||||
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="disabled"><span>»</span></li>
|
||||
@endif
|
||||
</ul>
|
@ -5,7 +5,7 @@
|
||||
<h1 class="pull-left">{!! $flight->airline->code !!}{!! $flight->flight_number !!}</h1>
|
||||
<h1 class="pull-right">
|
||||
<a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px"
|
||||
href="{!! route('admin.flights.edit', $flight->id) !!}">Edit</a>
|
||||
href="{!! route('flights.edit', $flight->id) !!}">Edit</a>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
|
@ -0,0 +1,34 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled"><span class="page-link">«</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Pagination Elements -->
|
||||
@foreach ($elements as $element)
|
||||
<!-- "Three Dots" Separator -->
|
||||
@if (is_string($element))
|
||||
<li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
<!-- Array Of Links -->
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="page-item active"><span class="page-link">{{ $page }}</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="page-item disabled"><span class="page-link">»</span></li>
|
||||
@endif
|
||||
</ul>
|
34
resources/views/layouts/default/pagination/default.blade.php
Normal file
34
resources/views/layouts/default/pagination/default.blade.php
Normal file
@ -0,0 +1,34 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled"><span>«</span></li>
|
||||
@else
|
||||
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Pagination Elements -->
|
||||
@foreach ($elements as $element)
|
||||
<!-- "Three Dots" Separator -->
|
||||
@if (is_string($element))
|
||||
<li class="disabled"><span>{{ $element }}</span></li>
|
||||
@endif
|
||||
|
||||
<!-- Array Of Links -->
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<li class="active"><span>{{ $page }}</span></li>
|
||||
@else
|
||||
<li><a href="{{ $url }}">{{ $page }}</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="disabled"><span>»</span></li>
|
||||
@endif
|
||||
</ul>
|
@ -0,0 +1,36 @@
|
||||
@if ($paginator->hasPages())
|
||||
<div class="ui pagination menu">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<a class="icon item disabled"> <i class="left chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev"> <i class="left chevron icon"></i> </a>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<a class="icon item disabled">{{ $element }}</a>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<a class="item active" href="{{ $url }}">{{ $page }}</a>
|
||||
@else
|
||||
<a class="item" href="{{ $url }}">{{ $page }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next"> <i class="right chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item disabled"> <i class="right chevron icon"></i> </a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
@ -0,0 +1,15 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="page-item disabled"><span class="page-link">«</span></li>
|
||||
@else
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li class="page-item"><a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="page-item disabled"><span class="page-link">»</span></li>
|
||||
@endif
|
||||
</ul>
|
@ -0,0 +1,15 @@
|
||||
<ul class="pagination">
|
||||
<!-- Previous Page Link -->
|
||||
@if ($paginator->onFirstPage())
|
||||
<li class="disabled"><span>«</span></li>
|
||||
@else
|
||||
<li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">«</a></li>
|
||||
@endif
|
||||
|
||||
<!-- Next Page Link -->
|
||||
@if ($paginator->hasMorePages())
|
||||
<li><a href="{{ $paginator->nextPageUrl() }}" rel="next">»</a></li>
|
||||
@else
|
||||
<li class="disabled"><span>»</span></li>
|
||||
@endif
|
||||
</ul>
|
36
resources/views/vendor/pagination/semantic-ui.blade.php
vendored
Normal file
36
resources/views/vendor/pagination/semantic-ui.blade.php
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
@if ($paginator->hasPages())
|
||||
<div class="ui pagination menu">
|
||||
{{-- Previous Page Link --}}
|
||||
@if ($paginator->onFirstPage())
|
||||
<a class="icon item disabled"> <i class="left chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev"> <i class="left chevron icon"></i> </a>
|
||||
@endif
|
||||
|
||||
{{-- Pagination Elements --}}
|
||||
@foreach ($elements as $element)
|
||||
{{-- "Three Dots" Separator --}}
|
||||
@if (is_string($element))
|
||||
<a class="icon item disabled">{{ $element }}</a>
|
||||
@endif
|
||||
|
||||
{{-- Array Of Links --}}
|
||||
@if (is_array($element))
|
||||
@foreach ($element as $page => $url)
|
||||
@if ($page == $paginator->currentPage())
|
||||
<a class="item active" href="{{ $url }}">{{ $page }}</a>
|
||||
@else
|
||||
<a class="item" href="{{ $url }}">{{ $page }}</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
{{-- Next Page Link --}}
|
||||
@if ($paginator->hasMorePages())
|
||||
<a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next"> <i class="right chevron icon"></i> </a>
|
||||
@else
|
||||
<a class="icon item disabled"> <i class="right chevron icon"></i> </a>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
Loading…
Reference in New Issue
Block a user