Update app.py
This commit is contained in:
@@ -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:
|
||||||
@@ -32,8 +33,9 @@ def client():
|
|||||||
client_interface = """
|
client_interface = """
|
||||||
1) Search products
|
1) Search products
|
||||||
2) View all
|
2) View all
|
||||||
2) My history
|
3) View my products
|
||||||
3) Messages
|
4) My movements
|
||||||
|
5) Messages
|
||||||
0) Exit
|
0) Exit
|
||||||
Your Selection: """
|
Your Selection: """
|
||||||
|
|
||||||
@@ -65,7 +67,10 @@ 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)
|
print("id name, actorid, director, imdbrating, genre, price, year, timeavaible, type")
|
||||||
|
moviename=database.view_movieinfo(client_input_view)
|
||||||
|
if moviename==0:
|
||||||
|
break
|
||||||
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)")
|
||||||
@@ -78,13 +83,21 @@ 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,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':
|
||||||
|
database.view_avaible_movies(email)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if client_input == '4':
|
||||||
|
print("clientid, date start, price, date end, usermail,months, id, type, movieid")
|
||||||
|
database.view_rent(email)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user