|
|
|
@ -0,0 +1,138 @@
|
|
|
|
|
from tkinter import *#图形界面库
|
|
|
|
|
import pymysql
|
|
|
|
|
from tkinter import ttk
|
|
|
|
|
import tkinter as tk
|
|
|
|
|
import tkinter.font as tkFont
|
|
|
|
|
import tkinter.messagebox as messagebox #弹窗
|
|
|
|
|
class StartPage:
|
|
|
|
|
def __init__(self, parent_window):
|
|
|
|
|
parent_window.destroy()#销毁子界面
|
|
|
|
|
self.window = tk.Tk()
|
|
|
|
|
self.window.title('某期刊的在线投稿审稿管理系统')
|
|
|
|
|
self.window.geometry('300x470')
|
|
|
|
|
label=Label(self.window,text="某期刊的在线投稿审稿管理系统",font=("Verdana",20))
|
|
|
|
|
label.pack(pady=100)#pady=100界面的长度
|
|
|
|
|
Button(self.window,text="作者登录",font=tkFont.Font(size=16),command=lambda:Authorlogin,
|
|
|
|
|
height=2,fg='white',bg='gray',activebackground='black',activeforeground='white').place(pady=25)
|
|
|
|
|
Button(self.window,text="审稿人登录",font=tkFont.Font(size=16),command=lambda:Reviewerlogin,
|
|
|
|
|
height=2,fg='white',bg='gray',activebackground='black',activeforeground='white').place(pady=25)
|
|
|
|
|
self.window.mainloop()#主消息循环
|
|
|
|
|
def login(self):
|
|
|
|
|
print(str(self.author_account.get()))
|
|
|
|
|
print(str(self.author_password.get()))
|
|
|
|
|
author_password=None
|
|
|
|
|
#数据库操作 查询作者表
|
|
|
|
|
db = pymysql.connect(
|
|
|
|
|
host='127.0.0.1',
|
|
|
|
|
port=3306,
|
|
|
|
|
user='root',
|
|
|
|
|
passwd='123456',
|
|
|
|
|
database='投稿',
|
|
|
|
|
charset='utf8',
|
|
|
|
|
#cursorclass=pymysql.cursors.DictCursor # 游标类型默认为元组,现在我们设置为字典类型
|
|
|
|
|
)
|
|
|
|
|
cursor = db.cursor()#使用cursor()方法获取操作游标
|
|
|
|
|
sql="select * from author where author_account='%s'" % self.author_account.get()
|
|
|
|
|
try:
|
|
|
|
|
#执行sql语句
|
|
|
|
|
cursor.execute(sql)
|
|
|
|
|
#获取所有记录列表
|
|
|
|
|
result = cursor.fetchall()
|
|
|
|
|
for row in result:
|
|
|
|
|
author_id=row[0]
|
|
|
|
|
author_password=row[1]
|
|
|
|
|
#打印结果
|
|
|
|
|
print("author_id=%s,author_password=%s" % (author_id,author_password))
|
|
|
|
|
except:
|
|
|
|
|
print("Error:unable to fecth date")
|
|
|
|
|
messagebox.showinfo("Error", "Author not found.")
|
|
|
|
|
db.close()
|
|
|
|
|
print("正在登录作者界面")
|
|
|
|
|
print("self",self.author_password)
|
|
|
|
|
print("local",author_password)
|
|
|
|
|
if self.author_password.get()==author_password:
|
|
|
|
|
AuthorManage(self.window)#进入作者操作界面
|
|
|
|
|
else:
|
|
|
|
|
messagebox.showinfo("Error", "Author not found.")
|
|
|
|
|
def back(self):
|
|
|
|
|
StartPage(self.window)#显示主窗口 销毁本窗口
|
|
|
|
|
|
|
|
|
|
def login(self):
|
|
|
|
|
print(str(self.reviewer_account.get()))
|
|
|
|
|
print(str(self.reviewer_password.get()))
|
|
|
|
|
reviewer_password=None
|
|
|
|
|
#数据库操作 查询作者表
|
|
|
|
|
db = pymysql.connect(
|
|
|
|
|
host='127.0.0.1',
|
|
|
|
|
port=3306,
|
|
|
|
|
user='root',
|
|
|
|
|
passwd='123456',
|
|
|
|
|
database='投稿',
|
|
|
|
|
charset='utf8',
|
|
|
|
|
#cursorclass=pymysql.cursors.DictCursor # 游标类型默认为元组,现在我们设置为字典类型
|
|
|
|
|
)
|
|
|
|
|
cursor = db.cursor()#使用cursor()方法获取操作游标
|
|
|
|
|
sql="select * from reviewer where author_account='%s'" % self.reviewer_account.get()
|
|
|
|
|
try:
|
|
|
|
|
#执行sql语句
|
|
|
|
|
cursor.execute(sql)
|
|
|
|
|
#获取所有记录列表
|
|
|
|
|
result = cursor.fetchall()
|
|
|
|
|
for row in result:
|
|
|
|
|
reviewer_id=row[0]
|
|
|
|
|
reviewer_password=row[1]
|
|
|
|
|
#打印结果
|
|
|
|
|
print("author_id=%s,reviewer_password=%s" % (reviewer_id,reviewer_password))
|
|
|
|
|
except:
|
|
|
|
|
print("Error:unable to fecth date")
|
|
|
|
|
messagebox.showinfo("Error", "Author not found.")
|
|
|
|
|
db.close()
|
|
|
|
|
print("正在登录作者界面")
|
|
|
|
|
print("self",self.reviewer_password)
|
|
|
|
|
print("local",reviewer_password)
|
|
|
|
|
if self.reviewer_password.get()==reviewer_password:
|
|
|
|
|
ReviewerManage(self.window)#进入作者操作界面
|
|
|
|
|
else:
|
|
|
|
|
messagebox.showinfo("")
|
|
|
|
|
def back(self):
|
|
|
|
|
StartPage(self.window)#显示主窗口 销毁本窗口
|
|
|
|
|
#作者账号设置
|
|
|
|
|
class Authorlogin:
|
|
|
|
|
def __init__(self,parent_window):
|
|
|
|
|
parent_window.destroy()
|
|
|
|
|
self.window=tk.Tk()#初始框的声明
|
|
|
|
|
self.window.title('请先登录作者账户')
|
|
|
|
|
self.window.geometry('500x500')
|
|
|
|
|
label=tk.Label(self.window,text='作者登录',bg='pink',ront=('Verdana',20),width=30,height=40)
|
|
|
|
|
label.pack()
|
|
|
|
|
label(self.window,text='作者账号:',font=tkFont.Font(size=14)).pack(pady=25)
|
|
|
|
|
self.author_account=tk.Entry(self.window,font=tkFont.Font(size=14))
|
|
|
|
|
self.author_account.pack()
|
|
|
|
|
Label(self.window,text='作者密码:',font=tkFont.Font(size=14)).pack(pady=25)
|
|
|
|
|
self.author_password=tk.Entry(self.window,font=tkFont.Font(size=14),bg='Ivory',show='*')
|
|
|
|
|
self.author_password.pack()
|
|
|
|
|
Button(self.window,text="修改密码",width=8,font=tkFont.Font(size=12),command=self.login_change).pack(pady=25)
|
|
|
|
|
Button(self.window, text="创建账号", width=8, font=tkFont.Font(size=12), command=self.login_create).pack(pady=25)
|
|
|
|
|
Button(self.window, text="返回首页", width=8, font=tkFont.Font(size=12), command=self.back).pack(pady=25)
|
|
|
|
|
self.window.protocol("WM_DELETE_WINDOW",self.back)#捕捉右上角关闭点击
|
|
|
|
|
self.window.mainloop()#进入消息循环
|
|
|
|
|
#审稿人账号设置
|
|
|
|
|
class Reviewerlogin:
|
|
|
|
|
def __init__(self,parent_window):
|
|
|
|
|
parent_window.destroy()
|
|
|
|
|
self.window=tk.Tk()#初始框的声明
|
|
|
|
|
self.window.title('请先登录审稿人账户')
|
|
|
|
|
self.window.geometry('500x500')
|
|
|
|
|
label=tk.Label(self.window,text='审稿人登录',bg='green',ront=('Verdana',20),width=30,height=40)
|
|
|
|
|
label.pack()
|
|
|
|
|
label(self.window,text='审稿人账号:',font=tkFont.Font(size=14)).pack(pady=25)
|
|
|
|
|
self.reviewer_account=tk.Entry(self.window,font=tkFont.Font(size=14))
|
|
|
|
|
self.reviewer_account.pack()
|
|
|
|
|
Label(self.window,text='作者密码:',font=tkFont.Font(size=14)).pack(pady=25)
|
|
|
|
|
self.reviewer_password=tk.Entry(self.window,font=tkFont.Font(size=14),bg='Ivory',show='*')
|
|
|
|
|
self.reviewer_password.pack()
|
|
|
|
|
Button(self.window,text="修改密码",width=8,font=tkFont.Font(size=12),command=self.login_change).pack(pady=25)
|
|
|
|
|
Button(self.window, text="创建账号", width=8, font=tkFont.Font(size=12), command=self.login_create).pack(pady=25)
|
|
|
|
|
Button(self.window, text="返回首页", width=8, font=tkFont.Font(size=12), command=self.back).pack(pady=25)
|
|
|
|
|
self.window.protocol("WM_DELETE_WINDOW",self.back)#捕捉右上角关闭点击
|
|
|
|
|
self.window.mainloop()#进入消息循环
|