package UI;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import javax.sql.DataSource;
import org.postgresql.ds.PGSimpleDataSource;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import RDG.*;

/**
 *
 * @author Marcel
 */
public class Menu {
    /**
    * Print Main Menu
    * @throws SQLException
    * @throws Exception
    * @throws IOException
    */
    public static void MainMenu() throws IOException, SQLException, Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        while(true){
            System.out.println("Vitajte. Možnosti:");
            System.out.println("1 - Lety");
            System.out.println("2 - Modely lietadiel");
            System.out.println("3 - Cenové tarify");
            System.out.println("4 - Letiská");
            System.out.println("5 - Hľadanie letu s prestupmi");
            System.out.println("6 - Nákup letenky");
            System.out.println("7 - Výber miesta pre letenku");
            System.out.println("8 - Zrušenie letenky");
            System.out.println("9 - Zmena lietadla");
            System.out.println("10 - Podiel na trhu");
            System.out.println("11 - Prepravení cestujúci");
            System.out.println("12 - return");
            String odpoved = input.readLine();
            
            try{
                switch(odpoved){
                    case "1" -> FlightsMenu.FlightsMenu();
                    case "2" -> AircraftMenu.AircraftsMenu();
                    case "3" -> FlightCostsMenu.FlightCostsMenu();
                    case "4" -> AirportsMenu.AirportsMenu();
                    case "5" -> FlightsFinderMenu.Menu();
                    case "6" -> BuyTicket.Menu();
                    case "7" -> SeatChoose.Menu();
                    case "8" -> TicketCancel.Menu();
                    case "9" -> AircraftChange.Menu();
                    case "10" -> FractionOfMarket.Menu();
                    case "11" -> TrasportedPeople.Menu();
                    case "12" -> { return; }
                    default -> System.out.println("Skús ešte raz");
                }
            }catch(Exception e){
                System.out.println(e);
            }
        }
    }   
}
