|
|
@ -40,7 +40,7 @@ class FootSpaManagementSystem:
|
|
|
|
|
|
|
|
|
|
|
|
if username == admin_username and password == admin_password:
|
|
|
|
if username == admin_username and password == admin_password:
|
|
|
|
messagebox.showinfo("管理员登录", "登录成功!")
|
|
|
|
messagebox.showinfo("管理员登录", "登录成功!")
|
|
|
|
# Add code here for handling admin login success
|
|
|
|
self.show_admin_options()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
messagebox.showerror("管理员登录", "用户名或密码错误")
|
|
|
|
messagebox.showerror("管理员登录", "用户名或密码错误")
|
|
|
|
|
|
|
|
|
|
|
@ -65,6 +65,55 @@ class FootSpaManagementSystem:
|
|
|
|
self.login_button = tk.Button(self.admin_login_window, text="登录", command=self.admin_login)
|
|
|
|
self.login_button = tk.Button(self.admin_login_window, text="登录", command=self.admin_login)
|
|
|
|
self.login_button.pack()
|
|
|
|
self.login_button.pack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def show_user_info(self):
|
|
|
|
|
|
|
|
user_info_window = tk.Toplevel(self.root)
|
|
|
|
|
|
|
|
user_info_window.title("用户信息")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
with open(self.user_data_file, "r") as file:
|
|
|
|
|
|
|
|
user_data = file.readlines()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if user_data:
|
|
|
|
|
|
|
|
for user_info in user_data:
|
|
|
|
|
|
|
|
username = user_info.strip()
|
|
|
|
|
|
|
|
label = tk.Label(user_info_window, text=username)
|
|
|
|
|
|
|
|
label.pack()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
label = tk.Label(user_info_window, text="暂无用户信息")
|
|
|
|
|
|
|
|
label.pack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def show_technician_info(self):
|
|
|
|
|
|
|
|
technician_info_window = tk.Toplevel(self.root)
|
|
|
|
|
|
|
|
technician_info_window.title("Technician Information")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
technician_data_file = "technician_data.txt" # 技师数据文件的路径
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
with open(technician_data_file, "r") as file:
|
|
|
|
|
|
|
|
technician_data = file.readlines()
|
|
|
|
|
|
|
|
if technician_data:
|
|
|
|
|
|
|
|
for tech_info in technician_data:
|
|
|
|
|
|
|
|
technician_name, technician_specialty = tech_info.strip().split(",") # 假设数据以逗号分隔
|
|
|
|
|
|
|
|
label = tk.Label(technician_info_window,
|
|
|
|
|
|
|
|
text=f"姓名:{technician_name},专长:{technician_specialty}")
|
|
|
|
|
|
|
|
label.pack()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
label = tk.Label(technician_info_window, text="暂无技师信息")
|
|
|
|
|
|
|
|
label.pack()
|
|
|
|
|
|
|
|
except FileNotFoundError:
|
|
|
|
|
|
|
|
label = tk.Label(technician_info_window, text="找不到技师数据文件")
|
|
|
|
|
|
|
|
label.pack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def show_admin_options(self):
|
|
|
|
|
|
|
|
self.admin_login_window.pack_forget()
|
|
|
|
|
|
|
|
self.admin_options_window = tk.Frame(self.root)
|
|
|
|
|
|
|
|
self.admin_options_window.pack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.user_info_button = tk.Button(self.admin_options_window, text="查看用户信息", command=self.show_user_info)
|
|
|
|
|
|
|
|
self.user_info_button.pack()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.technician_info_button = tk.Button(self.admin_options_window, text="查看技师信息",command=self.show_technician_info)
|
|
|
|
|
|
|
|
self.technician_info_button.pack()
|
|
|
|
|
|
|
|
|
|
|
|
#用户注册函数
|
|
|
|
#用户注册函数
|
|
|
|
def register_user(self):
|
|
|
|
def register_user(self):
|
|
|
|
username = self.username_entry.get()
|
|
|
|
username = self.username_entry.get()
|
|
|
|