} else {
                        returnSpecialHoursToUser($db, $bookingUserID, $hrsSourceList[$i], 0.5);
                    }
                }
                http_response_code(200);
                //success
            } else {
                //otherwise they are admin or deleting a faculty booking
                deleteBooking($db, $bookingID);
                //check if admin is deleting a different user's booking
                if ($bookingUserID != $_SESSION["netID"]) {
                    $to = $bookingUserID . "@queensu.ca";
                    cancelBooking($room, $building, $startDate, $start, $end, $reason, $desc, $numP, $db, $to, true);
                } else {
                    $to = userEmail();
                    cancelBooking($room, $building, $startDate, $start, $end, $reason, $desc, $numP, $db, $to, false);
                }
            }
            http_response_code(200);
            //sucess
        }
    }
}
//Close the connection
$db = NULL;
//retrieve the hrsSource for each 30 minute block of a booking
//return an array with the hours to return
function retrieveHrsSource($db, $bookingID)
{
    global $hrsSourceList;
    $sth = $db->prepare("SELECT hrsSource FROM BookingSlots where bookingID = ?");
Exemple #2
0
}
if ($action == 'get_all_flights') {
    getAdminAllFlights();
}
if ($action == 'delete_flight') {
    deleteFlight($_GET['flight_id']);
}
if ($action == 'edit_flight') {
    editFlight($_GET['flight_id'], $_GET['flight_no'], $_GET['flight_from'], $_GET['flight_to'], $_GET['departure_time'], $_GET['arrival_time'], $_GET['price'], $_GET['economy_seats'], $_GET['business_seats']);
}
if ($action == 'create_flight') {
    createFlight($_GET['flight_no'], $_GET['flight_from'], $_GET['flight_to'], $_GET['departure_time'], $_GET['arrival_time'], $_GET['price'], $_GET['economy_seats'], $_GET['business_seats']);
}
if ($action == 'get_passengers') {
    getPassengers($_GET['flight_id']);
}
if ($action == 'cancel_booking') {
    cancelBooking($_GET['booking_id']);
}
if ($action == 'get_airports') {
    getAirports();
}
if ($action == 'generate_flights') {
    generateFlights();
}
if ($action == 'send_sms') {
    sendSMS($_GET['flight_id']);
}
if ($action == "generatePassengers") {
    generatePassengers(100);
}