Commit dbcce2f6 authored by Arhan Banerjee's avatar Arhan Banerjee
Browse files

Added initial client app

parent d5bd552a
import mysql.connector as mysql
db = mysql.connect(
host = "marmoset04.shoshin.uwaterloo.ca",
user = "",
passwd = ""
)
cursor = db.cursor()
cursor.execute("USE db356_a39baner;")
'''
cursor.execute("show tables;")
tables = cursor.fetchall()
print(tables)
'''
command = ""
user_role = 0
print('''
***************************
_____
/\ / ____| /\
/ \ | | / \
/ /\ \| | / /\ \
/ ____ | |____ / ____ \
/_/ \_\_____/_/ \_\
***************************
''')
print("Welcome to ACA, the number one stop for all your culinary needs! \nDiscover recipes, reviews, and how-tos from users all around the world right here!")
while(True):
user_role = int(input("\nHow do you want to access the application? (Press 1 for Guest, 2 for Member): "))
if(user_role == 1):
print("\nSigned in as Guest")
break
elif (user_role == 2):
print("\nSigned in as Member")
break
else:
print("\nError logging in. Please select a valid role.")
print("Type in 'help' to get list of commands and user role descriptions")
while (command != "quit"):
command = input("\nEnter a command: ")
if (command == "help"):
print("\nUser Roles: \n\nGuest: Only able to view/select items from database.")
print("Member: Able to view, add, delete, and edit items from database\n")
print("Commands: \n")
print("quit: Terminates the application")
print("edit: Members can add and delete entries from database")
elif (command == "edit"):
if(user_role == 1):
print("\nError: Guest users do not have the permission to edit. Please quit and sign in as a Member to edit.")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment