Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 117

Title of the Project:

Employee Management System

Abstract of Project Employee Management System

In this world of growing technologies everything has been


computerized. With large number of work opportunities the Human
workforce has increased. Thus there is a need of a system which can handle
the data of such a large number of Employees in an organization. This
project simplifies the task of maintain records because of its user friendly
nature.

The “EMPLOYEE MANAGEMENT SYSTEM” has been developed to override the


problems prevailing in the practicing manual system. This software is
supported to eliminate and in some cases reduce the hardships faced by this
existing system. Moreover this system is designed for the particular need of
the company to carry out operations in a smooth and effective manner.

The application is reduced as much as possible to avoid errors while entering


the data. It also provides error message while entering invalid data. No
formal knowledge is needed for the user to use this system. Thus by this all
it proves it is user-friendly.
This project will allow admin to add new employees after proper
authentication. Admin can also add new departments and posts. It can
allocate employees to different departments at different posts. Database
should store all personal details of employees such as date of birth full name
etc. and his educational background, work experience, skill sets, current and
past projects in different tables with proper relations.

This system enables employees to perform their own profile. It enables the
automation of work flow notifications and leave request. Work flow
notification from administrator are stored in the backend and notified to
employee, once employee log in to the system. Leave request made by the
employee is placed for administrator approval, the administrator module
checks up with the leave availability and approves or rejects the request.
Introduction of the Project Employee Management System

Every organization, whether big or small, has human resource


challenges to overcome. every organization has different employee
management needs, therefore we design exclusive employee management
systems that are adapted to your managerial requirements. This is designed
to assist in strategic planning, and will help you ensure that your
organization is equipped with the right level of human resources for your
future goals. Also, for those busy executive who are always on the go, our
systems come with remote access features, which will allow you to manage
your workforce anytime, at all times. These systems will ultimately allow
you to better manage resources. One of the main features in employee
management system is time tracking for employees. Effective time tracking
mechanism saves both time and money for the organization.
Implementation of security mechanisms at various levels

Data Security System: The data security system will allow data to be

securely transmitted between the various components of the e-commerce

portal. This includes transmission of product, merchant and customer

information from the content management system to the website, and also

the transmission of data from the website to the content management

system.

Folder Security using .htaccess: The .htaccess (short for “Hypertext

Access”) file in your site’s directory is a configuration file you can

use to override the settings on your web server. With the right commands,

you can enable/disable extra functionality and features to protect your site

from spammers, hackers and other threats.

Prevent Directory Browsing: Protecting directories from being listed is, at

best, security by obscurity. That is, its hiding your stuff from view,

preventing meddling visitors from browsing through your directories. Really,

its the web equivalent of hiding your cash under your mattress.Still, its good

practice to prevent directory browsing, along with implementing other

measures to secure your site.

To disable browsing of your directories, add this to your .htaccess file:

Options All –Indexes


Restrict Access to Your Admin Area : A simple way to restrict access if

your internet has a fixed IP address and you always access your site form

the same location is by creating a new .htaccess file with the following

snippet:

order deny,allow

allow from 192.168.5.1

deny from all


System Design

In this phase, a logical system is built which fulfils the given requirements.

Design phase of software development deals with transforming the

customer’s requirements into a logically working system. Normally, design is

performed in the following in the following two steps:

1) Primary Design Phase: In this phase, the system is designed at

block level. The blocks are created on the basis of analysis done in the

problem identification phase. Different blocks are created for different

functions emphasis is put on minimising the information flow between

blocks. Thus, all activities which require more interaction are kept in

one block.

2) Secondary Design Phase : In the secondary phase the detailed

design of every block is performed.

The general tasks involved in the design process are the following:

I. Design various blocks for overall system processes.

II. Design smaller, compact and workable modules in each block.

III. Design various database structures.

IV. Specify details of programs to achieve desired functionality.

V. Design the form of inputs, and outputs of the system.


VI. Perform documentation of the design.

VII. System reviews.

User Interface Design

User Interface Design is concerned with the dialogue between a user and the

computer. It is concerned with everything from starting the system or

logging into the system to the eventually presentation of desired inputs and

outputs. The overall flow of screens and messages is called a dialogue.

The following steps are various guidelines for User Interface Design:

1) The system user should always be aware of what to do next.

2) The screen should be formatted so that various types of information,

instructions and messages always appear in the same general display

area.

3) Message, instructions or information should be displayed long enough

to allow the system user to read them.

4) Use display attributes sparingly.

5) Default values for fields and answers to be entered by the user should

be specified.

6) A user should not be allowed to proceed without correcting an error.

7) The system user should never get an operating system message or

fatal error.
TESTING

Testing is the process in which the system is run on manually created

input so that the system is correctly working as desired or not.

During systems testing, the system is used experimentally to ensure

that the software does not fail. In other words, we can say that it will run

according to its specifications and in the way users expect. Special test data

are input for processing, and the results examined.

A limited number of users may be allowed to use the system so that

analyst can see whether they tr

y to use it in unforeseen ways. It is desirable to discover any surprises

before the organization implements the system and depends on it.

Testing of a system is generally done in two phases – One is Unit Testing

which is done for each module independently on its completion and the other

one is System Testing which is done at the end of a project.


VALIDATION CRITERIA

The validation criteria in this project are as follows...

In System also, the user inputs are validated before storing them, and

then further for displaying etc. The main validations that are donel System

are as follows –

All the screens have a similar look and feel. They all have the almost same

color combinations in its background. This provides a better user interface to

the users.

1) The primary key values cannot be duplicated.

2) All the entries in any combo box have been sorted in alphabetical

order. This helps a user while selecting a value from the combo box.

IMPORTANCE OF TESTING

During systems testing, the system is used experimentally to ensure that

the software does not fail. In other words, we can say that it will run

according to its specifications and in the way users expect. Special test data

are input for processing, and the results examined.

The importance of system testing is that the system is expected to run

according to member’s requirement before delivering it to the customer.


The System is tested on the basis of specification so that it does not

fail on user site.

Implementation and Testing

Implementation

Detailed Design of Implementation - This phase of the systems

development life cycle refines hardware and software specifications,

establishes programming plans, trains users and implements extensive

testing procedures, to evaluate design and operating specifications and/or

provide the basis for further modification.

Technical Design - This activity builds upon specifications produced during

new system design, adding detailed technical specifications and

documentation.

Test Specifications and Planning - This activity prepares detailed test

specifications for individual modules and programs, job streams,

subsystems, and for the system as a whole.

Programming and Testing - This activity encompasses actual

development, writing, and testing of program units or modules.

User Training - This activity encompasses writing user procedure manuals,

preparation of user training materials, conducting training programs, and


testing procedures.

Acceptance Test - A final procedural review to demonstrate a system and

secure user approval before a system becomes operational.

Installation Phase - In this phase the new Computerized system is

installed, the conversion to new procedures is fully implemented, and the

potential of the new system is explored.

System Installation: The process of starting the actual use of a system

and training user personnel in its operation.

Review Phase - This phase evaluates the successes and failures during a

systems development project, and to measure the results of a new

Computerized Transystem in terms of benefits and savings projected at the

start of the project.

Development Recap - A review of a project immediately after completion

to find successes and potential problems in future work.

Post-Implementation Review - A review, conducted after a new system

has been in operation for some time, to evaluate actual system performance

against original expectations and projections for cost-benefit improvements.

Also identifies maintenance projects to enhance or improve the system.

THE STEPS IN THE SOFTWARE TESTING


The steps involved during Unit testing are as follows:

a) Preparation of the test cases.

b) Preparation of the possible test data with all the validation checks.

c) Complete code review of the module.

d) Actual testing done manually.

e) Modifications done for the errors found during testing.

f) Prepared the test result scripts.

The unit testing done included the testing of the following items:

1) Functionality of the entire module/forms.

2) Validations for user input.

3) Checking of the Coding standards to be maintained during coding.

4) Testing the module with all the possible test data.

5) Testing of the functionality involving all type of calculations etc.

6) Commenting standard in the source files.

After completing the Unit testing of all the modules, the whole system is

integrated with all its dependencies in that module. While System

Integration, We integrated the modules one by one and tested the system at

each step. This helped in reduction of errors at the time of the system

testing.

The steps involved during System testing are as follows:


 Integration of all the modules/forms in the system.

 Preparation of the test cases.

 Preparation of the possible test data with all the validation checks.

 Actual testing done manually.

 Recording of all the reproduced errors.

 Modifications done for the errors found during testing.

COST ESTIMATION OF THE PROJECT

Software cost comprises a small percentage of overall computer-based

system cost. There are a number of factors, which are considered, that can

affect the ultimate cost of the software such as - human, technical,

Hardware and Software availability etc.

The main point that was considered during the cost estimation of project

was its sizing. In spite of complete software sizing, function point and

approximate lines of code were also used to "size" each element of the

Software and their costing.

The cost estimation done by me for Project also depend upon the baseline

metrics collected from past projects and these were used in conjunction with

estimation variables to develop cost and effort projections.

We have basically estimated this project mainly on two bases -


1) Effort Estimation - This refers to the total man-hours required for

the development of the project. It even includes the time required for

doing documentation and user manual.

2) Hardware Required Estimation - This includes the cost of the PCs

and the hardware cost required for development of this project.


SYSTEM ANALYSIS

The analysis model is a concise, precise abstraction of what the desired

system must do, and not how it will be done after the study of the

existing system is completed. This basically includes system study and

the requirement analysis. Interacting with the clients regarding their

requirements and expectations from the system does requirement

analysis.

The steps, which are essential for system analysis, are:

1. Research and define essential components.

2. Analyze current processes and identify gaps.

3. Interview users, Trainee, Trainers and other concerned personnel

regarding essential components and current processes.

4. Write requirements document.

5. Define standards for standards, policies, and procedures.

6. Review draft requirements document with users, Trainee, Trainers and

other concerned personnel.

7. Update and expand project plan.


FEASIBILITY STUDY

At this stage, the analyst estimates the urgency of the project and estimates

the development cost.

In feasibility analysis, we have to study the following:

1) Technical Feasibility:

Technical feasibility is concerned with the availability of hardware and

software required for the development of the system, to see

compatibility and maturity of the technology proposed to be used and

to see the availability of the required technical manpower to develop

the system.

After the study we came to conclusion that we proceed further with

the tools and development environment chosen by us. This was

important in our case as we were working on two various phases of

the department that will need to be integrated in future to make an

extended system.

2) Operational Feasibility:

Operational feasibility is all about problems that may arise during

operations. There are two aspects related with this issue:

 What is the probability that the solution developed may not be

put to use or may not work?


 What is the inclination of the management and end users

towards the solution? Though, there is very least possibility of

management being averse to the solution, there is a significant

probability that the end users may not be interested in using the

solution due to lack of training, insight etc.

3) Economic Feasibility:

It is the measure of cost effectiveness of the project. The economic

feasibility is nothing but judging whether the possible benefit of solving

the problems is worthwhile of not. At the feasibility study level, it is

impossible to estimate the cost because member’s requirements and

alternative solutions have not been identified at this stage. However,

when the specific requirements and solutions have been identified, the

analyst weighs the cost and benefits of all solutions, this is called “cost

benefit analysis.
PROJECT SCHEDULING

An elementary Gantt chart or Timeline chart for the development plan is

given below. The plan explains the tasks versus the time (in weeks) they will

take to complete.

January February March

Requirement

Gathering

Analysis

Design

Coding

Testing

Implement

W W W W W W W W W W W W4

1 2 3 4 1 2 3 4 1 2 3

Wi‘s are weeks of the months, for i =1, 2, 3, 4


RDBMS Architecture Diagram

Project Category:
Relational Database Management System (RDBMS) : This is an RDBMS
based project which is currently using MySQL for all the transaction
statements. MySQL is an opensource RDBMS System.
Brief Introduction about RDBSM :
A relational database management system (RDBMS) is a database
management system (DBMS) that is based on the relational model as
invented by E. F. Codd, of IBM's San Jose Research Laboratory. Many
popular databases currently in use are based on the relational database
model.
RDBMSs have become a predominant choice for the storage of information in
new databases used for financial records, manufacturing and logistical
information, personnel data, and much more since the 1980s. Relational
databases have often replaced legacy hierarchical databases and network
databases because they are easier to understand and use.
Implementation Methodology:

Model View Controller or MVC as it is popularly called, is a software design


pattern for developing web applications. A Model View Controller pattern
is made up of the following three parts:
 Model - The lowest level of the pattern which is responsible for
maintaining data.
 View - This is responsible for displaying all or a portion of the data to
the user.
 Controller - Software Code that controls the interactions between
the Model and View.
MVC is popular as it isolates the application logic from the user interface
layer and supports separation of concerns. Here the Controller receives all
requests for the application and then works with the Model to prepare any
data needed by the View. The View then uses the data prepared by the
Controller to generate a final presentable response. The MVC abstraction can
be graphically represented as follows.
MVC (Model View Controller Flow) Diagram
Design Diagrams
of the Project
Admin Add Em ee Seuence Dia
Admin

Login to age

oyee

ate’

Save Emp oyee

oyee is in
InvaData
Em ee Leave A fication Seuence Dia
E mployee

Log in to Pa é

y Leave

Save Leaves

eave is ing
nva

eceaveus
Loin Seuence Diaram for Loin of User
User of System

oginage
ecogin

ogin

nvaorg in

irec ogin agease pure


Seuence Dia
Admin

Login to age

ate’

Save Sa

is ing
InvaData
Em ee Timesheet EntrForm Seuence Dia
E m ployee

Log inage

imes ee

ate

ave imes ee

imes ee epo
InvaData

Times eet Reports

+getLeave( ) : public
+listLeave( ) : public
Salary +getStatus( ) : public
+salID: Integer
+empID: Integer
+salMonth: String
+saleDate: Date
+salAmount: Integer
+addSala ry ( ) : public
+editSala ry ( ) : public
+getSala ry ( ) : public
+1istsala ry( ) : public

Leave
+leaveID: Integer
+empID: Integer
+leaveTitle: String
+leaveDescription: String
+1eaveAppl yDat e: Date
+1eavesta rtDat e: Date
+1eaveEndDate: Date —
+1eavestat us: Boot ean
+applyLeave( ): public
+editLeave( ) : public
Employee
Timesheet
Manaqement +timeID: Integer
S +empID: Integer
+timeTotalHours: Integer
v +timeDate: Date
s +timeTask: String
+timeDescription: String
t +addTimesheet(): public
e +editTimesheet(): public
m +getTimesheet(): public
+listTimesheet(): public

C
l
a
s
s
D
i
a
g
r
a
m

Employee
+empID: Integer
+empName: String
+empContact: String
+empDepartment: String
+empEmail: String
+empAddress: String
+addEmployee( ) : public
+editEmployee() : public
+deleteEmployee() :
public
+getEmployee( ) : public
+listEmployee() : public

Login
+loginID: Integer
+empID: Integer
+loginUsername: String
+loginPassword: MD5
+loginStatus: Boolean
+checkLogin(): public
+getLoginDetails():
public
+getLoginStatus(): public
+createLogin( ): public
+changePassword(): public
Usecase Diaqram
Employee Management System

Employee Management

My Profile

Leave Management

Apply Leaves

EMS Admin Salary Management mployee

View Payslip/Salary

Timesheet Management

View/Add Timesheet
Input and Output
Screen of the Project
Employee Management System is a functirci io orgaaizadous designed to znazioñze earployee performance of ao e

HR is a prodixt of ike buman relatims rnnvemext of the early 20tfi centuiy, when researcbers beggri dixurœnfing ways of creating busimss value tbinugfi tfie strategic mmager0erit of the u rhforœ. The iû riction was initiaily dnmi
In startrrp companies, HR duties eiay be performed by trained professionals. Ix larger companies, an entire hinctiotial group is typically dedicated to ike discipline, with staff specializing in varioro ftR tasks and iirnctional leaders
In the current global work environment, most companies f‹xus on lowering empkiyee turnover arid m retakring the talent and knnwledge held by their workforce. New kiriog not oaty mta1Is a bigh oral but also f/xreases file
ABOUT US ADMINISTRATOR LOGIN CONTACT US
AODUTUS REPORTS CHANGE PASSWORD CONTACT US
Admin Dashboard Screen
l(Dl Amit 09876543212 IT Depanment Worker kaushal(ifgrnaiI.COtTl Select Action •
1002 Kaushal 09876543212 HR Department Fresher kaushal.rahuljaiswal@gmdÏl.CO£1J Select Action •
l(D3 Sumit 09876543212 IT Depanment Worker kishore(ifgmdil.COm Select Action •
1004 Deepak 09876543212 Java Developement Worker amitJgnaail.COm Select Action •
I(DS Manager Select Action •
1006 Atul 9876543212 IT Department lntern aatul@gmdil.CO£1J Select Action •

Select Action •
1008 Neha 09876543212 HR Department lntern aggaru'al.nehaÇn9gmail.com Select Action •
Payment Report

1DO3 gdit

Admin Salary Report Screen


l(D2 Kaushal Jaiswal l0(Dl 1 July,2015 Edit
1003 Sumit Aggarwal 10002 l July,20l5 Edit
l(D2 Kaushal I0(D2 8 l July,2015 Edit
1002 Jaiswal 10001 1 June,20l3 Edit
l(D2 I0(D2 8 7 July,2015 Edit
Kaushal
1002 10001 l July,20l5 Edit
Jaiswal
Kaushal
Jaiswal Kaushal
Jaiswal

Admin Timesheet Report Screen


Employee Dashboard Screen
ABOUT US NIà .ACCOLhT CA ANGE PASS\VORD CONT.ACT US
ABOUT US Mà' .ACCOLhT CHANGE PASS\VORD CONT.ACT US
Coding of the
Project
Code of Connect.java
package com;
import java.sql.*;
import java.util.*;

public class Connect


{
public static Statement statement = null;
public static Connection connection;
public static ResultSet rs;
public static PreparedStatement pstmt;
/////Function for connect to the MySQL Server Database////////////
public static void connect_mysql()
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection =
DriverManager.getConnection("jdbc:mysql://localhost/employee_manageme
nt_system?" + "user=root&password=root");
statement=connection.createStatement();
}
catch(Exception e)
{
System.out.println(" Error : "+ e.toString());
}
}
////////Function for geting the Option/////////////////////
public static String getOptionList(String tableName,String
idColumn,String valueColumn,String Columns,int selID,String conn)
{
String SQL = "SELECT "+Columns+" FROM "+tableName+"
where "+conn;
String Option="<option value=''>Please Select</option>";
try
{
rs = statement.executeQuery(SQL);
while(rs.next())
{
int selectedID = rs.getInt(idColumn);
if(selectedID==selID)
Option+="<option value=\""+selectedID+"\"
Selected>"+rs.getString(valueColumn)+"</option>";
else
Option+="<option
value=\""+selectedID+"\">"+rs.getString(valueColumn)+"</option>";
}
}
catch(Exception e)
{
System.out.println("Error : "+e);
}
return Option;
}
}
Code of Employee.java
package Model;

import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;

public class Employee extends Connect


{
/////Function for connect to the MySQL Server Database////////////
public Employee()
{
Connect.connect_mysql();
}
//////////Save User Details /////
public String saveEmployee(HashMap employeeData)
{

String SQL = "INSERT INTO employee (employee_user,


employee_password, employee_level, employee_sal, employee_first_name,
employee_middle_name, employee_last_name, employee_gender,
employee_address, employee_village, employee_state, employee_country,
employee_landline, employee_mobile, employee_email, employee_status,
employee_deparment, employee_dob, employee_nationalty) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
int record=0,last_inserted_id=0;
String error = "";
try
{
pstmt = connection.prepareStatement(SQL); pstmt.setString(1,
(String)
employeeData.get("employee_user"));
pstmt.setString(2,(String)
employeeData.get("employee_password"));
pstmt.setString(3,(String)
employeeData.get("employee_level"));
pstmt.setString(4,(String) employeeData.get("employee_sal"));
pstmt.setString(5,(String)
employeeData.get("employee_first_name"));
pstmt.setString(6,(String)
employeeData.get("employee_middle_name")); pstmt.setString(7,
(String)
employeeData.get("employee_last_name"));
pstmt.setString(8,(String)
employeeData.get("employee_gender"));
pstmt.setString(9,(String)
employeeData.get("employee_address"));
pstmt.setString(10,(String)
employeeData.get("employee_village"));
pstmt.setString(11,(String)
employeeData.get("employee_state"));
pstmt.setString(12,(String)
employeeData.get("employee_country"));
pstmt.setString(13,(String)
employeeData.get("employee_landline"));
pstmt.setString(14,(String)
employeeData.get("employee_mobile"));
pstmt.setString(15,(String)
employeeData.get("employee_email"));
pstmt.setString(16,(String)
employeeData.get("employee_status"));
pstmt.setString(17,(String)
employeeData.get("employee_deparment")); pstmt.setString(18,
(String)
employeeData.get("employee_dob"));
pstmt.setString(19,(String)
employeeData.get("employee_nationalty"));

record = pstmt.executeUpdate();
/// Get the Last Insert ID ///
rs = pstmt.getGeneratedKeys();
if(rs.next())
{
last_inserted_id = rs.getInt(1);
}

pstmt.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}

/// Save Credentials to Login ////


SQL = "INSERT INTO login (login_emp_id, login_user, login_password,
login_email) VALUES (?, ?, ?, ? );";
try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setInt(1,last_inserted_id);
pstmt.setString(2,(String)
employeeData.get("employee_user"));
pstmt.setString(3,(String)
employeeData.get("employee_password"));
pstmt.setString(4,(String)
employeeData.get("employee_email"));
record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}

return error;
}

//////////////////Function for getting Users Details//////////


public HashMap getEmployeeDetails(int employee_id)
{
HashMap resultsArray = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM employee WHERE employee_id =
"+employee_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{

resultsArray.put("employee_id",rs.getString("employee_id"));

resultsArray.put("employee_user",rs.getString("employee_user"));

resultsArray.put("employee_level",rs.getString("employee_level"));

resultsArray.put("employee_sal",Integer.parseInt(rs.getString("employee_sal
")));
resultsArray.put("employee_first_name",rs.getString("employee_first_name"
));

resultsArray.put("employee_middle_name",rs.getString("employee_middle_n
ame"));

resultsArray.put("employee_last_name",rs.getString("employee_last_name")
);

resultsArray.put("employee_gender",rs.getString("employee_gender"));

resultsArray.put("employee_address",rs.getString("employee_address"));

resultsArray.put("employee_village",rs.getString("employee_village"));

resultsArray.put("employee_state",Integer.parseInt(rs.getString("employee_
state")));

resultsArray.put("employee_country",Integer.parseInt(rs.getString("employe
e_country")));

resultsArray.put("employee_landline",rs.getString("employee_landline"));

resultsArray.put("employee_mobile",rs.getString("employee_mobile"));
resultsArray.put("employee_email",rs.getString("employee_email"));

resultsArray.put("employee_status",Integer.parseInt(rs.getString("employee
_status")));

resultsArray.put("employee_deparment",Integer.parseInt(rs.getString("empl
oyee_deparment")));

resultsArray.put("employee_dob",rs.getString("employee_dob"));

resultsArray.put("employee_nationalty",rs.getString("employee_nationalty"))
;
count++;
}
if(count==0)
{
resultsArray.put("employee_id","");
resultsArray.put("employee_user","");
resultsArray.put("employee_level","");
resultsArray.put("employee_sal",0);
resultsArray.put("employee_first_name","");
resultsArray.put("employee_middle_name","");
resultsArray.put("employee_last_name","");
resultsArray.put("employee_gender","");
resultsArray.put("employee_address","");
resultsArray.put("employee_village","");
resultsArray.put("employee_state",0);
resultsArray.put("employee_country",0);
resultsArray.put("employee_landline","");
resultsArray.put("employee_mobile","");
resultsArray.put("employee_email","");
resultsArray.put("employee_status",0);
resultsArray.put("employee_deparment",0);
resultsArray.put("employee_dob","");
resultsArray.put("employee_nationalty","");

}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultsArray;
}

public String updateEmployee(HashMap employeeData)


{
String SQL = "UPDATE employee SET employee_sal = ?,
employee_first_name = ?, employee_middle_name = ?,
employee_last_name = ?, employee_gender = ?, employee_address = ?,
employee_village = ?, employee_state = ?, employee_country = ?,
employee_landline = ?, employee_mobile = ?, employee_email = ?,
employee_status = ?, employee_deparment = ?, employee_dob = ?,
employee_nationalty = ? WHERE employee_id = ?";
String error = "";

int record=0;

try {
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)

employeeData.get("employee_sal"));
pstmt.setString(2,(String)
employeeData.get("employee_first_name"));
pstmt.setString(3,(String)
employeeData.get("employee_middle_name"));
pstmt.setString(4,(String)
employeeData.get("employee_last_name"));
pstmt.setString(5,(String)
employeeData.get("employee_gender"));
pstmt.setString(6,(String)
employeeData.get("employee_address"));
pstmt.setString(7,(String)
employeeData.get("employee_village"));
pstmt.setString(8,(String)
employeeData.get("employee_state"));
pstmt.setString(9,(String)
employeeData.get("employee_country"));
pstmt.setString(10,(String)
employeeData.get("employee_landline"));
pstmt.setString(11,(String)
employeeData.get("employee_mobile"));
pstmt.setString(12,(String)
employeeData.get("employee_email"));
pstmt.setString(13,(String)
employeeData.get("employee_status"));
pstmt.setString(14,(String)
employeeData.get("employee_deparment"));
pstmt.setString(15,(String)
employeeData.get("employee_dob"));
pstmt.setString(16,(String)
employeeData.get("employee_nationalty"));
pstmt.setString(17,(String)
employeeData.get("employee_id"));
record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
public boolean deleteEmployee(int employee_id)
{
return true;
}
/////Function for Getting the List////////////
public String getStateOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("state","state_id","state_name","state_id,state_name
",selectedID,"1");
}

/////Function for Getting the List////////////


public String getCountryOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("country","country_id","country_name","country_id,c
ountry_name",selectedID,"1");
}

/////Function for Getting the List////////////


public String getSalutionOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("salutions","sl_id","sl_name","sl_id,sl_name",selected
ID,"1");
}

/////Function for Getting the List////////////


public String getConnectionTypeOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("connection_type","cont_id","cont_name","cont_id,co
nt_name",selectedID,"1");
}

/////Function for Getting the List////////////


public String getStatusOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("status","status_id","status_name","status_id,status_
name",selectedID,"1");
}

/////Function for Getting the List////////////


public String getDepartmentOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("department","dept_id","dept_name","dept_id,dept_n
ame",selectedID,"1");
}

////////////////Function for getting all the Airport


Details////////////////////
public ArrayList getAllEmployee()
{
int count=0;
String error = "";
ArrayList resultArray = new ArrayList();
try
{
String SQL = "SELECT * FROM employee" ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
HashMap results = new HashMap();

results.put("employee_id",rs.getString("employee_id"));

results.put("employee_user",rs.getString("employee_user"));

results.put("employee_level",rs.getString("employee_level"));

results.put("employee_sal",rs.getString("employee_sal"));

results.put("employee_first_name",rs.getString("employee_first_name"));

results.put("employee_middle_name",rs.getString("employee_middle_name"
));

results.put("employee_last_name",rs.getString("employee_last_name"));

results.put("employee_gender",rs.getString("employee_gender"));

results.put("employee_address",rs.getString("employee_address"));
results.put("employee_village",rs.getString("employee_village"));

results.put("employee_state",rs.getString("employee_state"));

results.put("employee_country",rs.getString("employee_country"));

results.put("employee_landline",rs.getString("employee_landline"));

results.put("employee_mobile",rs.getString("employee_mobile"));

results.put("employee_email",rs.getString("employee_email"));

results.put("employee_status",Integer.parseInt(rs.getString("employee_stat
us")));

results.put("employee_deparment",Integer.parseInt(rs.getString("employee_
deparment")));

results.put("employee_dob",rs.getString("employee_dob"));

results.put("employee_nationalty",rs.getString("employee_nationalty"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return resultArray;
}

public String getDepartment(int dept_id)


{
HashMap results = new HashMap();
String SQL = "";
String value = "";
int count=0;
try
{
SQL = "SELECT dept_name FROM department WHERE dept_id =
"+dept_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
value = rs.getString("dept_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}

public String getStatus(int status_id)


{
HashMap results = new HashMap();
String SQL = "";
String value = "";
int count=0;
try
{
SQL = "SELECT status_name FROM status WHERE status_id =
"+status_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
value = rs.getString("status_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}
}
Code of Leave.java
package Model;

import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;

public class Leave extends Connect


{
/////Function for connect to the MySQL Server Database////////////
public Leave()
{
Connect.connect_mysql();
}
//////////Save User Details /////
public String saveLeave(HashMap leaveData)
{
String SQL = "INSERT INTO `leave` (leave_employee_id,
leave_reason, leave_description, leave_from_date, leave_to_date) VALUES
(?, ?, ?, ?, ?);";
int record=0;
String error = "";

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
leaveData.get("leave_employee_id"));
pstmt.setString(2,(String) leaveData.get("leave_reason"));
pstmt.setString(3,(String)
leaveData.get("leave_description"));
pstmt.setString(4,(String)
leaveData.get("leave_from_date"));
pstmt.setString(5,(String)
leaveData.get("leave_to_date"));

record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Users Details//////////
public HashMap getLeaveDetails(int leave_id)
{
HashMap results = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM `leave` WHERE leave_id =
"+leave_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
results.put("leave_id",rs.getString("leave_id"));

results.put("leave_employee_id",Integer.parseInt(rs.getString("leave_emplo
yee_id")));

results.put("leave_reason",rs.getString("leave_reason"));

results.put("leave_description",rs.getString("leave_description"));

results.put("leave_from_date",rs.getString("leave_from_date"));

results.put("leave_to_date",rs.getString("leave_to_date"));

results.put("leave_status",rs.getString("leave_status"));

count++;
}
if(count==0)
{
results.put("leave_id","");
results.put("leave_employee_id",0);
results.put("leave_reason","");
results.put("leave_description","");
results.put("leave_from_date","");
results.put("leave_to_date","");
results.put("leave_status",0);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}
/// Update the Leave ////
public String updateLeave(HashMap leaveData)
{
String SQL = "UPDATE `leave` SET leave_status = ? WHERE
leave_id = ?";
String error = "";

int record=0;

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String) leaveData.get("leave_status"));
pstmt.setString(2,(String) leaveData.get("leave_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}

catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}

////////////////Function for getting all the Airport


Details////////////////////
public ArrayList getAllLeave(String emp_id)
{
String SQL = "SELECT * FROM `leave`,`employee` WHERE
leave_employee_id = employee_id";
int count=0;
ArrayList resultArray = new ArrayList();
try
{
if(!emp_id.equals("0"))
{
SQL = "SELECT * FROM `leave`,`employee` WHERE
leave_employee_id = employee_id AND employee_id = "+emp_id;
}
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
HashMap results = new HashMap();
results.put("leave_id",rs.getString("leave_id"));

results.put("leave_employee_id",Integer.parseInt(rs.getString("leave_emplo
yee_id")));

results.put("leave_reason",rs.getString("leave_reason"));

results.put("leave_description",rs.getString("leave_description"));

results.put("leave_from_date",rs.getString("leave_from_date"));

results.put("leave_to_date",rs.getString("leave_to_date"));

results.put("leave_status",rs.getString("leave_status"));

results.put("employee_name",rs.getString("employee_first_name")+"
"+rs.getString("employee_last_name"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
/////Function for Getting the List////////////
public String getEmployeeOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("employee","employee_id","employee_id","employee_
id,employee_id",selectedID,"1");
}
}
Code of Login.java
package Model;

import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;

public class Login extends Connect


{
/////Function for connect to the MySQL Server Database////////////
public Login()
{
Connect.connect_mysql();
}
//////////////////Function for Update the airport////////////////////////
public boolean changePassword(String old_password,String
new_password, int login_id)
{
String SQL;
int count = 0;
try
{
SQL = "SELECT * FROM login WHERE login_password =
'"+old_password+"' AND login_id = "+login_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next()) count++;
if(count==1)

login_id=?";
{
SQL = "UPDATE login SET login_password=? WHERE

int record=0;
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,new_password);
} pstmt.setInt(2,1);
record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
System.out.println(" Error : "+ e.toString());
}
if(count==0)
return false;
return true;
}
//////////////////Function for geting the Single Airport Details//////////
public boolean checkLogin(String login_user,String login_password)
{
int count=0;
try
{
String SQL = "SELECT * FROM login WHERE login_user =
'"+login_user+"' AND login_password = '"+login_password+"'" ;
statement = connection.createStatement();
rs =
statement.executeQuery(SQL);
while(rs.next()) count++;
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
if(count==0)
return false;
return true;
}
//////////////////Function for getting Login Details//////////
public HashMap getLoginDetails(String login_user,String login_password)
{
HashMap resultsArray = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM login WHERE login_user =
'"+login_user+"' AND login_password = '"+login_password+"'" ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
resultsArray.put("login_id",rs.getString("login_id"));

resultsArray.put("login_emp_id",rs.getString("login_emp_id"));

resultsArray.put("login_user",rs.getString("login_user"));
resultsArray.put("login_level",rs.getString("login_level"));
count++;
}
if(count==0)
{
resultsArray.put("login_id","");
resultsArray.put("login_emp_id","");
resultsArray.put("login_user","");
resultsArray.put("login_level","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultsArray;
}
}
Code of Salary.java
package Model;

import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;

public class Salary extends Connect


{
/////Function for connect to the MySQL Server Database////////////
public Salary()
{
Connect.connect_mysql();
}
//////////Save User Details /////
public String saveSalary(HashMap salaryData)
{
String SQL = "INSERT INTO salary (sal_employe_id, sal_month,
sal_year, sal_amount) VALUES (?, ?, ?, ?);";
int record=0;
String error = "";

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
salaryData.get("sal_employe_id"));
pstmt.setString(2,(String) salaryData.get("sal_month"));
pstmt.setString(3,(String) salaryData.get("sal_year"));
pstmt.setString(4,(String) salaryData.get("sal_amount"));

record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Users Details//////////
public HashMap getSalaryDetails(int sal_id)
{
HashMap results = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM salary WHERE sal_id = "+sal_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
results.put("sal_id",rs.getString("sal_id"));

results.put("sal_employe_id",Integer.parseInt(rs.getString("sal_employe_id"
)));
results.put("sal_year",rs.getString("sal_year"));

results.put("sal_month",Integer.parseInt(rs.getString("sal_month")));

results.put("sal_amount",rs.getString("sal_amount"));
count++;
}
if(count==0)
{
results.put("sal_id","");
results.put("sal_employe_id",0);
results.put("sal_year","");
results.put("sal_month",0);
results.put("sal_amount","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}

//////////////////Function for getting Users Details//////////


public String getMonth(int mon_id)
{
HashMap results = new HashMap();
String SQL = "";
String value = "";
int count=0;
try
{
SQL = "SELECT month_name FROM month WHERE month_id =
"+mon_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
value = rs.getString("month_name");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return value;
}

public String updateSalary(HashMap salaryData)


{
String SQL = "UPDATE salary SET sal_employe_id = ?,sal_year
= ?,sal_month = ?,sal_amount = ? WHERE sal_id = ?";
String error = "";
int record=0;

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
salaryData.get("sal_employe_id"));
pstmt.setString(2,(String) salaryData.get("sal_year"));
pstmt.setString(3,(String) salaryData.get("sal_month"));
pstmt.setString(4,(String) salaryData.get("sal_amount"));
pstmt.setString(5,(String) salaryData.get("sal_id"));
record = pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
public boolean delete_login(int airline_id)
{
return true;
}

////////////////Function for getting all the Airport


Details////////////////////
public ArrayList getAllSalary(String emp_id)
{
String SQL = "SELECT * FROM salary";
int count=0;
ArrayList resultArray = new ArrayList();
try
{
if(!emp_id.equals("0"))
{
SQL = "SELECT * FROM salary WHERE
sal_employe_id = "+emp_id;
}
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
HashMap results = new HashMap();
results.put("sal_id",rs.getString("sal_id"));

results.put("sal_employe_id",Integer.parseInt(rs.getString("sal_employe_id"
)));
results.put("sal_year",rs.getString("sal_year"));

results.put("sal_month",Integer.parseInt(rs.getString("sal_month")));
results.put("sal_amount",rs.getString("sal_amount"));

count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
/////Function for Getting the List////////////
public String getMonthOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("month","month_id","month_name","month_id,month
_name",selectedID,"1");
}
/////Function for Getting the List////////////
public String getEmployeeOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("employee","employee_id","employee_id","employee_
id,employee_id",selectedID,"1");
}
}
Code of Timesheet.java
package Model;

import java.util.*;
import java.sql.*;
import com.*;
import java.io.*;

public class Timesheet extends Connect


{
/////Function for connect to the MySQL Server Database////////////
public Timesheet()
{
Connect.connect_mysql();
}
//////////Save User Details /////
public String saveTimesheet(HashMap timesheetData)
{
String SQL = "INSERT INTO timesheet (timesheet_employee_id,
timesheet_project_id, timesheet_work_title, timesheet_description,
timesheet_hours, timesheet_date) VALUES (?, ?, ?, ?, ?, ?);";
int record=0;
String error = "";

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
timesheetData.get("timesheet_employee_id"));
pstmt.setString(2,(String)
timesheetData.get("timesheet_project_id"));
pstmt.setString(3,(String)
timesheetData.get("timesheet_work_title"));
pstmt.setString(4,(String)
timesheetData.get("timesheet_description"));
pstmt.setString(5,(String)
timesheetData.get("timesheet_hours"));
pstmt.setString(6,(String)
timesheetData.get("timesheet_date"));

record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}
//////////////////Function for getting Users Details//////////
public HashMap getTimesheetDetails(int timesheet_id)
{
HashMap results = new HashMap();
int count=0;
try
{
String SQL = "SELECT * FROM `timesheet` WHERE timesheet_id =
"+timesheet_id ;
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{

results.put("timesheet_id",rs.getString("timesheet_id"));

results.put("timesheet_employee_id",Integer.parseInt(rs.getString("timeshe
et_employee_id")));

results.put("timesheet_project_id",Integer.parseInt(rs.getString("timesheet_
project_id")));

results.put("timesheet_work_title",rs.getString("timesheet_work_title"));

results.put("timesheet_description",rs.getString("timesheet_description"));

results.put("timesheet_hours",rs.getString("timesheet_hours"));

results.put("timesheet_date",rs.getString("timesheet_date"));

count++;
}
if(count==0)
{
results.put("timesheet_id","");
results.put("timesheet_employee_id",0);
results.put("timesheet_project_id",0);
results.put("timesheet_work_title","");
results.put("timesheet_description","");
results.put("timesheet_hours","");
results.put("timesheet_date","");
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return results;
}
/// Update the Timesheet ////
public String updateTimesheet(HashMap timesheetData)
{
String SQL = "UPDATE timesheet SET timesheet_employee_id
= ?, timesheet_project_id = ?, timesheet_work_title = ?,
timesheet_description = ?, timesheet_hours = ?, timesheet_date = ?
WHERE timesheet_id = ?;";
String error = "";

int record=0;

try
{
pstmt = connection.prepareStatement(SQL);
pstmt.setString(1,(String)
timesheetData.get("timesheet_employee_id"));
pstmt.setString(2,(String)
timesheetData.get("timesheet_project_id"));
pstmt.setString(3,(String)
timesheetData.get("timesheet_work_title"));
pstmt.setString(4,(String)
timesheetData.get("timesheet_description"));
pstmt.setString(5,(String)
timesheetData.get("timesheet_hours"));
pstmt.setString(6,(String)
timesheetData.get("timesheet_date"));
pstmt.setString(7,(String)
timesheetData.get("timesheet_id"));

record =
pstmt.executeUpdate();
pstmt.close();
connection.close();
}
catch(Exception e)
{
StringWriter writer = new StringWriter();
PrintWriter printWriter = new PrintWriter( writer
); e.printStackTrace( printWriter );
printWriter.flush();
String stackTrace = writer.toString();
error+="Error : "+stackTrace;
System.out.println(" Error : "+ e.toString());
}
return error;
}

////////////////Function for getting all the Airport


Details////////////////////
public ArrayList getAllTimesheet(String emp_id)
{
String SQL = "SELECT * FROM `timesheet`,`employee` WHERE
timesheet_employee_id = employee_id";
int count=0;
ArrayList resultArray = new ArrayList();
try
{
if(!emp_id.equals("0"))
{
SQL = "SELECT * FROM `timesheet`,`employee`
WHERE timesheet_employee_id = employee_id AND employee_id =
"+emp_id;
}
statement = connection.createStatement();
rs = statement.executeQuery(SQL);
while(rs.next())
{
HashMap results = new HashMap();

results.put("timesheet_id",rs.getString("timesheet_id"));
results.put("timesheet_employee_id",Integer.parseInt(rs.getString("timeshe
et_employee_id")));

results.put("timesheet_project_id",Integer.parseInt(rs.getString("timesheet_
project_id")));

results.put("timesheet_work_title",rs.getString("timesheet_work_title"));

results.put("timesheet_description",rs.getString("timesheet_description"));

results.put("timesheet_hours",rs.getString("timesheet_hours"));

results.put("timesheet_date",rs.getString("timesheet_date"));

results.put("employee_name",rs.getString("employee_first_name")+"
"+rs.getString("employee_last_name"));
count++;
resultArray.add(results);
}
}
catch(Exception e)
{
System.out.println("Error is: "+ e);
}
return resultArray;
}
/////Function for Getting the List////////////
public String getEmployeeOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("employee","employee_id","employee_id","employee_
id,employee_id",selectedID,"1");
}
/////Function for Getting the List////////////
public String getProjectOption(Integer SelID)
{
int selectedID = SelID.intValue();
return
Connect.getOptionList("project","project_id","project_id","project_id,project
_id",selectedID,"1");
}
}
Code of Model employee.jsp:
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Employee employee_obj = new Employee();
if((request.getParameter("act")).equals("Save"))
{
HashMap employee_data = new HashMap();

employee_data.put("employee_id",request.getParameter("employee_id"));

employee_data.put("employee_user",request.getParameter("employee_user
"));

employee_data.put("employee_password",request.getParameter("employee_
password"));
employee_data.put("employee_level","1");

employee_data.put("employee_sal",request.getParameter("employee_sal"));

employee_data.put("employee_first_name",request.getParameter("employe
e_first_name"));

employee_data.put("employee_middle_name",request.getParameter("emplo
yee_middle_name"));
employee_data.put("employee_last_name",request.getParameter("employee
_last_name"));

employee_data.put("employee_gender",request.getParameter("employee_ge
nder"));

employee_data.put("employee_address",request.getParameter("employee_a
ddress"));

employee_data.put("employee_village",request.getParameter("employee_vill
age"));

employee_data.put("employee_state",request.getParameter("employee_stat
e"));

employee_data.put("employee_country",request.getParameter("employee_c
ountry"));

employee_data.put("employee_landline",request.getParameter("employee_l
andline"));

employee_data.put("employee_mobile",request.getParameter("employee_m
obile"));
employee_data.put("employee_email",request.getParameter("employee_em
ail"));

employee_data.put("employee_status",request.getParameter("employee_sta
tus"));

employee_data.put("employee_deparment",request.getParameter("employe
e_deparment"));

employee_data.put("employee_dob",request.getParameter("employee_dob")
);

employee_data.put("employee_nationalty",request.getParameter("employee
_nationalty"));

if((request.getParameter("employee_id")).equals(""))
{
employee_obj.saveEmployee(employee_data);
response.sendRedirect("../report-employee.jsp?
msg=Employee Saved Successfully");
}
else
{

employee_data.put("employee_id",request.getParameter("employee_id"));
out.print(employee_obj.updateEmployee(employee_data));

if(request.getParameter("employee_id").equals(session.getAttribute("login_e
mp_id")))
{
response.sendRedirect("../employee.jsp?
employee_id="+session.getAttribute("login_emp_id")+"&msg=Account
Updated Successfully");
}
else
{
response.sendRedirect("../report-employee.jsp?
msg=Employee Updated Successfully");
}
}
}
if((request.getParameter("act")).equals("delete"))
{
int employee_id =
Integer.parseInt(request.getParameter("employee_id"));
if(employee_obj.deleteEmployee(employee_id))
response.sendRedirect("../register.jsp?msg=Record
Deleted Successfully");
else
response.sendRedirect("../register.jsp?msg=Problem in
Deletion.");
}
%>
Code of model Leave.jsp
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Leave leaveObj = new Leave();
String emp_id = "0";
if(session.getAttribute("login_level") != null &&
session.getAttribute("login_level").equals("3")) {
emp_id = (String) session.getAttribute("login_emp_id");
}
if((request.getParameter("act")).equals("Save"))
{
HashMap results = new HashMap();

results.put("leave_id",request.getParameter("leave_id"));

results.put("leave_employee_id",request.getParameter("leave_employee_id"
));

results.put("leave_reason",request.getParameter("leave_reason"));

results.put("leave_description",request.getParameter("leave_description"));

results.put("leave_from_date",request.getParameter("leave_from_date"));

results.put("leave_to_date",request.getParameter("leave_to_date"));
results.put("leave_status",request.getParameter("leave_status"));

if((request.getParameter("leave_id")).equals(""))
{
out.println(leaveObj.saveLeave(results));
response.sendRedirect("../report-leave.jsp?
emp_id="+emp_id+"&msg=Leave Saved Successfully");
}
else
{
results.put("leave_id",request.getParameter("leave_id"));
out.println(leaveObj.updateLeave(results));
response.sendRedirect("../report-leave.jsp?
emp_id=0&msg=Leave Updated Successfully");
}
}
%>
Code of model login.jsp
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Login login_obj = new Login();
if((request.getParameter("act")).equals("chk_login"))
{

if(login_obj.checkLogin(request.getParameter("login_user"),request.getPara
meter("login_password")))
{
HashMap Values =
login_obj.getLoginDetails(request.getParameter("login_user"),request.getPar
ameter("login_password"));
session.setAttribute("login_id",Values.get("login_id"));

session.setAttribute("login_emp_id",Values.get("login_emp_id"));

session.setAttribute("login_user",Values.get("login_user"));

session.setAttribute("login_level",Values.get("login_level"));
response.sendRedirect("../login-home.jsp?msg=You are
login successfully.");
}
else
{
response.sendRedirect("../login.jsp?msg=Invalid
User/Password. Please try again........");
}
}
if((request.getParameter("act")).equals("change_password"))
{

if(login_obj.changePassword(request.getParameter("old_password"),request.
getParameter("new_password"),Integer.parseInt((String)
session.getAttribute("login_id"))))
{
response.sendRedirect("../change-password.jsp?msg=Your
Password has been changed successfully.");
}
else
{
response.sendRedirect("../change-password.jsp?msg=Old
Password doesnot match. Please try again.. . . .");
}
}
if((request.getParameter("act")).equals("logout"))
{
session.setAttribute("login_id",null);
session.setAttribute("login_level",null);
response.sendRedirect("../login.jsp?msg=You are logout
successfully.....");
}
%>
Code of model register.jsp
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Login login_obj = new Login();
if((request.getParameter("act")).equals("Save"))
{
HashMap login_data = new HashMap();

login_data.put("login_user",request.getParameter("login_user"));

login_data.put("login_password",request.getParameter("login_password"));

login_data.put("login_email",request.getParameter("login_email"));
login_data.put("login_sal",request.getParameter("login_sal"));

login_data.put("login_first_name",request.getParameter("login_first_name")
);

login_data.put("login_middle_name",request.getParameter("login_middle_na
me"));

login_data.put("login_last_name",request.getParameter("login_last_name"))
;

login_data.put("login_gender",request.getParameter("login_gender"));
login_data.put("login_address",request.getParameter("login_address"));

login_data.put("login_village",request.getParameter("login_village"));

login_data.put("login_state",request.getParameter("login_state"));

login_data.put("login_country",request.getParameter("login_country"));

login_data.put("login_landline",request.getParameter("login_landline"));

login_data.put("login_mobile",request.getParameter("login_mobile"));

if((request.getParameter("login_id")).equals(""))
{
login_obj.save_login(login_data);
if(request.getParameter("login_id").equals(""))
{
response.sendRedirect("../login.jsp?msg=You have
registered successfully.<br>Login to access your account.");
}
else
{
response.sendRedirect("../report-customer.jsp?
msg=Customer Saved Successfully");
}
}
else
{

login_data.put("login_id",request.getParameter("login_id"));
login_obj.update_login(login_data);

if(request.getParameter("login_id").equals(session.getAttribute("login_id")))
{
response.sendRedirect("../register.jsp?
login_id=1&msg=Account Updated Successfully");
}
else
{
response.sendRedirect("../report-customer.jsp?
msg=Customer Updated Successfully");
}
}
}
if((request.getParameter("act")).equals("delete"))
{
int login_id =
Integer.parseInt(request.getParameter("login_id"));
if(login_obj.delete_login(login_id))
response.sendRedirect("../register.jsp?msg=Record
Deleted Successfully");
else
response.sendRedirect("../register.jsp?msg=Problem in
Deletion.");
}
%>
Code of model Salary.jsp
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Salary salaryObj = new Salary();
if((request.getParameter("act")).equals("Save"))
{
HashMap results = new HashMap();
results.put("sal_id",request.getParameter("sal_id"));

results.put("sal_employe_id",request.getParameter("sal_employe_id"));
results.put("sal_year",request.getParameter("sal_year"));
results.put("sal_month",request.getParameter("sal_month"));
results.put("sal_amount",request.getParameter("sal_amount"));

if((request.getParameter("sal_id")).equals(""))
{
out.println(salaryObj.saveSalary(results));
response.sendRedirect("../report-salary.jsp?msg=Salary
Saved Successfully");
}
else
{
results.put("sal_id",request.getParameter("sal_id"));
out.println(salaryObj.updateSalary(results));
response.sendRedirect("../report-salary.jsp?msg=Salary
Updated Successfully");
}
}
if((request.getParameter("act")).equals("delete"))
{
int pay_id = Integer.parseInt(request.getParameter("sal_id"));
if(salaryObj.delete_login(pay_id))
response.sendRedirect("../register.jsp?msg=Record
Deleted Successfully");
else
response.sendRedirect("../register.jsp?msg=Problem in
Deletion.");
}
%>
Code of model timesheet.jsp
<%@ page import= "Model.*" %>
<%@ page import= "java.util.*" %>

<%
Timesheet timesheetObj = new Timesheet();
String emp_id = "0";
if(session.getAttribute("login_level") != null &&
session.getAttribute("login_level").equals("3")) {
emp_id = (String) session.getAttribute("login_emp_id");
}
if((request.getParameter("act")).equals("Save"))
{
HashMap results = new HashMap();

results.put("timesheet_id",request.getParameter("timesheet_id"));

results.put("timesheet_employee_id",request.getParameter("timesheet_emp
loyee_id"));

results.put("timesheet_project_id",request.getParameter("timesheet_project
_id"));

results.put("timesheet_work_title",request.getParameter("timesheet_work_ti
tle"));
results.put("timesheet_description",request.getParameter("timesheet_descri
ption"));

results.put("timesheet_hours",request.getParameter("timesheet_hours"));

results.put("timesheet_date",request.getParameter("timesheet_date"));

results.put("employee_name",request.getParameter("employee_first_name"
)+" "+request.getParameter("employee_last_name"));

if((request.getParameter("timesheet_id")).equals(""))
{
out.println(timesheetObj.saveTimesheet(results));
response.sendRedirect("../report-timesheet.jsp?
emp_id="+emp_id+"&msg=Timesheet Saved Successfully");
}
else
{

results.put("timesheet_id",request.getParameter("timesheet_id"));
out.println(timesheetObj.updateTimesheet(results));
response.sendRedirect("../report-timesheet.jsp?
emp_id=0&msg=Timesheet Updated Successfully");
}
}
%>

You might also like