Documentation Final
Documentation Final
SNO DESCRIPTION
01 ACKNOWLEDGEMENT
03 SYNOPSIS
05 SOURCE CODE
06 OUTPUT
07 BIBLIOGRAPHY
1
ACKNOWLEDGEMENT
In the successful completion of this project, many people have bestowed
upon me their blessings and sincere support. I utilize this moment to express
my heart-felt gratitude to all the people who have been associated with this
project.
Primarily, I thank the Lord Almighty for His blessings that helped me combat
the various hurdles that arose during the course of the project.
A project is a bridge between theoretical and practical learning and with this
thinking I worked on the project and made it successful due to the timely
support of my classmates. I would like to thank my friends for the knowledge
they shared.
Last but not the least; I thank my parents for the undeniable support they
rendered.
2
SYSTEM REQUIREMENTS AND SPECIFICATIONS
Hardware Specifications
Software Specifications
1. Operating System – Windows 10
2. Development Environment –Python IDLE , Tkinter
3. Language Used – Python 3.10.10
4. Front End – Python
5. Back End – Mysql
3
SYNOPSIS
Our project is a unique food delivery app that would enable people to order
food online.
The user can start using the app by creating an account. After signing up,
the user can access the app by entering their Username and Password.
After logging in , the user will reach the homepage. The homepage consists
of 10 restaurants. The user can order food from a particular restaurant by
clicking the restaurant icon. After clicking the icon the restaurant menu is
displayed in a separate side window.
The user can add food by clicking on the ‘+’ icon next to the item’s image
and increase or decrease the quantity by clicking on the respective icons
.The items are then added to the cart.
Now, the user can go to the homepage and click on the cart icon in the top
right corner to see the food they ordered and the bill is displayed. After
clicking on the place order button your delivery address will be displayed
and your order is successfully placed .
4
DATABASE DICTIONARY
desc users;
Field Type Null Key Default Extra
desc restaurant;
Field Type Null Key Default Extra
desc menu;
Field Type Null Key Default Extra
5
Restaurant_id int YES MUL NULL Stores restaurant
id
desc cart;
Field Type Null Key Default Extra
6
SOURCE CODE
Restaurant_Interface=None
cart=None
account_setting=None
image_references=[]
cn=ms.connect(host='localhost',user='root',passwd='root')
cur=cn.cursor()
cur.execute("""
CREATE TABLE IF NOT EXISTS Users (
user_id INT PRIMARY KEY,
username VARCHAR(60) UNIQUE,
password VARCHAR(20),
phone_no varchar(10),
address VARCHAR(200)
)
""")
7
cn.commit()
cur.execute("""
CREATE TABLE IF NOT EXISTS Restaurant (
Restaurant_id INT(7) PRIMARY KEY,
Restaurant_name VARCHAR(30),
address VARCHAR(200),
Cuisine VARCHAR(20)
)
""")
cn.commit()
cur.execute("""
CREATE TABLE IF NOT EXISTS MENU (
Item_id CHAR(9) NOT NULL,
Restaurant_id INT(7) NOT NULL,
Item_Name VARCHAR(100),
Price INT(5),
FOREIGN KEY (Restaurant_id) REFERENCES Restaurant(Restaurant_id)
)
""")
cn.commit()
cur.execute("""
CREATE TABLE IF NOT EXISTS cart (
user_id INT,
restaurant_id INT(7) NOT NULL,
order_date DATE,
item_id char(9) NOT NULL,
item_name VARCHAR(100),
quantity INT,
price DECIMAL(10, 2),
FOREIGN KEY (user_id) REFERENCES Users(user_id)
)
8
""")
cn.commit()
def is_table_empty(table_name):
cur.execute(f"SELECT COUNT(*) FROM {table_name}")
count = cur.fetchone()[0]
return count == 0
restaurants = [
(1, 'Real Arabia', 'Mahatma Gandhi Rd, Atlantis, Ravipuram, Kochi', 'Arabic'),
(2, 'Zaatar Restaurant', 'Service Rd, Palarivattom, Kochi', 'Arabic'),
(3, 'Periyar Restaurant', 'Edapally - Panvel Hwy, Cheranallur, Kochi', 'Seafood'),
(4, 'Tharavadu Seafood Restaurant', 'NH 66, Cheranallur, Kochi', 'Seafood'),
(5, 'Supreme Upper Crust', 'Chalikkavattom, Vennala, Kochi', 'Continental'),
(6, 'Grand Entree', 'Chalikkavattom, Geetanjali Junction, Kochi', 'Continental'),
(7, 'Sethi Da Dhaba', 'Jawahar Nagar, Kadavanthra, Kochi', 'North Indian'),
(8, 'Urban Paratha', 'RP arcade, Ponnurunni, Vyttila, Kochi', 'North Indian'),
(9, 'Chiyang Restaurant', 'Sahodaran Ayyappan Rd, Kadavanthra, Kochi', 'Chinese'),
(10, 'Malaya Restaurant', 'Civil Line Rd, Sonia Nagar, Palarivattom, Kochi', 'Chinese'),
]
if is_table_empty("Restaurant"):
cur.executemany(restaurant_query, restaurants)
cn.commit()
menu_items = [
('ITEM001', 1, 'Shawarma', 250),
('ITEM002', 1, 'Al Faham', 280),
('ITEM003', 1, 'Barbecue', 570),
9
('ITEM004', 1, 'Afghani Chicken', 550),
('ITEM005', 1, 'Pepper Wings', 360),
10
('ITEM036', 8, 'Amritsari Chole', 150),
('ITEM037', 8, 'Bhature', 250),
('ITEM038', 8, 'Kashmiri Rogan Josh', 250),
('ITEM039', 8, 'Dal-Bati Churma', 320),
('ITEM040', 8, 'Dilli ki Chaat', 320),
if is_table_empty("MENU"):
cur.executemany(insert_query, menu_items)
cn.commit()
cn=cn=ms.connect(host='localhost',user='root',passwd='root',database='food_delivery
_system')
cur=cn.cursor()
11
login.configure(bg="#F7F5E6")
login_canvas = Canvas(
login,
bg="#F7F5E6",
height=569,
width=1012,
bd=0,
highlightthickness=0,
relief="ridge"
)
login_canvas.place(x=0, y=0)
box_bg_image = PhotoImage(file=r"D:\food
delivery\assets\loginsignup\login_signup_box.png")
box_bg = login_canvas.create_image(
761,
284.5,
image=box_bg_image
)
login_canvas.create_text(
690.2,
114.4,
anchor="nw",
text="LOGIN",
fill="#282727",
font=("IstokWeb", 33, "bold")
)
entry_image_1 = PhotoImage(file=r"D:\food
delivery\assets\loginsignup\entrybox.png")
entry_bg_1 = login_canvas.create_image(
761.4,
207.2,
image=entry_image_1
)
login_username = Entry(
bd=0,
12
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
login_username.place(
x=638.5,
y=192.2,
width=245.7,
height=30.9
)
entry_image_2 = PhotoImage(file=r"D:\food
delivery\assets\loginsignup\entrybox.png")
entry_bg_2 = login_canvas.create_image(
761.4,
284.7,
image=entry_image_2
)
login_password = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0,
show="*"
)
login_password.place(
x=638.5,
y=269.7,
width=245.7,
height=30.9
)
login_canvas.create_text(
634.8,
171.9,
anchor="nw",
text="Username",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,'bold')
13
)
login_canvas.create_text(
634.8,
249.4,
anchor="nw",
text="Password",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,'bold')
)
signin_button_image = PhotoImage(file=r"D:\food
delivery\assets\loginsignup\signin_button.png")
signin_button = Button(
image=signin_button_image,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda: validate_login(login, login_username, login_password,
login_status),
relief="flat"
)
signin_button.place(
x=681.2,
y=332.2,
width=160.3,
height=40.0
)
login_canvas.create_text(
659.1,
442.4,
anchor="nw",
text="Don’t have an account?",
fill="#303030",
font=("Inter Bold", 12 * -1,'bold')
14
)
signup_button_image = PhotoImage(file=r"D:\food
delivery\assets\loginsignup\signup_button.png")
signup_button = Button(
image=signup_button_image,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
activeforeground="white",
fg="white",
highlightthickness=0,
command=signupfunc,
relief="flat"
)
signup_button.place(
x=793.8,
y=441.8,
width=45.8,
height=18.9
)
15
login_status.place(x=650, y=380)
login.resizable(False, False)
login.mainloop()
if (entered_username,entered_password) in validate:
cur.execute("select user_id from users where username=%s",(entered_username,))
user_idfetch=cur.fetchone()
global user_id
user_id=user_idfetch[0] #stores user_id as global variable for further table
insertions
login.destroy()
mainwindowinterface()
else:
login_status.config(text="Incorrect username or password",
fg="red",bg='#FFD966')
16
signup.configure(bg = "#F7F5E6")
signup_canvas = Canvas(
signup,
bg = "#F7F5E6",
height = 569,
width = 1012,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
signup_canvas.place(x = 0, y = 0)
signup_box_img = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\login_signup_box.png")
signup_box = signup_canvas.create_image(
760.7,
284.5,
image=signup_box_img
)
signup_canvas.create_text(
704.1,
114.3,
anchor="nw",
text="SignUp",
fill="#282727",
font=("IstokWeb Bold", 33 * -1,"bold")
)
entry_image_1 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_1 = signup_canvas.create_image(
761.1,
195.0,
image=entry_image_1
)
signup_username = Entry(
17
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
signup_username.place(
x=638.2,
y=180.0,
width=245.6,
height=30.9
)
entry_image_2 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_2 = signup_canvas.create_image(
761.1,
254.5,
image=entry_image_2
)
signup_password = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0,
show="*"
)
signup_password.place(
x=638.2,
y=239.6,
width=245.6,
height=30.9
signup_canvas.create_text(
634.6,
159.7,
anchor="nw",
text="Username",
18
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
entry_image_3 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_3 = signup_canvas.create_image(
761.1,
314.1,
image=entry_image_3
)
signup_phoneno = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
signup_phoneno.place(
x=638.2,
y=299.1,
width=245.6,
height=30.9
)
signup_canvas.create_text(
634.6,
278.8,
anchor="nw",
text="Phone No",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
entry_image_4 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_4 = signup_canvas.create_image(
761.1,
373.7,
image=entry_image_4
19
)
signup_address = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
signup_address.place(
x=638.2,
y=358.7,
width=245.6,
height=30.9
)
signup_canvas.create_text(
634.6,
338.3,
anchor="nw",
text="Address",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
signup_canvas.create_text(
634.6,
219.2,
anchor="nw",
text="Password",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
create_signup_img = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\create_signup_button.png")
create_signup_button = Button(
image=create_signup_img,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
20
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda:
signupvalidate(signup,signup_username,signup_password,signup_
phoneno,signup_address),
relief="flat"
)
create_signup_button.place(
x=680.9,
y=416.3,
width=160.2,
height=40.0
)
signup.mainloop()
21
entered_username = signup_username.get()
entered_password = signup_password.get()
entered_phoneno = signup_phoneno.get()
entered_address = signup_address.get()
if (entered_username,) in usernamevalidate:
messagebox.showerror("Error", "Username already Taken")
elif entered_username=='':
messagebox.showerror("Error", "Please enter a username")
elif entered_password=='':
messagebox.showerror("Error", "Please enter a password")
elif entered_address=='':
messagebox.showerror("Error", "Please enter an address")
else:
signup_flag = True
if signup_flag==True:
cur.execute("SELECT MAX(user_id) FROM users")
maxid = cur.fetchone() #fetches maximum user id
userid = maxid[0] + 1 if maxid[0] else 101 #auto increments user_id for each new
user
22
)
cn.commit()
global user_id
user_id=userid
signup.destroy()
mainwindowinterface()
global mainwindow
mainwindow = Tk()
mainwindow.title("Homepage")
mainwindow.geometry("1012x569")
mainwindow.resizable(False, False)
23
menu_image_path = r"D:\food delivery\assets\Mainwindow\menubar.png"
menu_image = Image.open(menu_image_path)
menu_image = menu_image.resize((1012, 74), Image.LANCZOS)
menu_photo = ImageTk.PhotoImage(menu_image)
account_img = PhotoImage(file=r"D:\food
delivery\assets\Mainwindow\account.png")
account_btn = Button(
menu_bar,
image=account_img,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
24
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda: accountpage(mainwindow)
)
account_btn.place(
x=877.0,
y=26.25,
width=115.0,
height=32.0
)
def update_scrollregion():
scrollable_frame.update_idletasks()
mainwindow_canvas.config(scrollregion=mainwindow_canvas.bbox("all"))
def mouse_scroll_main(event):
mainwindow_canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")
mainwindow_canvas.bind_all("<MouseWheel>", mouse_scroll_main)
def on_mainwindow_focus_in(event):
25
mainwindow_canvas.bind_all("<MouseWheel>", mouse_scroll_main)
if 'restaurantinterface_canvas' in globals():
restaurantinterface_canvas.unbind_all("<MouseWheel>")
mainwindow.bind("<FocusIn>", on_mainwindow_focus_in)
def load_images(image_folder): #function to load all image paths and store in a list
images = []
for img_file in os.listdir(image_folder):
img_path = os.path.join(image_folder, img_file)
images.append(img_path)
display_images_in_grid(images)
update_scrollregion()
def display_images_in_grid(images):
columns = 4
x_spacing = 45
y_spacing = 50
file_name_with_extension = os.path.basename(img_path)
26
cur.execute("SELECT Restaurant_name FROM Restaurant WHERE
Restaurant_id=%s", (rest_id,))
rec = cur.fetchone()
img.thumbnail((150, 150))
img = ImageTk.PhotoImage(img)
restaurant_btn.image = img
mainwindow.mainloop()
27
Restaurant_Interface.destroy()
except TclError:
Restaurant_Interface = None
record=(user_id,rest_id,current_date,item_id,item_name,count,item_price*count)
cur.execute("Insert into cart values(%s,%s,%s,%s,%s,%s,%s)",(record))
cn.commit()
28
cur.execute("UPDATE cart SET quantity = %s, price = %s WHERE user_id = %s
AND item_id = %s", (count, item_price * count, user_id, item_id))
cn.commit()
return count
else:
cur.execute("UPDATE cart SET quantity = %s, price = %s WHERE user_id = %s
AND item_id = %s", (count, item_price * count, user_id, item_id))
cn.commit()
update_counter(counter_label, count)
return count
Restaurant_Interface = Toplevel(mainwindow)
Restaurant_Interface.title("Restaurant Interface")
Restaurant_Interface.geometry("310x600")
29
main_frame = Frame(restaurantinterface_canvas,bg="#F7F5E6")
restaurantinterface_canvas.create_window((0, 0), window=main_frame,
anchor='nw')
rest_name=Label(main_frame,text=restdetails[0],font=('Nunito',
9,'bold'),fg='#000000', bg='#F7F5E6')
rest_name.grid(row=0,column=0, columnspan=2, sticky='w',padx=10)
rest_cuisine=Label(main_frame,text=restdetails[2],font=('Nunito',
9,'bold'),fg='#000000', bg='#F7F5E6')
rest_cuisine.grid(row=1,column=0, columnspan=2, sticky='w',padx=10)
rest_address=Label(main_frame,text=restdetails[1],font=('Nunito',
9,'bold'),fg='#000000', bg='#F7F5E6')
rest_address.grid(row=2,column=0, columnspan=2, sticky='w',padx=10)
item_frame_img = PhotoImage(file=item_frame_path)
orange_img = PhotoImage(file=orange_box_image)
30
minus_img = PhotoImage(file=minus_icon_path)
plus_img = PhotoImage(file=plus_icon_path)
item_img = PhotoImage(file=item_image_path)
image_references.append(item_img)
31
box_label = Label(item_frame, image=orange_img, borderwidth=0)
box_label.grid(row=1, column=0, columnspan=2, sticky='nw', padx=(10, 0),
pady=0)
item_id = itemdetails[0]
item_name = itemdetails[1]
item_price = itemdetails[2]
main_frame.update_idletasks()
restaurantinterface_canvas.config(scrollregion=restaurantinterface_canvas.bbox("all"))
32
def mouse_scroll_rest(event):
restaurantinterface_canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")
restaurantinterface_canvas.bind_all("<MouseWheel>", mouse_scroll_rest)
def on_restaurant_focus_in(event):
restaurantinterface_canvas.bind_all("<MouseWheel>", mouse_scroll_rest)
if 'mainwindow_canvas' in globals():
mainwindow_canvas.unbind_all("<MouseWheel>")
Restaurant_Interface.bind("<FocusIn>", on_restaurant_focus_in)
Restaurant_Interface.resizable(False, False)
Restaurant_Interface.mainloop()
cart = Tk()
cart.geometry("1012x569")
cart.title("Cart")
cart.configure(bg="#F7F5E6")
cart_canvas = Canvas(
cart,
bg="#F7F5E6",
33
height=569,
width=1012,
bd=0,
highlightthickness=0,
relief="ridge"
)
cart_canvas.pack(fill="both", expand=True)
deliboy_img=PhotoImage(file="D:/food delivery/assets/cart/deliboy.png")
deliboy=cart_canvas.create_image(230.72,90,image=deliboy_img)
boximg=PhotoImage(file="D:/food delivery/assets/cart/box.png")
box=cart_canvas.create_image(819,88.25,image=boximg)
mapimg=PhotoImage(file="D:/food delivery/assets/cart/map.png")
map_icon=cart_canvas.create_image(350,250,image=mapimg)
restimg_extension = ".png"
restimg_directory = "D:/food delivery/assets/Mainwindow/restaurant pics"
rest_image_path = os.path.join(restimg_directory, str(restidstore) +
restimg_extension)
rest_image = Image.open(rest_image_path)
resized_image = rest_image.resize((136, 90), Image.Resampling.LANCZOS)
restimg = ImageTk.PhotoImage(resized_image)
rest_img=cart_canvas.create_image(740,88.25,image=restimg)
34
cart_canvas.create_text(
820.1,
50,
anchor="nw",
text=restname,
fill="#000000",
font=("Inter Bold", 15 * -1,'bold')
)
cart_canvas.create_text(
820.1,
75,
anchor="nw",
text=restcuisine,
fill="#000000",
font=("Inter Bold", 13 * -1,'bold')
)
scrollframe.bind("<Configure>", lambda e:
scroll_canvas.configure(scrollregion=scroll_canvas.bbox("all")))
def on_mouse_wheel(event):
scroll_canvas.yview_scroll(int(-1 * (event.delta / 120)), "units")
scroll_canvas.bind_all("<MouseWheel>", on_mouse_wheel)
35
cur.execute("select item_name,quantity,price from cart where
user_id=%s",(user_id,))
billstore=cur.fetchall()
lim=len(billstore)
quantity=billstore[i][1]
quanlabel = Label(scrollframe, text="x"+str(quantity), bg="#FFD966",
font=("Arial", 12))
quanlabel.grid(row=i, column=1, padx=(40,0), pady=7)
price=billstore[i][2]
pricelabel = Label(scrollframe, text="₹"+str(price), bg="#FFD966", font=("Arial",
12))
pricelabel.grid(row=i, column=2, padx=(50,0), pady=7,sticky="e")
bottombox_image = PhotoImage(
file="D:/food delivery/assets/cart/bottombox.png")
bottombox = cart_canvas.create_image(
819.0,
421.25,
image=bottombox_image
)
cart_canvas.create_text(
669.0,
300.25,
anchor="nw",
text="Bill Details\n",
fill="#393939",
font=("RadioCanada Regular", 20 * -1)
)
36
cart_canvas.create_text(
669.0,
327.25,
anchor="nw",
text="Item Total "+str(itemstotal),
fill="#393939",
font=("RadioCanada Regular", 20 * -1)
)
cart_canvas.create_text(
669.0,
354.25,
anchor="nw",
text="Delivery Fee 20",
fill="#393939",
font=("RadioCanada Regular", 20 * -1)
)
cart_canvas.create_text(
669.0,
381.25,
anchor="nw",
text="GST "+str(gst),
fill="#393939",
font=("RadioCanada Regular", 20 * -1)
)
finalbill=itemstotal+20+gst
cart_canvas.create_text(
669.0,
420.25,
anchor="nw",
text="TO PAY "+str(finalbill),
fill="#000000",
font=("RadioCanada Bold", 20 * -1)
)
cod_image = PhotoImage(
file="D:/food delivery/assets/cart/cod.png")
cod = cart_canvas.create_image(
37
815.0,
465.25,
image=cod_image
)
line_image = PhotoImage(
file=("D:/food delivery/assets/cart/line.png"))
line = cart_canvas.create_image(
819.0,
412.75,
image=line_image
)
placeorder_image = PhotoImage(
file="D:/food delivery/assets/cart/placeorder.png")
placeorder = Button(
image=placeorder_image,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda: placeoderfunc(cart),
relief="flat"
)
placeorder.place(
x=739.0,
y=487.25,
width=160.2,
height=40.0
)
homebutton_img = PhotoImage(
file="D:/food delivery/assets/cart/home.png")
homebutton = Button(
image=homebutton_img,
borderwidth=0,
bg='#F7F5E6',
activebackground="#F7F5E6",
38
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda: mainwindowinterface(),
relief="flat"
)
homebutton.place(
x=17.0,
y=16.25,
width=48.0,
height=48.0
)
cur.execute("select address from users where user_id=%s",(user_id,))
cartaddress=cur.fetchone()[0]
cart_canvas.create_text(
440.0,
480.25,
anchor="nw",
text="Delivering To:",
fill="#000000",
font=("RadioCanada Regular", 20 * -1,"bold")
)
cart_canvas.create_text(
390.0,
510.25,
anchor="nw",
text=cartaddress,
fill="#1B1B1B",
font=("RadioCanada Regular", 17 * -1)
)
cart.resizable(False,False)
cart.mainloop()
39
cart.configure(bg = "#F7F5E6")
cart_canvas = Canvas(
cart,
bg = "#F7F5E6",
height = 569,
width = 1012,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
cart_canvas.place(x = 0, y = 0)
chick_img = PhotoImage(
file="D:/food delivery/assets/cart/chick.png")
chick = cart_canvas.create_image(
354.0,
284.25,
image=chick_img
)
urcart_img = PhotoImage(
file="D:/food delivery/assets/cart/urcart.png")
urcart = cart_canvas.create_image(
687.0,
283.25,
image=urcart_img
)
homebutton_img = PhotoImage(
file="D:/food delivery/assets/cart/home.png")
homebutton = Button(
image=homebutton_img,
borderwidth=0,
bg='#F7F5E6',
activebackground="#F7F5E6",
activeforeground="white",
fg="white",
40
highlightthickness=0,
command=lambda: mainwindowinterface(),
relief="flat"
)
homebutton.place(
x=17.0,
y=16.25,
width=48.0,
height=48.0
)
cart.resizable(False, False)
cart.mainloop()
account_setting_canvas = Canvas(
41
account_setting,
bg = "#F7F5E6",
height = 569,
width = 1012,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
account_setting_canvas.place(x = 0, y = 0)
account_setting_box_img = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\login_signup_box.png")
account_setting_box = account_setting_canvas.create_image(
760.7,
284.5,
image=account_setting_box_img
)
account_setting_canvas.create_text(
640.1,
114.3,
anchor="nw",
text="Edit Your Account",
fill="#282727",
font=("IstokWeb Bold", 28* -1,"bold")
)
entry_image_1 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_1 = account_setting_canvas.create_image(
761.1,
195.0,
image=entry_image_1
)
account_setting_username = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
42
)
account_setting_username.place(
x=638.2,
y=180.0,
width=245.6,
height=30.9
)
account_setting_username.insert(0,userstore[0])
entry_image_2 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_2 = account_setting_canvas.create_image(
761.1,
254.5,
image=entry_image_2
)
account_setting_password = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0,
)
account_setting_password.place(
x=638.2,
y=239.6,
width=245.6,
height=30.9
)
account_setting_password.insert(0,userstore[1])
account_setting_canvas.create_text(
634.6,
159.7,
anchor="nw",
text="Username",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
43
)
entry_image_3 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_3 = account_setting_canvas.create_image(
761.1,
314.1,
image=entry_image_3
)
account_setting_phoneno = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
account_setting_phoneno.place(
x=638.2,
y=299.1,
width=245.6,
height=30.9
)
account_setting_phoneno.insert(0,userstore[2])
account_setting_canvas.create_text(
634.6,
278.8,
anchor="nw",
text="Phone No",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
entry_image_4 = PhotoImage(
file=r"D:\food delivery\assets\loginsignup\entrybox.png")
entry_bg_4 = account_setting_canvas.create_image(
761.1,
373.7,
image=entry_image_4
)
44
account_setting_address = Entry(
bd=0,
bg="#F7F5E6",
fg="#000716",
highlightthickness=0
)
account_setting_address.place(
x=638.2,
y=358.7,
width=245.6,
height=30.9
)
account_setting_address.insert(0,userstore[3])
account_setting_canvas.create_text(
634.6,
338.3,
anchor="nw",
text="Address",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
account_setting_canvas.create_text(
634.6,
219.2,
anchor="nw",
text="Password",
fill="#000000",
font=("IstokWeb Bold", 12 * -1,"bold")
)
update_img = PhotoImage(
file=r"D:\food delivery\assets\account setting\update.png")
update_button = Button(
image=update_img,
borderwidth=0,
bg='#FFD966',
activebackground="#FFD966",
45
activeforeground="white",
fg="white",
highlightthickness=0,
command=lambda:
accountsetting_validate(account_setting,account_setting_username,account_setting_
password,
account_setting_phoneno,account_setting_address),
relief="flat"
)
update_button.place(
x=680.9,
y=416.3,
width=160.2,
height=40.0
)
homebutton_img = PhotoImage(
file="D:/food delivery/assets/cart/home.png")
homebutton = Button(
image=homebutton_img,
borderwidth=0,
bg='#F7F5E6',
activebackground="#F7F5E6",
activeforeground="white",
46
fg="white",
highlightthickness=0,
command=lambda: mainwindowinterface(),
relief="flat"
)
homebutton.place(
x=17.0,
y=16.25,
width=48.0,
height=48.0
)
account_setting.resizable(False, False)
account_setting.mainloop()
accountsettingflag=False
entered_username = account_setting_username.get()
entered_password = account_setting_password.get()
entered_phoneno = account_setting_phoneno.get()
entered_address = account_setting_address.get()
if (entered_username,) in usernamevalidate:
messagebox.showerror("Error", "Username already Taken")
elif entered_username=='':
messagebox.showerror("Error", "Please enter a username")
elif entered_password=='':
47
messagebox.showerror("Error", "Please enter a password")
elif entered_address=='':
messagebox.showerror("Error", "Please enter an address")
else:
accountsettingflag=True
databasecreate()
login_func()
48
OUTPUT
Login
Login Error
49
Signup
Account Settings
50
Homepage
Restaurant Interface
51
Bill
Empty Cart
52
BIBLIOGRAPHY
1. https://www.geeksforgeeks.org/python-gui-tkinter/
2. https://realpython.com/python-gui-tkinter/
3. https://github.com/
4. https://www.w3schools.com/python/python_mysql_getstarted.asp
5. https://www.swiggy.com/
53