-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMuseumProgram.py
More file actions
55 lines (39 loc) · 1.45 KB
/
MuseumProgram.py
File metadata and controls
55 lines (39 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import mysql.connector
import login
import AdminMenu
import AlterMenu
import BrowseMenu
def main():
ids=str(input("database user ID - "))
password = str(input("database user password - "))
print("\n\nWELCOME TO ART MUSEUM allinone PROGRAM")
print("-----------------------------------------------")
print("\n\nPlease login or select Guest option")
while(True):
print("\n(0) User Login")
print("(1) Guest Login")
print("(2) Exit")
ans = str(input("\n -> "))
if ans == "0":
userid = str(input("\nenter username = "))
passid = str(input("\nenter password = "))
usertype = login.login(userid,passid,ids,password)
if usertype == "admin":
AdminMenu.AdminMenu(ids,password)
if usertype == "user":
while True:
ans = str(input("\n(1)alter menu\n(2)Browse menu \n -> "))
if ans == "1":
AlterMenu.alter(ids,password)
elif ans =="2":
BrowseMenu.browse(ids,password)
else:
print("Invalid option :(")
elif ans == "1":
print("\nYou are now using guest mode")
BrowseMenu.browse()
elif ans == "2":
exit()
else:
print("\nchoose correct option!")
main()