Employee Management
Employee Management
CLASS: XII A
Under the guidance of
Mr. MANOJ BALANI
COMPUTER SCIENCE
DEPARTMENT OF COMPUTER
SCIENCE
SIR MUTHA SCHOOL, CHENNAI
ACKNOWLEDGEMENT
INDEX
1. Acknowledgement………………………..
2. Introduction………………………………..
4. Why python………………………………..
5. Code………………………………………….
6. Output……………………………………..
7. Further Development…………………….
8. Bibliography……………………………….
INTRODUCTION
The purpose of the employee management
system is to provide a mechanism that
handles office operations using a computer
within a fraction of a second. As the name
suggests it is connected to the employees
of
the workplace. It records full employee
information like the Name, Date of joining,
calculating the salary with the number of
holidays taken, the post of the employee,
the
number of holidays taken in a month,
Deleting the employee, bonus, and
promotion. The employees can apply for
their
leave, there are only a small number of
leaves
in a month
HARDWARE AND
SOFTWARE USED
HARDWARE USED:
LAPTOP-O40VO6QV
SOFTWARE USED:
Python, MYSQL
WHY PYTHON?
Python is a very productive language.
We don’t need to spend too much time
understanding the syntax or behaviour of
the
programming language. Python is an
interpreted language which means that
Python directly executes the code line by
line.
In case of any error, it stops further
execution and reports back the error which
has occurred.
Python shows only one error even if the
program has multiple errors. This
makes debugging easier.
con = mysql.connector.connect(
host="localhost", user="root", password="",
database="emp")
def Add_Employee():
Id = input("Enter Employee Id : ")
if(check_employee(Id) == True):
print("Employee aready exists\nTry Again\n")
menu()
else:
Name = input("Enter Employee Name : ")
Post = input("Enter Employee Post : ")
Salary = input("Enter Employee Salary : ")
data = (Id, Name, Post, Salary)
sql = 'insert into empd values(%s,%s,%s,%s)'
c = con.cursor()
c.execute(sql, data)
con.commit()
print("Employee Added Successfully ")
menu()
def Promote_Employee():
Id = int(input("Enter Employ's Id"))
if(check_employee(Id) == False):
print("Employee does not exists\nTry Again\
n")
menu()
else:
Post = input("Enter change in post")
c.execute(sql, data)
r = c.fetchone()
t = Post
c.execute(sql, d)
con.commit()
print("Employee Promoted")
menu()
def Bonus_Employee():
Id = int(input("Enter Employ's Id"))
if(check_employee(Id) == False):
print("Employee does not exists\nTry Again\
n")
menu()
else:
bn = int(input("Enter Bonus:"))
c.execute(sql, data)
r = c.fetchone()
t = r[0]+bn
c.execute(sql, d)
con.commit()
print("Bonus Added")
menu()
def leave_Employee():
Id=input("Enter employee Id")
day=int(input("Enter the number of leave
days"))
if (day<=3):
print("LEAVE GRANTED")
print("EMPLOYEE ID:",Id,",",day,"DAYS
LEAVE GRANTED")
else:
print("PLEASE SEEK PERMISSION FROM THE
HR MANAGER")
menu()
def Remove_Employee():
Id = input("Enter Employee Id : ")
if(check_employee(Id) == False):
print("Employee does not exists\nTry Again\
n")
menu()
else:
con.commit()
print("Employee Removed")
menu()
def check_employee(employee_id):
c = con.cursor(buffered=True)
data = (employee_id,)
c.execute(sql, data)
r = c.rowcount
if r == 1:
return True
else:
return False
def Display_Employees():
c.execute(sql)
r = c.fetchall()
for i in r:
print("Employee Id : ", i[0])
print("Employee Name : ", i[1])
print("Employee Post : ", i[2])
print("Employee Salary : ", i[3])
print("---------------------\
-----------------------------\
------------------------------\
---------------------")
menu()
def menu():
print(" Employee Management System")
print("Press: ")
print("1 to Add Employee")
print("2 to Remove Employee ")
print("3 to Display Employee")
print("4 to Bonus Employees")
print("5 to promote Employee")
print("6 to Grant leave")
print("7 tO Exit")
menu()
OUTPUT
FURTHER
DEVELOPMENT
https://
www.anjeevsinghacademy.com/
python1