-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
88 lines (68 loc) · 3 KB
/
main.py
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import User__login
from termcolor import colored
username = ""
account_type = ""
# making wb object with sheets
wb, sheet1, sheet2 = User__login.loading_xl_file()
User__login.opening_message()
User__login.xl_defaulter_or_ok()
# Asks Login or Sign-up
login_or_signup = input(colored("Would you like to login or signup?\n", 'green'))
while login_or_signup.lower() != "login" and login_or_signup.lower() != "signup":
login_or_signup = input(colored("You have inputted invalid answer. Would you like to login or signup?\n", 'red'))
# Login
if login_or_signup.lower() == "login":
username = input(colored("Username: ", "cyan"))
password = input(colored('Password: ', 'cyan'))
username, password, account_type, name, cnic, phone_no = User__login.username(username, password)
# Signup Using Function
elif login_or_signup.lower() == "signup":
username, password, account_type, name, cnic, phone_no = User__login.signup()
choice = ""
# Account Type is buyer, admin, hr, finance
if account_type.lower() == "buyer":
while choice != "5":
choice = User__login.buyer_choice()
if choice == "1":
buy_options_full_detail_lst, s_no_value = User__login.show_available_units()
if buy_options_full_detail_lst is not None:
# Payment
User__login.xl_update(str(s_no_value), str(username))
elif choice == "2":
display_only = True
buy_options_full_detail_lst, s_no_value = User__login.bought_units_display(username, True)
elif choice == "3":
display_only = False
buy_options_full_detail_lst, s_no_value = User__login.bought_units_display(username, False)
if buy_options_full_detail_lst is not None:
# Payment
User__login.xl_update(str(s_no_value), str(username))
elif choice == "4":
User__login.sending_whatsapp_query(username)
elif account_type.lower() == "hr":
while choice != "3":
choice = User__login.hr_choice()
if choice == "1":
User__login.question_checker()
if choice == "2":
User__login.plaza_update()
elif account_type.lower() == "finance":
while choice != "4":
choice = User__login.finance_choice()
if choice == "1":
defaulter_name_lst, defaulter_phone_no_lst = User__login.defaulter_display()
elif choice == "2":
User__login.monthly_expense()
elif choice == "3":
defaulter_name_lst, defaulter_phone_no_lst = User__login.defaulter_display()
User__login.defaulter_msg(defaulter_name_lst, defaulter_phone_no_lst)
elif account_type.lower() == "admin":
while choice != "4":
choice = User__login.admin_choice()
if choice == "1": # View Finance Report
User__login.read_file()
elif choice == "2": # Refund Granted
User__login.refund_granted()
elif choice == "3": # Look at Inventory
User__login.all_units_display()
User__login.goodbye_msg()