Update and rename appUPDATED.py to appUPDATED-alex.py

This commit is contained in:
alexalmeida2001
2020-12-05 18:26:57 +00:00
committed by GitHub
parent fdf9b678d9
commit 6e1e2665fe
+13 -5
View File
@@ -22,6 +22,7 @@ def menu():
email = input("Enter your e-mail: ") email = input("Enter your e-mail: ")
password = input("Enter your password: ") password = input("Enter your password: ")
if database.log_in(email, password): if database.log_in(email, password):
database.view_saldo(email)
break break
else: else:
@@ -33,7 +34,7 @@ def client():
1) Search products 1) Search products
2) View all 2) View all
3) View my products 3) View my products
4) My history 4) My movements
5) Messages 5) Messages
0) Exit 0) Exit
Your Selection: """ Your Selection: """
@@ -66,7 +67,7 @@ def client():
client_interface_view = "\nselecione um filme ou pressione zero para saír " client_interface_view = "\nselecione um filme ou pressione zero para saír "
while (client_input_view := input(client_interface_view)) !='0': while (client_input_view := input(client_interface_view)) !='0':
if client_input_view != '0': if client_input_view != '0':
database.view_movieinfo(client_input_view) moviename=database.view_movieinfo(client_input_view)
client_input_view_buy =input ("press 1 to buy press 0 to leave\n") client_input_view_buy =input ("press 1 to buy press 0 to leave\n")
if client_input_view_buy == '1': if client_input_view_buy == '1':
client_input_view_buy=input("are you sure you want to buy?\n(press 1 yes press 0 no)") client_input_view_buy=input("are you sure you want to buy?\n(press 1 yes press 0 no)")
@@ -79,10 +80,17 @@ def client():
if(custo<saldo): if(custo<saldo):
print("item bought successefully!\n") print("item bought successefully!\n")
database.compra_filme(custo,saldo,email) database.compra_filme(custo,saldo,email)
database.create_rent(custo,email) database.create_rent(custo,email,moviename)
print("saldo atual:\n") print("saldo atual:\n")
database.view_saldo(email) database.view_saldo(email)
else: else:
print("nao tem saldo suficiente") print("nao tem saldo suficiente")
if client_input == '3':
#por fazer
email=menu()
client()