We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 21
CONTENTS
Sr.No | Topic Name Page No.
1 | Certificate 3
2 | Acknowledgement 4
3. | Introduction 5
4 | Database Table Structure 6
5 | Database Having 10 Records 7
6 | Source code 8-20
7 | Sample Output 21 - 28
8 _| Limitation of the Project 29
9 | Conclusion 30
Page|CERTIFICATE
This is to certify that the project titled, “Pay Slip Generating System For
Employees” is a piece of work done by Disha Narang of class XII-A
Session 2019-20 in partial fulfillment of CBSE"S AISSCE-2020 and has
been carried out under my supervision and guidance . This report or an
identicalreport on this topic has not been submitted for any other
examination and does not form a part of any other course undergone by
the candidate.
Signature Of Teacher/Guide
Name : Mr.Yash Kant
Designation: PGT (Computer Science)
Place: Rosary Sr. Sec. School
Date: -/ ~ / 2019ACKNOWLEDGEMENT
1am deeply indebted to my guide Mr.Yash Kant for his valuable
guidance, stimulus and constructive criticism during the whole span of
this project work. | am also grateful to him for his continuous support
and encouragement during the
Course of present work. am also grateful to him as he cleared all my
doubts related with MySQL-Python Interface and Python in particular.
Tam thankful to my friends and classmates as they have always helped
me with heart in many ways. This is incomplete unless I say thanks to
my parents, whose important time I used for everything.
Signature Of Student
Name: Disha Narang
Class & Section XI-A
Place: Rosary Sr. Sec. School, Delhi
Date: -/ ~/ 2019INTRODUCTION
This Project is based on generating employee payslip , this
project is developed on python by interfacing it with MySQL .
This System can Insert Records, Update Records, Delete
records, Display records, Generate Record i.e of a particular
person we want and Generate payslip from the record.
Name of Databases: - project
Name of Table: - emp!2DATABASE TABLE STRUCTURE
eno | int (11) [No | PRI | NULL |
ename | varchar(3@) | NO | [uu |
dept | varchar(31) | NO | [nue |
desig | varchar(31) | NO | [wut |
sal | int (11) [no | [nu |
mobile | bigint(12) | No | [nut |
Address | varchar(3@) | NO | [nue |
email | varchar(3@) | NO | [nu |
= +
Page |SDATABASE HAVING 10 RECORDS
| desig | sal | mobile | Address | email
|
te | Graphic Designer | 80000 | 9217825101 | Rohini | [email protected] |
| 1562 | Raghav | Contant Analysis | Contnat Writter | 75000 | 8004512788 | Mirankari Colony | [email protected] |
| 1563 | Tanya | Administration | Clerk | 39000 | 7845148729 | Mukherji Nager | Tanyafignail.com |
| 1564 | Rahul | Administration | Supervisor | 45000 | 9725871445 | Saket | [email protected] |
| 1565 | Sonia | Staffing Control | HR Manager’ | 65900 | 9825547812 | Gk - 1 | Soniadgnail.com |
| 1566 | Wohit | Testing | Test Leader | 55000 | 9871145789 | Gurgaon | Wohitdenail.con |
| 1567 | Lakshya | Business Devlopnent | Lead Analysist | 42000 | 8571456987 | Hanesar | Lakshyagnailcon |
| 1568 | Krishika | Technical support | Tech Leader | 55000 | 8571459889 | Indra Vihar | Krishikafjnail.con |
| 1569 | Manya | Service Control | Service Head | 67000 | 794145114 | GTB Nagar | Manyaignail.com |
| 1570 | Dhruv | Project Control | Project Manager | 79000 | 9871145785 | Hudsun lane | Dhruvgnail.com |
| 1571 | Vanshika | Sales | Sales Coordinator | 28000 | 8641147859 | Punjabi Bagh | Vanshikalignail.con |
| 1572 | Vishakha | Sales | Sales Manager | 49000 | 7506411218 | Ashok Vihar | Vishakhadigmail.com |
Page 16SOURCE CODE
import mysql.connector
defaddQ:
mydb=mysql.connector.connect{host="ocalhost”
sql" database="project")
root” passwd="my
mycur=mydb.cursor()
eno=int(input("\nEnter The Employee no: "))
ename =input("Enter The Employee name: ")
dept=input("Enter The Department name: ")
desig=input("Enter The Designation: ")
salary=int(input("Enter The salary: "))
mobile=int(input("Enter The mobile no: "))
address=input("Enter The address: ")
email=input("Enter The email id: ")
str="INSERT INTO empl VALUES({},'{}''0)'0'.0,0,'0",'0)"
query=(str.format(eno,ename,dept,desig.salary, mobile,address,email))mycur.execute(query)
mydb.commit()
print("\nRocord inserted\n")
ch=input("Want to Add more records(y/n): ")
def searchQ):
mydb=mysql.connector.connect(host="localhost" user="root" passwd="my
sql" database="project")
mycur=mydb.cursor( )
eno=int(input("\nEnter The Employee no: "))
str="Select * from empl where eno=(}"
query=str.format(eno)
print
mycur.execute(query)
myrec=mycur.fetchall()
for x in myrec:eno=x{0]
ename=x{1]
dept=x[2]
desig=x[3]
sal=x[4]
mobile=x[5]
address=x[6]
email=x{7]
print(eno,”" sal," ",mobile," "address,"
email)
ename," "dept," "desig,
def display():
mydb=mysql.connector.connect(host="localhost" user="root",passwd="my
sql" database=" project")
mycur=mydb.cursor()
mycur.execute("Select * from empl")
print
myrec=mycur-fetchall()
for x in myree:
eno=x[0]ename=x{1]
dept=x{2]
desig=x[3]
sal=x[4]
mobile=x[5]
address=x[6]
email=x{7]
print(eno, sal," "mobile," "address,"
email)
ename,” "dept," "desig,
def editQ):
mydb=mysql.connector.connect(host=
sql" database=" project")
localhost" user="root",passwd="my
mycur=mydb.cursor( )
mycur.execute("Select * from empl")
print
print('Before Updation’)
myrec=mycur-fetchall()
for x in myrec:
eno=x[0]
ename=x{1]dept=x{2]
desig=x[3]
sal=x[4]
mobile=x{5]
address=x[6]
email=x[7]
print(eno," "jename," "dept," "desig," "sal," "mobile," ",address,”
email)
eno=int{input("Enter The Customer no wanted to Update: "))
print("Enter the changes you want\n")
ename =input("Enter The Employee name:
dept=input("Enter The Department name: ")
desig=input("Enter The Designation: ")
sal=int(input("Enter The salary: "))
mobile=int(input("Enter The mobile no: "))
address=input("Enter The address: ")
email=input("Enter The email id: ")
mycur=mydb.cursor()
Update empl set
‘.dept="QV desig:
='{)'sal=Q,mobile=(},address="{)' email="{Jquery=str.format(ename,dept,desig,sal, mobile,address,email,eno)
mycur.execute(query)
mydb.commit()
mycur=mydb.cursor( )
print(‘After Updation’)
mycur.execute("Select * from empl")
print
print(‘After Updation')
myrec=mycur-.fetchall()
for x in myrec:
eno=x[0]
ename=x{1]
dept=x[2]
desig=x[3]
sal=x[4]
mobile=x[5]
address=x[6]
email=x[7]
print(eno," "ename,” "dept," ",desig," "sal," "mobile," "jaddress,"
email)def delete():
‘localhost",uset
mydb=mysql.connector.connect(ho:
sql" database=" project")
mycur=mydb.cursor()
mycur.execute("Select * from empl")
print(’
print('Before Deletion’)
myrec=mycur-fetchall()
for x in myree:
eno=x[0]
ename=x[1]
dept=x{2]
desig=x[3]
sal=x[4]
mobile=x[5]
address=x[6]
email=x[7]
print(eno," "jename," "dept," "desig," "sal," "mobile," ",address,”
email)
mycur=mydb.cursor()eno=int{input(”\nEnter The Employee no: "))
str="Delete from empl where eno={)"
query=str.format(eno)
mycur.execute(query)
mydb.commit()
mycur.execute(query)
print("record deleted")
mycur=mydb.cursor( )
mycur.execute("Select * from empl")
print
print(‘After Deletion’)
myrec=mycur-fetchall()
for x in myrec:
eno=x{0]
ename=x{1]
dept=x[2]
desig=x[3]
sal=x[4]
mobile=x[5]
address=x[6]
email=x{7]print(eno," ",ename,” "dept," ",desig," "sal," "mobile," ",address,"
email)
def generate():
mydb=mysql.connector.connect(host="localhost" user=root" passwd="my
sql" database="project")
mycur=mydb.cursor( )
eno=int(input("Enter The Employee no:"))
str="Select * from empl where eno=(}"
query=str.format(eno)
mycur.execute(query)
myrec=mycur.fetchall()
for x in myrec:
eno=x{0]
ename=x{1]
dept=x[2]
desig=x[3]
salary=x[4]mobile=x[5]
address=x[6]
email=x{7]
print("\n")
print(’ EMPLOYEE PAY SLIP
print(’
print(" Phno.-9856320120 email-
[email protected]")
print(’
if salary>=10001 and salary<=20000:
hra=salary*30/100
da=salary*20/100
pf=salary*10/100
med=salary*7/100
itax=salary*4/100
edu=salary*3.5/100
elif salary>=20001 and salary<=30000:
|16hra=salary*40/100
da=salary*30/100
pf-salary*20/100
med=salary*10/100
itax=salary*5/100
edu=salary*4/100
elif salary>=30001:
hra=salary*50/100
a
=salary*40/100
pf=salary*25/100
med=salary*15/100
itax=salary*8/100
edu=salary*4.5/100
else:
hra=0
da=0
pf=0
med=0print("
Date:19/07/19 ")
print(" No. “,eno)
print(" Name: "ename)
print(” designation: ", dept)
print(” Salary: “,salary)
print(" Mobile: _ ",mobile)
print(" Email: ",email)
print(" Address: ",address)
print(”
=)
gross=salary+hratda+med
net=gross-pf-itax
print(" Salary is: " salary)
print(" House rent Allowance is :"}hra)
print(” Dearness Allowance is: ",da)
print(" Medical is : "med)
print(" provident fundis: — ",pf)
print(" Income Taxis: ",itax)
print(” education cessis: ",edu)print("
print(" NET SALARY IS:",net)
print("
EMPLOYEE PAY SLIP
print(”
print("CHOICES")
print("1.To ADD New Record")
print("2.To Search a Record")
print("3.To Update the Record")
print("4.To Delete the Record")
Page 19print("S.To View all the Record")
print("6.To Generate the Report\n")
print("
ch=int(input("Enter the choice: "))
if ch==1:
addQ)
elif ch=
search()
delete()
elif ch==5:
display()
elif ch
generate()
print('\n\n-—-
ch=input("Want to See Main Menu(y/n): ")SAMPLE OUTPUT
CHOICES
L.To ADD New Record
2.To Search a Record
3.To Update the Record
4.To Delete the Record
5.To View alll the Record
6.To Generate the Report
Enter the choice: 6
Enter The Employee no:1560
EMPLOYEE PAY SLIP
Date:19/07/19
No: 1560
Name: Disha Narang
designation: Sales
Salary: 12000
Mobile: 8855658632
Email: — [email protected]
Address: Hudson Lane
Salary is : 12000
House rent Allowance is : 3600.0
Dearness Allowance is: 2400.0
Medical is 840.0
provident fund is: 1200.0
Income Tax is: 480.0
education cessis: 420.0
NET SALARY IS: 17160.0