private void editReservation() {
        Object[] options = {"Edit Reservation", "Delete Reservation"};
        JTextField phoneNumber = new JTextField();
            JTextField cusID = new JTextField();
            JPanel cusInput = new JPanel(new GridLayout(0,1));
            
            cusInput.add(new JLabel("Customer phone number:"));
            cusInput.add(phoneNumber);
            cusInput.add(new JLabel("Customer ID:"));
            cusInput.add(cusID);
            
        int result = JOptionPane.showOptionDialog(frame, cusInput, 
                "Edit or Delete Reservation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, 
                null, options,options[0]);
        
        //Checks if the input is valid
        if(result == JOptionPane.YES_OPTION || result == JOptionPane.NO_OPTION) {
            if(isIntNumber(cusID.getText()) == true || isIntNumber(phoneNumber.getText()) == true) {
                try {                    
                    Order order = new Order(database, Integer.parseInt(cusID.getText()));
                    Flight flight = new Flight(database, order.getFlight());
                    Customer customer = new Customer(database, order.getCustomer());
                    
                    //Delete Option
                    if(result == JOptionPane.NO_OPTION) {
                        JOptionPane confirmDialog = new JOptionPane();
                        int confirmResult = confirmDialog.showConfirmDialog(gui.returnFrame(),"Are you sure you wish to delete your order?",
                                                            "Confirm your choice.", confirmDialog.OK_CANCEL_OPTION);
                        if(confirmResult == confirmDialog.YES_OPTION) {
                            FlightScanner flightscanner = new FlightScanner();
                            int numberOfSeats = (flightscanner.seatAnalyser(order.getSeat())).size();
                            int bookedSeatsTotal = flight.getBookedSeats() - numberOfSeats;
                            database.execute("UPDATE Flights SET bookedseats = " + bookedSeatsTotal + " WHERE id = " + order.getFlight());
                            customer.delete(database, customer.getKey());
                            order.delete(database, order.getKey());
                        }
                    }
                    //Edit Option
                    if(result == JOptionPane.YES_OPTION) {
                        FlightSeat flightseat = new FlightSeat(gui, database, flightScanner);
                        String thisFlight = flight.getStartDestination()+"-"+flight.getEndDestination();
                        flightseat.chooseSeats(flight.getKey(), flight.getNumberOfSeats(), thisFlight, 1, Integer.parseInt(cusID.getText())); 
                    }
                }
                catch (SQLException ex) {
                    System.out.println("finding order exception : " + ex);
                }
            
            }
            
            else {
                JOptionPane errorDialog = new JOptionPane();
                errorDialog.showMessageDialog(null, "Error! Incorrect input!");
                editReservation();
            }
        }
    }