Professional Documents
Culture Documents
School
A
Project Report
on
Employee Management
CERTIFICATE
This is to certify that Kratika Mittal, Manish Suryakant Jain and Mohit Chandel of
Class XII A, has successfully completed the investigatory project on the topic Employee
Management under the guidance of Mr. Sunil Nehra (PGT, Computer Science) during
the academic year 2019-20 in the partial fulfillment of AISSCE Practical Examination
conducted by CBSE.
My sincere thanks goes to Dr Bela Joshi, our Principal Madam, for her coordination in
extending every possible support for completion of this project.
I also thanks to my parents for their motivation and support. I must thanks to my
classmates for their timely help and support for compilation of this project.
Last but not least, I would like to those who had helped directly or indirectly towards the
completion of this project.
1. Introduction
4. Coding
5. Output Scenes
7. Bibliography
INTRODUCTION
One more table named post in MySQL5.0 to store information about post code
and name.
One more table named staff in MySQL5.0 to store information about employee
(staff) name, address, phone number, salary and post.
Table: cred
Table: staff
Table: department
Table: post
CODING
import mysql.connector as my
yu="n"
while yu=="n":
print("---1-FOR LOGIN---")
print("---2-FOR SIGNUP---")
print("---0-EXIT---")
a6=input("ENTER:-")
if a6=="1":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
row=cur.fetchall()
for r in row:
if r[0]==pswd:
print("Sucessfully Login!")
cur.close()
# !!!department's employee management functions!!!
f0="n"
while f0=="n":
print("""
---1-Employee Details---
---2-Department Functions---
---3-Post Details---
---0-LOGOUT---""")
a=input("ENTER:-")
if a=="1":
f1="n"
while f1=="n":
print("")
a1=input("ENTER:-")
# !!!all details!!!
if a1=="1":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
for i in cur:
print(i)
con.close()
# !!!searcher!!!
if a1=="2":
y="y"
while y=="y":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
cur.execute("select * from staff where s_id='"+eid+"'")
for i in cur:
print(i)
con.close()
# !!!changer!!!
if a1=="3":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
print("""
---1-Change name---
---2-Change Contact---
---3-Change Address---
---4-Change Salary---""")
a10=input("ENTER:-")
if a10=="1":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
con.commit()
con.close()
print("Record Updated!")
if a10=="2":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
con.commit()
con.close()
print("Record Updated!")
if a10=="3":
cur=con.cursor()
con.commit()
con.close()
print("Record Updated!")
if a10=="4":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
con.commit()
con.close()
print("Record Updated!")
# !!!adder!!!
if a1=="4":
nid=input("Enter ID:-")
nna=input("Enter name:-")
nad=input("Enter address:-")
nap=input("Enter Contact:-")
nsa=input("Enter Salary:-")
npo=input("Enter post:-")
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
con.commit()
con.close()
print("Details Saved!")
else:
# !!!remover!!!
if a1=="5":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
if x==None:
print("Invalid Id!")
else:
con.commit()
con.close()
print("Record Removed!")
if a1=="0":
f1="y"
# !!!Department Functions!!!
if a=="2":
f1="n"
while f1=="n":
print("""
---1-See Department---
---2-Search Department---
---3-Add Department---
---4-Remove Department---
---5-Upadate Department---
# !!!see Department!!!
if a2=="1":
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
for i in cur:
print(i)
# !!!search item!!!
if a2=="2":
ad="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
cur.execute("select * from department where deptcode='"+a+"'")
for i in cur:
print(i)
# !!!Add Department!!!
if a2=="3":
ad="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchall()
if x==None:
print("Try Again!")
else:
print("Sucessfully Added!")
con.commit()
con.close()
# !!!remover!!!
if a2=="4":
ad="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
con.commit()
con.close()
print("Deleted Sucessfully!")
# !!!updater!!!
if a2=="5":
ad="y"
print("""
i=input("ENTER:-")
if i=="1":
e="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
cur.execute("update department set deptname='"+na+"' where
deptcode='"+a+"'")
con.commit()
con.close()
if i=="2":
e="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Id!")
else:
con.commit()
con.close()
e=input("Change Any Other Package(y/n):-")
print("Record Updated!")
if a2=="0":
f1="y"
print("Department Closed!")
# !!!post functions!!!
if a=="3":
qp="n"
while qp=="n":
print("""
---2-Update Post---
a3=input("ENTER:-")
if a3=="1":
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
cur.execute("select * from post")
for i in cur:
print(i)
con.close()
# !!!Updater!!!
if a3=="2":
er="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Invalid Code!")
else:
con.commit()
con.close()
print("Post Updated!")
if a3=="3":
ui="y"
---2-Remove Post---""")
rty=input("ENTER:-")
if rty=="1":
df="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
itq=input("Enter No_Of_Employees:-")
x=cur.fetchall()
if x==None:
con.commit()
con.close()
print("Post Added!")
else:
if rty=="2":
op="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
x=cur.fetchone()
if x==None:
else:
con.close()
print("Post Removed!")
if a3=="0":
qp="y"
print("Posts Closed!")
if a=="4":
lk="n"
print("""
---0-For Exit---""")
jkl=input("ENTER:-")
if jkl=="1":
ty="y"
while ty=="y":
print("""
---1-Update LoginID---
---2-Update Password---""")
rt=input("ENTER:-")
if rt=="1":
nm="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
x=cur.fetchone()
if x==None:
else:
con.commit()
con.close()
print("LoginID Updated!")
nm="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
oid=input("Enter LoginID:-")
x=cur.fetchone()
if x==None:
else:
con.commit()
con.close()
print("Password Updated!")
if jkl=="2":
nm="y"
con=my.connect(host='localhost',user="root",passwd="manager",database="empmanage"
)
cur=con.cursor()
oid=input("Enter LoginID:-")
x=cur.fetchone()
if x==None:
else:
con.commit()
con.close()
print("LoginID Removed!")
if jkl=="0":
lk="y"
print("Sucessfully Exit!")
if a=="0":
f0="y"
print("Sucessfully LOGOUT!")
else:
print("Try Again!!")
# !!!Signup Function!!!
if a6=="2":
y="y"
con=my.connect(host="localhost",user="root",passwd="manager",database="empmanage
")
cur=con.cursor()
x=cur.fetchone()
if x==None:
print("Sucessfully Saved!")
con.commit()
con.close()
else:
print("UserID Already Exists!")
# !!!Programme Closer!!!
if a6=="0":
yu="y"
print("Programme Closed!")
OUTPUT
Main Record, Employee Details, Insert record, Show Particular
Record, Delete Record, Department record, Post Record, Delete
Record, Update Record.
Limitations and Enhancement
Limitations:
Enhancement:
1. www.google.com
3. https://www.w3schools.com/python