# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'HomePage.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5 import Qt
import TicketAir
from LoginWidget import Ui_LOGINWidget
from AdminWidget import Ui_ADMINPanel
from SearchFlightWidget import Ui_SEARCHFLIGHTPanel
from SearchPlaneWidget import Ui_SEARCHPLANEPanel
from BuyTicketWidget import Ui_BUYTICKETPanel
import sched, time

class Ui_MainWindow(object):

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1752, 1051)
        MainWindow.setMinimumSize(QtCore.QSize(1000, 700))
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.top_menu = QtWidgets.QFrame(self.centralwidget)
        self.top_menu.setMaximumSize(QtCore.QSize(16777215, 45))
        self.top_menu.setStyleSheet("background-color: rgb(11, 190, 255);")
        self.top_menu.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.top_menu.setFrameShadow(QtWidgets.QFrame.Raised)
        self.top_menu.setObjectName("top_menu")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.top_menu)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.frame_2 = QtWidgets.QFrame(self.top_menu)
        self.frame_2.setMinimumSize(QtCore.QSize(250, 0))
        self.frame_2.setMaximumSize(QtCore.QSize(50, 16777215))
        self.frame_2.setStyleSheet("background-color: rgb(35, 35, 35);")
        self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_2.setObjectName("frame_2")
        self.horizontalLayout_2.addWidget(self.frame_2)
        self.frame_3 = QtWidgets.QFrame(self.top_menu)
        self.frame_3.setStyleSheet("background-color: rgb(255, 255, 127);")
        self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_3.setObjectName("frame_3")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame_3)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.frame_10 = QtWidgets.QFrame(self.frame_3)
        self.frame_10.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_10.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_10.setObjectName("frame_10")
        self.horizontalLayout_3.addWidget(self.frame_10)
        self.frame_9 = QtWidgets.QFrame(self.frame_3)
        self.frame_9.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_9.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_9.setObjectName("frame_9")
        self.horizontalLayout_3.addWidget(self.frame_9)
        self.frame_8 = QtWidgets.QFrame(self.frame_3)
        self.frame_8.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_8.setObjectName("frame_8")
        self.horizontalLayout_3.addWidget(self.frame_8)
        self.frame_12 = QtWidgets.QFrame(self.frame_3)
        self.frame_12.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_12.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_12.setObjectName("frame_12")
        self.horizontalLayout_3.addWidget(self.frame_12)
        self.frame_11 = QtWidgets.QFrame(self.frame_3)
        self.frame_11.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_11.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_11.setObjectName("frame_11")
        self.horizontalLayout_3.addWidget(self.frame_11)
        self.frame_7 = QtWidgets.QFrame(self.frame_3)
        self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_7.setObjectName("frame_7")
        self.horizontalLayout_3.addWidget(self.frame_7)
        self.frame_6 = QtWidgets.QFrame(self.frame_3)
        self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_6.setObjectName("frame_6")
        self.horizontalLayout_3.addWidget(self.frame_6)
        self.frame_14 = QtWidgets.QFrame(self.frame_3)
        self.frame_14.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_14.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_14.setObjectName("frame_14")
        self.horizontalLayout_3.addWidget(self.frame_14)
        self.frame_15 = QtWidgets.QFrame(self.frame_3)
        self.frame_15.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_15.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_15.setObjectName("frame_15")
        self.horizontalLayout_3.addWidget(self.frame_15)
        self.frame_16 = QtWidgets.QFrame(self.frame_3)
        self.frame_16.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_16.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_16.setObjectName("frame_16")
        self.horizontalLayout_3.addWidget(self.frame_16)
        self.frame_17 = QtWidgets.QFrame(self.frame_3)
        self.frame_17.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_17.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_17.setObjectName("frame_17")
        self.horizontalLayout_3.addWidget(self.frame_17)
        self.frame_18 = QtWidgets.QFrame(self.frame_3)
        self.frame_18.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_18.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_18.setObjectName("frame_18")
        self.horizontalLayout_3.addWidget(self.frame_18)
        self.frame_4 = QtWidgets.QFrame(self.frame_3)
        self.frame_4.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.frame_4.setAutoFillBackground(False)
        self.frame_4.setStyleSheet("background-image: url(:/MainPage/img/login_homepage.png);\n"
                                   "background-repeat: no-repeat;")
        self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_4.setObjectName("frame_4")
        self.horizontalLayout_3.addWidget(self.frame_4)
        self.USERNAMELabel = QtWidgets.QLabel(self.frame_3)
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(9)
        self.USERNAMELabel.setFont(font)
        self.USERNAMELabel.setObjectName("USERNAMELabel")
        self.horizontalLayout_3.addWidget(self.USERNAMELabel)
        self.horizontalLayout_2.addWidget(self.frame_3)
        self.verticalLayout.addWidget(self.top_menu)
        self.content = QtWidgets.QFrame(self.centralwidget)
        self.content.setStyleSheet("background-color: rgb(15, 15, 15);")
        self.content.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.content.setFrameShadow(QtWidgets.QFrame.Raised)
        self.content.setObjectName("content")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.content)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.left_menu = QtWidgets.QFrame(self.content)
        self.left_menu.setMinimumSize(QtCore.QSize(250, 0))
        self.left_menu.setMaximumSize(QtCore.QSize(50, 16777215))
        self.left_menu.setStyleSheet("background-color: rgb(35, 35, 35);")
        self.left_menu.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.left_menu.setFrameShadow(QtWidgets.QFrame.Raised)
        self.left_menu.setObjectName("left_menu")
        self.Logo = QtWidgets.QFrame(self.left_menu)
        self.Logo.setGeometry(QtCore.QRect(20, -30, 181, 161))
        self.Logo.setStyleSheet("background-image: url(:/LogoImage/logo.png);\n"
                                "background-repeat: no-repeat;")
        self.Logo.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.Logo.setFrameShadow(QtWidgets.QFrame.Raised)
        self.Logo.setObjectName("Logo")
        self.FINDFLIGHTButton = QtWidgets.QPushButton(self.left_menu)
        self.FINDFLIGHTButton.setGeometry(QtCore.QRect(10, 830, 221, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.FINDFLIGHTButton.setFont(font)
        self.FINDFLIGHTButton.setStyleSheet("QPushButton {\n"
                                            "    \n"
                                            "    \n"
                                            "    background-color: rgb(35, 35, 35);\n"
                                            "    border: 2px solid rgb(8, 148, 255);\n"
                                            "    border-radius: 10px;\n"
                                            "    color: rgb(8, 148, 255);\n"
                                            "}\n"
                                            "\n"
                                            "QPushButton:hover {\n"
                                            "    background-color: rgb(60, 60, 60);\n"
                                            "    border: 2px solid rgb(70,70,70);\n"
                                            "    border-radius: 10px;\n"
                                            "}\n"
                                            "\n"
                                            "QPushButton:pressed {\n"
                                            "    background-color: rgb(8, 148, 255);;\n"
                                            "    border: 2px solid rgb(0,0,0);\n"
                                            "    border-radius: 10px;\n"
                                            "    color: rgb(35, 35, 35);\n"
                                            "}")
        self.FINDFLIGHTButton.setObjectName("FINDFLIGHTButton")
        self.BUYTICKETButton = QtWidgets.QPushButton(self.left_menu)
        self.BUYTICKETButton.setGeometry(QtCore.QRect(20, 360, 201, 51))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.BUYTICKETButton.setFont(font)
        self.BUYTICKETButton.setStyleSheet("QPushButton {\n"
                                           "    \n"
                                           "    \n"
                                           "    background-color: rgb(35, 35, 35);\n"
                                           "    border: 2px solid rgb(255, 255, 127);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(255, 255, 127);\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:hover {\n"
                                           "    background-color: rgb(60, 60, 60);\n"
                                           "    border: 2px solid rgb(70,70,70);\n"
                                           "    border-radius: 10px;\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:pressed {\n"
                                           "    background-color: rgb(255, 255, 127);\n"
                                           "    border: 2px solid rgb(0,0,0);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(35, 35, 35);\n"
                                           "}")
        self.BUYTICKETButton.setObjectName("BUYTICKETButton")
        self.FINDPLANEButton = QtWidgets.QPushButton(self.left_menu)
        self.FINDPLANEButton.setGeometry(QtCore.QRect(20, 590, 211, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.FINDPLANEButton.setFont(font)
        self.FINDPLANEButton.setStyleSheet("QPushButton {\n"
                                           "    \n"
                                           "    background-color: rgb(35, 35, 35);\n"
                                           "    border: 2px solid rgb(20, 255, 94);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(20, 255, 94);\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:hover {\n"
                                           "    background-color: rgb(60, 60, 60);\n"
                                           "    border: 2px solid rgb(70,70,70);\n"
                                           "    border-radius: 10px;\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:pressed {\n"
                                           "    background-color: rgb(20, 255, 94);\n"
                                           "    border: 2px solid rgb(0,0,0);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(35, 35, 35);\n"
                                           "}")
        self.FINDPLANEButton.setObjectName("FINDPLANEButton")
        self.ENTERFLIGHTCODELabel = QtWidgets.QLineEdit(self.left_menu)
        self.ENTERFLIGHTCODELabel.setGeometry(QtCore.QRect(9, 780, 221, 51))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.ENTERFLIGHTCODELabel.setFont(font)
        self.ENTERFLIGHTCODELabel.setStyleSheet("QLineEdit {\n"
                                                "    border: 2px solid rgb(45,45,45);\n"
                                                "    border-radius: 5px;    \n"
                                                "    padding: 15 px;\n"
                                                "    background-color: rgb(30,30,30);\n"
                                                "    color: rgb(255, 255, 255);\n"
                                                "}\n"
                                                "\n"
                                                "QLineEdit:hover {\n"
                                                "    border: 2px solid rgb(55,55,55);\n"
                                                "}\n"
                                                "\n"
                                                "QLineEdit:focus {\n"
                                                "    border: 2px solid  rgb(255, 255, 255);\n"
                                                "    color: rgb(200,200,200)\n"
                                                "}")
        self.ENTERFLIGHTCODELabel.setText("")
        self.ENTERFLIGHTCODELabel.setMaxLength(100)
        self.ENTERFLIGHTCODELabel.setObjectName("ENTERFLIGHTCODELabel")
        self.ENTERPLANECODELabel = QtWidgets.QLineEdit(self.left_menu)
        self.ENTERPLANECODELabel.setGeometry(QtCore.QRect(19, 540, 211, 51))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.ENTERPLANECODELabel.setFont(font)
        self.ENTERPLANECODELabel.setStyleSheet("QLineEdit {\n"
                                               "    border: 2px solid rgb(45,45,45);\n"
                                               "    border-radius: 5px;    \n"
                                               "    padding: 15 px;\n"
                                               "    background-color: rgb(30,30,30);\n"
                                               "    color: rgb(255, 255, 255);\n"
                                               "}\n"
                                               "\n"
                                               "QLineEdit:hover {\n"
                                               "    border: 2px solid rgb(55,55,55);\n"
                                               "}\n"
                                               "\n"
                                               "QLineEdit:focus {\n"
                                               "    border: 2px solid  rgb(255, 255, 255);\n"
                                               "    color: rgb(200,200,200)\n"
                                               "}")
        self.ENTERPLANECODELabel.setText("")
        self.ENTERPLANECODELabel.setMaxLength(100)
        self.ENTERPLANECODELabel.setObjectName("ENTERPLANECODELabel")
        self.PlaneIcon = QtWidgets.QFrame(self.left_menu)
        self.PlaneIcon.setGeometry(QtCore.QRect(80, 490, 101, 41))
        self.PlaneIcon.setStyleSheet("background-image: url(:/LogoImage/img/resize_plane.png);")
        self.PlaneIcon.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.PlaneIcon.setFrameShadow(QtWidgets.QFrame.Raised)
        self.PlaneIcon.setObjectName("PlaneIcon")
        self.TimetableIcon = QtWidgets.QFrame(self.left_menu)
        self.TimetableIcon.setGeometry(QtCore.QRect(80, 670, 101, 111))
        self.TimetableIcon.setStyleSheet("background-image: url(:/LogoImage/img/resize_timetable.png);\n"
                                         "background-repeat: no-repeat;")
        self.TimetableIcon.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.TimetableIcon.setFrameShadow(QtWidgets.QFrame.Raised)
        self.TimetableIcon.setObjectName("TimetableIcon")
        self.TicketIcon = QtWidgets.QFrame(self.left_menu)
        self.TicketIcon.setGeometry(QtCore.QRect(80, 250, 101, 101))
        self.TicketIcon.setStyleSheet("background-image: url(:/LogoImage/img/resize_ticket.png);")
        self.TicketIcon.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.TicketIcon.setFrameShadow(QtWidgets.QFrame.Raised)
        self.TicketIcon.setObjectName("TicketIcon")
        self.AMINPANELButton = QtWidgets.QPushButton(self.left_menu)
        self.AMINPANELButton.setGeometry(QtCore.QRect(20, 910, 221, 41))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.AMINPANELButton.setFont(font)
        self.AMINPANELButton.setStyleSheet("QPushButton {\n"
                                           "    \n"
                                           "    background-color: rgb(35, 35, 35);\n"
                                           "    border: 2px solid rgb(36, 2, 122);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(255, 255, 255);\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:hover {\n"
                                           "    background-color: rgb(60, 60, 60);\n"
                                           "    border: 2px solid rgb(70,70,70);\n"
                                           "    border-radius: 10px;\n"
                                           "}\n"
                                           "\n"
                                           "QPushButton:pressed {\n"
                                           "    background-color: rgb(36, 2, 122);\n"
                                           "    border: 2px solid rgb(0,0,0);\n"
                                           "    border-radius: 10px;\n"
                                           "    color: rgb(255, 255, 255);\n"
                                           "}")
        self.AMINPANELButton.setObjectName("AMINPANELButton")
        self.horizontalLayout.addWidget(self.left_menu)
        self.content_right = QtWidgets.QFrame(self.content)
        self.content_right.setStyleSheet("background-color: rgb(60, 60, 60);fr")
        self.content_right.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.content_right.setFrameShadow(QtWidgets.QFrame.Raised)
        self.content_right.setObjectName("content_right")
        self.LOGINButton = QtWidgets.QPushButton(self.content_right)
        self.LOGINButton.setGeometry(QtCore.QRect(1400, 20, 81, 31))
        self.LOGINButton.setStyleSheet("QPushButton {\n"
                                       "    background-color: rgb(255, 255, 127);\n"
                                       "    border: 2px solid rgb(60,60,60);\n"
                                       "    border-radius: 5px;\n"
                                       "}\n"
                                       "\n"
                                       "QPushButton:hover {\n"
                                       "    background-color: rgb(60, 60, 60);\n"
                                       "    border: 2px solid rgb(70,70,70);\n"
                                       "    border-radius: 5px;\n"
                                       "}\n"
                                       "\n"
                                       "QPushButton:pressed {\n"
                                       "    background-color: rgb(255, 255, 127);\n"
                                       "    border: 2px solid rgb(0,0,0);\n"
                                       "    border-radius: 5px;\n"
                                       "    \n"
                                       "    color: rgb(35, 35, 35);\n"
                                       "}")
        self.LOGINButton.setObjectName("LOGINButton")
        self.SEARCHFLIGHTButton = QtWidgets.QPushButton(self.content_right)
        self.SEARCHFLIGHTButton.setGeometry(QtCore.QRect(1260, 440, 191, 51))
        font = QtGui.QFont()
        font.setPointSize(10)
        self.SEARCHFLIGHTButton.setFont(font)
        self.SEARCHFLIGHTButton.setStyleSheet("QPushButton {\n"
                                              "    background-color: rgb(255, 255, 127);\n"
                                              "    border: 2px solid rgb(60,60,60);\n"
                                              "    border-radius: 10px;\n"
                                              "}\n"
                                              "\n"
                                              "QPushButton:hover {\n"
                                              "    background-color: rgb(60, 60, 60);\n"
                                              "    border: 2px solid rgb(70,70,70);\n"
                                              "    border-radius: 10px;\n"
                                              "}\n"
                                              "\n"
                                              "QPushButton:pressed {\n"
                                              "    background-color: rgb(255, 255, 127);\n"
                                              "    border: 2px solid rgb(0,0,0);\n"
                                              "    border-radius: 10px;\n"
                                              "    \n"
                                              "    color: rgb(35, 35, 35);\n"
                                              "}")
        self.SEARCHFLIGHTButton.setObjectName("SEARCHFLIGHTButton")
        self.FROMComboBox = QtWidgets.QComboBox(self.content_right)
        self.FROMComboBox.setGeometry(QtCore.QRect(310, 450, 371, 41))
        self.FROMComboBox.setStyleSheet("background-color: rgb(255, 255, 255);\n"
                                        "border-radius: 10px;")
        self.FROMComboBox.setObjectName("FROMComboBox")
        self.TOComboBox = QtWidgets.QComboBox(self.content_right)
        self.TOComboBox.setGeometry(QtCore.QRect(790, 450, 371, 41))
        self.TOComboBox.setStyleSheet("background-color: rgb(255, 255, 255);\n"
                                      "border-radius: 10px;")
        self.TOComboBox.setObjectName("TOComboBox")
        self.label = QtWidgets.QLabel(self.content_right)
        self.label.setGeometry(QtCore.QRect(310, 430, 61, 16))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.label.setFont(font)
        self.label.setStyleSheet("color: rgb(255, 255, 255);")
        self.label.setObjectName("label")
        self.label_2 = QtWidgets.QLabel(self.content_right)
        self.label_2.setGeometry(QtCore.QRect(800, 430, 61, 16))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.label_2.setFont(font)
        self.label_2.setStyleSheet("color: rgb(255, 255, 255);")
        self.label_2.setObjectName("label_2")
        self.NOTFOUNDEDFrame = QtWidgets.QFrame(self.content_right)
        self.NOTFOUNDEDFrame.setGeometry(QtCore.QRect(700, 550, 450, 31))
        self.NOTFOUNDEDFrame.setMaximumSize(QtCore.QSize(450, 16777215))
        self.NOTFOUNDEDFrame.setStyleSheet("background-color: rgb(170, 255, 127);\n"
                                           "border-radius: 5px;")
        self.NOTFOUNDEDFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.NOTFOUNDEDFrame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.NOTFOUNDEDFrame.setObjectName("NOTFOUNDEDFrame")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.NOTFOUNDEDFrame)
        self.horizontalLayout_4.setContentsMargins(3, 3, 3, 3)
        self.horizontalLayout_4.setSpacing(3)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.NOTFOUNDEDLabel = QtWidgets.QLabel(self.NOTFOUNDEDFrame)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.NOTFOUNDEDLabel.setFont(font)
        self.NOTFOUNDEDLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.NOTFOUNDEDLabel.setObjectName("NOTFOUNDEDLabel")
        self.horizontalLayout_4.addWidget(self.NOTFOUNDEDLabel)
        self.NOTFOUNDEDButton = QtWidgets.QPushButton(self.NOTFOUNDEDFrame)
        self.NOTFOUNDEDButton.setMaximumSize(QtCore.QSize(20, 20))
        self.NOTFOUNDEDButton.setStyleSheet("QPushButton {\n"
                                            "    border-raadius: 5px;\n"
                                            "    background-position: centre;\n"
                                            "    border: 2px solid;\n"
                                            "}\n"
                                            "\n"
                                            "QPushButton:hover {\n"
                                            "    background-color: rgb(50, 50, 50);\n"
                                            "    color: rgb(255, 234, 70);\n"
                                            "}\n"
                                            "\n"
                                            "QPushButton:pressed {\n"
                                            "    background-color: rgb(35, 35, 35);\n"
                                            "    color: rgb(255, 234, 70);\n"
                                            "}")
        self.NOTFOUNDEDButton.setObjectName("NOTFOUNDEDButton")
        self.horizontalLayout_4.addWidget(self.NOTFOUNDEDButton)
        self.label_5 = QtWidgets.QLabel(self.content_right)
        self.label_5.setGeometry(QtCore.QRect(90, 600, 300, 71))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(18)
        font.setBold(True)
        font.setItalic(False)
        font.setWeight(75)
        self.label_5.setFont(font)
        self.label_5.setStyleSheet("color: rgb(255, 255, 255);")
        self.label_5.setObjectName("label_5")
        self.frame_13 = QtWidgets.QFrame(self.content_right)
        self.frame_13.setGeometry(QtCore.QRect(1320, 240, 120, 80))
        self.frame_13.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_13.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_13.setObjectName("frame_13")
        self.frame_19 = QtWidgets.QFrame(self.content_right)
        self.frame_19.setGeometry(QtCore.QRect(490, 50, 661, 321))
        self.frame_19.setStyleSheet("background-image: url(:/LogoImage/img/mapsearch.png);")
        self.frame_19.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame_19.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame_19.setObjectName("frame_19")
        self.Plane1 = QtWidgets.QFrame(self.content_right)
        self.Plane1.setGeometry(QtCore.QRect(220, 700, 341, 191))
        self.Plane1.setStyleSheet("background-image: url(:/LogoImage/img/plane4.jpg);")
        self.Plane1.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.Plane1.setFrameShadow(QtWidgets.QFrame.Raised)
        self.Plane1.setObjectName("Plane1")
        self.Plane2 = QtWidgets.QFrame(self.content_right)
        self.Plane2.setGeometry(QtCore.QRect(660, 700, 351, 191))
        self.Plane2.setStyleSheet("background-image: url(:/LogoImage/img/plane2.jpg);")
        self.Plane2.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.Plane2.setFrameShadow(QtWidgets.QFrame.Raised)
        self.Plane2.setObjectName("Plane2")
        self.Plane3 = QtWidgets.QFrame(self.content_right)
        self.Plane3.setGeometry(QtCore.QRect(1080, 700, 351, 191))
        self.Plane3.setStyleSheet("background-image: url(:/LogoImage/img/plane3.jpg);")
        self.Plane3.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.Plane3.setFrameShadow(QtWidgets.QFrame.Raised)
        self.Plane3.setObjectName("Plane3")
        self.FROMLabel1 = QtWidgets.QLabel(self.content_right)
        self.FROMLabel1.setGeometry(QtCore.QRect(210, 910, 140, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.FROMLabel1.setFont(font)
        self.FROMLabel1.setStyleSheet("color: rgb(255, 255, 255);")
        self.FROMLabel1.setObjectName("FROMLabel1")
        self.TOLabel1 = QtWidgets.QLabel(self.content_right)
        self.TOLabel1.setGeometry(QtCore.QRect(350, 910, 140, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.TOLabel1.setFont(font)
        self.TOLabel1.setStyleSheet("color: rgb(255, 255, 255);")
        self.TOLabel1.setObjectName("TOLabel1")
        self.label_7 = QtWidgets.QLabel(self.content_right)
        self.label_7.setGeometry(QtCore.QRect(320, 910, 16, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.label_7.setFont(font)
        self.label_7.setStyleSheet("color: rgb(255, 255, 255);")
        self.label_7.setObjectName("label_7")
        self.TOLabel2 = QtWidgets.QLabel(self.content_right)
        self.TOLabel2.setGeometry(QtCore.QRect(800, 910, 140, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.TOLabel2.setFont(font)
        self.TOLabel2.setStyleSheet("color: rgb(255, 255, 255);")
        self.TOLabel2.setObjectName("TOLabel2")
        self.FROMLabel2 = QtWidgets.QLabel(self.content_right)
        self.FROMLabel2.setGeometry(QtCore.QRect(650, 910, 140, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.FROMLabel2.setFont(font)
        self.FROMLabel2.setStyleSheet("color: rgb(255, 255, 255);")
        self.FROMLabel2.setObjectName("FROMLabel2")
        self.label_10 = QtWidgets.QLabel(self.content_right)
        self.label_10.setGeometry(QtCore.QRect(780, 910, 16, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.label_10.setFont(font)
        self.label_10.setStyleSheet("color: rgb(255, 255, 255);")
        self.label_10.setObjectName("label_10")
        self.FROMLabel3 = QtWidgets.QLabel(self.content_right)
        self.FROMLabel3.setGeometry(QtCore.QRect(1080, 910, 140, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.FROMLabel3.setFont(font)
        self.FROMLabel3.setStyleSheet("color: rgb(255, 255, 255);")
        self.FROMLabel3.setObjectName("FROMLabel3")
        self.TOLabel3 = QtWidgets.QLabel(self.content_right)
        self.TOLabel3.setGeometry(QtCore.QRect(1240, 910, 130, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.TOLabel3.setFont(font)
        self.TOLabel3.setStyleSheet("color: rgb(255, 255, 255);")
        self.TOLabel3.setObjectName("TOLabel3")
        self.label_13 = QtWidgets.QLabel(self.content_right)
        self.label_13.setGeometry(QtCore.QRect(1210, 910, 16, 31))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(14)
        self.label_13.setFont(font)
        self.label_13.setStyleSheet("color: rgb(255, 255, 255);")
        self.label_13.setObjectName("label_13")
        self.PRICELabel1 = QtWidgets.QLabel(self.content_right)
        self.PRICELabel1.setGeometry(QtCore.QRect(490, 895, 50, 61))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(13)
        font.setBold(True)
        font.setWeight(75)
        self.PRICELabel1.setFont(font)
        self.PRICELabel1.setStyleSheet("color: rgb(255, 74, 74);")
        self.PRICELabel1.setObjectName("PRICELabel1")
        self.PRICELabel2 = QtWidgets.QLabel(self.content_right)
        self.PRICELabel2.setGeometry(QtCore.QRect(940, 895, 50, 61))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(13)
        font.setBold(True)
        font.setWeight(75)
        self.PRICELabel2.setFont(font)
        self.PRICELabel2.setStyleSheet("color: rgb(255, 74, 74);")
        self.PRICELabel2.setObjectName("PRICELabel2")
        self.CURRENCYLabel1 = QtWidgets.QLabel(self.content_right)
        self.CURRENCYLabel1.setGeometry(QtCore.QRect(550, 895, 51, 61))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.CURRENCYLabel1.setFont(font)
        self.CURRENCYLabel1.setStyleSheet("color: rgb(255, 74, 74);")
        self.CURRENCYLabel1.setObjectName("CURRENCYLabel1")
        self.CURRENCYLabel2 = QtWidgets.QLabel(self.content_right)
        self.CURRENCYLabel2.setGeometry(QtCore.QRect(1000, 905, 41, 41))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.CURRENCYLabel2.setFont(font)
        self.CURRENCYLabel2.setStyleSheet("color: rgb(255, 74, 74);")
        self.CURRENCYLabel2.setObjectName("CURRENCYLabel2")
        self.CURRENCYLabel3 = QtWidgets.QLabel(self.content_right)
        self.CURRENCYLabel3.setGeometry(QtCore.QRect(1450, 905, 41, 41))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(12)
        font.setBold(True)
        font.setWeight(75)
        self.CURRENCYLabel3.setFont(font)
        self.CURRENCYLabel3.setStyleSheet("color: rgb(255, 74, 74);")
        self.CURRENCYLabel3.setObjectName("CURRENCYLabel3")
        self.PRICELabel3 = QtWidgets.QLabel(self.content_right)
        self.PRICELabel3.setGeometry(QtCore.QRect(1390, 895, 50, 61))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(13)
        font.setBold(True)
        font.setWeight(75)
        self.PRICELabel3.setFont(font)
        self.PRICELabel3.setStyleSheet("color: rgb(255, 74, 74);")
        self.PRICELabel3.setObjectName("PRICELabel3")
        self.frame = QtWidgets.QFrame(self.content_right)
        self.frame.setGeometry(QtCore.QRect(100, 320, 120, 80))
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.horizontalLayout.addWidget(self.content_right)
        self.verticalLayout.addWidget(self.content)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1752, 18))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

        self.FROMComboBox.activated.connect(self.setDestinations)
        self.LOGINButton.clicked.connect(self.showLoginWidget)
        self.AMINPANELButton.clicked.connect(self.showAdminPanel)
        self.FINDPLANEButton.clicked.connect(self.showPlanePanel)
        self.FINDFLIGHTButton.clicked.connect(self.showFlightPanel)
        self.SEARCHFLIGHTButton.clicked.connect(self.showFlightPanelfromBox)
        self.NOTFOUNDEDButton.clicked.connect(self.closePopup)
        self.BUYTICKETButton.clicked.connect(self.showBuyTicket)
        self.NOTFOUNDEDFrame.hide()
        self.AMINPANELButton.hide()

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.USERNAMELabel.setText(_translate("MainWindow", "USERNAME"))
        self.FINDFLIGHTButton.setText(_translate("MainWindow", "FIND FLIGHT"))
        self.BUYTICKETButton.setText(_translate("MainWindow", "BUY TICKET"))
        self.FINDPLANEButton.setText(_translate("MainWindow", "FIND PLANE"))
        self.ENTERFLIGHTCODELabel.setPlaceholderText(_translate("MainWindow", "ENTER FLIGHT CODE"))
        self.ENTERPLANECODELabel.setPlaceholderText(_translate("MainWindow", "ENTER PLANE CODE"))
        self.AMINPANELButton.setText(_translate("MainWindow", "ADMIN PANEL"))
        self.LOGINButton.setText(_translate("MainWindow", "LOGIN "))
        self.SEARCHFLIGHTButton.setText(_translate("MainWindow", "SEARCH FLIGHTS"))
        self.label.setText(_translate("MainWindow", "FROM"))
        self.label_2.setText(_translate("MainWindow", "TO"))
        self.NOTFOUNDEDLabel.setText(_translate("MainWindow", "YOUR FLIGHT WAS NOT FOUND. "))
        self.NOTFOUNDEDButton.setText(_translate("MainWindow", "X"))
        self.label_5.setText(_translate("MainWindow", "OUR RECOMMENDATION"))
        self.FROMLabel1.setText(_translate("MainWindow", "CRACOW"))
        self.TOLabel1.setText(_translate("MainWindow", "MOSCOW"))
        self.label_7.setText(_translate("MainWindow", "-"))
        self.TOLabel2.setText(_translate("MainWindow", "WARSAW"))
        self.FROMLabel2.setText(_translate("MainWindow", "BARCELONA"))
        self.label_10.setText(_translate("MainWindow", "-"))
        self.FROMLabel3.setText(_translate("MainWindow", "LIZBONA"))
        self.TOLabel3.setText(_translate("MainWindow", "BERLIN"))
        self.label_13.setText(_translate("MainWindow", "-"))
        self.PRICELabel1.setText(_translate("MainWindow", "99 "))
        self.PRICELabel2.setText(_translate("MainWindow", "79 "))
        self.CURRENCYLabel1.setText(_translate("MainWindow", "€"))
        self.CURRENCYLabel2.setText(_translate("MainWindow", "€"))
        self.CURRENCYLabel3.setText(_translate("MainWindow", "€"))
        self.PRICELabel3.setText(_translate("MainWindow", "59 "))

    def setDestinations(self):
        if self.FROMComboBox.currentIndex() != 0:
            self.TOComboBox.enabled = True
            db = TicketAir.DataBase()
            self.TOComboBox.clear()
            self.TOComboBox.insertItem(1, '')
            destinations = db.getDestinations(str(self.FROMComboBox.currentText()))
            i = 2
            try:
                for destination in destinations:
                    self.TOComboBox.insertItem(i, destination)
                    i += 1
            except:
                pass
        else:
            self.TOComboBox.enabled = False
            self.TOComboBox.clear()

    def setOrigins(self):
        db = TicketAir.DataBase()
        self.FROMComboBox.clear()
        self.TOComboBox.clear()
        self.FROMComboBox.insertItem(1, '')
        origins = db.getOrigins(str(self.TOComboBox.currentText()))
        i = 2
        try:
            for origin in origins:
                self.FROMComboBox.insertItem(i, origin)
                i += 1
        except:
            pass

    def showLoginWidget(self):
        if self.currentUser is None:
            self.LOGINWidget = QtWidgets.QWidget()
            self.ui = Ui_LOGINWidget(self)
            self.ui.setupUi(self.LOGINWidget)
            self.LOGINWidget.show()
        else:
            self.currentUser = None
            self.LOGINButton.setText('LOGIN')
            self.USERNAMELabel.setText('USERNAME')
            self.AMINPANELButton.hide()


    def showAdminPanel(self):
        self.ADMINPanel = QtWidgets.QWidget()
        self.ui = Ui_ADMINPanel(self)
        self.ui.setupUi(self.ADMINPanel)
        self.ADMINPanel.show()

    def showPlanePanel(self):
        try:
            self.db = TicketAir.DataBase()
            plane = self.db.getPlane(str(self.ENTERPLANECODELabel.text()))
            self.SEARCHPLANEPanel = QtWidgets.QWidget()
            self.ui = Ui_SEARCHPLANEPanel()
            self.ui.setupUi(self.SEARCHPLANEPanel)
            self.SEARCHPLANEPanel.show()
            self.ui.setPlane(plane)
            self.ENTERPLANECODELabel.setText('')
        except:
            self.NOTFOUNDEDFrame.show()
            self.NOTFOUNDEDLabel.setText('There is no plane with that tail number.')

    def showFlightPanel(self):
        try:
            self.db = TicketAir.DataBase()
            flight = self.db.getFlight(str(self.ENTERFLIGHTCODELabel.text()))
            if flight != None:
                self.SEARCHFLIGHTPanel = QtWidgets.QWidget()
                self.ui = Ui_SEARCHFLIGHTPanel()
                self.ui.setupUi(self.SEARCHFLIGHTPanel)
                self.SEARCHFLIGHTPanel.show()
                self.ui.setFlight(flight)
                self.ENTERFLIGHTCODELabel.setText('')
            else:
                self.NOTFOUNDEDFrame.show()
                self.NOTFOUNDEDLabel.setText('There is no flight with that number.')
        except:
            self.NOTFOUNDEDFrame.show()
            self.NOTFOUNDEDLabel.setText('There is no flight with that number.')

    def showFlightPanelfromBox(self):
        try:
            self.db = TicketAir.DataBase()
            flight = self.db.getFlightfromBox(str(self.FROMComboBox.currentText()), str(self.TOComboBox.currentText()))
            self.SEARCHFLIGHTPanel = QtWidgets.QWidget()
            self.ui = Ui_SEARCHFLIGHTPanel()
            self.ui.setupUi(self.SEARCHFLIGHTPanel)
            self.SEARCHFLIGHTPanel.show()
            self.ui.setFlight(flight)
        except:
            self.NOTFOUNDEDFrame.show()
            self.NOTFOUNDEDLabel.setText('There is no flight with that destination.')

    def closePopup(self):
        self.NOTFOUNDEDFrame.hide()

    def setUser(self, user):
        self.currentUser = user
        self.USERNAMELabel.setText(user.name)
        if type(self.currentUser) == TicketAir.Admin:
            self.AMINPANELButton.show()
        else:
            self.AMINPANELButton.hide()
        if self.currentUser != None:
            self.LOGINButton.setText('LOGOUT')

    def showBuyTicket(self):
        if self.currentUser != None:
            self.BUYTICKETPanel = QtWidgets.QWidget()
            self.ui = Ui_BUYTICKETPanel(nick=self.currentUser.login, flight='')
            self.ui.setupUi(self.BUYTICKETPanel)
            self.BUYTICKETPanel.show()
        else:
            self.NOTFOUNDEDFrame.show()
            self.NOTFOUNDEDLabel.setText('You must be logged in to buy ticket.')

    def __init__(self):
        self.currentUser = None

    def callThisFunctionEvery15Secs(self):
        import threading
        threading.Timer(15.0, self.callThisFunctionEvery15Secs).start()
        db = TicketAir.DataBase()
        flights = db.get3RandomFlights()
        self.TOLabel1.setText(str(flights[0].destination))
        self.TOLabel2.setText(str(flights[1].destination))
        self.TOLabel3.setText(str(flights[2].destination))
        self.FROMLabel1.setText(str(flights[0].origin))
        self.FROMLabel2.setText(str(flights[1].origin))
        self.FROMLabel3.setText(str(flights[2].origin))
        self.PRICELabel1.setText(str(flights[0].price))
        self.PRICELabel2.setText(str(flights[1].price))
        self.PRICELabel3.setText(str(flights[2].price))

import file

if __name__ == "__main__":
    import sys

    app = QtWidgets.QApplication(sys.argv)
    MainWindow = QtWidgets.QMainWindow()
    ui = Ui_MainWindow()
    ui.setupUi(MainWindow)
    ui.setOrigins()
    #ui.callThisFunctionEvery15Secs()
    MainWindow.show()
    sys.exit(app.exec_())
