Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ben #45

Merged
merged 2 commits into from
Dec 20, 2023
Merged

Ben #45

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions backend/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,24 @@ def get_all_reservations():
if connection:
try:
cursor = connection.cursor(dictionary=True)
cursor.execute("""
SELECT Reservations.ReservationID, Users.Username, Reservations.StartTime, Reservations.EndTime, Reservations.Seat, Reservations.TableFee, Reservations.ResDate
FROM Reservations
JOIN Users ON Reservations.UserID = Users.UserID
""")
query = """
SELECT Reservations.ReservationID, Users.Username, Reservations.StartTime, Reservations.EndTime, Reservations.Seat, Reservations.TableFee, Reservations.ResDate
FROM Reservations
JOIN Users ON Reservations.UserID = Users.UserID
UNION
SELECT Completed_Reservations.ReservationID, Users.Username, Completed_Reservations.StartTime, Completed_Reservations.EndTime, Completed_Reservations.Seat, Completed_Reservations.TableFee, Completed_Reservations.ResDate
FROM Completed_Reservations
JOIN Users ON Completed_Reservations.UserID = Users.UserID
"""
cursor.execute(query)
results = cursor.fetchall()
cursor.close()
connection.close()
return results
except mysql.connector.Error as err:
print(f"Error Fetching Reservations: {err}")


def perform_warehouse_process():
operational_connection = get_db_connection(db_config)
warehouse_connection = get_db_connection(warehouse_db_config)
Expand Down
Loading