Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
133 views

Web Based Employee Management System

This document describes a web based employee management system project submitted by Elius Ansari to fulfill the requirements for a Post Graduate Diploma in Information and Communication Technology from the Bangladesh University of Engineering and Technology. The project received approval from a board of examiners in September 2019. It aims to develop a web application to manage employee information and records electronically rather than using paper-based systems common in developing countries. This is expected to reduce costs and improve efficiency compared to traditional methods. The report outlines the objectives, methodology, system design, implementation, and findings of the project.

Uploaded by

idowuopeyemi074
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

Web Based Employee Management System

This document describes a web based employee management system project submitted by Elius Ansari to fulfill the requirements for a Post Graduate Diploma in Information and Communication Technology from the Bangladesh University of Engineering and Technology. The project received approval from a board of examiners in September 2019. It aims to develop a web application to manage employee information and records electronically rather than using paper-based systems common in developing countries. This is expected to reduce costs and improve efficiency compared to traditional methods. The report outlines the objectives, methodology, system design, implementation, and findings of the project.

Uploaded by

idowuopeyemi074
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

WEB BASED EMPLOYEE MANAGEMENT SYSTEM

by

ELIUS ANSARI

POST GRADUATE DIPLOMA IN INFORMATION AND COMMUNICATION


TECHNOLOGY

Institute of Information and Communication Technology (IICT)


BANGLADESH UNIVERSITY OF ENGINEERING AND TECHNOLOGY (BUET)
September 2019

i
This project titled “WEB BASED EMPLOYEE MANAGEMENT SYSTEM” submitted by
Elius Ansari, Roll No: 1014311021, Session: October/2014, has been accepted as satisfactory
in partial fulfilment of the requirements for the degree of Post Graduate Diploma in Information
and Communication Technology on 23 September, 2019.

Board of Examiners

1. Dr. Md. Rubaiyat Hossain Mondal Chairman


Associate Professor (Supervisor)
IICT, BUET, Dhaka

2. Dr. Md. Saiful Islam Member


Professor
IICT, BUET, Dhaka

3. Dr. Shahin Akhter Member


Assistant Professor
IICT, BUET, Dhaka
.

ii
iii
Dedicated
To
My Parents and Family Members

iv
TABLE OF CONTENT

Title Page No.


Board of Examiners ii
Candidate’s Declaration iii
Dedication iv
Table of Contents v
List of Figures viii
Abbreviation & Key Terms ix
Acknowledgement x
Abstract xi

CHAPTER-I: INTRODUCTION

1.1 Introduction 01
1.2 Objectives with specific aims and possible outcome 01
1.2.1 Objectives with specific aims 01
1.2.2 Possible outcomes: 01
1.3 Organization of the Project Report 02

CHAPTER-II: SYSTEM STUDY & REQUIREMENT ANALYSIS

2.1 Feasibility Study 03


2.2 Planning 04
2.3 Scope 04
2.4 Methodology 05
2.5 Requirement Gathered for the System 05
2.5.1 Hardware Requirement 05
2.5.2 Communication Interfaces 05
2.5.3 Architecture of web Application: 06
2.6 Implementation Tools and Technologies 06
2.7 Chapter Summery 06

v
CHAPTER-III: SYSTEM DESIGN

3.1 Scope and Features of the Proposed System 07


3.2 Major Section of the System Activities 07
3.3 System Architecture 09
3.4 Data Flow Diagram (DFD) 11
3.5 Front end and Back End Design 11
3.5.1 What is System Design? 11
3.5.2 Basic Design of Software 11
3.5.3 Front End and Back End Design of the Proposed System 12
3.6 Database 12
3.6.1 Types of Database Application 12
3.6.2 Procedures of Database 12
3.7 Information Modeling 12
3.7.1 Concept of Information Modeling 13
3.7.2 Procedures for Information Modeling 14
3.8 Data Modeling 14
3.8.1 Types of data Modeling 14
3.8.2 Entity–relationship model 15
3.9 Database Development 15
3.19.1 Description of the Database Development 15
3.10 Software Tools 19
3.10.1 Programming Language and Software Platform 19
3.10.2 Software Interface 19
3.11 Test Case 21
3.12 Chapter Summery 22

vi
CHAPTER-IV: IMPLEMENTATION AND FINDINGS

4.1 Implementation 23
Approaches to project implementation:
4.2 23
4.3 Reports and Findings 24
4.4 Description of the developed software 24
4.4.1 HR CPanel 24
4.4.2 System Admin Control Panel 25
4.4.3 Employee Login Page 25
4.4.4 HR Dashboard 26
4.4.5 Employee Enrolment Form 26
4.4.6 Leave Settings 27
4.4.7 Leave Apply 27
4.5 Chapter Summary 28

CHAPTER-V: CONCLUSION
CHAPTER-IV: IMPLEMENTATION AND FINDINGS

5.1
4.1 Project Summary
Implementation 29
39
4.2 5.1.1
Input Strengths
and Outputof the Project 40
29
4.3 Reports
5.1.2 and Findings
Limitations 40
29
4.4 Description of the developed software 41
5.1.3 Challenges 29
4.5 Chapter Summery 44
5.2 Conclusion 30
5.3 Recommendation 30
5.4 Future Works 31

References 32

Appendix 33

vii
LIST OF FIGURES

Figure No Figure Caption Page No

Fig-3.1 System Architecture 10


Fig-3.2 One-to-One Relation 13
Fig -3.3 One-to-Many Relation 13
Fig -3.4 Many-to-One Relation 13
Fig-3.5 Many-to-Many Relation 13
Fig-4.1 HR CPanel of EMS system 24

Fig-4.2 System Admin Control Panel of EMS system 25

Fig-4.3 Employee login page for leave module 25

Fig-4.4 Dashboard of Web Based Employee Management System 26

Fig 4.5 Employee Enrollment Form 26

Fig 4.6 Leave Settings Option 27

Fig 4.7 Leave Apply Page 27

viii
ABBREVIATION & KEY TERMS

URL Uniform Resource Locator


HTTP Hypertext Transfer Protocol
WWW World Wide Web
HTML Hyper Text Markup Language
PHP Hypertext Preprocessor
CSS Cascading Style Sheets
UIR User Interface Re-engineering
DR Database Re-engineering
DAI Database Administrative Interface
DBMS Database Management System
DFD Data Flow Diagram
ERD Entity Relationship Diagram
DD Database Diagram
PC Personal Computer
TCP/IP Transmission Control Protocol/ Internet Protocol

ix
Acknowledgement

At first I would like to convey my gratitude to Almighty Allah for giving me the opportunity
to accomplish this project. I would like to thank my supervisor Dr. Md. Rubaiyat Hossain
Mondal, Associate Professor, Institute of Information and Communication Technology (IICT),
Bangladesh University of Engineering and Technology (BUET), Dhaka, Bangladesh. He has
assigned me an interesting and useful area, which has an extensive range of relevance in real
world. He has provided all sorts of support regarding the project work. Without his proper
guidance, advice, continual encouragement and active involvement in this process of this work,
it would have not been feasible.

I am indebted to all the teachers, officers and staffs of Information and Communication
Technology (IICT) for giving me their kind support and information during the study. I am
also grateful to my parents whose continuous support all over my life has brought me this far
in my career.

Finally, I tender special thanks to the Almighty that I have been successful in my effort to
complete the study.

x
Abstract

In developing or underdeveloped countries, many offices use 1 copy paper documents for
office management including employee management. This means a lot of file work, wastage
of money, space ect. This creates inefficiency in work too. For example, in order to for leave,
an employee has to collect the hard copy application form then fill it up and submit to the
human resources (HR) or administrative department. After being checked and approved, the
data of the application is usually entered into the attendance sheet and also into the job file of
the respective applicant. This process can be time consuming according to the HR policy of
any organization.

The attendance process also very time consuming as because manual entry has to done for
every employee for the daily attendance. There is also a chance of entering fake entry and data
manipulation which may cause misunderstanding and financial loose for the organization.

With the concept of digitalization, the papers and other documents can be made digital and the
flow of information can be done via online. This will make the management of employees
easier. The employees will aslo get benefit in their task such as leave application, attending
training, applying for no objection certificate (NOC) for passports, receiving task notification
through emails and SMS etc. Although there are many offices management software in many
countries, a number of offices still need such system. This project focuses on the development
of web based employee management system.

xi
xii
CHAPTER-I
Introduction

1.1 Introduction
In developing or underdeveloped countries, many offices use 1 copy paper documents for
office management including employee management [1-3]. This means a lot of file work,
wastage of money, space ect. This creates inefficiency in work too [4-6]. For example, in order
to for leave, an employee has to collect the hard copy application form then fill it up and submit
to the human resources (HR) or administrative department. After being checked and approved,
the data of the application is usually entered into the attendance sheet and also into the job file
of the respective applicant. This process can be time consuming according to the HR policy of
any organization.

The attendance process also very time consuming as because manual entry has to done for
every employee for the daily attendance. There is also a chance of entering fake entry and data
manipulation which may cause misunderstanding and financial loose for the organization.

With the concept of digitalization, the papers and other documents can be made digital and the
flow of information can be done via online. This will make the management of employees
easier. The employees will aslo get benefit in their task such as leave application, attending
training, applying for no objection certificate (NOC) for passports, receiving task notification
through emails and SMS etc. Although there are many offices management software in many
countries, a number of offices still need such system. This project focuses on the development
of web based employee management system.

1.2 Objectives with specific aims and possible outcome

1.2.1 Objectives with specific aims


The main objective of this project is to develop a web based software for employee
management of offices. The specific aims of the work are as follows:
 To develop an online system for new employee addition, employee promotion,
employee transfer, employee leave, employee daily attendance etc.
 To develop email and SMS notification system for employees.
 To develop different types of printable reports for all the employees and
management.

1.2.2 Possible outcomes:


After successful completion of the project, an employee management system will be
developed.
1
1.3 Organization of the Project Report
The report is organized as below order:

Chapter 1 describes the objectives of the project. Chapter 2 describes about the system study
and requirement analysis. The system design and development is presented in Chapter 3. In
Chapter 4, a description is provided for the implementation of the system. Chapter 5 describes
project strength, limitations and challenges of the project, conclusion and recommendations for
future works of the system.

2
CHAPTER-II
System Study and Requirement Analysis

This project was developed following a number of stages including feasibility study, planning,
requirement analysis, process flow and implementation. These stages are described in the
following.

2.1 Feasibility Study


A feasibility study is an analysis that takes all of a project's relevant matters into account—
including economic, technical, legal, and scheduling to complete the project successfully.
Project management team use feasibility studies to understand the project before they invest a
lot of time and money into it.

The goals of feasibility studies are as follows:

 To understand thoroughly all aspects of a project, concept, or plan.


 To become aware of any potential problems that could occur while implementing the
project.
 To determine if, after considering all significant factors, the project is viable—that is,
worth undertaking.

An employee management system is a useful tool for business owners, HR professionals, and
managers alike because it organizes and streamlines team management. These systems can
range from onboarding and payroll to performance and time off tracking, but should have the
essential HR features covered. The key is to find a system that not only works well for your
team, but one that also saves you time, headaches, and money.

A web-based employee management system helps you be more efficient with your time, and
reduces the time your team spends on repetitive, administrative tasks.

Having an employee management system in place means you can access all the essential
information about your team, projects, and clients from a single dashboard.

This centralized insight is what every good employee management system should offer. Plus,
you should also look for a system that provides:

 Optimized workload and streamlined admin tasks


 Data security
 Increased employee engagement

3
2.2 Planning

A Software Project is the procedure of software development from requirement analysis to


testing and maintenance, carried out according to the methodologies, in a specified period of
time to achieve intended desire outcomes.

In this project, appropriate and well-defined planning was done.

The system has five fundamentals to it:


 A Database of Employees;

 System Manager for organization’s structure set-up;

 Online Leave system;

 Protect Fraudulent activity;

 Reduce Cost and Time.

2.3 Scope

It’s that part of the project planning which determines and documents what are the project
goals, deliverables, tasks, costs and deadlines. This way you can begin to define the boundaries
of your project and figure out what responsibilities you will task your team with, and the action
plan by which that work will be delivered and approved.

The scopes of this project are as follows:

1. Information, Requirement and Company Setup.

2. Registration /Company User

3. Online leave Module

4. Email notification

5. Online Reports

6. Overall control and permission by Admin

4
2.4 Methodology

The methodology is where you describe how you will meet your project's objectives. In
methodology you demonstrate your project's feasibility by detailing your knowledge and
resources that will be drawn upon to complete the project. The following steps are followed to
develop the web based employee management system for any business organization.
1. First of all, requirement analysis has been done according the HR and Admin process
of any business organization. The 'software requirements specifications (SRS)' has
been prepared.
2. The data flow diagram (DFD) and entity relationship diagram (ERD) has been prepared.
After completing the database design, user interfaces/forms were designed for different
tasks such as online registration form, application status view for the employees.Next,
the web based software was developed using Hypertext Preprocessor (PHP) as the
dynamic scripting language. In the front end of the software, HyperText Markup
Language (HTML), jQuery and Cascading Style Sheets (CSS) were used. MySQL was
used as the database. In addition, fpdf library was used for generating printable reports.
3. After the development of the software, thorough testing was done with practical use
case scenarios.

2.5 Requirement Gathered for the System

2.5.1 Hardware Requirement


Hosting Server: It is required to have a mid-range server with Windows or Linux Operating
System.
Workstation: A personal computer (PC) which is able to use internet browsing.
2.5.2 Communication Interfaces
The default communication protocol for data transmission between server and the client is
Transmission Control Protocol/ Internet Protocol (TCP/IP). At the upper level hypertext
transfer protocol (HTTP) was used for communication between the web server and client.
Memory Constrain: There is no specific memory constraint for this software.

5
2.5.3 Architecture of web Application:
The following architecture was followed for the proposed project.
(1) The Client Side- A client, i.e. the computer, laptop, mobile etc. which requests the
resources, through the internet with a user interface (typically a web browser) for presentation
purposes.
(2) The Admin Side- Admin is also a client, i.e. the computer, laptop, mobile etc. which
requests the resources, through the internet with a user interface (typically a web browser) for
creating, updating and deleting information.
(3) The Web Server- Almost all of the works of web application take place on the server. A
specific application, called a web server, is responsible for authentication, authorization and
secure communication channel with the browser. A relational-database server stores whatever
information the application requires.
(4) The Application Server/Middleware- The application server is also called middleware,
whose assignment it is to provide the requested resources, but by calling on another server.
PHP belongs to a class of languages known as middleware.
These languages work closely with the Web server to interpret the requests made from the
World Wide Web (WWW), process these requests, interact with other programs on the server
to fulfill the requests, and then pass the web server exactly what to serve to the client’s browser.

2.6 Implementation Tools and Technologies


The fundamental requirement of the project is a web application built in Apache2, MySQL and
PHP. The web based software will be developed using Hypertext Preprocessor (PHP) as the
dynamic scripting language. In the front end of the software, HyperText Markup Language
(HTML), jQuery and Cascading Style Sheets (CSS) will be used. MySQL will be used as the
database. In addition, Crystal Reports will be used for generating printable reports.

2.7 Chapter Summery


This chapter describes the feasibility study, planning, scope, methodology of the project. This
chapter has also focused on the platform of software and the implementation tools.

6
CHAPTER-III
System Design and Development

3.1 Scope and Features of the Proposed System


The proposed system named Web Based Employee Management System is completely a web
based automated system for managing employees in any organization. The overall software
was developed using the popular RAD (Rapid Action Development) Process Model where
software requirement analysis, design, implementation, verification and maintenance are done
sequentially. It is possible to get printable reports for the employees and management. It has
the following noteworthy features:
(a) System Manager for set department, designation, job level, job location, shift, bank
etc ;
(b) Employee Addition;
(c) Employee Promotion;
(d) Employee Transfer;
(e) Employee Resignation;
(f) Employee Daily Attendance;
(g) Employee Leave Management System;
(h) Get Different kinds of printable reports.;
(i) Control and Supervision by Administration;

3.2 Major Section of the System Activities


There are basically four major sections of system activities regarding system user. The details
are illustrated below:
HR Admin User - Add Employees, Transfer Employees, Promote Employees,
Resign Employees,
- Add and Upload Daily Attendance.
- Upload Leave Calendar
- Enter and Upload Leave Settings for Employees.
- Get Different kinds of Admin and HR Reports.
- Get Notification and feedback
Employee/User - Apply Leave
-Approve Leave

7
- Confirm Leave
- Search Leave Balance
- Search Leave History
- Change Password.
- Get Notification and feedback
- Get Different kinds of reports
System Admin User - Enter Department,
- Enter Designation,
- Enter Job Level,
- Enter Job Location,
- Enter Shift,
- Enter Bank;
- Register employees in Leave System.
- Assign ID and Password for Leave System
- Leave Settings
- Control, monitoring and supervision

8
3.3 System Architecture
The overall system architecture is shown below:

1
Add Employee

Get Add Employee Form


3 2
Transfer
MYSQL DATABASE

Get Transfer Form

ADMIN/ HR USER INTERFACE


5 4
Resignation

Get Resignation
6
7
Promotion

Get Promotion
WEB BASED EMPLOYEE MANAGEMENT SYSTEM

9 8
Add Attendance

Get Add Attendance Form


11 10
0 Upload Attendance

Get Upload Attendance


12
13 View Reports

14 Leave Apply
APACHE WEB SERVER

Get Leave Application Form


15
16
Leave Approval

Get Leave Approval Form


EMPLOYEE INTERFACE

17
18 Form
Leave Confirmation

Get Leave Confirmation Form


19
20 Form
Change Password

Get Change Password Form


21
View Employee Leave History
22
View Employee Leave Balance
23

View Reports
24

9
25
MYSQL DATABASE
Add Department

Get Add Department Form

WEB BASED EMPLOYEE MANAGEMENT SYSTEM


26
27
Add Designation

Get Add Designation Form


28
29 Add Location

Get Add Location Form


30
31 Add Degree

Get Add Degree Form


32
33
SYSTEM ADMIN

Add Bank

Get Add Bank Form


34
35
Add Job Level
APACHE WEB SERVER

Get Add Job Level Form


36
37
Add Shift

Get Add Shift Form


38
39
Data Upload

40 Get Data Upload Form


41
User Enrollment
Form

Get User Enrollment Form


42
43 User Leave Settings

Get User Leave Settings


44

Fig 3.1: System Architecture

10
3.4 Data Flow Diagram (DFD)
A DFD describes the movement of data between external entities and the processes and data
stores within the system. The elements required for the system and their changes are
represented by DFD.

 DFD is a way of expressing system requirements in a graphical form.


 The DFD clarifies system requirements and identifies major transformations that will
become programs in system design.
It is the starting point in system design that decomposes the requirements specifications down
to the lowest level detail. In the following, the DFDs of the overall system are demonstrated.
[19] [20] [21

3.5 Front end and Back End Design


3.5.1 What is System Design?
Systems design is the process of defining the architecture, modules, interfaces, and data for a
system to satisfy specified requirements. Systems design could be seen as the application of
systems theory to product development. There is some overlap with the disciplines of systems

analysis, systems architecture and systems engineering.

3.5.2 Basic Design of Software


The Automation Application administrator can manipulate data with the help of this software.
It assists administrator to keep record of the information with more comfortably, safely and
securely. There are two interfaces of the Stake Holder Relationship Management System which
are described below:
Administrator Interface: The software is connected with company server database, thus no
more connection with other systems is needed. No system interface is needed during the
development of this project.
User Interface: The software must be designed as a web based that has a main user interface.
Format of main screen must be standard and flexible. The system must be user friendly. Pages
must be connected to each other in a consistent way. Operations to be done with the system
being repeatable.

11
3.5.3 Front End and Back End Design of the Proposed System
The web based software will be developed using PHP as the dynamic scripting language. In
the front end of the software, HTML, jQuery and CSS will be used. MySQL will be used as
the database in the back end. In addition, fpdf library will be used for generating printable
reports.

3.6 Database
Database systems are designed to manage large bodies of information. Defining structures for
storage of information and proving mechanisms for the manipulation of information are
included in management of data. In addition, the safety of the information stored must ensure
by the database system, despite system crashes attempts to unauthorized access. The system
must avoid possible anomalies result, if data are to be shared among several users.
A database management system (DBMS) is a collection of interrelated data and a set of
programs to access those data. The collection of data usually refers to the database, containing
information relevant to an enterprise. The primary goal of a database is to provide a way to
store and retrieve database information that is both convenient and efficient. [8]

3.6.1 Types of Database Application


There are two types of application:
1. Desktop Based
- Standalone, - Network Support
2. Web Based
3.6.2 Procedures of Database
There are lot of procedures for database Design. Some of the database procedures are shown
below:
Create Database Tables Coding
Normalization Debugging and Testing
Relationship Database level Modification
Implement with Oracle/MySQL Finalization
Implementation

3.7 Information Modeling


An information model in software engineering is a representation of concepts and the
relationships, constraints, rules, and operations to specify data semantics for a chosen domain
of discourse. Typically it specifies relations between kinds of things, but may also include

12
relations with individual things. It can provide sharable, stable, and organized structure of
information requirements or knowledge for the domain context.
3.7.1 Concept of Information Modeling
The first step of information modeling is to precisely choose that part of reality, which is of
interest. This is known as Entity. Entity defines another parameter. Entities are atomic that they
are invisible. The parameters of entity are known as attributes. Attributes are known as
quantum of information, which describes the entity entirely.
The second step in information modeling is relationship among entities. It is the most important
in making sense of the entity and inter-entity relationship. The relationship is the information,
which links two entities. The relationship can be of four categories:
One-to-One (1:1) –One instance of the first entity can correspond to only one instance
of the second entity. It is known as binary relationship.

1:1

Fig-3.2: One-to-One Relation

One-to-Many(1:M) – One instance of the first entity can correspond to more than
one of the second entity.

1:m

Fig-3.3: One-to-Many Relation

Many-to-One (M:1) – More than one instance of the first entity can corresponds
to the same one instance of the second entity

m:1

Fig-3.4: Many-to-One Relation

Many-to-Many (M:M) – More than one instance of the first entity can
correspond to more than one instance of the second entity.

m:m

13
Fig-3.5: Many-to-Many Relation

3.7.2 Procedures for Information Modeling


The steps for Information Modeling and rules of data normalization are described below:
 The universe of discourse or the part of real world should be selected properly with
minimum redundancy but completely in terms of entities.
 Entities are to be classified according to their attributes contents and merged, which has
One-to-One (1:1) Relationship into composite entities.
 Their relationship among entities should be defined and named.
 Normalization should be done to reduce redundancy and increase integrity. [8]

3.8 Data Modeling

Data modeling is the process of creating a data model for the data to be stored in a Database.
This data model is a conceptual representation of

 Data objects
 The associations between different data objects
 The rules.

Data modeling helps in the visual representation of data and enforces business rules, regulatory
compliances, and government policies on the data. Data Models ensure consistency in naming
conventions, default values, semantics, and security while ensuring quality of the data.

Data model emphasizes on what data is needed and how it should be organized instead of what
operations need to be performed on the data. Data Model is like architect's building plan which
helps to build a conceptual model and set the relationship between data items.

3.8.1 Types of data Modeling


The data modeling consists of three interrelated pieces of information, the data object, the
attributes that describes the data object and the relationship that connects data objects to one
another. A data object is a representation of almost any composite information that must be
understood by software. Composite information means something that has a number of
different properties or attributes.
Six different types of data models are given below:
 Entity-Relationship Model (E-R Model)
 Relational Model

14
 Object-Oriented Data Model
 Object-Relational Data Model
 Hierarchical Data Model
 Network Data Model

3.8.2 Entity–relationship model


An entity–relationship model is a systematic way of describing and defining a business process.
In this business process, the components (entities) are connected with each other by
relationships that express the dependencies and requirements between them, such as: a building
may be divided into zero or more apartments, but an apartment can only be located in one
building. Entities may have several properties (attributes) which characterizes them. To
represent these entities, attributes, and relationships graphically are called entity–relationship
diagrams.

3.9 Database Development


Relational database management system was used to manage the database. The database was
developed in MySQL. The total data have been normalized and then tables are obtained.

3.9.1 Description of the Database Development


Name of the database: EMS
Number of Tables: 17

Brief description of the tables is given below:

bank Table: This table contains two columns (bankid, bankname)


Sl Field Type
1 bankid int(10)
2 bankname varchar(100)

dailyattendanceTable: This table contains five columns (attndsysid, employeeid, date, intime,
outtime)

Sl Field Type
1 attndsysid int(100)
2 employeeid int(100)
3 date varchar(100)
4 intime varchar(100)
5 outtime varchar(100)

15
degree Table: This table contains two columns (degreeid, degreename)
Sl Field Type
1 degreeid int(10)
2 degreename varchar(10)

department Table: This table contains three columns (departmentsysid, departmentcode,


departmentname)

Sl Field Type
1 departmentsysid int(10)
2 departmentcode varchar(10)
3 departmentname varchar(100)

designation Table: This table contains three columns (designationsysid, designation,


designationcode)

Sl Field Type
1 designationsysid int(10)
2 designation varchar(10)
3 designationcode varchar(100)

employeebasicinfoandaddress Table: This table contains sixteen columns (empsysid, nidno,


firstname,lastname,gender,fathername,mothername,relegion,permanentaddress,presentaddress, email
phoneno, emmergencycontact, maritalstatus, bloodgroup, bank).

Sl Field Type Sl Field Type


1 empsysid int(100) 9 permanentaddress varchar(100)
2 nidno bigint(255) 10 presentaddress varchar(100)
3 firstname varchar(100) 11 email varchar(100)
4 lastname varchar(100) 12 phoneno varchar(100)
5 gender varchar(100) 13 emmergencycontact varchar(100)
6 fathername varchar(100) 14 maritalstatus varchar(100)
7 mothername varchar(100) 15 bloodgroup varchar(100)
8 relegion varchar(100) 16 bank varchar(100)

16
employeeeducationalinfo Table: This table contains nine columns (empsysid, employeeid,
department, shift, joblevel, companydesignation, joblocation, reportingpersoneel, status)

Sl Field Type Sl Field Type


1 empsysid int(100) 6 companydesignation varchar(100)
2 employeeid int(100) 7 joblocation varchar(100)
3 department varchar(100) 8 reportingpersoneel varchar(100)
4 shift varchar(100) 9 status varchar(100)
5 joblevel varchar(100)

employeeeducationandjobexperiances Table: This table contains eight columns (empsysid,


lastedudegree, obtainingyear, institutiuon, lastcompany, servingperiod, designation, lastjoblocation)

Sl Field Type Sl Field Type


1 empsysid int(100) 6 servingperiod varchar(100)
2 lastedudegree varchar(100) 7 designation varchar(100)
3 obtainingyear varchar(100) 8 lastjoblocation varchar(100)
4 institutiuon varchar(100)
5 lastcompany varchar(100)

emsadmin Table: This table contains eight columns (adminusername, adminpassword,


adminname, employeecode, admintype, admindepartment)

Sl Field Type Sl Field Type


1 adminusername varchar(4) 6 employeecode varchar(10)
2 adminpassword varchar(10) 7 admintype varchar(10)
3 adminname varchar(20) 8 admindepartment varchar(10)

factoryleavecalender Table: This table contains three columns (holidayname,


holidaydescription, days)

Sl Field Type
1 holidayname varchar(30)
2 holidaydescription varchar(30)
3 days varchar(10)

headofficeleavecalender Table: This table contains three columns (holidayname,


holidaydescription, days)

Sl Field Type
1 holidayname varchar(30)
2 holidaydescription varchar(30)
3 days varchar(10)

17
joblevel Table: This table contains two columns (joblevelsysid, joblevelname)

Sl Field Type
1 joblevelsysid int(100)
2 joblevelname varchar(100)

joblocation Table: This table contains three columns (joblocationsysid, joblocationcode,


joblocationname)

Sl Field Type
1 joblocationsysid int(100)
2 joblocationcode varchar(100)
3 joblocationname varchar(100)

leaveapplyinfo Table: This table contains eleven columns (leaveid, leavetype, applicationdate,
fromdate, todate, numberofdays, userid, reportingid, hrid, username, status)

Sl Field Type Sl Field Type


1 leaveid int(11) 6 numberofdays float
2 leavetype varchar(20) 7 userid int(11)
3 applicationdate date 8 reportingid int(11)
4 fromdate date 9 hrid int(11)
5 todate date 10 username varchar(40)
11 status varchar(10)

shift Table: This table contains three columns (joblocationsysid, joblocationcode,


joblocationname)

Sl Field Type
1 joblocationsysid int(100)
2 joblocationcode varchar(100)
3 joblocationname varchar(100)

18
userbasicinfo Table: This table contains twelve columns (userid, password, employecode,
username, department, gender, joblocation, reportingid, hrid, email, reportingemail, priviledge)

Sl Field Type Sl Field Type


1 userid int(11) 7 joblocation float
2 password varchar(20) 8 reportingid int(11)
3 employecode date 9 hrid int(11)
4 username date 10 email int(11)
5 department date 11 reportingemail varchar(40)
6 gender 12 priviledge varchar(10)

userleaveinfo Table: This table contains thirteen columns (userid,


totalleave,
totalpriviledgeleave, totalsickleave, totalmaternityleave, usedleave, usedpriviledgeleave,
usedsickleave, usedmaternityleave, availableleave, availableleave, availablepriviledgeleave,
availablesickleave, availablematernityleave)

Sl Field Type Sl Field Type


1 userid varchar(4) 7 usedpriviledgeleave float
2 totalleave int(2) 8 usedsickleave float
3 totalpriviledgeleave int(2) 9 usedmaternityleave float
4 totalsickleave int(2) 10 availableleave float
5 totalmaternityleave int(3) 11 availablepriviledgeleave float
6 usedleave float 12 availablesickleave float
float 13 availablematernityleave float

3.10 Software Tools

3.10.1 Programming Language and Software Platform


Programming language is very much important because it helps to Design interface and runs
the application smoothly. In addition, a programming language affords a organized mechanism
for defining fragments of data, and the operations or alterations on that data automatically when
required. The following software interfaces were used in the proposed system.

3.10.2 Software Interfaces:


Name & Source Purpose Definition of the Interface
Version
Browser: Mozilla, The web browser Firefox is one of the world's most popular
Firefox, Chrome Google and specified here is browsers. It includes a variety of features
and Microsoft Microsoft required in order to that are designed to give you a fast and
Internet Corporation execute the user secure browsing experience. The Microsoft
Internet Explorer provides easier, faster,

19
Explorer(IE) any side of the safer, flexible and reliable browsing
version software. experience with enhanced web privacy
features for all users. A freeware web
browser developed by Google is Google
Chrome. It used the WebKit layout engine
until version 27 and, with the exception of
its iOS releases, from version 28 and beyond
uses the WebKit fork Blink.
Web Server: Created by The web server WampServer is a Windows web
Wamp Server- Romain specified here is development environment. It allows us to
2.4.23 Bourdon required as the create web applications with Apache2, PHP
provider of the and a MySQL database. Alongside,
client software at PhpMyAdmin allows us to manage easily
the server site. our databases. A software stack denotes by
WampServer for the Microsoft Windows
operating system, created by Romain
Bourdon and consisting of the Apache web
server, OpenSSL for SSL support, MySQL
database and PHP programming language.
Web PHP Group. PHP is used for PHP is a mostly-used general-purpose
Development: server-side web scripting language that has improved object-
PHP-5.6.25 development PHP oriented capabilities especially suited for
generally runs on a web development and can be embedded into
web server which HTML
work with MySQL
database and
Apache server.
Name & Source Purpose Definition of the Interface
Version
Database: MySQL. Required as MySQL is the world's most popular and
MySQL-5.7.14 relational database powerful open source relational database
server. software, with over 100 million copies of its
software downloaded or distributed
throughout its history. With flexibility,
superior speed, reliability, and ease of use,
MySQL has become the preferred choice of
corporate IT managers because it eliminates

20
the major problems associated with
downtime, maintenance, administration and
support.
User Interface Macromedia The web Macromedia Dreamweaver is professional
Design: Inc. development tool HTML editor tool, enabling users to
Macromedia specified here is efficiently design, coding, develop and
Dreamweaver required for maintain standards websites and
8.0 designing and applications.
coding of the
software.

3.12 Test Case

A test case for the testing of proposed software project is represented below:
Project Name: Web Based Employee Management System
Sample Test Case
Test Case ID: 0856 Test Designed By: Mr. X.
Test Priority: Medium Test Design Date: 10.09.2019
Module Name: System Login Screen Test Executed By: Mr. Y
Test Title: Verify Login with valid User_ID and Test Execution Date: 10.09.2019
Password
Description: Test the System Admin Login Page

Pre-conditions: User has valid User_ID and Password


Dependencies: N/A

Step Test Step Test Data Excepted Actual Status Notes


Result Result (Pass/Fail)
1 Navigate to Login User_ID: User User is Pass
Page 0856 should be navigated
able to to
login
2 Provide valid User Password: dashboard
Name 0856 with
successful
3 Provide Valid login
Password
4 Click on Login
Button
Post-Conditions: User is validated with database and successfully login to account. The account
session details are logged in database.

21
3.12 Chapter Summery
This chapter described the whole process of the system. The design, development and testing
of the system is explained in details. Step by step analysis and designing technique of this
system is described. This chapter has also focused on the software testing process and the
relationship between the table.

22
CHAPTER-IV
Implementation and Findings

4.1 Implementation
Project implementation consists of carrying out the activities with the aim of delivering the
outputs and monitoring progress compared to the work plan. Monitoring can be defined as
control of the project implementation in order to keep the project on track and achieve the
end results of the project.

The implementation phase is where you and your project team actually do the project work to
produce the deliverables. The word “deliverable” means anything your project delivers. The
deliverables for your project include all of the products or services that you and your team are
performing for the client, customer, or sponsor, including all the project management
documents that you put together.

4.2 Approaches to project implementation:

There are a variety of options that a project manager could consider when implementing a
solution. These implementation choices available to a project manager are:

 Parallel implementation
 Phased implementation
 Crash implementation

Parallel implementation

A parallel implementation or approach implies that a new solution is implemented parallel to


the current operating system in use. Those who are using the system will not see major
downtime once it is implemented.

Phased implementation

Sometimes trying to implement a solution all at once is not feasible because many clients have
essential operations that run during normal working hours and cannot afford the luxury of
having their entire operation close down for a lengthy period in time. This is why many clients
approve of a phased implementation approach, and the project team must ensure that the phased
implementation is possible. This approach involves implementing the solution to a certain
amount of users and then rolling them onto the new solution, while the rest of the users are
rolled out in a similar fashion until the entire solution is rolled out within the client
environment.

23
Crash implementation

Careful planning needs to take place when considering a crash (also known as full-blown)
implementation. It takes an incredible amount of planning and re-planning to ensure no
problems arise.

4.3 Reports and findings


 List of Employees (Department wise)
 Daily Attendance Reports
 Employee Job Card
 Employee Personal Leave Reports
 Employee Reporting Leave Reports
 Employee HR Leave Reports
 Employee Leave History
 Employee Leave Balance

4.4 Description of the developed software


In the following, the developed software is briefly described:

4.4.1 HR CPanel

Executive of HR and admin has to login into the system form this page. This page will
redirect the user to the Dashboard where the admin can perform his or her different
administrative operations.

Fig 4.1: HR CPanel of EMS system


24
4.4.2 System Admin Control Panel

Admin of this software can login into this system by this page. A system admin is the admin
of this software who can audit the software and can update the software.

Fig 4.2: System Admin Control Panel of EMS system

4.4.3 Employee Login Page

General employees of the organization can login into the system to take their leave and other
information form the system by this login panel.

Fig 4.3: Employee login page for leave module

25
4.4.4 HR Dashboard

HR and Admin executive of the system will be redirected to this page after successful login.
From this page admin can perform his or her different types of administrative oprations.

Fig 4.4: Dashboard of Web Based Employee Management System

4.4.5 Employee Enrolment Form

HR and admin executive can add employees from this page.

Fig 4.5 Employee Enrollment Form

26
4.4.6 Leave Settings

Admin of the system will use this page to set different types of option for the leave module.

Fig 4.6 Leave Settings Option

4.4.7 Leave Apply

Employees can apply their leave from this page. They can also view their leave reports.

Fig 4.7 Leave Apply Page

27
4.5 Chapter Summary
This chapter has explained implementation of the project at the very beginning. Then it has
described probable input and output of the proposed system. Finally, most possible reports and
findings from the system have been elaborated.

28
CHAPTER-V
Conclusion and Recommendation

5.1 Project Summary


The overall project summary in brief is described as follows:
5.1.1 Strengths of the Project
The proposed automated system provides a number of benefits over the existing manual
systems. Some of these are given below:

 Online Employee Management system for any business organization.


 SMS and Email reply, notification and feedback
 Electronic Reports
 Status view and possible required reports
 User friendly and location independent system
 It is easy to take decision and make new future plans
 This system reduces the paper work and the physical labor
 It is easy to store and retrieve any information when necessary
 In summary, the system will reduce the functional complexity.

5.1.2 Limitations
Each and every system around the world has some limitations. The proposed system has some
limitations too. Some of the limitations are as follows:

 Every organization has their own HR Policy and practice, so the designed system may
not cover all the requirements of any business organization.
5.1.3 Challenges
The major challenges to implement the proposed system are as follows:
 Integration with attendance machine
 Adaptability
 Security and Support
 Monitoring, Supervision, Control and Up gradation
 Awareness, Training, etc.

29
5.2 Conclusion

With the concept of digitalization, the papers and other documents can be made digital and the
flow of information can be done via online. This will make the management of employees
easier. The employees will aslo get benefit in their task such as leave application, attending
training, applying for no objection certificate (NOC) for passports, receiving task notification
through emails and SMS etc. Although there are many offices management software in many
countries, a number of offices still need such system. This project focuses on the development
of web based employee management system.

The web based software has been developed using Hypertext Preprocessor (PHP) as the
dynamic scripting language. In the front end of the software, HyperText Markup Language
(HTML), jQuery and Cascading Style Sheets (CSS) have been used. MySQL has been used as
the database. In addition, fpdf library have been used for generating printable reports. This
system acts as an easy communication between food product manufacturers and food quality
certification authority. During the overall process, SMS and Email reply, notification and
feedback status create applicant gratification. The developed system is a user-friendly system
in many aspects

5.3 Recommendation
There are some important observations regarding the developed web based system for web
based employee management system The recommendations are stated below:
(i) Power and data backup for smooth performance.
(ii) Maintenance, supports and security issues
(iii) Java programming language can be used instead of PHP programming due to
its platform independency.
(iv) In this software, there is no way to reset password at the user end. So, Password
recovery can be added for better performance.
(v) This software is only tested for some medium scale scenarios. If anyone wants
to implement it in a large-scale, Oracle can be used instead of MySQL for better
performance.

30
5.4 Future Work
Possible future work related to the developed system are outlined below:
 Mobile Apps Development
 Integration with other existing system.
 System up gradation based on user needs.
 Technological Development
 Implementation in broad scale to cover more HR and Admin practice in the
organization.

31
References

[1] Arthur. J.B., “Effects of human resources system or manufacturing performance and
turnover”, Academy of Management Journal, Vol. 37 no. 3, pp. 670-87, 1994.

[2] Basheer, M.K and Raghu, C.V, “Fingerprint Attendance System for Classroom needs”, in
proc. Indian Conference(INDICON), pp 433-438, 7-9 Dec.2012.

[3] Maciaszek, L., “Requirement Analysis and System Design, Addison Wesley”, 3rd edition,
2007.

[4] Walker. R., “Achieving The Paperless Office”, Efficient Technology Inc., 2009-08-07.

[5] Sellen, A, J., and Harper, R. H. R. “The myth of the paperless Office”. Cambridge,
Massachusettes: MIT Press, 2003.

[6] Kaliannan, M., Adjovu, S. N., “Effective Emploee Engagement and Organizational
Success: A Case Study”, Procedia-Social and Behavioral Sciences, Vol. 172, pp. 161-168,
2015.

[7] Khalifa, M,. and Verner, J.M., “Drivers for software development method usage,” in
IEEE Transactions on Engineering Management, Vol. 47, no 3, pp. 360-369, Aug,2000.

[8] https://www.mysql.com, last accessed on 23rd March,2019.

[9] www.php.net, last accessed on 23rd March 2019.

[10] https://www.investopedia.com/terms/f/feasibility-study.asp

[11] https://www.tutorialspoint.com/software_engineering/
software_project_management.htm

[12] https://www.projectmanager.com/blog/project-scope

[13] https://en.wikipedia.org/wiki/Information_model

[14] https://www.guru99.com/data-modelling-conceptual-logical.html

[15] https://pmtips.net/article/project-implementation-approaches

32
Appendix: Code Segment of the Developed Software

Dashboard

<?php
include ('emsmethod.php');
include ('emsconfig.php');
session_start();
if(!isset($_SESSION['adminusername']))

{
header('location:cpanel.php');
}
else{
$admininfo=$obj-
>GetAdminInfoByAdminUserId("emsadmin",$_SESSION['adminusername']);
if($admininfo==!0)
{
foreach($admininfo as $adminsingleinfo)
{
extract($adminsingleinfo);
}
//echo $adminname;
//echo $employeecode;
}

?>
<!---------------------------START HTML----------------------------------->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!----------------------START EXTARNAL LINK------------------------------->
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-3.2.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-3.2.0/dist/css/bootstrap-
theme.min.css">
<link rel="stylesheet" href="jquery-1.11.3.js">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css
">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></sc
ript>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"><
/script>
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-
awesome.min.css" rel="stylesheet">

33
<!---------------------------END LINK------------------------------------->

<title>Online Employement Management System</title>


</head>

<body>
<!-------------------START HTML------------------------------------------->
<!---------------------START PAGE CONTAINER------------------------------->
<div class="container-fluid">
<!--------------------Top Navigation Bar--------------------------------->
<div class="navbar">
<div class="navbar-inner" style="height:15px;" >
<ul class="nav" >

<li style="position:relative;bottom:15px;">

<b><H2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;

ONLINE EMPLOYEE MANAGEMENT SYSTEM</H2></b></li>


</li>
</ul>

</div>
</div>
<!-----------END Top Navigation Bar-------------------------------------->

<!------------------USER INFO NAVIGATION BAR----------------------------->


<div class="navbar">

<div class="navbar-inner" style="position: relative; bottom:40px;">

<ul class="nav">
<a class="brand" href="#"><span class="glyphicon glyphicon-user"
style="color:blue;"></span></a>
<li class="active"><a href="#"><?php echo "Hi, Mr.".$adminname;
?></a></li>
<li><a href="#">Employee Code :<?php echo $employeecode; ?></a></li>
<a class="brand" href="dashboard.php"><span class="glyphicon
glyphicon-home" style="color:green;"></span></a>
<li><a href="#"><span class="glyphicon glyphicon-off"
style="color:red;"></a></li>

<ul>
</div>
</div>
<!-----------------------END OF USER INFO-------------------------------->
<!----------------------- START MAIN BODY-------------------------------->

<div class="row-fluid">

<!---------------START NAVIGATION---------------------------------------->
<div class="span4">
<div class="col-xs-10" style="background-color: gray; height:540px;
position:relative; bottom:60px;">

34
<div class="panel-group" id="accordion" style="position:relative;
top:30px;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse1"><B>SYSTEM MANAGER</B></a>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse in">
<ul>
<a href="adddepartment.php" style="text-decoration:none;
color:black;"><li>Department</li></a>
<a href="adddesignation.php" style="text-decoration:none;
color:black;"><li>Designation</li></a>
<a href="addjoblocation.php" style="text-decoration:none;
color:black;"><li>Location</li></a>
<a href="adddegree.php" style="text-decoration:none;
color:black;"><li>Degree</li></a>
<a href="addbank.php" style="text-decoration:none;
color:black;"><li>Bank</li></a>
<a href="addshift.php" style="text-decoration:none;
color:black;"><li>Shift</li></a>
<a href="addjoblevel.php" style="text-decoration:none;
color:black;"><li>Job Level</li></a>

</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse2"><B>EMPLOYEE MANAGEMENT</B></a>
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<ul>
<a href="addemployeeinfo.php" style="text-decoration:none;
color:black;"><li>Add Employe</li></a>
<a href="transfer.php" style="text-decoration:none;
color:black;"><li>Transfer</li></a>
<a href="resignation.php" style="text-decoration:none;
color:black;"><li>Resignation</li></a>
<a href="promotion.php" style="text-decoration:none;
color:black;"><li>Promotion</li></a>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse3"><B>ATTENDANCE MANAGEMENT</B></a>
</h4>
</div>
<div id="collapse3" class="panel-collapse collapse">
<ul>
<a href="dailyattendance.php" style="text-decoration:none;
color:black;"><li>Add Attendance</li></a>

35
<a href="uploadattendance.php" style="text-decoration:none;
color:black;"><li>Upload Attendance</li></a>
</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse4"><B>LEAVE MANAGEMENT</B></a>
</h4>
</div>
<div id="collapse4" class="panel-collapse collapse">
<ul>
<a href="leaveadminpanel.php" style="text-decoration:none;
color:black;"><li>Leave Settings</li></a>
<a href="loginpage.php" style="text-decoration:none;
color:black;"><li>Leave Apply</li></a>

</ul>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion"
href="#collapse5"><B>REPORTS</B></a>
</h4>
</div>
<div id="collapse5" class="panel-collapse collapse">
<ul>
<a href="#" style="text-decoration:none; color:black;"><li>Employe
List</li></a>
<a href="#" style="text-decoration:none; color:black;"><li>Daily
Attendace Report</li></a>
<a href="#" style="text-decoration:none;
color:black;"><li>Leave Report</li></a>
<ul>
</div>
</div>
</div>
</div>

</div>
<!----------------------END NAVIGATION---------------------------------->

<!-----------------------START BODY------------------------------------->
<div class="span5">
<div class="col-xs-14" style="background-image:url('peopleicon.jpg');
background-repeat: no-repeat; height:540px; position: relative; bottom:
60px;">

</div>
</div>
<!--------------------END BODY------------------------------------------>

<div class="span3" style="position:relative; bottom:60px;">


<!------------------------------START CALENDER-------------------------->

36
<iframe
src="https://calendar.google.com/calendar/embed?src=76qninj8g47ui49of3vp3b7
8gs%40group.calendar.google.com&ctz=Asia%2FDhaka" style="border: 0"
width="300" height="300" frameborder="0" scrolling="no" ></iframe>
<!-----------------END CALENDER---------------------------------------->

<!---------------------START MASSAGE---------------------------------->

<!---------------------------END MESSAGE------------------------------->
</div>
</div>

</div>
<!------------------------------END PAGE CONTAINER------------------------>

</body>
</html>
<!-------------------------END HTML--------------------------------------->

Class
<?php
class operation{
public $emsconn;
/*Below function (__construct) is being used for the connection*/
/*=======================================================================*/
public function __construct($host,$user,$pass,$db){
$this->emsconn=mysqli_connect($host,$user,$pass,$db);

if(mysqli_connect_errno()){
die('Connection Failed!!!');
}
else{
//echo"Connection established to EMS by
emsmethod.php";
}
37
}
/*=======================================================================*/
/*++++++++++++++++++END OF CONNECTION++++++++++++++++++++++++++++++++*/

/********* Below Function used to get Admin info by *******************/


/*=======================================================================*/
public function
GetAdminInfoByAdminUserId($table,$adminusername)

{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table WHERE adminusername=$adminusername");

$num=mysqli_num_rows($query);
if($num>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);

}
else{
echo "No
data in database it ems method";
}
}

/*=======================================================================*/
/*++++++++++++++ End of Getting Admin info++++++++++++++++++++++++++++++*/

/********* Below Function used to insert department **********************/


/*=======================================================================*/
public function
InsertDepartment($table,$departmentcode,$departmentname)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

departmentcode='$departmentcode',

departmentname='$departmentname'

"

) ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return
true;
}
else{
return
false;
}

/*=======================================================================*/
/*++++++++End of insertion department++++++++++++++++++++++++++++++++++*/

38
/********* Below Function used to insert designation *********************/
/*=======================================================================*/
public function
InsertDesignation($table,$designation,$designationcode)
{

$query=mysqli_query($this->emsconn,"INSERT INTO designation SET

designation='$designation',

designationcode='$designationcode'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return
true;
}
else{
return
false;
}
}

/*======================================================================*/
/*+++++++++++++End of insertion department+++++++++++++++++++++++++++++*/

/******** Below Function used to insert joblocation *********************/


/*=======================================================================*/
public function
InsertJoblocation($table,$joblocationcode,$joblocationname)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

joblocationcode='$joblocationcode',

joblocationname='$joblocationname'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{return false;}
}
/*=======================================================================*/
/*++++++++++End of insertion department++++++++++++++++++++++++++++++++++*/

/******** Below Function used to insert employebasicinfo *****************/


/*=======================================================================*/
public function InsertEmployeeBasicAndAddressInfo($table,
$nidno,

39
$firstname,

$lastname,

$gender,

$fathername,

$mothername,

$relegion,

$permanentaddress,

$presentaddress,

$email,

$phoneno,

$emmergencycontact,

$maritalstatus,

$bloodgroup,

$bank

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

nidno='$nidno',

firstname='$firstname',

lastname='$lastname',

gender='$gender',

fathername='$fathername',

mothername='$mothername',

relegion='$relegion',

permanentaddress='$permanentaddress',

presentaddress='$presentaddress',

email='$email',

phoneno='$phoneno',

40
emmergencycontact='$emmergencycontact',

maritalstatus='$maritalstatus',

bloodgroup='$bloodgroup',

bank='$bank';

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
return false;

}
/*=======================================================================*/
/*+++++++++++++++++++End of insertion department++++++++++++++++++++++++*/

/******* Below Function used to fetch employebasicinfo *******************/


/*=======================================================================*/
public function FetchEmployeeInfo($table,$employecode)
{

$query=mysqli_query($this->emsconn,"SELECT* FROM $table WHERE


employecode=$employecode");

$num=mysqli_num_rows($query) ;

if($num>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);

}
else{
echo "No data
in DB";

}
/*=======================================================================*/
/*+++++++++++++++++++End of insertion department+++++++++++++++++++++++++*/

/********* Below Function used to insert degree **************************/


/*=======================================================================*/
public function InsertDegree($table,$degreename)

41
{

$query=mysqli_query($this->emsconn,"INSERT INTO degree SET

degreename='$degreename'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return
true;
}
else{
return
false;
}
}

/*=======================================================================*/
/*+++++++++End of insertion degree+++++++++++++++++++++++++++++++++++*/

/********* Below Function used to insert bank **************************/


/*=======================================================================*/
public function InsertBank($table,$bankname)
{

$query=mysqli_query($this->emsconn,"INSERT INTO bank SET

bankname='$bankname'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return
true;
}
else{
return
false;
}
}

/*=======================================================================*/
/*+++++++++++End of insertion degree+++++++++++++++++++++++++++++++++++++*/

/*** Below Function used to insert employee education and job experiances
********/
/*=======================================================================*/
public function
InsertEmployeeEducationAndJobExperiances($table,
$lastedudegree,

$obtainingyear,

$institution,

42
$lastcompany,

$servingperiod,

$designation,

$lastjoblocation

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

lastedudegree='$lastedudegree',

obtainingyear='$obtainingyear',

institutiuon='$institution',

lastcompany='$lastcompany',

servingperiod='$servingperiod',

designation='$designation',

lastjoblocation='$lastjoblocation';

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
running abcd---";

}
/*=======================================================================*/
/*+++++++End of insertion employee education and job experiances+++++++++*/

/****** Below Function used to insert employee company info *************/


/*=======================================================================*/
public function InsertEmployeeCompanyInfo($table,
$employeeid,

$department,

$companydesignation,

43
$joblocation,

$reportingpersonnel,

$shift,

$status,

$joblevel

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

employeeid='$employeeid',

department='$department',

companydesignation
='$companydesignation',

joblocation='$joblocation',

reportingpersoneel
='$reportingpersonnel',

shift ='$shift',

status='$status',

joblevel='$joblevel';

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*+++++++++++++++++++++End of insertion employee company info++++++++++++*/

/************** Below Function used to insert Shift info *****************/


/*=======================================================================*/

44
public function InsertShiftInfo($table,
$shiftname,

$intime,

$outtime

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

shiftname='$shiftname',

intime='$intime',

outtime='$outtime'

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*+++++++++++++++++++End of insertion shift info+++++++++++++++++++++++++*/

/*********** Below Function used to insert Job Level *********************/


/*======================================================================*/
public function InsertJobLevel($table,
$joblevelname

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

joblevelname='$joblevelname'

45
") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*+++++++++++++End of insertion shift info+++++++++++++++++++++++++++++++*/

/********** Below Function used to Update Employee Designation ***********/


/*=======================================================================*/

public function
UpdateEmployeeDesignation($table,$employeeid,$newjoblevel,$newdesignation)

$query=mysqli_query($this->emsconn,"UPDATE $table SET

companydesignation='$newdesignation',

joblevel='$newjoblevel'

WHERE employeeid='$employeeid'

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/

46
/*++++++++++End of insertion shift info++++++++++++++++++++++++++++++++++*/

/******** Below Function used to Update Employee Designation *************/


/*=======================================================================*/

public function
UpdateEmployeeLocation($table,$employeeid,$newlocation)

$query=mysqli_query($this->emsconn,"UPDATE $table SET

joblocation='$newlocation'

WHERE employeeid='$employeeid'

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*++++++++++End of insertion shift info++++++++++++++++++++++++++++++++++*/

/***** Below Function used to Update Employee Status ********************/


/*=======================================================================*/

public function
UpdateEmployeeStatus($table,$employeeid,$newstatus)

$query=mysqli_query($this->emsconn,"UPDATE $table SET

status='$newstatus'

WHERE employeeid='$employeeid'

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{

47
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*+++++++End of insertion shift info+++++++++++++++++++++++++++++++++++++*/

/****** Below Function used to insert Daily Attendance *******************/


/*=======================================================================*/
public function
InsertDailyAttendance($table,$employeeid,$date,$intime,$outtime)
{

$query=mysqli_query($this->emsconn,"INSERT INTO $table SET

employeeid='$employeeid',

date='$date',

intime='$intime',

outtime='$outtime'

") ;

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
echo "not
runnig-----";

}
/*=======================================================================*/
/*+++++++++++++End of insertion Daily Attendance ++++++++++++++++++++++++*/

/******** Below Function used to get user info by LOGIN ID***************/


/*=======================================================================*/
public function GetUserInfoByLoginId($table,$loginid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$loginid");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in userbasicinfo table";
}

48
}
/*=======================================================================*/
/*++++ End of GetUserInfoByLoginId FUNCTION++++++++++++++++++++++++++++++*/

/*******Below Function used to get leave info of individuals by LOGIN ID


*****************************/
/*=======================================================================*/

public function GetUserLeaveInfoByLoginId($table,$loginid){


$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$loginid");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in userleaveinfo table";
}
}
/*=======================================================================*/
/*+++++++ End of GetUserLeaveInfoByLoginId ++++++++++++++++++++++++++++++*/

/******Below Function used to change password ***************************/


/*=======================================================================*/

public function PasswordChanger($table,$password,$userid)


{
$query=mysqli_query($this-
>emsconn,"UPDATE userbasicinfo SET password=$password WHERE
userid=$userid");
if(mysqli_affected_rows($this-
>emsconn)>0)
{
return true;
}
else
{
return false;
}

}
/*=======================================================================*/
/*************** END OF PasswordChanger ********************************/

/**********Below Function used to Enroll user***************************/


/*=======================================================================*/
public function EnrollUser(
$table,
$userid,
$password,
$employecode,
$username,
$department,
$gender,
$joblocation,
$reportingid,
$hrid,
$email,

$reportingemail,

49
$priviledge
)
{
$query=mysqli_query($this-
>emsconn,"INSERT INTO $table SET

userid='$userid',

password='$password',

employecode='$employecode',

username='$username',

department='$department',

gender='$gender',

joblocation='$joblocation',

reportingid='$reportingid',

hrid='$hrid',

email='$email',

reportingemail='$reportingemail',

priviledge='$priviledge'

");
if(mysqli_affected_rows($this-
>emsconn)>0){

return true;

}
else{
return false;

}
/*======================================================================*/
/******End of EnrollUser
Function**************/

/********Below function used for Leave settings **************************/


/*=======================================================================*/
public function LeaveSettings(
$table,

$userid,

$totalleave,

$totalpriviledgeleave,

$totalsickleave,

$totalmaternityleave,

50
$usedleave,

$usedpriviledgeleave,

$usedsickleave,

$usedmaternityleave,

$availableleave,

$availablepriviledgeleave,

$availablesickleave,

$availablematernityleave
)
{
$query=mysqli_query($this-
>emsconn,"INSERT INTO $table SET

userid='$userid',

totalleave='$totalleave',

totalpriviledgeleave='$totalpriviledgeleave',

totalsickleave='$totalsickleave',

totalmaternityleave='$totalmaternityleave',

usedleave='$usedleave',

usedpriviledgeleave='$usedpriviledgeleave',

usedsickleave='$usedsickleave',

usedmaternityleave='$usedmaternityleave',

availableleave='$availableleave',

availablepriviledgeleave='$availablepriviledgeleave',

availablesickleave='$availablesickleave',

availablematernityleave='$availablematernityleave'

");

if(mysqli_affected_rows($this->emsconn)>0){

return true;

51
else{
return false;
}

}
public function HolidaySettings($table,$date,$description)
{
$query=mysqli_query($this->emsconn,"INSERT INTO $table
SET
date='$date',

description='$description'
");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}
}
/******BELOW FUNCTION USED FOR ACCES THE FACTORY HOLDAY TABLE************/
/*=======================================================================*/

public function GetHolidayByAppliedLeaveDay($table,$leaveday)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM factoryholidayinfo WHERE date='$leaveday'");
if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
return false;
}
}
/*****************END OF ACCESSING FACTORY HOLIDAY TABLE***********/

/*********BELOW FUNCTION USED FOR ACCES THE HEAD OFFICE HOLDAY TABLE******/
/*=======================================================================*/

public function GetHolidayByAppliedLeaveDayHO($table,$leaveday)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table WHERE date='$leaveday'");
if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
return false;
}
}
/*********************END OF ACCESSING FACTORY HOLIDAY TABLE******/
/***BELOW FUNCTION USED FOR INSERTION OF DATA INTO leaveapplyinfo
TABLE****/
/*=======================================================================*/

52
public function InsertLeaveIntoleaveapplyinfo($table,
$leavetype,

$applicationdate,

$fromdate,

$todate,

$numberofdays,

$userid,

$reportingid,

$hrid,

$username

)
{
$query=mysqli_query($this-
>emsconn,"INSERT INTO $table SET

leavetype='$leavetype',

applicationdate='$applicationdate',

fromdate='$fromdate',

todate='$todate',

numberofdays='$numberofdays',

userid='$userid',

reportingid='$reportingid',

hrid='$hrid',

username='$username',

status='Open'

");
if(mysqli_affected_rows($this-
>emsconn)>0)

return true;

}
else{
return false;
}

53
/*+++++++++++++++++++ End of Data insertion into leaveapplyinfo++++++++++*/

/******** Below Function used to get user's leave info by LOGIN ID********/
/*=======================================================================*/
public function GetAppliedLeaveInfoByLoginId($table,$loginid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$loginid AND status='Open'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in database";
}
}
/*=======================================================================*/
/*+++++++++++++++++++++++ End of GetUserInfoByLoginId FUNCTION+++++++++*/

/***** Below Function used to get user's leave info by LOGIN ID *********/
/*=======================================================================*/
public function GetAppliedFinalLeaveInfoByLoginId($table,$loginid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$loginid AND status='Applied'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in database";
}
}
/*=======================================================================*/
/*++++++++++++++++++++++++++ End of GetUserInfoByLoginId FUNCTION++++++++*/

/******** Below Function used to get user's leave info by LOGIN ID *******/
/*=======================================================================*/
public function GetAppliedLeaveInfoByReportingId($table,$reportingid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE reportingid=$reportingid AND status='Applied'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in database";
}
}
/*=======================================================================*/
/*++++++++++++++++++ End of GetUserInfoByLoginId FUNCTION++++++++++++++++*/

/**** Below Function used to get user's leave info by HR ID ************/


/*=======================================================================*/
public function GetAppliedLeaveInfoByHrId($table,$hrid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE hrid=$hrid AND status='Approved'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in database";

54
}
}
/*=======================================================================*/
/*++++++++ End of GetUserInfoByLoginId FUNCTION++++++++++++++++++++++++*/

/****** Below Function used to get Confiromed leave info by Leave ID ****/
/*=======================================================================*/
public function GetConfiromedLeaveInfoByLeaveId($table,$leaveid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE leaveid=$leaveid AND status='Confirom'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in database";
}
}
/*=======================================================================*/
/*+++++++++++++++ End of GetUserInfoByLoginId FUNCTION++++++++++++++++++*/

/******** BELOW FUNCTION USED TO DELETE LEAVE ***************************/


/*=======================================================================*/

public function Delete($table,$leaveid){


$query=mysqli_query($this->emsconn,"DELETE FROM $table
WHERE leaveid=$leaveid");
if(mysqli_affected_rows($this->emsconn)>0){
return true;
}
else{
return false;
}
}

/*=======================================================================*/
/*++++++++++++++++++++++++++ END OF FUNCTION TO DELETE LEAVE+++++++++++*/

/***** BELOW FUNCTION USED TO UPDATE LEAVE STATUS TO APPLIED ************/


/*=======================================================================*/
public function UpdateLeaveStatustoApplied($table,$leaveid){

$query=mysqli_query($this->emsconn,"UPDATE
leaveapplyinfo SET status='Applied' WHERE leaveid=$leaveid");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*++++++++++++++++++++ END OF FUNCTION TO UPDATE LEAVE STATUS+++++++++++*/

/***** BELOW FUNCTION USED TO UPDATE LEAVE STATUS TO APPROVED ***********/


/*=======================================================================*/
public function UpdateLeaveStatustoApprove($table,$leaveid){

55
$query=mysqli_query($this->emsconn,"UPDATE
leaveapplyinfo SET status='Approved' WHERE leaveid=$leaveid");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*++++++++++++++++++++ END OF FUNCTION TO UPDATE LEAVE STATUS+++++++++++*/

/*** BELOW FUNCTION USED TO UPDATE LEAVE STATUS TO REJECT***************/


/*=======================================================================*/
public function UpdateLeaveStatustoReject($table,$leaveid){

$query=mysqli_query($this->emsconn,"UPDATE
leaveapplyinfo SET status='Reject' WHERE leaveid=$leaveid");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*++++++++++++++++++++++++++ END OF FUNCTION TO UPDATE LEAVE STATUS+++++*/

/**** BELOW FUNCTION USED TO UPDATE LEAVE STATUS TO CONFIROM*************/


/*=======================================================================*/
public function UpdateLeaveStatustoConfirom($table,$leaveid){

$query=mysqli_query($this->emsconn,"UPDATE
leaveapplyinfo SET status='Confirom' WHERE leaveid=$leaveid");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*++++++++++++ END OF FUNCTION TO UPDATE LEAVE STATUS++++++++++++++++++*/

/*************Below Function used to get leave info of individuals by USER


ID ************/
/*=======================================================================*/

public function GetUserLeaveInfoByUserId($table,$userid){


$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$userid");
$num=mysqli_num_rows($query);

56
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in Database";
}
}
/*=======================================================================*/
/*++++++++++++++++++ End of GetUserLeaveInfoByLoginId +++++++++++++++++*/

/**** BELOW FUNCTION USED TO UPDATE LEAVE TRANSACTION FOR PL*************/


/*=======================================================================*/
public function UpdateLeaveTransactionForPL($table,
$userid,

$updatedusedpl,

$updatedavailablepl,

$updatedusedleave,

$updatedavailableleave)
{

$query=mysqli_query($this->emsconn,"UPDATE $table
SET

usedpriviledgeleave=$updatedusedpl,

availablepriviledgeleave=$updatedavailablepl,

usedleave=$updatedusedleave,

availableleave=$updatedavailableleave

WHERE userid=$userid
");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*+++++++ END OF FUNCTION TO UPDATE LEAVE TRANSACTION FOR PL+++++++++++++*/

/***** BELOW FUNCTION USED TO UPDATE LEAVE TRANSACTION FOR SL************/


/*=======================================================================*/
public function UpdateLeaveTransactionForSL($table,
$userid,

$updatedusedsl,

$updatedavailablesl,

57
$updatedusedleave,

$updatedavailableleave)
{

$query=mysqli_query($this->emsconn,"UPDATE $table
SET

usedsickleave=$updatedusedsl,

availablesickleave=$updatedavailablesl,

usedleave=$updatedusedleave,

availableleave=$updatedavailableleave

WHERE userid=$userid
");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*=======================================================================*/
/*+++++++++++++ END OF FUNCTION TO UPDATE LEAVE TRANSACTION FOR SL+++++++*/

/********* BELOW FUNCTION USED TO UPDATE LEAVE TRANSACTION FOR ML*******/


/*=======================================================================*/
public function UpdateLeaveTransactionForML($table,
$userid,

$updatedusedml,

$updatedavailableml,

$updatedusedleave,

$updatedavailableleave)
{

$query=mysqli_query($this->emsconn,"UPDATE $table
SET

usedmaternityleave=$updatedusedml,

availablematernityleave=$updatedavailableml,

usedleave=$updatedusedleave,

availableleave=$updatedavailableleave

58
WHERE userid=$userid
");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/*====================================================================*/
/*+++++++ END OF FUNCTION TO UPDATE LEAVE TRANSACTION FOR ML+++++++++++++*/

/********* Below Function used to Upload data into userbasicinfo TABLE


********/
/*=======================================================================*/
public function UploadTouserbasicinfo(
$table,
$userid,
$password,
$employecode,
$username,
$department,
$gender,
$joblocation,
$reportingid,
$hrid,
$email,

$reportingemail,
$priviledge
)
{
$query=mysqli_query($this-
>emsconn,"INSERT INTO $table SET

userid='$userid',

password='$password',

employecode='$employecode',

username='$username',

department='$department',

gender='$gender',

joblocation='$joblocation',

reportingid='$reportingid',

hrid='$hrid',

email='$email',

59
reportingemail='$reportingemail',

priviledge='$priviledge'

");
if(mysqli_affected_rows($this-
>emsconn)>0){

return true;

}
else{
return false;

}
/*=======================================================================*/
/*++++++++++ End of Uploading to userbasicinfo ++++++++++++++++++++++++++*/

/********* Below Function used to Upload data into userleaveinfo TABLE


******/
/*=======================================================================*/
public function UploadtoUserLeaveInfo($table,
$userid,

$totalleave,

$totalpriviledgeleave,

$totalsickleave,

$totalmaternityleave,

$usedleave,

$usedpriviledgeleave,

$usedsickleave,

$usedmaternityleave,

$availableleave,

$availablepriviledgeleave,

$availablesickleave,

$availablematernityleave

)
{

$query=mysqli_query($this->emsconn,"INSERT INTO userleaveinfo SET

userid='$userid',

totalleave='$totalleave',

60
totalpriviledgeleave='$totalpriviledgeleave',

totalsickleave='$totalsickleave',

totalmaternityleave='$totalmaternityleave',

usedleave='$usedleave',

usedpriviledgeleave='$usedpriviledgeleave',

usedsickleave='$usedsickleave',

usedmaternityleave='$usedmaternityleave',

availableleave='$availableleave',

availablepriviledgeleave='$availablepriviledgeleave',

availablesickleave='$availablesickleave',

availablematernityleave='$availablematernityleave'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;

}
else{
return false;
}

/*=======================================================================*/
/*++++++++++ End of Uploading to userleaveinfo ++++++++++++++++++++++++++*/

/****** Below Function used to Upload data into factoryholidayinfo


TABLE*******/
/*=======================================================================*/
public function UploadToFactoryHolidayInfo ($table,
$date,

$description

)
{
$query =
mysqli_query($this->emsconn,"INSERT INTO factoryholidayinfo SET

61
date='$date',

description='$description'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}

else{
return false;

/*=======================================================================*/
/*+++++++++++++++++++++++++ End of Uploading to userleaveinfo ++++++++++*/

/******* Below Function used to Upload data into headofficeholidayinfo


TABLE******/
/*=======================================================================*/
public function UploadToHeadOfficeHolidayInfo ($table,
$date,

$description

)
{
$query =
mysqli_query($this->emsconn,"INSERT INTO headofficeholidayinfo SET

date='$date',

description='$description'

");

if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}

else{
return false;

/*=======================================================================*/
/*++++++++++++++++++++++++++++++ End of Uploading to userleaveinfo ++++++*/

/****Below Function used to get leave info of individuals by userid for


AJAX**********************/

62
/*=======================================================================*/

public function GetUserLeaveInfoByUSERIDFORAJAX($table,$userid){


$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$userid");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in userleaveinfo table";
}
}
/*=====================================================================*/
/*+++++++++++++++++++++++ End of GetUserLeaveInfoByUSERID FOR AJAX ++++*/

/******Below Function used to get leave history info of individuals by


userid for AJAX***************/
/*========================================================================*
/

public function GetUserLeaveHistoryByUSERIDFORAJAX($table,$userid){


$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$userid AND
status='Confirom'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in userleaveinfo table";
}
}
/*=======================================================================*/
/*+++++++++++++++++++++++ End of GetUserLeaveHistoryByUSERID FOR AJAX +++*/

/***Below Function used to get user's leave info by LOGIN ID for personal
report ***/
/*=======================================================================*/
public function
GetAppliedLeaveInfoByLoginIdForPersonalReport($table,$loginid){
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE userid=$loginid AND status='Confirom'");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
//echo"No data in database";
}
}
/*=======================================================================*/
/*++++ End of GetUserInfoByLoginId FUNCTION++++++++++++++++++++++++++++++*/

/**Below Function used to get Aplliedleave info of by LEAVE ID for


Update******/
/*=======================================================================*/

public function
GetUserAppledLeaveInfoByLeaveIdForUpdate($table,$leaveid){

63
$query=mysqli_query($this->emsconn,"SELECT*FROM $table
WHERE leaveid=$leaveid");
$num=mysqli_num_rows($query);
if($num>0){
return mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo"No data in userleaveinfo table";
}
}
/*=======================================================================*/
/*+++++++++++++++++++++++ End of GetUserLeaveInfoByLeaveId ++++++++++++++*/

public function
UpdateLeave($table,$leavetype,$applicationdate,$fromdate,$todate,$numberofd
ays,$leaveid){
$query=mysqli_query($this->emsconn,"UPDATE $table SET

leavetype=$leavetype,

applicationdate=$applicationdate,

fromdate=$fromdate,

todate=$todate,

numberofdays=$numberofdays

WHERE leaveid=$leaveid

");
if(mysqli_affected_rows($this->emsconn)>0)
{
return true;
}
else{
return false;
}

/******BELOW FUNCTION USED TO GET FACTORY LEAVE CALENDER INFO************/


/*=======================================================================*/
public function GetFactoryLeaveCalender($table)
{
$query = mysqli_query($this-
>emsconn,"SELECT*FROM $table");
if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
echo "No data in $table
table";
}
}

64
/*=======================================================================*/
/*+++++++++++++END OF FACTORY LEAVE CALENDER+++++++++++++++++++++++++++++*/

/************BELOW FUNCTION USED TO GET DEPARTMENT************************/


/*=======================================================================*/
public function GetDepartment($table)
{
$query=mysqli_query($this-
>emsconn,"SELECT * FROM $table");

if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
echo "ok";
}
else{
echo "not fetching
department table";
}

}
/*====================================================================*/
/*+++++++++++++++++++++++++END OF FETCHING DEPARTMENT+++++++++++++++++++*/

/*******************BELOW FUNCTION USED TO GET JOB LEVEL******************/


/*=======================================================================*/

public function GetJobLevel($table)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");

if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);

}
else{
return false;
}

/*====================================================================*/
/*+++++++++++++++++++++++++END OF FETCHING JOB LEVEL++++++++++++*/

/*****************************BELOW FUNCTION USED TO GET DESIGNATION****/


/*=======================================================================*/

public function GetDesignation($table)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");

if(mysqli_num_rows($query)>0)

65
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
return false;
}
}

/**********************************END OF FETCHING DESIGNATION***********/


/*=======================================================================*/

/**********************************BELOW FUNCTION USED TO BANK***********/


/*=======================================================================*/

public function GetBank($table)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");

if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
return false;
}

/**********************************END OF FETCHING BANK*******************/


/*=======================================================================*/

/*******************BELOW FUNCTION USED TO DEGREE***********************/


/*=======================================================================*/

public function GetDegree($table)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");

if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else{
return false;
}
}

/**************END OF FETCHING DEGREE*************************************/


/*========================================================================*
/

/***********BELOW FUNCTION USED TO GET JOB LOCATION***********************/


/*========================================================================*
/

66
public function GetJobLocation($table)
{
$query=mysqli_query($this->emsconn,"SELECT*FROM $table");

if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);
}
else
{
return false;
}
}

/*******END OF FETCHING JOBLOCATION*********************************/


/*=====================================================================*/

/*********BELOW FUNCTION USED TO GET SHIFT**************************/


/*=======================================================================*/

public function GetShift($table)


{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");
if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);

}
else{

return false;
}

/****************************END OF FETCHING SHIFT***********************/


/*======================================================================*/

/******************BELOW FUNCTION USED TO GET EMPLOYEE INFO***********/


/*=================================================================*/
public function GetEmployeeInfo($table)
{
$query=mysqli_query($this-
>emsconn,"SELECT*FROM $table");
if(mysqli_num_rows($query)>0)
{
return
mysqli_fetch_all($query,MYSQLI_ASSOC);

}
else{

return false;
}

/****************END OF FETCHING EMPLOYEE INFO****************************/

67
/*=====================================================================*/
}
$obj=new operation("localhost","root","","EMS");
?>

68

You might also like