Geocrack

adminlog

Jul 2nd, 2022 (edited)
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.14 KB | None | 0 0
  1. #I defined menu
  2.  
  3. #I defined menu for Admin
  4.  
  5. #I declared the user name and password for Admin
  6.  
  7. def menu():
  8.  
  9.     print("[1] Admin")
  10.  
  11.     print("[2] Guest")
  12.  
  13.     print("[3] Customer")
  14.  
  15.     print("[0] Exit the system.")
  16.  
  17.  
  18.  
  19. def admin_menu():
  20.  
  21.     print("[11] Upload med")
  22.  
  23.     print("[12] View med")
  24.  
  25.     print("[13] Update med")
  26.  
  27.     print("[14] Delete med")
  28.  
  29.     print("[15] Search med")
  30.  
  31.     print("[16] View order")
  32.  
  33.     print("[17] Search order")
  34.  
  35.     print("[18] Exit the system.")
  36.  
  37.     username = "joe"
  38.  
  39.     password = "joe"
  40.  
  41.  
  42.  
  43.     #I defined the adminlog
  44.  
  45.  
  46. def adminlog():
  47.  
  48.     print("\nPlease enter your username and password.")
  49.  
  50.     name=input("Username:")
  51.  
  52.     passw=input("Password:")
  53.  
  54.     if name==username:  
  55.  
  56.         if passw==password:
  57.  
  58.             print("\nWelcome", username)
  59.  
  60.     else:
  61.  
  62.         print ("\nThe username or password you have entered is incorrect")
  63.  
  64.  
  65.  
  66.  
  67.  
  68. #Made option 1 as a function
  69.  
  70. def option1():
  71.  
  72.     print("\nYou are directed to Admin")
  73.  
  74.     adminlog()
  75.  
  76.  
  77.  
  78. #Called menu so user chooses the options provided
  79.  
  80. #when user chooses option 1 he gets directed to option1() --> adminlog()
  81.  
  82. menu()
  83.  
  84. option = int(input("Enter your option: "))
  85.  
  86.  
  87.  
  88. while option !=0:
  89.     if option ==1:
  90.         option1()
  91.     elif option ==2:
  92.         print("You are directed to Guest")
  93.     elif option ==3:
  94.         print("You are directed to Customer")
  95.     else:
  96.         print("Invalid option.")
  97.  
  98.  
  99.  
  100.     print()
  101.  
  102.     menu()
  103.  
  104.     option = int(input("Enter your option: "))
  105.  
  106.     print("Thank you for using this program. Goodbye.")
  107.  
  108.  
  109.  
  110. admin_menu()
  111.  
  112. op = int(input("Enter your option: "))
  113.  
  114.  
  115.  
  116. admin_menu()
  117.  
  118.  
  119.  
  120. while op !=10:
  121.  
  122.     if op ==11:
  123.  
  124.         print("Upload")
  125.  
  126.     elif op ==12:
  127.  
  128.         print("View upload")
  129.  
  130.     elif op ==13:
  131.  
  132.         print("Update")
  133.  
  134.     elif op ==14:
  135.  
  136.         print("Delete")
  137.  
  138.     elif op ==15:
  139.  
  140.         print("Search")
  141.  
  142.     elif op ==16:
  143.  
  144.         print("View order")
  145.  
  146.     elif op ==17:
  147.  
  148.         print("Search order")
  149.  
  150.     elif op ==18:
  151.  
  152.         print("Exit to main menu")
  153.  
  154.     else:
  155.  
  156.         print("Invalid option.")
Advertisement
Add Comment
Please, Sign In to add comment