-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMenuPage.py
134 lines (109 loc) · 5.54 KB
/
MenuPage.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import tkinter as tk
from tkinter.constants import BOTTOM
from tkinter.font import BOLD
import pymongo
#=========================
#Creating Menu Page=======
#=========================
class MenuPage(tk.Frame):
#Mongo Connection
client = pymongo.MongoClient("mongodb+srv://harsh8833:[email protected]/myFirstDatabase?retryWrites=true&w=majority")
db = client["g10"]
def __init__(self, parent, controller):
tk.Frame.__init__(self, parent,bg='#0B4619')
self.controller = controller
self.controller.title('Jarvis Mart')
self.controller.state('zoomed')
heading_label = tk.Label(self,
text='Jarvis Mart',
font=('orbitron',45,'bold'),
foreground='#FFCC1D',
background='#0B4619')
heading_label.pack(pady=25)
main_menu_label = tk.Label(self,
text='Main Menu',
font=('orbitron',20,BOLD),
fg='#B7C304',
bg='#0B4619')
main_menu_label.pack()
selection_label = tk.Label(self,
text='Please make a selection',
font=('orbitron',18),
fg='white',
bg='#0B4619',
anchor='w')
selection_label.pack()
button_frame = tk.Frame(self,bg='#116530')
button_frame.pack(fill='both',expand=True)
def New_shopping_page():
controller.show_frame('New_shopping_page')
newshopping_button = tk.Button(button_frame,
text='New Shopping',
command= New_shopping_page,
font=('orbitron',18,BOLD),
fg='#FFCC1D',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
newshopping_button.pack(pady=1)
def best_customer_page():
controller.show_frame('best_customer_page')
Update_button = tk.Button(button_frame,
text='Best Customer',
command=best_customer_page,
font=('orbitron',18,BOLD),
fg='#FFCC1D',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
Update_button.pack(pady=1)
def invohis():
controller.show_frame('invoice_history')
invoice_history_button = tk.Button(button_frame,
text='Invoice History',
command=invohis,
font=('orbitron',18,BOLD),
fg='#FFCC1D',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
invoice_history_button.pack(pady=1)
def find_customer():
controller.show_frame('find_customer')
find_customer_button = tk.Button(button_frame,
text='Find Customer',
command=find_customer,
font=('orbitron',18,BOLD),
fg='#FFCC1D',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
find_customer_button.pack(pady=1)
def prod_page():
controller.show_frame('prod_update')
find_customer_button = tk.Button(button_frame,
text='Manage Products',
command=prod_page,
font=('orbitron',18,BOLD),
fg='#FFCC1D',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
find_customer_button.pack(pady=1)
def exit():
parent.quit()
exit_button = tk.Button(button_frame,
text='Exit',
command=exit,
font=('orbitron',18,BOLD),
fg='Red',
bg = '#3C4A3E',
relief='flat',
width=40,
height=2)
exit_button.pack(pady=1)