Feedback
Feedback
Feedback
import mysql.connector
from tkinter import messagebox, ttk
from browse import browser
class Feedback:
def __init__(self, root):
self.root = root
self.root.title("Neel Games Store")
self.root.geometry("1550x840+0+0")
self.root.state("zoomed")
self.root.resizable(0, 0)
#===========================main
frame=========================================================
main_frame = Frame(self.root, width=300, height=840, bg="#1C1C1C")
main_frame.place(x=0,y=0)
self.right_Frame = Frame(root,width=1230,height=840,bg="#333333")
self.right_Frame.place(x=300,y=0)
#===========================btn
frame=========================================================
lbry_btn=Button(main_frame,text="Library",
font=("cursive",20,"bold"),width=10,bg="#1C1C1C",bd=0,fg="light
gray",cursor="hand2")
lbry_btn.place(x=50,y=150)
feedback_btn=Button(main_frame, text="FeedBack",
font=("cursive",20,"bold"),width=10,bg="#1C1C1C",bd=0,fg="light
gray",cursor="hand2")
feedback_btn.place(x=50,y=250)
report_btn=Button(main_frame,text="Report",
font=("cursive",20,"bold"),width=10,bg="#1C1C1C",bd=0,fg="light
gray",cursor="hand2")
report_btn.place(x=50,y=350)
def submit_feedback(self):
name = self.name_entry.get()
email = self.email_entry.get()
feedback = self.feedback_text.get("1.0", "end-1c")
try:
# Connect to the database
conn = mysql.connector.connect(
host="localhost",
user="root",
password="Neel_123",
database="mydata"
)
cursor = conn.cursor()
query = "INSERT INTO feedback (name, email, feedback) VALUES (%s, %s,
%s)"
values = (name, email, feedback)
cursor.execute(query, values)
conn.commit()
finally:
if conn.is_connected():
cursor.close()
conn.close()
def clear_fields(self):
self.name_entry.delete(0, END)
self.email_entry.delete(0, END)
self.feedback_text.delete("1.0", END)
def open_browser(self):
browser(self.root)
def backHome(self):
for widget in self.root.winfo_children():
widget.destroy()
if __name__ == "__main__":
root = Tk()
app = Feedback(root)
root.mainloop()