Cancel Flight
<<Back to Main Menu
Description:
Allows the manager to cancel a flight
Accessible by:
Managers
Accessed from:
View Flight
Itself.
Input parameters:
Flight Number
areYouSure
Output
Cancel Flight Form or
Error or success message if the form has been submitted
Pseudo Code:
get/create session
if ('usertype' param in session == 'm') {
get parameters from the form
if (areYouSure == 'no') {
get flight data from the database
display flight information (from, to, operator, date, time)
display Cancel Flight Form
}
else {
get all bookings for that flight from the database
send emails to all customers who've booked the flight
delete the flight from the DB
delete all bookings relating to the flight from the DB
display success message
}
}
else {
error message to say user must be logged in and be a manager
}