Professional Documents
Culture Documents
Project 2k19 2k20
Project 2k19 2k20
(2019-
2020)
ACKNOWLEDGEMENT
First of all , I am immensely indebted to almighty god for
his blessings and grace without which I could not have
undertaken this task and my efforts would never have
been a success.
PgNo: 3
INDEX
INTRODUCTION
OBJECT ORIENTED PROGRAMMING
PYTHON
ADDITIONAL MODULES
SOURCE CODE
OUTPUT
REFERENCE
PgNo: 4
INTRODUCTION
This program is designed using the
language python.The modules used
are Tkinter ,PIL Python Imaging
Library,Mysql Connector. The name
of the management system is
EMPLOYEE MANAGEMENT
SYSTEM. In the window we have to
enter the details of employee. Add
button stores the details in the
program, Update button add’s the
details in mysql, Delete button
delete details from mysql, Clear
button clear’s entered values,
Report button preview’s the
entered values.
PgNo: 5
OBJECT ORIENTED PROGRAMMING (OOP)
Object-oriented programming (OOP) is a
programming paradigm based on the concept
of “ objects ", which may contain data, in the
form of fields, often known as attributes; and
code, in the form of procedures, often known
as methods. A feature of objects is that an
object's procedures can access and often
modify the data fields of the object with which
they are associated. In OOP , computer
programs are designed by making them out of
objects that interact with one another.There is
significant diversity of OOP languages, but the
most popular ones are class-based, meaning
that objects are instances of classes, which
typically also determine their type.Many of
the most widely used programming languages
(such as C++, Object Pascal, Java, Python etc.)
are multi-paradigm programming languages
that support object-oriented programming to a
greater or lesser degree, typically in
combination with imperative, procedural
programming.Significant object-oriented
languages include Java ,C++ ,C#, Python ,
PHP, JavaScript, Ruby,Perl, Object Pascal,
Objective-C, Dart, Swift, Scala, Common Lisp,
and Smalltalk.
PgNo: 6
Python is an interpreted, high-level, general-purpose
programming language. Created by Guido van Rossum and
first released in 1991,
Python has a design philosophy that emphasizes code
readability, notably using significant whitespace.
It provides constructs that enable clear programming on both
small and large scales.In July 2018, Van
Rossum stepped down as the leader in the language
community.
PgNo: 7
ADDITIONAL MODULES
TKINTER
Tkinter is Python's de-facto standard GUI (Graphical
User Interface) package. It is a thin object oriented layer
on top of Tcl /Tk. Tkinter is not the only Gui
Programming toolkit for Python. It is however the most
commonly used one.
Cameron Laird calls the yearly decision to keep Tkinter
one of the minor traditions of the Python world.
PgNo: 8
SOURCE CODE
#EMPLOYEE MANAGEMENT
#MODULES
import os
import mysql.connector as sl
import tkinter as tk
from tkinter import *
from tkinter import ttk
import tkinter.messagebox as mb
from PIL import Image, ImageTk
#MYSQL
mq=sl.connect(host='localhost',user='root',password='arjun'
)
cr=mq.cursor()
if(mq.is_connected()):
print("Success")
#cr.execute('create database Tech_Soln')
cr.execute('use Tech_Soln')
#q="create table EMP(Employeeid int,Name
char(15),Surname char(15),Age int,Gender
char(10),Department char(10),Shift char(10))"
#cr.execute(q)
#mq.commit()
#FUNCTIONS
def delete():
P2=[]
P1=A.get()
P2.append(P1)
q="Delete from EMP where Employeeid = %s"
cr.execute(q,P2)
mq.commit()
PgNo: 9
def update():
mq.commit()
def clear():
Ca.set('')
Cb.set('')
Cc.set('')
Cd.set('')
Ce.set(0)
Cf.set('')
Cg.set('')
def add():
try:
C1=Ca.get()
C2=Cb.get()
C3=Cc.get()
C4=Cd.get()
C6=Cf.get()
C7=Cg.get()
C5=Ce.get()
if(C5==1):
c5 = 'Male'
elif(C5==2):
c5 = 'Female'
values = (C1,C2,C3,C4,c5,C6,C7)
q="insert into EMP values(%s ,%s ,%s ,%s ,%s ,%s ,%s )"
cr.execute(q, values)
except BaseException:
a=mb.askokcancel("Warning!!","Please fill all fields!!")
def Preview():
C1=Ca.get()
Re.insert(END,C1+'\n')
PgNo: 10
#MAIN SCREEN(MS)
MS=Tk()
MS.title("Employee Management System")
MS.geometry('1350x700+0+0')
MS.configure(background='lightyellow')
t=Frame(MS,width=500,height=50,bg="lightyellow")
t.pack(side=TOP,expand=True,fill=BOTH)
t1=Frame(MS,width=500,height=400,bd=1,bg="lightyellow")
t1.pack(side=LEFT,expand=True,fill=BOTH)
t2=Frame(MS,width=500,height=400,bd=1,bg="lightyellow")
t2.pack(side=RIGHT,expand=True,fill=BOTH)
l = Image.open("C:\\Users\\Arjun\\Desktop\\Scanned
files\\logo.jpg")
r = ImageTk.PhotoImage(l)
img = Label(t, image=r)
img.image = r
img.grid(row=0,column =0)
A=StringVar()
S=LabelFrame(t,width=100,height=100,font=("arial",18,'bold'),
text=' Search',bg="lightyellow",fg="brown")
S.grid(row=0,column=3)
name=Entry(S,textvariable=A,font=('arial',16,'bold'),bd=2,width=
16,justify='left')
name.grid(row=1,column=1)
L=Label(t,font=('arial',16),bg="lightyellow",text="Welcome to
Tech - Solution")
L.grid(row=0,column=1)
PgNo: 11
G=Label(t,font=('arial',12),bg="lightyellow",text="(Active
Maintainance Management Assistant)")
G.grid(row=1,column=1)
F=Label(t,font=('arial',12),bg="lightyellow",text="Easily Manage
Your Employee Directoy")
F.grid(row=2,column=1)
Logout=Button(t,padx=5,font=('arial',18,'bold'),width=6,bg='wh
ite',text='LOGOUT').grid(row=1,column=7)
#ENTRY DESIGN
#operations
OP=LabelFrame(t2,width=100,height=100,font=('arial',18,'bold'
), text=' Operations',bg="lightyellow",fg="red")
OP.grid(row=0,column=1)
Update=Button(OP,padx=5,command=update,font=('arial',14,'b
old'),width=5,bg='white',text='Update').grid(row=0,column=0)
Delete=Button(OP,padx=5,command=delete,font=('arial',14,'bol
d'),width=5,bg='white',text='Delete').grid(row=1,column=0)
Add=Button(OP,padx=5,command=add,font=('arial',14,'bold'),w
idth=5,bg='white',text='Add').grid(row=2,column=0)
Clear=Button(OP,padx=5,command=clear,font=('arial',14,'bold')
,width=5,bg='white',text='Clear').grid(row=3,column=0)
No=Label(OP,bg="lightyellow").grid(row=4,column=0)
Report=Button(OP,padx=5,command=Preview,font=('arial',18,'b
old'),width=6,bg='white',text='Report').grid(row=5,column=0)
No=Label(OP,bg="lightyellow").grid(row=6,column=0)
Print=Button(OP,padx=5,font=('arial',18,'bold'),width=6,bg='wh
ite',text='Print').grid(row=7,column=0)
PgNo: 12
#Preview
Rec=LabelFrame(t2,width=100,height=100,bg="lightyellow",font
=('arial',22),fg="brown",text="l EmployeeID l l Name l l
Age l l Gender l l Shift l")
Rec.grid(row=0,column=2)
Pri=Label(Rec,width=100,height=28,font=('arial',10,'bold'),bg="
white")
Pri.grid(row=0,column=0)
Re=Text(Pri, width=115, height=28,font=('arial',10,'bold'))
Re.grid(row=0,column=0)
#employee info
EIN=LabelFrame(t1,width=500,height=480,font=('arial',18,'bold')
, text='Employee Info',bg="lightyellow",fg="blue")
EIN.grid(row=0,column=0)
Ca=StringVar()
Empid=Label(EIN,text="EmployeeID",font=('arial',12,'bold'),bd=
20,fg="black",bg="lightyellow").grid(row=0,column=0,sticky=W)
eid=Entry(EIN,textvariable=Ca,font=('arial',16,'bold'),bd=3,width
=18,justify='left')
eid.grid(row=0,column=1)
Cb=StringVar()
Name=Label(EIN,text="Name",font=('arial',12,'bold'),bd=20,fg="
black",bg="lightyellow").grid(row=1,column=0,sticky=W)
name=Entry(EIN,textvariable=Cb,font=('arial',16,'bold'),bd=3,wi
dth=18,justify='left')
name.grid(row=1,column=1)
PgNo: 13
Cc=StringVar()
Surname=Label(EIN,text="Surname",font=('arial',12,'bold'),bd=2
0,fg="black",bg="lightyellow").grid(row=2,column=0,sticky=W)
sname=Entry(EIN,textvariable=Cc,font=('arial',16,'bold'),bd=3,wi
dth=18,justify='left')
sname.grid(row=2,column=1)
Cd=IntVar()
Age=Label(EIN,
font=('arial',12,'bold'),text="Age",bd=20,fg="black",bg="lightyell
ow").grid(row=3,column=0,sticky=W)
AGE=ttk.Combobox(EIN, textvariable=Cd,
state='readonly',font=('arial',14),width=12)
AGE['value']=('Select','25','26','27','28','29','30','31','32','33','34','
35')
AGE.current(0)
AGE.grid(row=3,column=1)
Cg=StringVar()
Shift=Label(EIN,text="Shift",font=('arial',12,'bold'),bd=20,fg="b
lack",bg="lightyellow").grid(row=6,column=0,sticky=W)
shift=Entry(EIN,textvariable=Cg,font=('arial',16,'bold'),bd=3,wi
dth=18,justify='left')
shift.grid(row=6,column=1)
=======================
PgNo: 15
OUTPUT
Main Screen
PgNo: 16
Detail’s display screen
PgNo: 17
Reference
https://en.m.wikipedia.org/wiki/Object-oriented_programming
https://wiki.python.org/moin/Tklnter
https://en.m.wikipedia.org/wiki/Python_Imaging_Library
https://en.m.wikipedia.org/wiki/Python_(programming_language)
PgNo: 18