[go: up one dir, main page]

0% found this document useful (0 votes)
16 views18 pages

Sahil CS Project

This document is an investigatory project report on an "Employee Management System" created using Python and MySQL for a school practical examination. It includes an acknowledgment, laboratory certificate, table of contents, description of the system, source code of the program, output screen layouts, and system requirements. The program allows users to view, add, search, edit, delete employees and generate pay slips by connecting to a MySQL database containing employee records.

Uploaded by

Heramb Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views18 pages

Sahil CS Project

This document is an investigatory project report on an "Employee Management System" created using Python and MySQL for a school practical examination. It includes an acknowledgment, laboratory certificate, table of contents, description of the system, source code of the program, output screen layouts, and system requirements. The program allows users to view, add, search, edit, delete employees and generate pay slips by connecting to a MySQL database containing employee records.

Uploaded by

Heramb Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

PM SHRI Kendriya Vidyalaya

jhunjhunu

An Investigatory Project Report


on
“Employee management system ”

for
SSCE Practical Examination 2023-24
[As a part of the subject Computer Science (083)]

Guided By: Submitted By:


Mr. Lokesh Saini Name: Sahil
PGT(Computer Science) Roll No:

Acknowledgement
Words seem to count short in number, when we get to acknowledge all those who have
helped me in the process of the development of this project. Their fruitful guidance,
encouragement, support and supervision had given me a positive dimension for the
initiation and completion of this project.

First and foremost, we would like to thank Mr. O. R. Choudhary Sir (Principal ,PM
Shri K.V. Jhunjhunu), for providing me with an opportunity to study in this esteemed
institution.

we would also like to thank our Computer Science teacher Mr. Lokesh Saini, PGT
Computer Science, PM Shri K.V. Jhunjhunu for being a true mentor and by providing
great support throughout the project.
Above all, we would like to thank our school, our parents who always inspired us always
in all endeavours.

Thanks everyone!

SAHIL
Class – XII- Science
Laboratory Certificate

This is to certify that Sahil of Class XII – Science has

successfully completed his project work on “Employee

Management System” in Computer Science (Code 083)

and here by submitting his report as an evidence of the

project work for the session 2023-24.

Mr. Lokesh Saini


PGT Computer Science

PM Shri K.V. Jhunjhunu


TABLE OF CONTENTS
1. COVER PAGE

2. ACKNOWLEDGEMENT

3. LABORATORY CERTIFICATE

4. TABLE OF CONTENTS

5. Description

6. System requirement

7. Source code

8. OUTPUT SCREEN LAYOUTS

Employee management system


Description:This is a python and mysql connectivity
program which deals with employee management. We
can see employee list, add a new employee, search an
employee, edit employee, delete employee, generate pay
slip.

source code of program


import mysql.connector as mycon
cn=mycon.connect(host='localhost',user='root',passwd="almightyheramb",data
base="company")

cur = cn.cursor()

def showAll():

global cn

global cur

try:

query="select * from emp"

cur.execute(query)

results = cur.fetchall()

print("**************************************************")

print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')

print("**************************************************")

count=0

for row in results:

print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])

count+=1

print("*************** TOTAL RECORD : ",count,"**********")

except:

print("error")

def addEmp():

global cn,cur

print("*******************ADD NEW
EMPLOYEE**************************")
eno = int(input("Enter employee number :"))

en = input("Enter employee name :")

dp = input("Enter department ")

sl = int(input("Enter Salary :"))

query="insert into emp values("+str(eno)+",'"+en+"','"+dp+"',"+str(sl)+")"

cur.execute(query)

cn.commit()

#print(query)

print("\n ## RECORD ADDED SUCCESSFULLY!")

def searchEmp():

global cn,cur

print("*******************SEARCH EMPLOYEE FORM


**************************")

en = int(input("Enter Employee number to search :"))

query="select * from emp where empno="+str(en)

cur.execute(query)

results = cur.fetchall()

if cur.rowcount<=0:

print("## SORRY! NO MATCHING DETAILS AVAILABLE ##")

else:

print("**************************************************")

print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')

print("**************************************************")

for row in results:

print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])
print("-"*50)

def editEmp():

global cn,cur

print("*******************EDIT EMPLOYEE FORM


**************************")

en = int(input("Enter Employee number to edit :"))

query="select * from emp where empno="+str(en)

cur.execute(query)

results = cur.fetchall()

if cur.rowcount<=0:

print("## SORRY! NO MATCHING DETAILS AVAILABLE ##")

else:

print("**************************************************")

print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')

print("**************************************************")

for row in results:

print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])

print("-"*50)

ans = input("Are you sure to update ? (y/n)")

if ans=="y" or ans=="Y":

d = input("Enter new department to update (enter old value if not to update)


:")

s = int(input("Enter new salary to update (enter old value if not to


update) :"))

query="update emp set dept='"+d+"',salary="+str(s) + " where


empno="+str(en)
cur.execute(query)

cn.commit()

print("\n## RECORD UPDATED ##")

def delEmp():

global cn,cur

print("*******************DELETE EMPLOYEE FORM


**************************")

en = int(input("Enter Employee number to delete :"))

query="select * from emp where empno="+str(en)

cur.execute(query)

results = cur.fetchall()

if cur.rowcount<=0:

print("## SORRY! NO MATCHING DETAILS AVAILABLE ##")

else:

print("**************************************************")

print('%5s'%"EMPNO",'%15s'%'EMP
NAME','%12s'%'DEPARTMENT','%10s'%'SALARY')

print("**************************************************")

for row in results:

print('%5s' % row[0],'%15s'%row[1],'%12s'%row[2],'%10s'%row[3])

print("-"*50)

ans = input("Are you sure to delete ? (y/n)")

if ans=="y" or ans=="Y":

query="delete from emp where empno="+str(en)

cur.execute(query)
cn.commit()

print("\n## RECORD DELETED ##")

def clear():

for i in range(1,50):

print()

def generateSlip():

global cn,cur

print("*******************SALARY SLIP **************************")

en = int(input("Enter Employee number to print salary slip :"))

query="select * from emp where empno="+str(en)

cur.execute(query)

results = cur.fetchone()

if cur.rowcount<=0:

print("## SORRY! NO MATCHING DETAILS AVAILABLE ##")

else:

clear()

print("EMPNO :",results[0]," "*20,"NAME :",results[1])

print("DEPARTMENT :",results[2])

print("*"*50)

s = int(results[3])

hra = s * 12/100

da = s * 15/100

it = 1000

nps = (s+hra)*10/100
gross = s +hra+da+nps

ded = it + nps

net = gross - ded

tded=it + nps

print("%19s"%"EARNING","%27s"%"DEDUCTION")

print("-------------------------------------------------")

print("%20s"%"Basic :"+str(s),"%22s"%"INC. TAX :"+str(it))

print("%20s"%"HRA :"+str(hra),"%20s"%"NPS :"+str(nps))

print("%20s"%"DA :"+str(da))

print("%20s"%"NPS :"+str(nps))

print("-"*50)

print(" GROSS :",gross," NET SALARY :",net," TOTAL DED :",tded)

print("-"*50)

print("=== PRESS ANY KEY ===")

input()

while True:

print("1. SHOW EMPLOYEE LIST ")

print("2. ADD NEW EMPLOYEE")

print("3. SEARCH EMPLOYEE ")

print("4. EDIT EMPLOYEE ")

print("5. DELETE EMPLOYEE ")

print("6. GENERATE PAY SLIP ")

print("7. CONTACT US")

print("0. EXIT")

ans = int(input("Enter your choice :"))


if ans==1:

showAll()

elif ans==2:

addEmp()

elif ans==3:

searchEmp()

elif ans==4:

editEmp()

elif ans==5:

delEmp()

elif ans==6:

generateSlip()

elif ans==7:

print("*"*60)

print(" "*20,"AUTHOR : VINOD KUMAR VERMA ")

print(" "*20,"EMAIL : VINODEXCLUSIVELY@GMAIL.COM")

print("*"*60)

elif ans==0:

print("\nBye!!")

cn.close()

break
output screen LAYOUTS

OUTPUT #1
OUTPUT #2
OUTPUT #3

OUTPUT #4
OUTPUT #5

OUTPUT #6
OUTPUT #7

OUTPUT #8
System requirement
I. 1 GB RAM (2 GB+ recommended)
II. 9-58 GB free hard disk space depending on edition and
configuration, including space required for temporary files
III. DVD-ROM drive (if installing from a Media Kit DVD)
IV. Basic GPU – Any vendor DirectX 9.0 class or better (Pixel
Shader Level 2)
V. Intel® Pentium® or compatible, 1.6 GHz minimum (2GHz+
recommended)
VI. 1024x768 or higher-resolution monitor
VII. Mouse or other pointing device
VIII. Microsoft® Windows 7, 8 or 8.1,10,11 (32-bit or 64-bit)

You might also like