Cancel A Reservation

Function Number: 3

Function Name: Cancel A Reservation

Link to Function Implementation

Function Type: Update and Delete

Description: This function accepts a Booking ID and will update associated records (reservation, assign_activities, assign_staff) to show that the booking was cancelled. Lodging assignments associated with the booking will be deleted.

Primary Users: Resort staff responsible for creating or managing reservations

Tables Affected: reservation, assign_activities, assign_staff, assign_lodging

Sample Input: Enter Booking ID = 1

Sample Output:
Reservation table updated.
Activities table updated.
Staff table updated.
Lodging assignments cancelled.

Notes: This function consists of five queries, updates to three tables (reservation, assign_activities, assign_staff) in order to set status column to 'cancelled' and a deletion on one table (assign_lodging). This function implements error checking using the mysqli_num_rows() function to check the number of rows returned by querying the Booking ID. If no rows are returned, the Booking ID does not exist in the database and the user is informed of this.

Main Menu