-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.py
More file actions
97 lines (79 loc) · 3.02 KB
/
admin.py
File metadata and controls
97 lines (79 loc) · 3.02 KB
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
from Tkinter import *
import MySQLdb
db = MySQLdb.connect(host="localhost", # your host, usually localhost
user="root", # your username
passwd="", # your password
db="college") # name of the data base
cur= db.cursor()
root = Tk()
topframe=Frame(root,width=1600,height=150)
topframe.pack()
bottomframe=Frame(root,width=1600,height=650)
bottomframe.pack()
scrollbar= Scrollbar(root)
scrollbar.pack(side=RIGHT,fill=Y)
y=Canvas(topframe,width=1600,height=150,background="#2E86C1")
y.pack(side=LEFT,expand=YES,fill=BOTH)
x=Canvas(bottomframe,width=1600,height=650)
x.pack(side=LEFT,expand=YES,fill=BOTH)
root.title("College management")
root.geometry("1600x800+0+0")
gif1 = PhotoImage(file = 'HMR.gif')
y.create_image(0, 0, image = gif1, anchor = NW)
instruction=Label(x,text='Kindly Fill The Following Fields\n')
instruction.grid(sticky=N)
rollnol = Label(x,text='Roll Number')
namel = Label(x, text='Name') # More labels
emaill = Label(x, text='Email') # ^
rollnol.grid(row=1, sticky=N)
namel.grid(row=2, sticky=N)
emaill.grid(row=3, sticky=N)
rollnoe = Entry(x)
namee = Entry(x) # The entry input
emaile = Entry(x)
rollnoe.grid(row=1,column=1)
namee.grid(row=2, column=1)
emaile.grid(row=3, column=1)
name=namee.get()
rollno=rollnoe.get()
email=emaile.get()
def Modify():
x.delete("all")
cur.execute("")
def Addec():
x.delete("all")
cur.execute("INSERT INTO ec VALUES('%s','%s','%s')"%(rollno,name,email))
db.commit()
def Addee():
x.delete("all")
cur.execute("INSERT INTO ee VALUES('%s','%s','%s')"%(rollno,name,email))
db.commit()
def Addcse():
x.delete("all")
cur.execute("INSERT INTO cse VALUES('%s','%s','%s')"%(rollno,name,email))
db.commit()
def Delete():
x.delete("all")
cur.execute("DELETE FROM ee,ec,cse WHERE roll_no='%s'"%(rollno))
db.commit()
#modifybutton= Button(topframe,text="EDIT",fg="blue",command=Modify)
addcsebutton= Button(topframe,text="ADD TO CSE",fg="blue",command=Addcse)
addeebutton= Button(topframe,text="ADD TO EE",fg="blue",command=Addee)
addecbutton= Button(topframe,text="ADD TO EC",fg="blue",command=Addec)
deletebutton= Button(topframe,text="DELETE",fg="blue",command=Delete)
#modifybutton.configure(relief=FLAT)
addcsebutton.configure(relief=FLAT)
addeebutton.configure(relief=FLAT)
addecbutton.configure(relief=FLAT)
deletebutton.configure(relief=FLAT)
#modifybutton_window = y.create_window(560, 100, anchor=W, window=modifybutton)
addcsebutton_window = y.create_window(500, 100, anchor=W, window=addcsebutton)
addeebutton_window = y.create_window(600, 100, anchor=W, window=addeebutton)
addecbutton_window = y.create_window(700, 100, anchor=W, window=addecbutton)
deletebutton_window = y.create_window(800, 100, anchor=W, window=deletebutton)
m = Menu(root)
root.config(m=m)
filemenu = Menu(m)
m.add_cascade(label="File", m=filemenu)
filemenu.add_command(label="Exit", command=root.destroy)
root.mainloop()