|
@@ -135,133 +135,139 @@ CREATE TABLE 'previousExperience' (
|
|
|
'autoland' INTEGER
|
|
|
);
|
|
|
DROP VIEW IF EXISTS 'viewDefault';
|
|
|
-CREATE VIEW viewDefault AS
|
|
|
+CREATE VIEW viewDefault AS
|
|
|
SELECT flight_id,
|
|
|
- doft as 'Date',
|
|
|
- dept AS 'Dept',
|
|
|
- printf('%02d',(tofb/60))||':'||printf('%02d',(tofb%60)) AS 'Time',
|
|
|
- dest AS 'Dest', printf('%02d',(tonb/60))||':'||printf('%02d',(tonb%60)) AS 'Time ',
|
|
|
- printf('%02d',(tblk/60))||':'||printf('%02d',(tblk%60)) AS 'Total',
|
|
|
- CASE WHEN pilot_id = 1 THEN alias ELSE lastname||', '||substr(firstname, 1, 1)||'.' END AS 'Name PIC',
|
|
|
- CASE WHEN variant IS NOT NULL THEN make||' '||model||'-'||variant ELSE make||' '||model END AS 'Type',
|
|
|
- registration AS 'Registration',
|
|
|
- FlightNumber AS 'Flight #',
|
|
|
- remarks AS 'Remarks'
|
|
|
-FROM flights
|
|
|
+ doft,
|
|
|
+ dept,
|
|
|
+ tofb,
|
|
|
+ dest,
|
|
|
+ tonb,
|
|
|
+ tblk,
|
|
|
+ pilots.pilot_id,
|
|
|
+ tails.tail_id,
|
|
|
+ tails.registration,
|
|
|
+ flightNumber,
|
|
|
+ remarks
|
|
|
+FROM flights
|
|
|
INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
INNER JOIN tails on flights.acft = tails.tail_id
|
|
|
-ORDER BY date DESC;
|
|
|
+ORDER BY doft DESC
|
|
|
|
|
|
DROP VIEW IF EXISTS 'viewDefaultSim';
|
|
|
-CREATE VIEW viewDefaultSim AS
|
|
|
-SELECT flight_id AS 'rowid',
|
|
|
- doft as 'Date',
|
|
|
- dept AS 'Dept',
|
|
|
- printf('%02d',(tofb/60))||':'||printf('%02d',(tofb%60)) AS 'Time',
|
|
|
- dest AS 'Dest', printf('%02d',(tonb/60))||':'||printf('%02d',(tonb%60)) AS 'Time ',
|
|
|
- printf('%02d',(tblk/60))||':'||printf('%02d',(tblk%60)) AS 'Total',
|
|
|
- CASE WHEN pilot_id = 1 THEN alias ELSE lastname||', '||substr(firstname, 1, 1)||'.' END AS 'Name PIC',
|
|
|
- CASE WHEN variant IS NOT NULL THEN make||' '||model||'-'||variant ELSE make||' '||model END AS 'Type',
|
|
|
- registration AS 'Registration',
|
|
|
- null AS 'Sim Type',
|
|
|
- null AS 'Time of Session',
|
|
|
- remarks AS 'Remarks'
|
|
|
-FROM flights
|
|
|
-INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
-INNER JOIN tails on flights.acft = tails.tail_id
|
|
|
-UNION
|
|
|
- SELECT (session_id * -1),
|
|
|
- date,
|
|
|
- null, null, null, null,
|
|
|
- 'SIM',
|
|
|
- null,
|
|
|
- aircraftType,
|
|
|
- registration,
|
|
|
- deviceType,
|
|
|
- printf('%02d',(totalTime/60))||':'||printf('%02d',(totalTime%60)),
|
|
|
+CREATE VIEW viewDefaultSim AS
|
|
|
+SELECT flights.flight_id,
|
|
|
+ flights.doft,
|
|
|
+ flights.dept,
|
|
|
+ flights.tofb,
|
|
|
+ flights.dest,
|
|
|
+ flights.tonb,
|
|
|
+ flights.tblk,
|
|
|
+ pilots.pilot_id ,
|
|
|
+ tails.tail_id,
|
|
|
+ tails.registration,
|
|
|
+ null AS 'deviceType',
|
|
|
+ null AS 'SimTime',
|
|
|
+ flights.remarks
|
|
|
+FROM flights
|
|
|
+INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
+INNER JOIN tails on flights.acft = tails.tail_id
|
|
|
+UNION
|
|
|
+ SELECT (simulators.session_id * -1),
|
|
|
+ simulators.date,
|
|
|
+ null, null, null, null, null, null,
|
|
|
+ simulators.aircraftType,
|
|
|
+ simulators.registration,
|
|
|
+ simulators.deviceType,
|
|
|
+ simulators.totalTime,
|
|
|
remarks
|
|
|
-FROM simulators
|
|
|
-ORDER BY date DESC;
|
|
|
+FROM simulators
|
|
|
+ORDER BY date DESC
|
|
|
|
|
|
DROP VIEW IF EXISTS 'viewEasa';
|
|
|
-CREATE VIEW viewEasa AS SELECT flight_id,
|
|
|
- doft as 'Date',
|
|
|
- dept AS 'Dept',
|
|
|
- printf('%02d',(tofb/60))||':'||printf('%02d',(tofb%60)) AS 'Time',
|
|
|
- dest AS 'Dest',
|
|
|
- printf('%02d',(tonb/60))||':'||printf('%02d',(tonb%60)) AS 'Time ',
|
|
|
- CASE WHEN variant IS NOT NULL THEN make||' '||model||'-'||variant ELSE make||' '||model END AS 'Type',
|
|
|
- registration AS 'Registration',
|
|
|
- (SELECT printf('%02d',(tSPSE/60))||':'||printf('%02d',(tSPSE%60)) WHERE tSPSE IS NOT NULL) AS 'SP SE',
|
|
|
- (SELECT printf('%02d',(tSPME/60))||':'||printf('%02d',(tSPME%60)) WHERE tSPME IS NOT NULL) AS 'SP ME',
|
|
|
- (SELECT printf('%02d',(tMP/60))||':'||printf('%02d',(tMP%60)) WHERE tMP IS NOT NULL) AS 'MP',
|
|
|
- printf('%02d',(tblk/60))||':'||printf('%02d',(tblk%60)) AS 'Total',
|
|
|
- CASE WHEN pilot_id = 1 THEN alias ELSE lastname||', '||substr(firstname, 1, 1)||'.' END AS 'Name PIC',
|
|
|
- ldgDay AS 'L/D',
|
|
|
- ldgNight AS 'L/N',
|
|
|
- (SELECT printf('%02d',(tNight/60))||':'||printf('%02d',(tNight%60)) WHERE tNight IS NOT NULL) AS 'Night',
|
|
|
- (SELECT printf('%02d',(tIFR/60))||':'||printf('%02d',(tIFR%60)) WHERE tIFR IS NOT NULL) AS 'IFR',
|
|
|
- (SELECT printf('%02d',(tPIC/60))||':'||printf('%02d',(tPIC%60)) WHERE tPIC IS NOT NULL) AS 'PIC',
|
|
|
- (SELECT printf('%02d',(tSIC/60))||':'||printf('%02d',(tSIC%60)) WHERE tSIC IS NOT NULL) AS 'SIC',
|
|
|
- (SELECT printf('%02d',(tDual/60))||':'||printf('%02d',(tDual%60)) WHERE tDual IS NOT NULL) AS 'Dual',
|
|
|
- (SELECT printf('%02d',(tFI/60))||':'||printf('%02d',(tFI%60)) WHERE tFI IS NOT NULL) AS 'FI',
|
|
|
- remarks AS 'Remarks'
|
|
|
-FROM flights
|
|
|
-INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
-INNER JOIN tails on flights.acft = tails.tail_id ORDER BY date DESC;
|
|
|
+CREATE VIEW viewEasa AS
|
|
|
+SELECT
|
|
|
+ flight_id,
|
|
|
+ doft,
|
|
|
+ dept,
|
|
|
+ tofb,
|
|
|
+ dest,
|
|
|
+ tonb,
|
|
|
+ tail_id,
|
|
|
+ registration,
|
|
|
+ tSPSE,
|
|
|
+ tSPME,
|
|
|
+ tMP,
|
|
|
+ tblk,
|
|
|
+ pilot_id,
|
|
|
+ ldgDay,
|
|
|
+ ldgNight,
|
|
|
+ tNight,
|
|
|
+ tIFR,
|
|
|
+ tPIC,
|
|
|
+ tSIC,
|
|
|
+ tDUAL,
|
|
|
+ tFI,
|
|
|
+ remarks
|
|
|
+FROM flights
|
|
|
+INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
+INNER JOIN tails on flights.acft = tails.tail_id ORDER BY doft DESC
|
|
|
|
|
|
DROP VIEW IF EXISTS 'viewEasaSim';
|
|
|
-CREATE VIEW viewEasaSim AS SELECT flight_id,
|
|
|
- doft as 'Date',
|
|
|
- dept AS 'Dept',
|
|
|
- printf('%02d',(tofb/60))||':'||printf('%02d',(tofb%60)) AS 'Time',
|
|
|
- dest AS 'Dest',
|
|
|
- printf('%02d',(tonb/60))||':'||printf('%02d',(tonb%60)) AS 'Time ',
|
|
|
- CASE WHEN variant IS NOT NULL THEN make||' '||model||'-'||variant ELSE make||' '||model END AS 'Type',
|
|
|
- registration AS 'Registration',
|
|
|
- (SELECT printf('%02d',(tSPSE/60))||':'||printf('%02d',(tSPSE%60)) WHERE tSPSE IS NOT NULL) AS 'SP SE',
|
|
|
- (SELECT printf('%02d',(tSPME/60))||':'||printf('%02d',(tSPME%60)) WHERE tSPME IS NOT NULL) AS 'SP ME',
|
|
|
- (SELECT printf('%02d',(tMP/60))||':'||printf('%02d',(tMP%60)) WHERE tMP IS NOT NULL) AS 'MP',
|
|
|
- printf('%02d',(tblk/60))||':'||printf('%02d',(tblk%60)) AS 'Total',
|
|
|
- CASE WHEN pilot_id = 1 THEN alias ELSE lastname||', '||substr(firstname, 1, 1)||'.' END AS 'Name PIC',
|
|
|
- ldgDay AS 'L/D',
|
|
|
- ldgNight AS 'L/N',
|
|
|
- (SELECT printf('%02d',(tNight/60))||':'||printf('%02d',(tNight%60)) WHERE tNight IS NOT NULL) AS 'Night',
|
|
|
- (SELECT printf('%02d',(tIFR/60))||':'||printf('%02d',(tIFR%60)) WHERE tIFR IS NOT NULL) AS 'IFR',
|
|
|
- (SELECT printf('%02d',(tPIC/60))||':'||printf('%02d',(tPIC%60)) WHERE tPIC IS NOT NULL) AS 'PIC',
|
|
|
- (SELECT printf('%02d',(tSIC/60))||':'||printf('%02d',(tSIC%60)) WHERE tSIC IS NOT NULL) AS 'SIC',
|
|
|
- (SELECT printf('%02d',(tDual/60))||':'||printf('%02d',(tDual%60)) WHERE tDual IS NOT NULL) AS 'Dual',
|
|
|
- (SELECT printf('%02d',(tFI/60))||':'||printf('%02d',(tFI%60)) WHERE tFI IS NOT NULL) AS 'FI',
|
|
|
- null AS 'Sim Type',
|
|
|
- null AS 'Time of Session',
|
|
|
- remarks AS 'Remarks'
|
|
|
-FROM flights
|
|
|
-INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
-INNER JOIN tails on flights.acft = tails.tail_id
|
|
|
-UNION
|
|
|
-SELECT (session_id * -1),
|
|
|
+CREATE VIEW viewEasaSim AS
|
|
|
+SELECT flight_id,
|
|
|
+ flights.doft as 'Date',
|
|
|
+ flights.dept,
|
|
|
+ flights.tofb,
|
|
|
+ flights.dest,
|
|
|
+ flights.tonb,
|
|
|
+ tails.tail_id AS 'Type',
|
|
|
+ tails.registration AS 'Registration',
|
|
|
+ flights.tSPSE,
|
|
|
+ flights.tSPME,
|
|
|
+ flights.tMP,
|
|
|
+ flights.tblk,
|
|
|
+ pilots.pilot_id AS 'PIC',
|
|
|
+ flights.ldgDay,
|
|
|
+ flights.ldgNight,
|
|
|
+ flights.tNight,
|
|
|
+ flights.tIFR,
|
|
|
+ flights.tPIC,
|
|
|
+ flights.tSIC,
|
|
|
+ flights.tDual,
|
|
|
+ flights.tFI,
|
|
|
+ null AS 'deviceType',
|
|
|
+ null AS 'simTime',
|
|
|
+ flights.remarks
|
|
|
+FROM flights
|
|
|
+INNER JOIN pilots on flights.pic = pilots.pilot_id
|
|
|
+INNER JOIN tails on flights.acft = tails.tail_id
|
|
|
+UNION
|
|
|
+SELECT (session_id * -1),
|
|
|
+ simulators.date,
|
|
|
+ null, null, null, null,
|
|
|
+ simulators.aircraftType,
|
|
|
+ simulators.registration,
|
|
|
+ null, null, null, null,
|
|
|
+ null, null, null, null,
|
|
|
+ null, null, null, null,
|
|
|
+ null,
|
|
|
+ simulators.deviceType,
|
|
|
+ simulators.totalTime,
|
|
|
+ simulators.remarks
|
|
|
+FROM simulators
|
|
|
+ORDER BY date DESC
|
|
|
+
|
|
|
+DROP VIEW IF EXISTS 'viewSimulators';
|
|
|
+CREATE VIEW viewSimulators AS
|
|
|
+SELECT (session_id * -1),
|
|
|
date,
|
|
|
- null, null, null, null,
|
|
|
- aircraftType,
|
|
|
registration,
|
|
|
- null, null, null,
|
|
|
- 'SIM',
|
|
|
- null, null, null, null, null, null, null, null, null,
|
|
|
- deviceType, printf('%02d',(totalTime/60))||':'||printf('%02d',(totalTime%60)),
|
|
|
+ aircraftType,
|
|
|
+ deviceType,
|
|
|
+ totalTime,
|
|
|
remarks
|
|
|
-FROM simulators
|
|
|
-ORDER BY date DESC;
|
|
|
-
|
|
|
-DROP VIEW IF EXISTS 'viewSimulators';
|
|
|
-CREATE VIEW viewSimulators AS SELECT (session_id * -1),
|
|
|
- date as 'Date',
|
|
|
- registration AS 'Registration',
|
|
|
- aircraftType AS 'Aircraft Type',
|
|
|
- deviceType 'Sim Type',
|
|
|
- printf('%02d',(totalTime/60))||':'||printf('%02d',(totalTime%60)) AS 'Time of Session',
|
|
|
- remarks AS 'Remarks'
|
|
|
-FROM simulators
|
|
|
-ORDER BY date DESC;
|
|
|
+FROM simulators
|
|
|
+ORDER BY date DESC
|
|
|
|
|
|
DROP VIEW IF EXISTS 'viewTails';
|
|
|
CREATE VIEW viewTails AS
|