SlideShare a Scribd company logo
1 of 17
EMPLOYEE MANAGEMENT SYSTEM
Mini-Project Report submitted in partial fulfilment of the requirements of the degree of Second
Year of Engineering by
Sanchit Raut - 46
Rohit Pujari – 44
Vaibhav Patel - 34
Department of Computer Engineering
St. John College of Engineering and Management
University of Mumbai
2017-2018
Abstract
Employee management is handy for organization for business tools for convinent information
storing which is easily accessible. By this system burden of managing and viewing employee
information is reduced.
This system is flexible and can be run on almost all major Operating systems like windows, linux
and mac.
Introduction
The organization are suffering from pity bad condition. Carrying heavy diaries to maintain
records and managing their salaries is a very tough job. To overcome these problems, we are
proposing “EMPLOYEE MANAGEMENT SYSTEM”. This app is very simple and easy to use.
Management team can add details of the Employees. It can store all details like name,
address, telephone number, their role, date of joining, salaries etc. of Employees.
All the data is stored in the database so there is no worry of Data Loss. The Data can be
accessed using Database manager (phpMyAdmin).
Implementation
Modules used :
 use DBI :
- It is a database access module for the Perl programming language. (Database
Independent Interface)
- Program is connected to database using this DBI module.
- During connection it will do a authentication check.
my $dsn = "DBI:mysql:Employee";
my $username = "root";
my $password = "mysql";
my $dbh = DBI->connect($dsn, $username, $password) or die "Connection failed.Please Check
Username and Password $!";
print("Connected To Database Successfully.n");
Here $dsn is the host, where Employee is the name of the database.
If the authentication failed due to some reason such as invalid Username or Password it will
execute the die() function notifying the error message.
Database (MySQL):
My Sql database is used for collecting the employees information and storing it to the
database.
Queries:
 Inserting :
my $sql = "INSERT INTO Data(ID, NAME, ADDRESS, PHONE_NO,
DATE_OF_JOINING, ROLE_ASSIGN, SALARY)VALUES(?,?,?,?,?,?,?)"
Here, ‘Insert into Data’ is used to insert information into table where ‘Data’ is the name of
the table.‘?’ binds the Index parameters coloumnwise.
 Viewing all employees :
my $sql = "SELECT * FROM Data";
This query displays all the data available in the database table.
 Viewing single employee(Single row):
my $var = $dbh->quote($ID);
For this at first User input is taken from user.The value of ID is then stored in the variable
“$var”. quote() function is used to fetch the user value which is stored in $ID.
my @row;
while (@row = $sth->fetchrow_array)
{
print join(", ", @row), "n";
}
fetchrow_arrow get the whole row from the table where ID is <STDIN>.
 Removing all rows:
my $sql = "TRUNCATE TABLE Data";
Truncate Table Data is the query to flush all the rows from the table.
 Removing a single employee :
my $sql = "DELETE FROM Data WHERE ID = ?"
Delete query will delete a single row from the table where ID is <STDIN>(User value).
 Update Employe data :
my $sql = "UPDATE Data SET NAME = ?, ADDRESS=?, PHONE_NO=?,
DATE_OF_JOINING=?, ROLE_ASSIGN=?, SALARY=? WHERE ID = ?";
It will Update the data and replace(SET) the new value to it as user give the input.
bind_param() :
bind parameters binds the scalar value fetched from user which is then updated in database
table.
$dbh :
Databasehandler is used to specify the DBI dsn (“connect in DBI”) as a hash reference
instead of a string.
Code
To create database table
#!usrbinperl
use warnings;
use strict;
use DBI;
my ($dbh, $sth);
$dbh=DBI->connect('dbi:mysql:Employee','root','mysql') ||
die "Error opening database: $DBI::errsn";
$sth=$dbh->prepare("CREATE TABLE Data (
ID INTEGER , NOT NULL
NAME VARCHAR(32) NOT NULL,
ADDRESS VARCHAR(32) NOT NULL,
PHONE_NO VARCHAR(32),
DATE_OF_JOINING VARCHAR(32) NOT NULL,
ROLE_ASSIGN VARCHAR(32) NOT NULL,
SALARY INTEGER)");
$sth->execute();
$sth->finish();
print "n Table created in database Employeen";
$dbh->disconnect || die "Failed to disconnectn";
Main code
#!/usr/bin/perl
use warnings;
use strict;
use DBI;
#Connecting to Database.
my $dsn = "DBI:mysql:Employee";
my $username = "root";
my $password = "mysql";
my $dbh = DBI->connect($dsn, $username, $password);
print("Connected To Database Successfully.n");
#Insert into Database.
sub insert
{
my $sql = "INSERT INTO Data(ID, NAME, ADDRESS, PHONE_NO,
DATE_OF_JOINING, ROLE_ASSIGN, SALARY)
VALUES(?,?,?,?,?,?,?)";
my $stmt = $dbh->prepare($sql);
my @employee = get_details();
foreach my $employee(@employee)
{
if($stmt->execute($employee->{ID}, $employee->{NAME}, $employee-
>{ADDRESS}, $employee->{PHONE_NO}, $employee->{DATE_OF_JOINING}, $employee-
>{ROLE_ASSIGN}, $employee->{SALARY}))
{
print("n Employee Inserted Successfully n");
}
}
$stmt->finish();
}
#Entering Details of an Employee
sub get_details
{
#my $trnl = '';
my @employee;
my($ID, $NAME, $ADDRESS, $PHONE_NO, $DATE_OF_JOINING,
$ROLE_ASSIGN, $SALARY);
print("ID : ");
chomp($ID = <STDIN>);
print("NAME : ");
chomp($NAME = <STDIN>);
print("ADDRESS : ");
chomp($ADDRESS = <STDIN>);
print("PHONE_NO : ");
chomp($PHONE_NO = <STDIN>);
print("DATE_OF_JOINING : ");
chomp($DATE_OF_JOINING = <STDIN>);
print("ROLE_ASSIGN : ");
chomp($ROLE_ASSIGN = <STDIN>);
print("SALARY : ");
chomp($SALARY = <STDIN>);
my %employee = (ID=> $ID, NAME=> $NAME, ADDRESS=> $ADDRESS,
PHONE_NO=> $PHONE_NO, DATE_OF_JOINING=> $DATE_OF_JOINING,
ROLE_ASSIGN=> $ROLE_ASSIGN, SALARY=> $SALARY);
push(@employee,%employee);
return @employee;
}
#Give Details of One Employee
sub view_one
{
print("ID : ");
chomp(my $ID = <STDIN>);
my $var = $dbh->quote($ID);
my $sql = "SELECT * FROM Data WHERE ID = $var";
my $sth = $dbh->prepare($sql) or die $DBI::errs;
$sth->execute() or die $DBI::errs;
my @row;
while (@row = $sth->fetchrow_array)
{
print join(", ", @row), "n";
}
#$sth->finish();
}
#Get Details of all Employee
sub view_all
{
my ($dbh) = @_;
my $sql = "SELECT * FROM Data";
my $sth = $dbh->prepare($sql) or die $DBI::errs;
$sth->execute() or die $DBI::errs;
$sth->dump_results();
$sth->finish();
}
#Update an Employee
sub update
{
my $sql = "UPDATE Data SET NAME = ?, ADDRESS=?, PHONE_NO=?,
DATE_OF_JOINING=?, ROLE_ASSIGN=?, SALARY=? WHERE ID = ?";
my $sth = $dbh->prepare($sql);
print("Enter ID to update : ");
chomp(my $ID = <STDIN>);
print("n");
print("NAME : ");
chomp(my $NAME = <STDIN>);
print("ADDRESS : ");
chomp(my $ADDRESS = <STDIN>);
print("PHONE_NO : ");
chomp(my $PHONE_NO = <STDIN>);
print("DATE_OF_JOINING : ");
chomp(my $DATE_OF_JOINING = <STDIN>);
print("ROLE_ASSIGN : ");
chomp(my $ROLE_ASSIGN = <STDIN>);
print("SALARY : ");
chomp(my $SALARY = <STDIN>);
$sth->bind_param(1,$NAME);
$sth->bind_param(2,$ADDRESS);
$sth->bind_param(3,$PHONE_NO);
$sth->bind_param(4,$DATE_OF_JOINING);
$sth->bind_param(5,$ROLE_ASSIGN);
$sth->bind_param(6,$SALARY);
$sth->bind_param(7,$ID);
$sth->execute();
print("n The record has been updated successfully! n");
$dbh->{mysql_auto_reconnect} = 1;
$sth->finish();
$dbh->disconnect();
}
#Delete single Employee
sub delete_one_row
{
my $sql = "DELETE FROM Data WHERE ID = ?";
my $sth = $dbh->prepare($sql);
print "Enter ID to remove : ";
chomp(my $ID = <STDIN>);
$sth->execute($ID);
print "ID no.$ID has been deleted successfully";
$dbh->{mysql_auto_reconnect} = 1;
$dbh->disconnect();
}
#Deletes all Employee
sub delete_all_rows
{
my($dbh) = @_;
my $sql = "TRUNCATE TABLE Data";
my $sth = $dbh->prepare($sql);
return $sth->execute();
}
#multi-line print() Function
sub menu
{
print <<EOT;
Please make a choice :
1. Add an Employee.
2. View an Employee.
3. View all Employee.
4. Update an Employee.
5. Remove an Employee.
6. Remove all Employee.
7. Exit.
Your Choice :
EOT
}
#Select Options
while(1)
{
menu();
chomp(my $answer = <STDIN>);
SWITCH: {
$answer == 1 and insert(), last SWITCH;
$answer == 2 and view_one(), last SWITCH;
$answer == 3 and view_all($dbh), last SWITCH;
$answer == 4 and update(), last SWITCH;
$answer == 5 and delete_one_row(), last SWITCH;
$answer == 6 and delete_all_rows($dbh), last SWITCH;
$answer == 7 and exit(0);
}
Output
Fig 1: Main Menu
Fig 2: Inserting Data
`
Fig 3: Updating Data
Conclusion
The project aims at bringing simplicity of the system such as by using this program to show details
in a well organized manner and with ease. In future this system can be extended to integrate more
modules and features. Provisions can be made in future so that much better GUI can be provided
to all the user of the system.
References
1. http://www.mysqltutorial.org
2. https://www.tutorialspoint.com/perl/index.htm
3. Programming the Perl DBI – O’REILLY

More Related Content

What's hot

Repot on-hospital-manegment-system
Repot on-hospital-manegment-systemRepot on-hospital-manegment-system
Repot on-hospital-manegment-systemPNEC
 
Employee management system report
Employee management system reportEmployee management system report
Employee management system reportPrince Singh
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagementMickey
 
Hostel Management Information system Abstract 2017
Hostel Management Information system Abstract 2017Hostel Management Information system Abstract 2017
Hostel Management Information system Abstract 2017ioshean
 
Hospital management system project
Hospital management system projectHospital management system project
Hospital management system projectHimani Chopra
 
Online Attendance Management System
Online Attendance Management SystemOnline Attendance Management System
Online Attendance Management SystemRIDDHICHOUHAN2
 
Event Management System Document
Event Management System Document Event Management System Document
Event Management System Document LJ PROJECTS
 
Narmesh 3 yrs Manual testing resume
Narmesh 3 yrs Manual testing resumeNarmesh 3 yrs Manual testing resume
Narmesh 3 yrs Manual testing resumenarmesh enukurthi
 
Event managementsystem
Event managementsystemEvent managementsystem
Event managementsystemPraveen Jha
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result SystemKuMaR AnAnD
 
Introduction to java Jasper Report with Server & iReport
Introduction to java Jasper Report with Server & iReportIntroduction to java Jasper Report with Server & iReport
Introduction to java Jasper Report with Server & iReportArif Hosain
 
Introduction to BizTalk for Beginners
Introduction to BizTalk for BeginnersIntroduction to BizTalk for Beginners
Introduction to BizTalk for BeginnersAboorvaRaja Ramar
 
student mangement
student mangementstudent mangement
student mangementAditya Gaud
 
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr Exp
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr ExpMubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr Exp
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr ExpMubashir Ahmed
 
Synopsis of online Attendance System
Synopsis of online Attendance SystemSynopsis of online Attendance System
Synopsis of online Attendance SystemShyam Sundar Pandey
 

What's hot (20)

F5 Automation Toolchain
F5 Automation ToolchainF5 Automation Toolchain
F5 Automation Toolchain
 
Repot on-hospital-manegment-system
Repot on-hospital-manegment-systemRepot on-hospital-manegment-system
Repot on-hospital-manegment-system
 
Employee management system report
Employee management system reportEmployee management system report
Employee management system report
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagement
 
Hostel Management Information system Abstract 2017
Hostel Management Information system Abstract 2017Hostel Management Information system Abstract 2017
Hostel Management Information system Abstract 2017
 
Hospital management system project
Hospital management system projectHospital management system project
Hospital management system project
 
Online Attendance Management System
Online Attendance Management SystemOnline Attendance Management System
Online Attendance Management System
 
Hair and Beauty Salon
Hair and Beauty SalonHair and Beauty Salon
Hair and Beauty Salon
 
Event Management System Document
Event Management System Document Event Management System Document
Event Management System Document
 
Narmesh 3 yrs Manual testing resume
Narmesh 3 yrs Manual testing resumeNarmesh 3 yrs Manual testing resume
Narmesh 3 yrs Manual testing resume
 
Event managementsystem
Event managementsystemEvent managementsystem
Event managementsystem
 
Project for Student Result System
Project for Student Result SystemProject for Student Result System
Project for Student Result System
 
SRS on blood bank
SRS on blood bankSRS on blood bank
SRS on blood bank
 
Introduction to java Jasper Report with Server & iReport
Introduction to java Jasper Report with Server & iReportIntroduction to java Jasper Report with Server & iReport
Introduction to java Jasper Report with Server & iReport
 
Japer Reports
Japer ReportsJaper Reports
Japer Reports
 
Introduction to BizTalk for Beginners
Introduction to BizTalk for BeginnersIntroduction to BizTalk for Beginners
Introduction to BizTalk for Beginners
 
student mangement
student mangementstudent mangement
student mangement
 
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr Exp
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr ExpMubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr Exp
Mubashir Ahmed ERP SAP Basis Consultant Resume with 3 Yr Exp
 
Synopsis of online Attendance System
Synopsis of online Attendance SystemSynopsis of online Attendance System
Synopsis of online Attendance System
 
Employee Management System
Employee Management SystemEmployee Management System
Employee Management System
 

Similar to Miniproject on Employee Management using Perl/Database.

Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivityMouli Chandira
 
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdfHow to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdfAppweb Coders
 
Contacto server API in PHP
Contacto server API in PHPContacto server API in PHP
Contacto server API in PHPHem Shrestha
 
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxModule 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxmoirarandell
 
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDatabase Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDhivyaa C.R
 
Form demoinplaywithmysql
Form demoinplaywithmysqlForm demoinplaywithmysql
Form demoinplaywithmysqlKnoldus Inc.
 
06 Php Mysql Connect Query
06 Php Mysql Connect Query06 Php Mysql Connect Query
06 Php Mysql Connect QueryGeshan Manandhar
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfrajkumarm401
 
Add edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHPAdd edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHPVineet Kumar Saini
 
Php update and delet operation
Php update and delet operationPhp update and delet operation
Php update and delet operationsyeda zoya mehdi
 
15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilorRazvan Raducanu, PhD
 
DIWE - Working with MySQL Databases
DIWE - Working with MySQL DatabasesDIWE - Working with MySQL Databases
DIWE - Working with MySQL DatabasesRasan Samarasinghe
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
UNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt pythonUNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt pythonSuganthiDPSGRKCW
 

Similar to Miniproject on Employee Management using Perl/Database. (20)

Sqlite perl
Sqlite perlSqlite perl
Sqlite perl
 
Ex[1].3 php db connectivity
Ex[1].3 php db connectivityEx[1].3 php db connectivity
Ex[1].3 php db connectivity
 
How to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdfHow to Create Login and Registration API in PHP.pdf
How to Create Login and Registration API in PHP.pdf
 
Contacto server API in PHP
Contacto server API in PHPContacto server API in PHP
Contacto server API in PHP
 
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docxModule 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
Module 6WEB SERVER AND SERVER SIDE SCRPTING, PART-2Chapte.docx
 
UNIT V (5).pptx
UNIT V (5).pptxUNIT V (5).pptx
UNIT V (5).pptx
 
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering CollegeDatabase Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
Database Connectivity MYSQL by Dr.C.R.Dhivyaa Kongu Engineering College
 
Form demoinplaywithmysql
Form demoinplaywithmysqlForm demoinplaywithmysql
Form demoinplaywithmysql
 
06 Php Mysql Connect Query
06 Php Mysql Connect Query06 Php Mysql Connect Query
06 Php Mysql Connect Query
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
Add edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHPAdd edit delete in Codeigniter in PHP
Add edit delete in Codeigniter in PHP
 
Stored Procedure
Stored ProcedureStored Procedure
Stored Procedure
 
Php update and delet operation
Php update and delet operationPhp update and delet operation
Php update and delet operation
 
15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor15. CodeIgniter editarea inregistrarilor
15. CodeIgniter editarea inregistrarilor
 
DIWE - Working with MySQL Databases
DIWE - Working with MySQL DatabasesDIWE - Working with MySQL Databases
DIWE - Working with MySQL Databases
 
Separation of concerns - DPC12
Separation of concerns - DPC12Separation of concerns - DPC12
Separation of concerns - DPC12
 
Mysql DBI
Mysql DBIMysql DBI
Mysql DBI
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
SQL -PHP Tutorial
SQL -PHP TutorialSQL -PHP Tutorial
SQL -PHP Tutorial
 
UNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt pythonUNIT V PYTHON.pptx python basics ppt python
UNIT V PYTHON.pptx python basics ppt python
 

Recently uploaded

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

Miniproject on Employee Management using Perl/Database.

  • 1. EMPLOYEE MANAGEMENT SYSTEM Mini-Project Report submitted in partial fulfilment of the requirements of the degree of Second Year of Engineering by Sanchit Raut - 46 Rohit Pujari – 44 Vaibhav Patel - 34 Department of Computer Engineering St. John College of Engineering and Management University of Mumbai 2017-2018
  • 2. Abstract Employee management is handy for organization for business tools for convinent information storing which is easily accessible. By this system burden of managing and viewing employee information is reduced. This system is flexible and can be run on almost all major Operating systems like windows, linux and mac.
  • 3. Introduction The organization are suffering from pity bad condition. Carrying heavy diaries to maintain records and managing their salaries is a very tough job. To overcome these problems, we are proposing “EMPLOYEE MANAGEMENT SYSTEM”. This app is very simple and easy to use. Management team can add details of the Employees. It can store all details like name, address, telephone number, their role, date of joining, salaries etc. of Employees. All the data is stored in the database so there is no worry of Data Loss. The Data can be accessed using Database manager (phpMyAdmin).
  • 4. Implementation Modules used :  use DBI : - It is a database access module for the Perl programming language. (Database Independent Interface) - Program is connected to database using this DBI module. - During connection it will do a authentication check. my $dsn = "DBI:mysql:Employee"; my $username = "root"; my $password = "mysql"; my $dbh = DBI->connect($dsn, $username, $password) or die "Connection failed.Please Check Username and Password $!"; print("Connected To Database Successfully.n"); Here $dsn is the host, where Employee is the name of the database. If the authentication failed due to some reason such as invalid Username or Password it will execute the die() function notifying the error message.
  • 5. Database (MySQL): My Sql database is used for collecting the employees information and storing it to the database. Queries:  Inserting : my $sql = "INSERT INTO Data(ID, NAME, ADDRESS, PHONE_NO, DATE_OF_JOINING, ROLE_ASSIGN, SALARY)VALUES(?,?,?,?,?,?,?)" Here, ‘Insert into Data’ is used to insert information into table where ‘Data’ is the name of the table.‘?’ binds the Index parameters coloumnwise.  Viewing all employees : my $sql = "SELECT * FROM Data"; This query displays all the data available in the database table.  Viewing single employee(Single row): my $var = $dbh->quote($ID); For this at first User input is taken from user.The value of ID is then stored in the variable “$var”. quote() function is used to fetch the user value which is stored in $ID. my @row; while (@row = $sth->fetchrow_array) { print join(", ", @row), "n"; } fetchrow_arrow get the whole row from the table where ID is <STDIN>.  Removing all rows: my $sql = "TRUNCATE TABLE Data"; Truncate Table Data is the query to flush all the rows from the table.  Removing a single employee : my $sql = "DELETE FROM Data WHERE ID = ?" Delete query will delete a single row from the table where ID is <STDIN>(User value).  Update Employe data : my $sql = "UPDATE Data SET NAME = ?, ADDRESS=?, PHONE_NO=?, DATE_OF_JOINING=?, ROLE_ASSIGN=?, SALARY=? WHERE ID = ?";
  • 6. It will Update the data and replace(SET) the new value to it as user give the input. bind_param() : bind parameters binds the scalar value fetched from user which is then updated in database table. $dbh : Databasehandler is used to specify the DBI dsn (“connect in DBI”) as a hash reference instead of a string.
  • 7. Code To create database table #!usrbinperl use warnings; use strict; use DBI; my ($dbh, $sth); $dbh=DBI->connect('dbi:mysql:Employee','root','mysql') || die "Error opening database: $DBI::errsn"; $sth=$dbh->prepare("CREATE TABLE Data ( ID INTEGER , NOT NULL NAME VARCHAR(32) NOT NULL, ADDRESS VARCHAR(32) NOT NULL, PHONE_NO VARCHAR(32), DATE_OF_JOINING VARCHAR(32) NOT NULL, ROLE_ASSIGN VARCHAR(32) NOT NULL, SALARY INTEGER)"); $sth->execute(); $sth->finish(); print "n Table created in database Employeen"; $dbh->disconnect || die "Failed to disconnectn";
  • 8. Main code #!/usr/bin/perl use warnings; use strict; use DBI; #Connecting to Database. my $dsn = "DBI:mysql:Employee"; my $username = "root"; my $password = "mysql"; my $dbh = DBI->connect($dsn, $username, $password); print("Connected To Database Successfully.n"); #Insert into Database. sub insert { my $sql = "INSERT INTO Data(ID, NAME, ADDRESS, PHONE_NO, DATE_OF_JOINING, ROLE_ASSIGN, SALARY) VALUES(?,?,?,?,?,?,?)"; my $stmt = $dbh->prepare($sql); my @employee = get_details(); foreach my $employee(@employee)
  • 9. { if($stmt->execute($employee->{ID}, $employee->{NAME}, $employee- >{ADDRESS}, $employee->{PHONE_NO}, $employee->{DATE_OF_JOINING}, $employee- >{ROLE_ASSIGN}, $employee->{SALARY})) { print("n Employee Inserted Successfully n"); } } $stmt->finish(); } #Entering Details of an Employee sub get_details { #my $trnl = ''; my @employee; my($ID, $NAME, $ADDRESS, $PHONE_NO, $DATE_OF_JOINING, $ROLE_ASSIGN, $SALARY); print("ID : "); chomp($ID = <STDIN>); print("NAME : "); chomp($NAME = <STDIN>); print("ADDRESS : ");
  • 10. chomp($ADDRESS = <STDIN>); print("PHONE_NO : "); chomp($PHONE_NO = <STDIN>); print("DATE_OF_JOINING : "); chomp($DATE_OF_JOINING = <STDIN>); print("ROLE_ASSIGN : "); chomp($ROLE_ASSIGN = <STDIN>); print("SALARY : "); chomp($SALARY = <STDIN>); my %employee = (ID=> $ID, NAME=> $NAME, ADDRESS=> $ADDRESS, PHONE_NO=> $PHONE_NO, DATE_OF_JOINING=> $DATE_OF_JOINING, ROLE_ASSIGN=> $ROLE_ASSIGN, SALARY=> $SALARY); push(@employee,%employee); return @employee; } #Give Details of One Employee sub view_one { print("ID : "); chomp(my $ID = <STDIN>);
  • 11. my $var = $dbh->quote($ID); my $sql = "SELECT * FROM Data WHERE ID = $var"; my $sth = $dbh->prepare($sql) or die $DBI::errs; $sth->execute() or die $DBI::errs; my @row; while (@row = $sth->fetchrow_array) { print join(", ", @row), "n"; } #$sth->finish(); } #Get Details of all Employee sub view_all { my ($dbh) = @_; my $sql = "SELECT * FROM Data"; my $sth = $dbh->prepare($sql) or die $DBI::errs; $sth->execute() or die $DBI::errs; $sth->dump_results(); $sth->finish();
  • 12. } #Update an Employee sub update { my $sql = "UPDATE Data SET NAME = ?, ADDRESS=?, PHONE_NO=?, DATE_OF_JOINING=?, ROLE_ASSIGN=?, SALARY=? WHERE ID = ?"; my $sth = $dbh->prepare($sql); print("Enter ID to update : "); chomp(my $ID = <STDIN>); print("n"); print("NAME : "); chomp(my $NAME = <STDIN>); print("ADDRESS : "); chomp(my $ADDRESS = <STDIN>); print("PHONE_NO : "); chomp(my $PHONE_NO = <STDIN>); print("DATE_OF_JOINING : "); chomp(my $DATE_OF_JOINING = <STDIN>);
  • 13. print("ROLE_ASSIGN : "); chomp(my $ROLE_ASSIGN = <STDIN>); print("SALARY : "); chomp(my $SALARY = <STDIN>); $sth->bind_param(1,$NAME); $sth->bind_param(2,$ADDRESS); $sth->bind_param(3,$PHONE_NO); $sth->bind_param(4,$DATE_OF_JOINING); $sth->bind_param(5,$ROLE_ASSIGN); $sth->bind_param(6,$SALARY); $sth->bind_param(7,$ID); $sth->execute(); print("n The record has been updated successfully! n"); $dbh->{mysql_auto_reconnect} = 1; $sth->finish(); $dbh->disconnect(); } #Delete single Employee sub delete_one_row {
  • 14. my $sql = "DELETE FROM Data WHERE ID = ?"; my $sth = $dbh->prepare($sql); print "Enter ID to remove : "; chomp(my $ID = <STDIN>); $sth->execute($ID); print "ID no.$ID has been deleted successfully"; $dbh->{mysql_auto_reconnect} = 1; $dbh->disconnect(); } #Deletes all Employee sub delete_all_rows { my($dbh) = @_; my $sql = "TRUNCATE TABLE Data"; my $sth = $dbh->prepare($sql); return $sth->execute(); } #multi-line print() Function sub menu { print <<EOT;
  • 15. Please make a choice : 1. Add an Employee. 2. View an Employee. 3. View all Employee. 4. Update an Employee. 5. Remove an Employee. 6. Remove all Employee. 7. Exit. Your Choice : EOT } #Select Options while(1) { menu(); chomp(my $answer = <STDIN>); SWITCH: { $answer == 1 and insert(), last SWITCH; $answer == 2 and view_one(), last SWITCH; $answer == 3 and view_all($dbh), last SWITCH; $answer == 4 and update(), last SWITCH; $answer == 5 and delete_one_row(), last SWITCH; $answer == 6 and delete_all_rows($dbh), last SWITCH; $answer == 7 and exit(0); }
  • 16. Output Fig 1: Main Menu Fig 2: Inserting Data ` Fig 3: Updating Data
  • 17. Conclusion The project aims at bringing simplicity of the system such as by using this program to show details in a well organized manner and with ease. In future this system can be extended to integrate more modules and features. Provisions can be made in future so that much better GUI can be provided to all the user of the system. References 1. http://www.mysqltutorial.org 2. https://www.tutorialspoint.com/perl/index.htm 3. Programming the Perl DBI – O’REILLY