from .flightDB import flightDB


def tableWidgetDispalyRead(fdb:flightDB,date):
    if date == "1":
        tableWidgetDispalydata1 = fdb.queryTabel("display", "A", "ID = '1'")[0][0] if len(
            fdb.queryTabel("display", "A", "ID = '1'")) != 0 else {}
    if date == "2":
        tableWidgetDispalydata1 = fdb.queryTabel("display", "A", "ID = '2'")[0][0] if len(
            fdb.queryTabel("display", "A", "ID = '2'")) != 0 else {}
    if date == "3":
        tableWidgetDispalydata1 = fdb.queryTabel("display", "A", "ID = '3'")[0][0] if len(
            fdb.queryTabel("display", "A", "ID = '3'")) != 0 else {}
    if "\'" in tableWidgetDispalydata1:
        tableWidgetDispalydata1 = tableWidgetDispalydata1.replace("\'", '"')
        tableWidgetDispalydata1 = tableWidgetDispalydata1.replace("'", '"')
        tableWidgetDispalydata1 = eval(tableWidgetDispalydata1)
    return tableWidgetDispalydata1