-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainmenu.py
134 lines (104 loc) · 4.42 KB
/
mainmenu.py
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
133
134
import os
from Tkinter import *
from tkFileDialog import *
import tkMessageBox
from PIL import ImageTk,Image
def About():
tkMessageBox.showinfo('About Us','For support contact Venkat Jagaduri(IT Head) and Mohan Sha')
def createCallBack():
os.system('python createtbl.py')
tkMessageBox.showinfo( "Alert", "Executed Create Table")
def imxlsCallBack():
os.system('python 1.importdata.py')
tkMessageBox.showinfo( "Alert", "Imported XLS Data")
def genCallBack():
os.system('python 2.make_att_record.py')
os.system('python 3.make_att_report.py')
tkMessageBox.showinfo( "Alert", "Generated Final Attendance")
def checkCallBack():
os.system('python check.py')
def checkdbCallBack():
os.system('python checkdb.py')
def checkcfgCallBack():
os.system('python checkcfg.py')
def checkhraCallBack():
os.system('python checkhra.py')
def holidayCallBack():
os.system('python holiday.py')
tkMessageBox.showinfo( "Alert", "Executed Holiday")
def calendarCallBack():
os.system('python load_calendar.py')
tkMessageBox.showinfo( "Alert", "Executed Calendar")
def imcsvCallBack():
os.system('python 1.import_csvdata.py')
tkMessageBox.showinfo( "Alert", "Imported CSV Data")
def cattCallBack():
os.system('python 4.calendar_att.py')
tkMessageBox.showinfo( "Alert", "Updated WeekOff")
def hattCallBack():
os.system('python 5.holiday_att.py')
tkMessageBox.showinfo( "Alert", "Updated Holiday ")
def emailCallBack():
os.system('python 6.email_att.py')
tkMessageBox.showinfo( "Alert", "Email(s) Sent")
def exportCallBack():
os.system('python 7.export.py')
tkMessageBox.showinfo( "Alert", "Exported")
def backupCallBack():
os.system('backup.bat')
tkMessageBox.showinfo( "Alert", "Backup successful")
def truncateCallBack():
os.system('python 8.deleteall.py')
tkMessageBox.showinfo( "Alert", "Deleted")
def archiveCallBack():
os.system('python 9.1archive.py')
tkMessageBox.showinfo( "Alert", "Archived")
def deleteCallBack():
os.system('python 10.delete.py')
tkMessageBox.showinfo( "Alert", "Deleted")
def deletehraCallBack():
os.system('python 11.deleteinhra.py')
tkMessageBox.showinfo( "Alert", "Deleted")
root = Tk()
canvas = Canvas(root, width = 300, height = 300)
canvas.pack()
img = ImageTk.PhotoImage(Image.open("logo.png"))
canvas.create_image(45, 50, anchor=NW, image=img)
menu = Menu(root)
root.config(menu=menu)
filemenu = Menu(menu)
menu.add_cascade(label="File", menu=filemenu)
filemenu.add_command(label="Check Config", command=checkcfgCallBack)
filemenu.add_command(label="Check DB", command=checkCallBack)
filemenu.add_command(label="Check Archive", command=checkhraCallBack)
filemenu.add_separator()
filemenu.add_command(label="Show Run/Backups", command=checkdbCallBack)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=root.quit)
mastermenu = Menu(menu)
menu.add_cascade(label="Master", menu=mastermenu)
mastermenu.add_command(label="Create Table", command=createCallBack)
mastermenu.add_command(label="Holiday", command=holidayCallBack)
mastermenu.add_command(label="Calendar", command=calendarCallBack)
transmenu = Menu(menu)
menu.add_cascade(label="Transaction", menu=transmenu)
transmenu.add_command(label="1. Import Data from XLS", command=imxlsCallBack)
transmenu.add_command(label="1. Import Data from CSV", command=imcsvCallBack)
transmenu.add_command(label="2. Generate Attendance", command=genCallBack)
transmenu.add_command(label="3. Updated WeekOff", command=cattCallBack)
transmenu.add_command(label="4. Update Holiday", command=hattCallBack)
transmenu.add_command(label="5. Mail Merge", command=emailCallBack)
transmenu.add_command(label="6. Export", command=exportCallBack)
adminmenu = Menu(menu)
menu.add_cascade(label="Admin", menu=adminmenu)
adminmenu.add_command(label="Backup", command=backupCallBack)
adminmenu.add_command(label="Delete All", command=truncateCallBack)
adminmenu.add_command(label="Archive", command=archiveCallBack)
adminmenu.add_command(label="Delete Table", command=deleteCallBack)
adminmenu.add_command(label="Delete In HRA", command=deletehraCallBack)
helpmenu = Menu(menu)
menu.add_cascade(label="Help", menu=helpmenu)
helpmenu.add_command(label="About Us", command=About)
root.title("Employee Attendance Manager")
root.geometry("450x180")
mainloop()