key = $key; $this->chart = $chart; $this->page = $page; $this->url = $this->gen_url($this->chart); if (!is_null($this->chart)) { $this->url_mirror = $this->gen_url('images/' . base64_encode($this->chart) . '.pdf'); } } function gen_url($b) { if (is_null($b)) { return null; } if (!is_null($this->page) && $this->page != 1) { return $b . '#page=' . $this->page; } return $b; } function a() { a($this->url, $this->key); if (!is_null($this->url_mirror)) { w('M'); } } } class FromDestBlock { public $chock = null; public $ad = null; public $bay = null; public $taxi = null; public $rwy = null; public $proc = null; public $metar = null; public $atis = null; public function __construct($chock, $ad, $bay, $taxi, $rwy, $proc, $metar, $atis) { $this->chock = $chock; $this->ad = $ad; $this->bay = $bay; $this->taxi = $taxi; $this->rwy = $rwy; $this->proc = $proc; $this->metar = $metar; $this->atis = $atis; } public static function parse($row, $key_chock, $key_prefix) { return new FromDestBlock( $row[$key_chock], new Charted($row[$key_prefix . 'ad'], $row[$key_prefix . 'ad_chart'], $row[$key_prefix . 'ad_chart_page']), new Charted($row[$key_prefix . 'bay'], $row[$key_prefix . 'bay_chart'], $row[$key_prefix . 'bay_chart_page']), new Charted($row[$key_prefix . 'taxi'], $row[$key_prefix . 'taxi_chart'], $row[$key_prefix . 'taxi_chart_page']), $row[$key_prefix . 'rwy'], new Charted($row[$key_prefix . 'proc'], $row[$key_prefix . 'proc_chart'], $row[$key_prefix . 'proc_chart_page']), $row[$key_prefix . 'metar'], $row[$key_prefix . 'atis'], ); } function p_ad() { $this->ad->a(); w('
'); if (!is_null($this->metar)) { w('
METAR' . $this->metar . '
'); } if (!is_null($this->atis)) { w('
ATIS' . $this->atis . '
'); } } function p_taxi() { w(''); if (!is_null($this->bay->key)) { w('Bay'); $this->bay->a(); w('
'); } if (!is_null($this->chock)) w('Chock: ' . (strval($this->chock) . 'Z
')); if (!is_null($this->taxi->key)) { w('
Taxi'); $this->taxi->a(); w('
'); } w(''); } function p_rwy() { } } class Aircraft { public $type = null; public $reg = null; public $link = null; public function __construct($type, $reg, $link) { $this->type = $type; $this->reg = $reg; $this->link = candidate($link, 'https://www.flightradar24.com/data/aircraft/' . strtolower($reg)); } public static function parse($row) { return new Aircraft($row['aircraft'], $row['registration'], $row['aircraft_link'] ); } function p() { w(''); w($this->type . '
'); a($this->link, $this->reg); w(''); } } class Flight { public $date = null; // Flight public $airline = null; public $flight_no = null; public $fr24_link = null; public $fa_link = null; // Aircraft public $aircraft = null; // From public $clearance = null; public $from = null; // Dest public $dest = null; public $approach = null; // Seat public $cabin = null; public $seat = null; public $seat_type = null; public $embark = null; public $disembark = null; // Enroute public $duration = null; public $distance = null; public $route = null; public $crz_alt = null; public $crz_speed = null; // Performance public $takeoff_weight = null; public $pax = null; public $payload = null; public $fuel = null; public $fuel_trip = null; public $v1 = null; public $vr = null; public $v2 = null; public $vref = null; // MISC public $notes = null; } class DB extends SQLite3 { private const STMT_SEL_ALL = " select datetime, airline, flight_no, fr24_link, fa_link, aircraft, registration, aircraft_link, from_ad, from_ad_chart, from_ad_chart_page, from_atis, from_metar, off_chock, from_bay, from_bay_chart, from_bay_chart_page, from_taxi, from_taxi_chart, from_taxi_chart_page, from_rwy, from_proc, from_proc_chart, from_proc_chart_page, dest_ad, dest_ad_chart, dest_ad_chart_page, dest_atis, dest_metar, on_chock, dest_bay, dest_bay_chart, dest_bay_chart_page, dest_taxi, dest_taxi_chart, dest_taxi_chart_page, dest_rwy, dest_proc, dest_proc_chart, dest_proc_chart_page, dest_approach, dest_approach_chart, dest_approach_chart_page, cabin, seat, seat_type, embark, disembark, duration, distance, route, clearance, crz_alt, crz_speed, takeoff_weight, pax, payload, fuel, fuel_trip, v1, vr, v2, vref, notes from flights order by datetime asc;"; private $stmt_sel_all; function __construct() { $this->open('./flights.sqlite', SQLITE3_OPEN_READONLY); $this->stmt_sel_all = $this->prepare(self::STMT_SEL_ALL); } function map($row) { $r = new Flight(); $r->date = $row['datetime']; $r->airline = $row['airline']; $r->flight_no = $row['flight_no']; $r->fr24_link = $row['fr24_link']; $r->fa_link = $row['fa_link']; $r->aircraft = Aircraft::parse($row); $r->clearance = $row['clearance']; $r->from = FromDestBlock::parse($row, 'off_chock', 'from_'); $r->dest = FromDestBlock::parse($row, 'on_chock', 'dest_'); $r->approach = new Charted($row['dest_approach'], $row['dest_approach_chart'], $row['dest_approach_chart_page']); $r->cabin = $row['cabin']; $r->seat = $row['seat']; if (is_null($row['seat_type'])) { $r->seat_type = null; } else { switch ($row['seat_type']) { case "WINDOW": $r->seat_type = SeatType::Window; break; case "MIDDLE": $r->seat_type = SeatType::Middle; break; case "AISLE": $r->seat_type = SeatType::Aisle; break; default: $r->seat_type = SeatType::Other; break; } } if (is_null($row['embark'])) { $r->embark = null; } else { switch ($row['embark']) { case "BRIDGE": $r->embark = EmbarkType::Bridge; break; case "STAIRS": $r->embark = EmbarkType::Stairs; break; default: $r->embark = EmbarkType::Other; break; } } if (is_null($row['disembark'])) { $r->disembark = null; } else { switch ($row['disembark']) { case "BRIDGE": $r->disembark = EmbarkType::Bridge; break; case "STAIRS": $r->disembark = EmbarkType::Stairs; break; default: $r->disembark = EmbarkType::Other; break; } } $r->duration = $row['duration']; $r->distance = $row['distance']; $r->route = $row['route']; $r->crz_alt = $row['crz_alt']; $r->crz_speed = $row['crz_speed']; $r->takeoff_weight = $row['takeoff_weight']; $r->pax = $row['pax']; $r->payload = $row['payload']; $r->fuel = $row['fuel']; $r->fuel_trip = $row['fuel_trip']; $r->v1 = $row['v1']; $r->vr = $row['vr']; $r->v2 = $row['v2']; $r->vref = $row['vref']; $r->notes = $row['notes']; return $r; } function getAll() { $res = $this->stmt_sel_all->execute(); $ra = array(); while ($r = $res->fetchArray()) { $d = $this->map($r); array_push($ra, $d); } $res->finalize(); return $ra; } } $db = new DB(); ?> Flights

Flights

This web page lists Yuuta's flights.

?'); } else { w('' . $text . ''); } } } function candidate(...$c) { foreach ($c as &$i) { if (!is_null($i)) { return $i; } } } function p_flight($data) { w(''); } function p_embark($data) { if (is_null($data->embark) && is_null($data->disembark)) { w(''); return; } w(''); } function p_seat($data) { w(''); } function p_enr_distance($data) { if (is_null($data->duration) && is_null($data->distance)) { w(''); return; } w(''); } function p_enr($data) { w(''); } function p_dest_ad($data) { w(''); w(''); } function p_dest_taxi($data) { w(''); } function p_perf_weight($data) { w(''); } function p_perf_fuel($data) { w(''); } function p($data) { w(''); p_flight($data); $data->aircraft->p(); p_seat($data); w(''); $data->from->p_taxi(); w(''); p_enr($data); w(''); w(''); $data->dest->p_taxi(); p_perf_weight($data); p_perf_fuel($data); w(''); } foreach ($db->getAll() as &$data) { p($data); } ?>
Flight Seat From Enroute Dest Performance
Flight Aircraft Seat Aerodrome Taxi Takeoff Route Aerodrome Landing Taxi Weight Fuel / Trip
'); w($data->date . 'L
'); if (is_null($data->airline) || is_null($data->flight_no)) { w('?'); } else { $flight_str = $data->airline . strval($data->flight_no); // a('https://www.flightaware.com/live/flight/' . $flight_str, $flight_str); w($flight_str); } w('
'); a($data->fr24_link, "FR24"); w(' '); a($data->fa_link, "FA"); if (!is_null($data->fr24_link)) { // https://www.flightradar24.com/data/flights/cx888#36a2ab06 if (preg_match('/https:\\/\\/.*flightradar24\\.com\\/data\\/flights\\/(.*)#(.*)/', $data->fr24_link, $matches, PREG_OFFSET_CAPTURE)) { w(' '); a('kmls/' . strtoupper($matches[1][0]) . '-' . $matches[2][0] . '.kml', 'KML'); } } w('
?'); a(null, is_null($data->embark) ? '?' : $data->embark->value); w('
'); a(null, is_null($data->disembark) ? '?' : $data->disembark->value); w('
'); if (!is_null($data->cabin)) w('Class ' . $data->cabin . '
'); if (!is_null($data->seat)) w($data->seat . '
'); if (!is_null($data->seat_type)) w($data->seat_type->value); w('
?'); w(''); if (!is_null($data->duration)) { w(strval(intdiv($data->duration, 60)) . ':' . strval($data->duration % 60)); w(" "); } if (!is_null($data->distance)) { w(strval($data->distance) . 'NM'); } w("
"); a(null, $data->crz_alt); w(" "); if (!is_null($data->crz_speed)) { w(strval($data->crz_speed) . 'ktFiled'); } w("
"); if (!is_null($data->route)) { w('
Route' . $data->route . '
'); } w('
'); $data->dest_ad->a(); w(' '); $data->dest_bay->a(); w('
'); a(null, $data->dest_rwy); w(' '); $data->dest_proc->a(); w('
'); w('On: ' . (is_null($data->off_chock) ? '?' : (strval($data->off_chock) . 'Z')) . '
'); if (is_null($data->dest_taxi->key)) { w('?'); } else { w('
Taxi'); $data->dest_taxi->a(); w('
'); } w('
'); if (!is_null($data->takeoff_weight)) w('TOW: ' . strval($data->takeoff_weight) . 'T
'); if (!is_null($data->pax)) w('PAX: ' . strval($data->pax) . '
'); if (!is_null($data->payload)) w('PLD: ' . strval($data->payload) . 'T'); w('
'); if (!is_null($data->fuel)) w('Fuel: ' . strval($data->fuel) . 'T' . '
'); if (!is_null($data->fuel_trip)) w('Trip: ' . strval($data->fuel_trip) . 'T'); w('
'); $data->from->p_ad(); if (!is_null($data->clearance)) { w('
Clearance' . $data->clearance . '
'); } w('
'); w('RWY'); a(null, $data->from->rwy); if (!is_null($data->from->proc->key)) { w('
DEP '); $data->from->proc->a(); } if (!is_null($data->v1) || !is_null($data->vr) || !is_null($data->v2)) w('
'); if (!is_null($data->v1)) w(strval($data->v1) . 'ktV1 '); if (!is_null($data->vr)) w(strval($data->vr) . 'ktVr '); if (!is_null($data->v2)) w(strval($data->v2) . 'ktV2 '); w('
'); $data->dest->p_ad(); w(''); w('RWY'); a(null, $data->dest->rwy); if (!is_null($data->dest->proc->key)) { w('
ARR '); $data->dest->proc->a(); } if (!is_null($data->approach->key)) { w('
APP '); $data->approach->a(); } if (!is_null($data->vref)) w('
'); if (!is_null($data->vref)) w(strval($data->vref) . 'ktVref '); w('
Flight Aircraft Seat Aerodrome Taxi Takeoff Route Aerodrome Landing Taxi Weight Fuel / Trip
Flight Seat From Enroute Dest Performance

More Actions

Yuuta 2024 - 2025: All rights reserved.