-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhow to creat a restaurents survey or complain form
133 lines (113 loc) · 4.39 KB
/
how to creat a restaurents survey or complain form
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
from tkinter import *
import tkinter as bro
from tkinter import ttk
from tkinter import messagebox
root=bro.Tk()
root.geometry("800x600")
root.resizable (0,0)
root.title("RESTAURENT'S SURVEY FORMS")
Label(root,text="restaurents survey form".upper(),font="algerian 24").pack()
copy=Label(root,text="all rights reserved".upper(),font="Georgia 15").pack(side=BOTTOM)
bro=Label(root,text="THE BRO'S",font="Bahnschrift 20").pack(side=BOTTOM)
F1=Frame(root,borderwidth=3,relief="solid",bg="light blue")
F1.pack(side="left",expand=True,fill="both")
F2=Frame(root,borderwidth=3,relief="solid",bg="light blue")
F2.pack(side="right",expand=True,fill="both")
l1=Label(F1,text="PERSONNEL INFORMATION",font="algerian 14",bg="orange")
l1.place(x=70,y=0)
l2=Label(F1,text="customer name".upper(),font="Elephant 14",bg="green").place(x=65,y=45)
e1=Entry(F1,bd=6)
e1.place(x=100,y=100)
l2=Label(F2,text="restaurents survey",font="algerian 14",bg="orange")
l2.place(x=90,y=0)
l3=Label(F1,text="EMAIL",bg="green",font="Elephant 14")
l3.place(x=120,y=150)
e2=Entry(F1,bd=6)
e2.place(x=100,y=190)
l4=Label(F1,text="contact number".upper(),bg="green",font="Rockwell 16").place(x=75,y=235)
e4=Entry(F1,bd=6)
e4.place(x=100,y=280)
l5=Label(F1,text="restaurent name".upper(),bg="green",font="Elephant 14").place(x=65,y=320)
e5=Entry(F1,bd=9)
e5.place(x=100,y=360)
l6=Label(F2,text="FOOD QUALITY & HYGIENE".upper(),font="Elephant 12",bg="light green").place(x=40,y=45)
e6=Entry(F2,bd=6)
e6.place(x=100,y=100)
l7=Label(F2,text="CLEANLINESS & SECURITY",bg="light green",font="Elephant 12")
l7.place(x=40,y=143)
e7=Entry(F2,bd=6)
e7.place(x=100,y=190)
l8=Label(F2,text="COMPLAINS".upper(),bg="light green",font="Rockwell 16").place(x=105,y=235)
e8=Entry(F2,bd=6)
e8.place(x=100,y=280)
l9=Label(F2,text="ANY SUGGESTIONS".upper(),bg="light green",font="Elephant 14").place(x=65,y=320)
e9=Entry(F2,bd=9)
e9.place(x=100,y=360)
def submit():
far = open("RSF.txt", "a")
if len(e1.get()) <= 0:
messagebox.showinfo(message="ENTER A VALID NAME")
else:
far.write("name: ".upper())
far.write(e1.get())
if len(e4.get())!= 10 or e4.get().isdigit == False:
messagebox.showerror(title="ERROR",message="ENTER A VALID MOBILE NUMBER")
else:
far.write("\n")
far.write("contact number: ".upper())
far.write(e4.get())
if ('@' not in e2.get()) or ("." not in e2.get()):
messagebox.showerror(message="plz enter valid mail address".upper())
else:
far.write("\n")
far.write("EMAIL: ")
far.write(e2.get())
if len(e5.get()) <= 0:
messagebox.showerror(title="ERROR", message="ENTER A VALID RESTAURENT NAME")
else:
far.write("\n")
far.write("RESTAURENT NAME: ")
far.write(e5.get())
if len(e6.get()) <= 0:
messagebox.showerror(title="ERROR",message="PLZ ENTER A VALID COMMENT!")
else:
far.write("\n")
far.write("FOOD QUALITY AND HYGIENE: ")
far.write(e6.get())
if len(e7.get()) <= 0:
messagebox.showerror(title="ERROR",message="PLZ ENTER A VALID COMMENT!")
else:
far.write("\n")
far.write("CLEANINESS AND SECURITY: ")
far.write(e7.get())
if len(e8.get()) <= 0:
messagebox.showerror(title="ERROR",message="enter a valid complain sir!".upper())
else:
far.write("\n")
far.write("complains: ".upper())
far.write(e8.get())
if len(e9.get()) <= 0:
messagebox.showerror(title="ERROR", message="enter a valid suggestion sir!".upper())
else:
far.write("\n")
far.write("suggestion: ")
far.write(e9.get())
far.write("\n")
far.close()
e1.delete()
def su():
f = messagebox.askquestion(title="saving review ".title(), message="do u wanna submit it!".upper())
if f == "yes":
messagebox.showinfo(message="THANKS FOR YOUR REVIEW")
e1.delete(0, END)
e2.delete(0, END)
e4.delete(0, END)
e5.delete(0, END)
e6.delete(0, END)
e7.delete(0, END)
e8.delete(0, END)
e9.delete(0, END)
if len(e1.get()) != 0 and len(e4.get()) == 10 or e4.get().isdigit == True and ("@" or "." in e2.get()) and len(e5.get() != 0) and (e6.get() != 0) and len(e7.get() != 0) and len(e8.get() != 0) and len(e9.get() != 0):
su()
b=Button(F2,text="SUBMIT",bd=4,command=submit,padx=34,pady=8,bg="orange",font="algerian 10").place(x=120,y=445)
root.mainloop()