Payroll Management

Download as pdf or txt
Download as pdf or txt
You are on page 1of 103

CHAPTER 1

INTRODUCTION

1
Introduction

Payroll system is the heart of any Human Resource System of an organization. The
solution has to take care of the calculation of salary as per rules of the company,
income tax calculation and various deductions to be done from the salary
including statutory deductions like Income tax and provident fund deductions. It
has to generate pay-slip, cheque summary and MIS reports.

It is understood that we are tired of managing thousand of odd papers, pay slips,
payroll reports, and salary details and so on. Imagine that we have a payroll
processing system which will generate our pay slips and payroll reports within
seconds. We can help others automated your payroll system by developing a
customized payroll application that suits your specific requirements.

Purpose
Main aim of developing Employee Payroll Management is to provide an easy way
not only to automate all functionalities involved managing leaves and Payroll for
the employees of Company, but also to provide full functional reports to
management of Company with the details about usage of leave facility.

We are committed to bring the best way of management in the various forms of
EPM. We understand that EPM in not a product to be sold, it is a tool to manage
the inner operation of Company related to employee leave and Payroll.

2
Objectives And Scope Of The Project

This Application works in Multiple PC’s installed on multiple Computers but


sharing same database by which users of different department can use it sitting at
different locations simultaneously.

But in future we can make the Application where the database will be
hosted in order to manage the all departments which will be located in different
places and by keeping domain of Application as Online.

3
CHAPTER 2
SYSTEM ANALYSIS

4
Requirements analysis and specification

Requirements analysis is usually the first phase of large-scale software


development project. It is undertaken after a feasibility study has been performed
to define the precise costs and benefits of a software system. The purpose of this
phase is to identify and document the exact requirements for the system. The
customer, the developer, a marketing organization or any combination of the three
may perform such study.In cases where the requirements are not clear e.g., for a
system that is never been defined, more interaction is required between the user
and the developer. The requirements at this stage are in end-user terms.

Design and specification


Once the requirements for a system have been documented, software
engineers design a software system to meet them. This phase is sometime split
into two sub-phases: architectural or high-level design.High-level design deals
with overall module structure and organization, rather than the details of the
modules. The high level design is refined by designing each module in detail.
Separating the requirements and analysis phase from the design phase is
instance of fundamental “what/how” dichotomy that we Encounter quite often
in computer science. The general principle involves makings a clear distinction
between what the problem is and how to solve the problem. In this case, the
requirement phase attempts to specify what the problem is. There are usually
many ways that the requirements may be met, including some solutions that do

5
not involve the use of computers at all. The purpose of the design phase is to
specify a particular software system that will meet the stated requirements.
Again there are usually many ways to build the specified system. In the coding
phase, which follows the design phase, a particular System is coded to meet the
design specification.

Existing System and Disadvantages


Retail Outlet of Any Type Companies are common in Indian Context. It can be
seen everywhere in India either towns or rural areas. Till date working system
of most outlets are manual in nature.Employees maintain account and book
keeping on registers. It is cumbersome and time consuming and always there
is possibility of errors. Also employees can make wrong entries in register and
can take away money easily.Calculating profit or losses is a time consuming
process and for checking purpose all registers have to keep in safe custody.
Thus we can say that there is huge possibility for change.

 The disadvantages of current system are all those associated with


manual working systems.
 It is time consuming to produce bills or reports as compared to any
other computerized system.
 Humans are more probes to errors so always possibility of errors in
producing results.
 As all the work done is written on registers if any register is missed or
damaged it is simply very difficult to produce to present accurate
figures.

6
 Employees can make fraud by writing wrong entries on register and take
away the money and it is simply impossible to catch the defaulter
because there is no proof.

Proposed system and advantages

With the shortcomings in the existing system at every area of work a new system
has to be worked upon which may overcome all the inefficiencies that the present
system has.In today’s high-tech world all the above mentioned characteristics of
the system is outdated and a need for a new, powerful, stable and result oriented
software is required which is why a new system based on Visual Basic & Oracle is
formulated. Visual Basic is used to provide front-end application for userfriendly
ambience and Oracle is used to maintain & update database for fast and reliable
retrieval of data and processing of queries.

 User friendly and simple in nature


 Compatible on all windows based systems
 Upgradeable with slight modification in coding
 Easy application maintenance due to its robustness
 Menu driven navigation to facilitate simple and quick access to required
functionality.
 A central database for all the data related to ensure data consistency
 Easier and faster data entry with menu support

7
 Can quickly produce required reports related to Daily, Weakly, monthly,
Yearly etc

Modules
 Login Page

 The page where the admin users will log in their system credentials
to access the system.

 Home Page

 The page where the admin will be redirected by default after logging
into the payroll management system.

 Department List Page

 The page where the admin can admin/staff will manage the list of
their company’s departments.

 Position List Page

 The page where the admin/staff will manage the list of their
company’s positions per department.

 Allowance List Page

 The page where the admin/staff will manage the list of allowances.

 Deduction List Page

 The page where the admin/staff will manage the list of deductions.

 Employee List Page

8
 The page where the admin will manage the list of the employees.
This also the page where the admin will manage the employees’
allowances and deductions.

 Attendance List Page

 The page where the admin will encode and manage the employees’
daily time records.

 Payroll List Page

 The page where all payroll cut-offs are listed and can be managed.
This also the page where can admin calculate the payroll of
employees.

 Cut-off Payroll Page

 The page where the employees’ payroll is listed.

 Employee’s Payslip Modal

 The popup modal that displays the employee’s payslip.

9
H/W and S/W Specifications
HARDWARE REQUIREMENTS:

Intel P-IV based


Processor : system

Processor Speed : 2.0. GHz

RAM : 1GB

Hard Disk : 40GB to 80GB

2.5 SOFTWARE REQUIREMENTS:

Database : MySQL

Server : Apache

Frontend : HTML

Scripting language : Java Script

IDE : Sublime

Technology : PHP

10
CHAPTER 3
SYSTEM DEVELOPMENT
ENVIRONMENT

11
SYSTEM DEVELOPMENT ENVIRONMENT

1. HTML

WHAT IS HTML?

To publish information for global distribution, one needs a university-


understood language, a kind of publishing mother tongue that all computers may
potentially understand. The publishing language used by the World Wide Web is HTML
(Hyper Text Markup Language)

HTML Gives Authors The Means To

1. Publish online documents with headings, text, tables, list, photos etc.

2. Retrieve online information via hypertext links, at the click of a button

3. Design forms for conducting transactions with remote services, for


use in searching information, making reservation, ordering products
etc.;
4. Includes spreadsheets, video clips, sound clips, and other
applications directly in the documents.

Some HTML Tags

12
<HTML> :Starting an HTML tag

<HEAD> : Creating a web page’s head

<TITLE> : Giving a web page ‘s body

</HEAD> : Ending a web pages head

</BODY> : Ending a web pages body

</HTML> :Ending a web page

<FORM> : Creating a HTML forms

<INPUT TYPE=BUTTON> : Creating a buttons

<INPUT TYPE=CHECKBOX> : Creating a checkboxes

13
<INPUT TYPE=SUBMIT> : Creating a submit button

<INPUT TYPE=TEXT> : Creating a text fields

HTML 4.0

HTML 4.0 extends with mechanisms for style sheets, scripting,


frames embedding objects, improved support for right to left and mixed
direction texts, richer tables and enhancements to form, offering improved
accessibilities for people with disability

2. INTRODUCTION TO JAVA SCRIPT

WHAT IS JAVA SCRIPT?

JavaScript, originally supported by Netscape Navigator, is the most


popular Web scripting language today. JavaScript lets you embed programs
right in your Web pages and run these programs using the Web browser.
You place these programs in a
<SCRIPT> element. If you want the script to write directly to the Web page,
place it in the <BODY> element.

14
EX: <HTML>

<HEAD>

<TITLE></TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE=”JavaScript”>

</SCRIPT>

</BODY></HTML>

JAVASCRIPTS OBJECTS

JavaScript is an object-oriented language. JavaScript comes with a


number of predefined objects.

Objects of the JavaScript

1. Document: Corresponds to the current Web page’s body. Using this


object, you have access to the HTML of the page itself, including the

15
all links, images and anchors in it.
2. Form: Holds information about HTML forms in the current page.

3. Frame: Refers to a frame in the browser’s window.

4. History: Holds the records of sites the Web browser has visited
before reaching the current page.
5. Location: Holds information about the location of the current web page.

6. Navigator: Refers to the browser itself, letting you determine what


browser the user has.
7. Window: Refers to the current browser window.

JAVASCRIPTS EVENTS

Some of the events of JavaScript

1. on Change: Occurs when data in a control, like a text field, changes.

2. on Click: Occurs when an element is clicked.

3. on Focus: Occurs when an element gets the focus.

4. on Mouse Down: Occurs when a mouse button goes down.

5. on Reset: Occurs when the user clicks the reset button.

16
JAVASCRIPTS FUNCTIONS

Declaration of function

Syntax: function function name ()

Write these functions in <SCRIPT> tag.

3. INTRODUCTION ABOUT PHP

The term PHP is an acronym for PHP: Hypertext Preprocessor. PHP is a server-
side scripting language designed specifically for web development. It is open-
source which means it is free to download and use. It is very simple to learn and
use. The files have the extension “.php”.

17
Rasmus Lerdorf inspired the first version of PHP and participating in the later
versions. It is an interpreted language and it does not require a compiler.

PHP code is executed in the server.


It can be integrated with many databases such as Oracle, Microsoft SQL Server,
MySQL, PostgreSQL, Sybase, Informix.
It is powerful to hold a content management system like WordPress and can be
used to control user access.
It supports main protocols like HTTP Basic, HTTP Digest, IMAP, FTP, and others.
Websites like www.facebook.com, www.yahoo.com are also built on PHP.
One of the main reasons behind this is that PHP can be easily embedded in HTML
files and HTML codes can also be written in a PHP file.
The thing that differentiates PHP from the client-side language like HTML is, PHP
codes are executed on the server whereas HTML codes are directly rendered on
the browser. PHP codes are first executed on the server and then the result is
returned to the browser.
The only information that the client or browser knows is the result returned after
executing the PHP script on the server and not the actual PHP codes present in
the PHP file. Also, PHP files can support other client-side scripting languages like
CSS and JavaScript.
Other characteristics of PHP are as follows.
 Simple and fast
 Efficient
 Secured
 Flexible
 Cross-platform, it works with major operating systems like Windows,
Linux, MacOS.

18
4.RDBMS CONCEPTS

1. DATA ABSTRACTION

A major purpose of a database system is to provide users with an


abstract view of the data. This system hides certain details of how the
data is stored and maintained. However in order for the system to be
usable, data must be retrieved efficiently. The efficiency lead to the
design of complex data structure for the representation of data in the
database. Certain complexity must be hidden from the database system
users. This accomplished by defining several levels of abstraction at
which the database may be viewed.

2. CLASSIFICATION OF DATABASE

There are 3 types of database approaches given below,

a. Hierarchical Database:

In this type of model data is represented in simple tree


structured. The record at the top of three is known as root,
the root may have any number of dependents. Each of these
may have any number of low level dependents and so on up
to any number of levels. The disadvantages of the approach
are that no independent record occurrence can exist without
it’s superior.

b. Network Database:

19
In a Network database, data is represented by Network
structure. In this approach record occurrence can have any
number of superiors as well as any number of immediate
dependents thus allow many to many correspondence
directly than an hierarchical approach.

The main disadvantage of the Network model is data


representation is very complex resulting in complexity of the
DML (Data Manipulation Language).

c. Relational Database:

The Relational model represents data and relationships


among data by a collection of tables each of which has a
number of columns with unique names.

5.THE SQL LANGUAGE

SQL is a language for relational database. SQL is a non-procedural


i.e., when we use SQL we specify what we want to be done not how to do
it.

Features Of SQL

1. SQL is an interactive query language.

2. SQL is a database administration language.

20
3. SQL is a database programming language.

4. SQL is a client/server language.

5. SQL is a distributed database language.

6. SQL is a database gateway language.

21
Basic SQL Commands

Data Definition Language commands (DDL) Data Manipulation Language


commands (DML) Transaction Control Language commands (TCL) Data
control Language commands (DCL)

XAMPP

XAMPP is an open-source software developed by Apache Friends. XAMPP software package


contains Apache distributions for Apache server, MariaDB, PHP, and Perl. And it is basically a
local host or a local server. This local server works on your own desktop or laptop computer.
The use of XAMPP is to test the clients or your website before uploading it to the remote
web server. This XAMPP server software gives you a suitable environment for testing
MYSQL, PHP, Apache, and Perl projects on the local computer. The full form of XAMPP is X
stands for Cross-platform, (A) Apache server, (M) MariaDB, (P) PHP, and (P) Perl. The Cross-
platform usually means that it can run on any computer with any operating system.
APACHE:Apache server is open-source free software that is initially developed by a group of
software developers and now it is maintained by Apache software foundation. Apache HTTP
is a remote server(computer) if someone requests files, images, or documents using their
browser they will serve those files to clients using HTTP servers.

22
CHAPTER 4
SYSTEM DESIGN

23
PROJECT DESIGNING

Design Document

 The entire system is projected with a physical diagram


which specifics the actual storage parameters that are
physically necessary for any database to be stored on to the
disk. The overall systems existential idea is derived from this
diagram.

 The relation upon the system is structure through a


conceptual ER-Diagram, which not only specifics the
existential entities but also the standard relations through
which the system exists and the cardinalities that are
necessary for the system state to continue.

 The content level DFD is provided to have an idea of the


functional inputs and outputs that are achieved through the
system. The system depicts the input and out put standards
at the high level of the systems existence.

1. Data Flow Diagrams:

24
Data flows are data structures in motion, while data stores are data
structures. Data flows are paths or ‘pipe lines’, along which data structures
travel, where as the data stores are place where data structures are kept
until needed.

Data flows are data structures in motion, while data stores are data
structures at rest. Hence it is possible that the data flow and the data store
would be made up of the same data structure.

Data flow diagrams is a very handy tool for the system analyst because it
gives the analyst the overall picture of the system, it is a diagrammatic
approach.

A DFD is a pictorial representation of the path which data takes From its
initial interaction with the existing system until it completes any
interaction. The diagram will describe the logical data flows dealing the
movements of any physical items. The DFD also gives the insight into the
data that is used in the system i.e., who actually uses it is temporarily
stored.

A DFD does not show a sequence of steps. A DFD only shows what the
different process in a system is and what data flows between them.

The following are some DFD symbols used in the project

25
External entities

Process: A transaction of information that resides


within the bounds of the system to be module.

RULES FOR DFD:

 Fix the scope of the system by means of context


diagrams.

 Organize the DFD so that the main sequence of the


actions reads left to right and top to bottom.

 Identify all inputs and outputs.

 Identify and label each process internal to the


system with rounded circles.

 A process is required for all the data


transformation and transfers. Therefore, never
connect a data store to a data source or the

26
destinations or another data store with just a data
flow arrow.

 Do not indicate hardware and ignore control


information.

 Make sure the names of the


processes accurately convey everything
the process is done.

 There must not be unnamed process.

 Indicate external sources and destinations of the


data, with squares.

 Number each occurrence of repeated external


entities.

 Identify all data flows for each process step,


except simple Record retrievals.

 Label data flow on each arrow.

 Use details flow on each arrow.

 Use the details flow arrow to indicate data


movements.

 There can’t be unnamed data flow.

 A data flow can’t connect two external entities.

27
LEVELS OF DFD:

The complexity of the business system means that it is a responsible to


represent the operations of any system of single data flow diagram. At the
top level, an Overview of the different systems in an organization is shown
by the way of context analysis diagram. When exploded into DFD

They are represented by:

 LEVEL-0 : SYSTEM INPUT/OUTPUT

 LEVEL-1:SUBSYSTEM LEVEL DATAFLOW


FUNCTIONAL

 LEVEL-2 : FILE LEVEL DETAIL DATA FLOW.

The input and output data shown should be consistent from one level to the
next.

LEVEL-0: SYSTEM INPUT/OUTPUT LEVEL

A level-0 DFD describes the system-wide boundaries, dealing inputs to and


outputs from the system and major processes. This diagram is similar to
the combined user-level context diagram.

28
LEVEL-1: SUBSYSTEM LEVEL DATA FLOW

A level-1 DFD describes the next level of details within the system, detailing
the data flows between subsystems, which makeup the whole.

LEVEL-2: FILE LEVEL DETAIL DATA FLOW

All the projects are feasible given unlimited resources and infinite time. It is
both necessary and prudent to evaluate the feasibility of the project at the
earliest possible time. Feasibility and the risk analysis are pertained in
many ways. If project risk is great.

29
DB Design

30
31
SCREENSHOTS

32
33
34
35
36
37
38
SOURCE CODE

INDEX.PHP

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>Admin | Employee's Payroll Management System</title>

<?php

session_start();

if(!isset($_SESSION['login_id']))

header('location:login.php');

include('./header.php');

// include('./auth.php');

39
?>

</head>

<style>

body{

background: #80808045;

.modal-dialog.large {

width: 80% !important;

max-width: unset;

.modal-dialog.mid-large {

width: 50% !important;

max-width: unset;

div#confirm_modal {

z-index: 9991;

</style>

<body>

40
<?php include 'topbar.php' ?>

<?php include 'navbar.php' ?>

<div class="toast" id="alert_toast" role="alert" aria-live="assertive" aria-


atomic="true">

<div class="toast-body text-white">

</div>

</div>

<main id="view-panel" >

<?php $page = isset($_GET['page']) ? $_GET['page'] :'home'; ?>

<?php include $page.'.php' ?>

</main>

<div id="preloader"></div>

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

<div class="modal fade" id="confirm_modal" role='dialog'>

<div class="modal-dialog modal-md" role="document">

<div class="modal-content">

<div class="modal-header">

41
<h5 class="modal-title">Confirmation</h5>

</div>

<div class="modal-body">

<div id="delete_content"></div>

</div>

<div class="modal-footer">

<button type="button" class="btn btn-


primary" id='confirm' onclick="">Continue</button>

<button type="button" class="btn btn-secondary" data-


dismiss="modal">Close</button>

</div>

</div>

</div>

</div>

<div class="modal fade" id="uni_modal" role='dialog'>

<div class="modal-dialog modal-md" role="document">

<div class="modal-content">

<div class="modal-header">

<h5 class="modal-title"></h5>

</div>

<div class="modal-body">

42
</div>

<div class="modal-footer">

<button type="button" class="btn btn-


primary" id='submit' onclick="$('#uni_modal form').submit()">Save</butt
on>

<button type="button" class="btn btn-secondary" data-


dismiss="modal">Cancel</button>

</div>

</div>

</div>

</div>

</body>

<script>

window.start_load = function(){

$('body').prepend('<di id="preloader2"></di>')

window.end_load = function(){

$('#preloader2').fadeOut('fast', function() {

$(this).remove();

})

43
window.uni_modal = function($title = '' , $url='',$size=""){

start_load()

$.ajax({

url:$url,

error:err=>{

console.log()

alert("An error occured")

},

success:function(resp){

if(resp){

$('#uni_modal .modal-title').html($title)

$('#uni_modal .modal-body').html(resp)

if($size != ''){

$('#uni_modal .modal-dialog').addClass($size)

}else{

$('#uni_modal .modal-
dialog').removeAttr("class").addClass("modal-dialog modal-md")

$('#uni_modal').modal({

show:true,

backdrop:'static',

44
keyboard:false,

focus:true

})

end_load()

})

window._conf = function($msg='',$func='',$params = []){

$('#confirm_modal #confirm').attr('onclick',$func+"("+$params.join(',')+
")")

$('#confirm_modal .modal-body').html($msg)

$('#confirm_modal').modal({

show:true,

backdrop:'static',

keyboard:false,

focus:true

})

window.alert_toast= function($msg = 'TEST',$bg = 'success'){

$('#alert_toast').removeClass('bg-success')

45
$('#alert_toast').removeClass('bg-danger')

$('#alert_toast').removeClass('bg-info')

$('#alert_toast').removeClass('bg-warning')

if($bg == 'success')

$('#alert_toast').addClass('bg-success')

if($bg == 'danger')

$('#alert_toast').addClass('bg-danger')

if($bg == 'info')

$('#alert_toast').addClass('bg-info')

if($bg == 'warning')

$('#alert_toast').addClass('bg-warning')

$('#alert_toast .toast-body').html($msg)

$('#alert_toast').toast({delay:3000}).toast('show');

$(document).ready(function(){

$('#preloader').fadeOut('fast', function() {

$(this).remove();

})

})

$('.datetimepicker').datetimepicker({

46
format:'Y/m/d H:i',

startDate: '+3d'

})

$('.select2').select2({

placeholder:"Please select here",

width: "100%"

})

</script>

</html>

EMPLOYEE.PHP

<?php include('db_connect.php') ?>


<div class="container-fluid " >
<div class="col-lg-12">

<br />
<br />
<div class="card">
<div class="card-header">
<span><b>Employee List</b></span>
<button class="btn btn-primary btn-sm btn-block col-md-3 float-
right" type="button" id="new_emp_btn"><span class="fa fa-
plus"></span> Add Employee</button>
</div>

47
<div class="card-body">
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<th>Employee No</th>
<th>Firstname</th>
<th>Middlename</th>
<th>Lastname</th>
<th>Department</th>
<th>Position</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$d_arr[0] = "Unset";
$p_arr[0] = "Unset";
$dept = $conn-
>query("SELECT * from department order by name asc");
while($row=$dept->fetch_assoc()):
$d_arr[$row['id']] = $row['name'];
endwhile;
$pos = $conn-
>query("SELECT * from position order by name asc");
while($row=$pos->fetch_assoc()):
$p_arr[$row['id']] = $row['name'];

48
endwhile;
$employee_qry=$conn-
>query("SELECT * FROM employee") or die(mysqli_error());
while($row=$employee_qry->fetch_array()){
?>
<tr>
<td><?php echo $row['employee_no']?></td>
<td><?php echo $row['firstname']?></td>
<td><?php echo $row['middlename']?></td>
<td><?php echo $row['lastname']?></td>
<td><?php echo $d_arr[$row['department_id']]?></td>
<td><?php echo $p_arr[$row['position_id']]?></td>
<td>
<center>
<button class="btn btn-sm btn-outline-
primary view_employee" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
eye"></i></button>
<button class="btn btn-sm btn-outline-
primary edit_employee" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
edit"></i></button>
<button class="btn btn-sm btn-outline-
danger remove_employee" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
trash"></i></button>
</center>
</td>
</tr>

49
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
$('#table').DataTable();
});
</script>
<script type="text/javascript">
$(document).ready(function(){

$('.edit_employee').click(function(){
var $id=$(this).attr('data-id');
uni_modal("Edit Employee","manage_employee.php?id="+$id)

50
});
$('.view_employee').click(function(){
var $id=$(this).attr('data-id');
uni_modal("Employee Details","view_employee.php?id="+$id,"mid-
large")

});
$('#new_emp_btn').click(function(){
uni_modal("New Employee","manage_employee.php")
})
$('.remove_employee').click(function(){
_conf("Are you sure to delete this employee?","remove_employee",[$
(this).attr('data-id')])
})
});
function remove_employee(id){
start_load()
$.ajax({
url:'ajax.php?action=delete_employee',
method:"POST",
data:{id:id},
error:err=>console.log(err),
success:function(resp){
if(resp == 1){
alert_toast("Employee's data successfully deleted","success");

51
setTimeout(function(){
location.reload();

},1000)
}
}
})
}
</script>

ALLOWANCES.PHP

<?php include('db_connect.php');?>

<div class="container-fluid">

<div class="col-lg-12">
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-allowances">
<div class="card">
<div class="card-header">
Allowances Form
</div>
<div class="card-body">
<input type="hidden" name="id">

52
<div class="form-group">
<label class="control-label">Allowance</label>
<textarea name="allowance" id="" cols="30" rows="2" class=
"form-control" required></textarea>
</div>
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="" cols="30" rows="2" class
="form-control" required></textarea>
</div>

</div>

<div class="card-footer">
<div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-
3"> Save</button>
<button class="btn btn-sm btn-default col-sm-
3" type="button" onclick="_reset()"> Cancel</button>
</div>
</div>
</div>
</div>
</form>

53
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Allowance Information</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$allowances = $conn-
>query("SELECT * FROM allowances order by id asc");
while($row=$allowances->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>

<td class="">

54
<p>Name: <b><?php echo $row['allowance'] ?></b></p
>
<p class="truncate"><small>Description: <b><?php echo
$row['description'] ?></b></small></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-
primary edit_allowances" type="button" data-
id="<?php echo $row['id'] ?>" data-
allowance="<?php echo $row['allowance'] ?>" data-
description="<?php echo $row['description'] ?>" >Edit</button>
<button class="btn btn-sm btn-
danger delete_allowances" type="button" data-
id="<?php echo $row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

55
td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
function _reset(){
$('[name="id"]').val('');
$('#manage-allowances').get(0).reset();
}

$('#manage-allowances').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_allowances',
data: new FormData($(this)[0]),
cache: false,
contentType: false,

56
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
})
$('.edit_allowances').click(function(){
start_load()
var cat = $('#manage-allowances')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))

57
cat.find("[name='allowance']").val($(this).attr('data-allowance'))
cat.find("[name='description']").val($(this).attr('data-description'))
end_load()
})
$('.delete_allowances').click(function(){
_conf("Are you sure to delete this allowances?","delete_allowances",[$(thi
s).attr('data-id')])
})
function displayImg(input,_this) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#cimg').attr('src', e.target.result);
}

reader.readAsDataURL(input.files[0]);
}
}
function delete_allowances($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_allowances',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){

58
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
}
</script>

ATTENDANCE.PHP
<?php include('db_connect.php') ?>
<div class="container-fluid " >
<div class="col-lg-12">

<br />
<br />
<div class="card">
<div class="card-header">
<span><b>Attendance List</b></span>
<button class="btn btn-primary btn-sm btn-block col-md-3 float-
right" type="button" id="new_attendance_btn"><span class="fa fa-
plus"></span> Add Attendance</button>
</div>
<div class="card-body">

59
<table id="table" class="table table-bordered table-striped">
<colgroup>
<col width="10%">
<col width="20%">
<col width="30%">
<col width="30%">
<col width="10%">
</colgroup>
<thead>
<tr>
<th>Date</th>
<th>Employee No</th>
<th>Name</th>
<th>Time Record</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$att=$conn-
>query("SELECT a.*,e.employee_no, concat(e.lastname,', ',e.firstname,' ',e.mid
dlename) as ename FROM attendance a inner join employee e on a.employee_
id = e.id order by UNIX_TIMESTAMP(datetime_log) asc ") or die(mysqli_error()
);
$lt_arr = array(1 => " Time-in AM",2=>"Time-
out AM",3 => " Time-in PM",4=>"Time-out PM");
while($row=$att->fetch_array()){

60
$date = date("Y-m-d",strtotime($row['datetime_log']));
$attendance[$row['employee_id']."_".$date]['details'] =
array("eid"=>$row['employee_id'],"name"=>$row['ename'],"eno"=>$row['em
ployee_no'],"date"=>$date);
if($row['log_type'] == 1 || $row['log_type'] == 3){
if(!isset($attendance[$row['employee_id']."_".$date]['
log'][$row['log_type']]))
$attendance[$row['employee_id']."_".$date]['log'][$r
ow['log_type']] = array('id'=>$row['id'],"date" => $row['datetime_log']);
}else{
$attendance[$row['employee_id']."_".$date]['log'][$r
ow['log_type']] =array('id'=>$row['id'],"date" => $row['datetime_log']);
}
}
foreach ($attendance as $key => $value) {
?>
<tr>
<td><?php echo date("M d,Y",strtotime($attendance[$key
]['details']['date'])) ?></td>
<td><?php echo $attendance[$key]['details']['eno'] ?></td
>
<td><?php echo $attendance[$key]['details']['name'] ?></t
d>
<td>
<div class="row">

<?php
$att_ids = array();

61
foreach($attendance[$key]['log'] as $k => $v) :
?>
<div class="col-sm-6" style="">
<p>
<small><b><?php echo $lt_arr[$k].": <br/>" ?>

<?php echo (date("h:i A",strtotime($attendance[$key]


['log'][$k]['date']))) ?> </b>
<span class="badge badge-danger rem_att" data-
id="<?php echo $attendance[$key]['log'][$k]['id'] ?>"><i class="fa fa-
trash"></i></span>
</small>
</p>
</div>
<?php endforeach; ?>
</div>

</td>
<td>
<center>
<button class="btn btn-sm btn-outline-
danger remove_attendance" data-
id="<?php echo $key ?>" type="button"><i class="fa fa-trash"></i></button>
</center>
</td>
</tr>

62
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<style>
td p{
margin: unset;
}
.rem_att{
cursor: pointer;
}
</style>

<script type="text/javascript">
$(document).ready(function(){
$('#table').DataTable();
});
</script>
<script type="text/javascript">

63
$(document).ready(function(){

$('.edit_attendance').click(function(){
var $id=$(this).attr('data-id');
uni_modal("Edit Employee","manage_attendance.php?id="+$id)

});
$('.view_attendance').click(function(){
var $id=$(this).attr('data-id');
uni_modal("Employee Details","view_attendance.php?id="+$id,"mid-
large")

});
$('#new_attendance_btn').click(function(){
uni_modal("New Time Record/s","manage_attendance.php",'mid-
large')
})
$('.remove_attendance').click(function(){
var d = '"'+($(this).attr('data-id')).toString()+'"';
_conf("Are you sure to delete this employee's time log record?","rem
ove_attendance",[d])
})
$('.rem_att').click(function(){
var $id=$(this).attr('data-id');

64
_conf("Are you sure to delete this time log?","rem_att",[$id])
})
});
function remove_attendance(id){
// console.log(id)
// return false;
start_load()
$.ajax({
url:'ajax.php?action=delete_employee_attendance',
method:"POST",
data:{id:id},
error:err=>console.log(err),
success:function(resp){
if(resp == 1){
alert_toast("Selected employee's time log data successfully del
eted","success");
setTimeout(function(){
location.reload();

},1000)
}
}
})
}
function rem_att(id){

65
start_load()
$.ajax({
url:'ajax.php?action=delete_employee_attendance_single',
method:"POST",
data:{id:id},
error:err=>console.log(err),
success:function(resp){
if(resp == 1){
alert_toast("Selected employee's time log data successfully del
eted","success");
setTimeout(function(){
location.reload();

},1000)
}
}
})
}
</script>

DEDUCTION.PHP

<?php include('db_connect.php');?>

<div class="container-fluid">

<div class="col-lg-12">

66
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-deductions">
<div class="card">
<div class="card-header">
Deductions Form
</div>
<div class="card-body">
<input type="hidden" name="id">
<div class="form-group">
<label class="control-label">Deduction Name</label>
<textarea name="deduction" id="" cols="30" rows="2" class=
"form-control" required></textarea>
</div>
<div class="form-group">
<label class="control-label">Description</label>
<textarea name="description" id="" cols="30" rows="2" class
="form-control" required></textarea>
</div>

</div>

<div class="card-footer">

67
<div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-
3"> Save</button>
<button class="btn btn-sm btn-default col-sm-
3" type="button" onclick="_reset()"> Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Deduction Information</th>
<th class="text-center">Action</th>
</tr>
</thead>

68
<tbody>
<?php
$i = 1;
$deductions = $conn-
>query("SELECT * FROM deductions order by id asc");
while($row=$deductions->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>

<td class="">
<p>Name: <b><?php echo $row['deduction'] ?></b></p
>
<p class="truncate"><small>Description: <b><?php echo
$row['description'] ?></b></small></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-
primary edit_deductions" type="button" data-
id="<?php echo $row['id'] ?>" data-
deduction="<?php echo $row['deduction'] ?>" data-
description="<?php echo $row['description'] ?>" >Edit</button>
<button class="btn btn-sm btn-
danger delete_deductions" type="button" data-
id="<?php echo $row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>

69
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
function _reset(){
$('[name="id"]').val('');

70
$('#manage-deductions').get(0).reset();
}

$('#manage-deductions').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_deductions',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()

71
},1500)

}
}
})
})
$('.edit_deductions').click(function(){
start_load()
var cat = $('#manage-deductions')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='deduction']").val($(this).attr('data-deduction'))
cat.find("[name='description']").val($(this).attr('data-description'))
end_load()
})
$('.delete_deductions').click(function(){
_conf("Are you sure to delete this deduction ?","delete_deductions",[$(thi
s).attr('data-id')])
})
function displayImg(input,_this) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#cimg').attr('src', e.target.result);
}

72
reader.readAsDataURL(input.files[0]);
}
}
function delete_deductions($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_deductions',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
}
</script>

DEPARTMENT.PHP

<?php include('db_connect.php');?>

73
<div class="container-fluid">

<div class="col-lg-12">
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-department">
<div class="card">
<div class="card-header">
Department Form
</div>
<div class="card-body">
<input type="hidden" name="id">
<div class="form-group">
<label class="control-label">Name</label>
<textarea name="name" id="" cols="30" rows="2" class="for
m-control"></textarea>
</div>

</div>

<div class="card-footer">
<div class="row">
<div class="col-md-12">

74
<button class="btn btn-sm btn-primary col-sm-3 offset-md-
3"> Save</button>
<button class="btn btn-sm btn-default col-sm-
3" type="button" onclick="_reset()"> Cancel</button>
</div>
</div>
</div>
</div>
</form>
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Department</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php

75
$i = 1;
$department = $conn-
>query("SELECT * FROM department order by id asc");
while($row=$department->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>

<td class="">
<p> <b><?php echo $row['name'] ?></b></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-
primary edit_department" type="button" data-
id="<?php echo $row['id'] ?>" data-
name="<?php echo $row['name'] ?>" >Edit</button>
<button class="btn btn-sm btn-
danger delete_department" type="button" data-
id="<?php echo $row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>

76
<!-- Table Panel -->
</div>
</div>

</div>
<style>

td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
function _reset(){
$('[name="id"]').val('');
$('#manage-department').get(0).reset();
}

$('#manage-department').submit(function(e){
e.preventDefault()

77
start_load()
$.ajax({
url:'ajax.php?action=save_department',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})

78
})
$('.edit_department').click(function(){
start_load()
var cat = $('#manage-department')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='name']").val($(this).attr('data-name'))
end_load()
})
$('.delete_department').click(function(){
_conf("Are you sure to delete this department?","delete_department",[$(t
his).attr('data-id')])
})
function displayImg(input,_this) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#cimg').attr('src', e.target.result);
}

reader.readAsDataURL(input.files[0]);
}
}
function delete_department($id){
start_load()
$.ajax({

79
url:'ajax.php?action=delete_department',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
}
</script>

PAYROLL.PHP

<?php include('db_connect.php') ?>


<div class="container-fluid " >
<div class="col-lg-12">

<br />
<br />
<div class="card">
<div class="card-header">
<span><b>Payroll List</b></span>

80
<button class="btn btn-primary btn-sm btn-block col-md-3 float-
right" type="button" id="new_payroll_btn"><span class="fa fa-
plus"></span> Add Payroll</button>
</div>
<div class="card-body">
<table id="table" class="table table-bordered table-striped">
<thead>
<tr>
<th>Ref No</th>
<th>Date From</th>
<th>Date To</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php

$payroll=$conn-
>query("SELECT * FROM payroll order by date(date_from) desc") or die(mysqli
_error());
while($row=$payroll->fetch_array()){
?>
<tr>
<td><?php echo $row['ref_no']?></td>
<td><?php echo date("M d, Y",strtotime($row['date_from'
])) ?></td>

81
<td><?php echo date("M d, Y",strtotime($row['date_to']))
?></td>
<?php if($row['status'] == 0): ?>
<td class="text-center"><span class="badge badge-
primary">New</span></td>
<?php else: ?>
<td class="text-center"><span class="badge badge-
success">Calculated</span></td>
<?php endif ?>
<td>
<center>
<?php if($row['status'] == 0): ?>
<button class="btn btn-sm btn-outline-
primary calculate_payroll" data-
id="<?php echo $row['id']?>" type="button">Calculate</button>
<?php else: ?>
<button class="btn btn-sm btn-outline-
primary view_payroll" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
eye"></i></button>
<?php endif ?>

<button class="btn btn-sm btn-outline-


primary edit_payroll" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
edit"></i></button>
<button class="btn btn-sm btn-outline-
danger remove_payroll" data-
id="<?php echo $row['id']?>" type="button"><i class="fa fa-
trash"></i></button>

82
</center>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
$('#table').DataTable();
});
</script>
<script type="text/javascript">
$(document).ready(function(){

83
$('.edit_payroll').click(function(){
var $id=$(this).attr('data-id');
uni_modal("Edit Employee","manage_payroll.php?id="+$id)

});
$('.view_payroll').click(function(){
var $id=$(this).attr('data-id');
location.href = "index.php?page=payroll_items&id="+$id;

});
$('#new_payroll_btn').click(function(){
uni_modal("New Payroll","manage_payroll.php")
})
$('.remove_payroll').click(function(){
_conf("Are you sure to delete this payroll?","remove_payroll",[$(this).
attr('data-id')])
})
$('.calculate_payroll').click(function(){
start_load()
$.ajax({
url:'ajax.php?action=calculate_payroll',
method:"POST",
data:{id:$(this).attr('data-id')},
error:err=>console.log(err),
success:function(resp){
if(resp == 1){

84
alert_toast("Payroll successfully computed","success");
setTimeout(function(){
location.reload();

},1000)
}
}
})
})
});
function remove_payroll(id){
start_load()
$.ajax({
url:'ajax.php?action=delete_payroll',
method:"POST",
data:{id:id},
error:err=>console.log(err),
success:function(resp){
if(resp == 1){
alert_toast("Employee's data successfully deleted","success");
setTimeout(function(){
location.reload();

},1000)
}
}

85
})
}
</script>

POSITION.PHP

<?php include('db_connect.php');?>

<div class="container-fluid">

<div class="col-lg-12">
<div class="row">
<!-- FORM Panel -->
<div class="col-md-4">
<form action="" id="manage-position">
<div class="card">
<div class="card-header">
Position Form
</div>
<div class="card-body">
<input type="hidden" name="id">
<div class="form-group">
<label class="control-label">Department</label>
<select class="custom-select browser-
default select2" name="department_id">
<option value=""></option>
<?php

86
$dept = $conn-
>query("SELECT * from department order by name asc");
while($row=$dept->fetch_assoc()):
?>
<option value="<?php echo $row['id'] ?>"><?php echo $ro
w['name'] ?></option>
<?php endwhile; ?>
</select>
</div>
<div class="form-group">
<label class="control-label">Name</label>
<textarea name="name" id="" cols="30" rows="2" class="for
m-control"></textarea>
</div>

</div>

<div class="card-footer">
<div class="row">
<div class="col-md-12">
<button class="btn btn-sm btn-primary col-sm-3 offset-md-
3"> Save</button>
<button class="btn btn-sm btn-default col-sm-
3" type="button" onclick="_reset()"> Cancel</button>
</div>
</div>
</div>

87
</div>
</form>
</div>
<!-- FORM Panel -->

<!-- Table Panel -->


<div class="col-md-8">
<div class="card">
<div class="card-body">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="text-center">#</th>
<th class="text-center">Position</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$position = $conn-
>query("SELECT * FROM position order by id asc");
while($row=$position->fetch_assoc()):
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>

88
<td class="">
<p> <b><?php echo $row['name'] ?></b></p>
</td>
<td class="text-center">
<button class="btn btn-sm btn-
primary edit_position" type="button" data-id="<?php echo $row['id'] ?>" data-
name="<?php echo $row['name'] ?>" data-
department_id="<?php echo $row['department_id'] ?>" >Edit</button>
<button class="btn btn-sm btn-
danger delete_position" type="button" data-
id="<?php echo $row['id'] ?>">Delete</button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>

</div>
<style>

89
td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
function _reset(){
$('[name="id"]').val('');
$('#manage-position').get(0).reset();
$('.select2').val('').select2({
placeholder:"Please Select Here",
width:"100%"
})
}
$('.select2').select2({
placeholder:"Please Select Here",
width:"100%"
})
$('#manage-position').submit(function(e){
e.preventDefault()

90
start_load()
$.ajax({
url:'ajax.php?action=save_position',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp==1){
alert_toast("Data successfully added",'success')
setTimeout(function(){
location.reload()
},1500)

}
else if(resp==2){
alert_toast("Data successfully updated",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})

91
})
$('.edit_position').click(function(){
start_load()
var cat = $('#manage-position')
cat.get(0).reset()
cat.find("[name='id']").val($(this).attr('data-id'))
cat.find("[name='name']").val($(this).attr('data-name'))
$('[name="department_id"]').val($(this).attr('data-
department_id')).select2({
width:"100%"
})
end_load()
})
$('.delete_position').click(function(){
_conf("Are you sure to delete this position?","delete_position",[$(this).att
r('data-id')])
})
function displayImg(input,_this) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#cimg').attr('src', e.target.result);
}

reader.readAsDataURL(input.files[0]);
}

92
}
function delete_position($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_position',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)

}
}
})
}
</script>

93
CHAPTER 5
testing

94
Testing

Testing is the process of detecting errors. Testing performs a very critical


role for quality assurance and for ensuring the reliability of software. The
results of testing are used later on during maintenance also

Psychology of Testing

The aim of testing is often to demonstrate that a program works by


showing that it has no errors. The basic purpose of testing phase is to
detect the errors that may be present in the program. Hence one should not
start testing with the intent of showing that a program works, but the
intent should be to show that a program doesn’t work.

Testing is the process of executing a program with the intent of finding


errors.

Testing Objectives:

The main objective of testing is to uncover a host of errors, systematically


and with minimum effort and time. Stating formally, we can say,

 Testing is a process of executing a program with the intent of finding


an error.

 A successful test is one that uncovers an as yet undiscovered error.

 A good test case is one that has a high probability of finding error, if it
exists.

 The tests are inadequate to detect possibly present errors.

95
 The software more or less confirms to the quality and reliable
standards.

LEVELS OF TESTING

In order to uncover the errors present in different phases we have the


concept of levels of testing. The basic levels of testing are

Client Needs Acceptance Testing

Requirements System Testing

Design Integration Testing

Code Unit Testing

A series of testing is done for the proposed system before the system is
ready for the user acceptance testing.

The steps involved in Testing are:

9.1 Unit Testing:

96
Unit testing focuses verification efforts on the smallest unit of the software
design, the module. This is also known as “Module Testing”. The modules
are tested separately. This testing carried out during programming stage
itself. In this testing each module is found to be working satisfactorily as
regards to the expected output from the module.

9.2 Integration Testing:

Data can be grossed across an interface; one module can have


adverse efforts on another. Integration testing is systematic testing for
construction the program structure while at the same time conducting tests
to uncover errors associated with in the interface. The objective is to take
unit tested modules and build a program structure. All the modules are
combined and tested as a whole. Here correction is difficult because the
isolation of cause is complicate by the vast expense of the entire program.
Thus in the integration testing stop, all the errors uncovered are corrected
for the text testing steps.

9.3 System testing:

System testing is the stage of implementation that is aimed at ensuring that


the system works accurately and efficiently for live operation commences.
Testing is vital to the success of the system. System testing makes a logical
assumption that if all the parts of the system are correct, then goal will be
successfully achieved.

97
The four major system testing are

i. Recovery Testing

ii.Security Testing

iii.Stress Testing

iv.Performance Testing

Recovery Testing

Recovery testing is a system test that forces the software to fail in a variety
of ways and verifies that recovery is properly performed. If recovery is
automatic, re-initialization, checkpoint mechanisms, data recovery, and
restart are each evaluated for correctness. If recovery requires human
intervention, the mean time to repair is evaluated to determine whether it
is within acceptable limits.

Security Testing

Security testing attempts to verify that protection mechanisms built into a


system will, in fact, protect it from improper penetration. During security
testing, the tester plays the role of the individual who desire to penetrate
the system. Given enough time and resources, good security testing will
ultimately penetrate a system. The role of the system designer is to make
penetration cost more than the value of the information that will be
obtained.

98
Stress Testing

During earlier software testing steps, white box and black box techniques
resulted in a thorough evaluation of normal program functions and
performance. Stress tests are designed to confront programs with
abnormal situations.

99
Performance Testing

For real-time and embedded systems, software that provides required


function but does not confirm to performance requirements is
unacceptable. Performance testing is designed to test the run-time
performance of software within the context of an integrated system.
Performance testing occurs throughout all steps in the testing process.

Performance tests are sometimes coupled with stress testing and often
require both hardware and software instrumentation. That is, it is often
necessary to measure resource utilization. By instrumenting a system, the
tester can uncover situations that lead to degradation and possible system
failure.

9.4 Validation Testing:

At the conclusion of integration testing software is completely assembled


as a package, interfacing errors have been uncovered and corrected and a
final series of software tests begins, validation test begins. Validation test
can be defined in many ways. But the simple definition is that validation
succeeds when the software function in a manner that can reasonably
expected by the customer. After validation test has been conducted one of
two possible conditions exists.

One is the function or performance characteristics confirm to specifications


and are accepted and the other is deviation from specification is uncovered
and a deficiency list is created. Proposed system under consideration has

100
been tested by using validation testing and found to be working
satisfactorily.

9.5 Output Testing:

After performing validation testing, the next step is output testing of


the proposed system since no system could be useful if it does not produce
the required output in the

specified format. Asking the users about the format required by them tests
the outputs generated by the system under consideration. Here the output
format is considered in two ways, one is on the screen and other is the
printed format. The output format on the screen is found to be correct as
the format was designed in the system designed phase according to the
user needs. For the hard copy also the output comes as the specified
requirements by the users. Hence output testing does not result any
corrections in the system.

9.6 User Acceptance Testing:

User acceptance of a system is the key factor of the success of any system.
The system under study is tested for the user acceptance by constantly
keeping in touch with the prospective system users at the time of
developing and making changes wherever required.

Test Data:

101
Taking various kinds of test data does the above testing. Preparation of test
data plays a vital role in the system testing after preparing the test data the
system under study is tested using the test data. While testing the system
by using the test data errors are again uncovered and corrected by using
above testing steps and corrections are also noted from the future use.

Testing:

The testing done here was System Testing–checking whether the


user requirements were satisfied. The code for the new system has been
written completely using JSP as the coding language, HTML as the interface
for front-end designing and Java Script for validating the client-side
applications. The new system has been tested well with the help of the
users and all the applications have been verified from every nook and
corner of the user.

Although some applications were found to be erroneous these


applications have been corrected before being implemented. The flow of
the forms has been found to be very much in accordance with the actual
flow of data.

Future Enhancement Of The Project

 Mobile App
 Build email facilities.
 Employee Dashboard
 Biometric Integration
 Payment Gateway

102
BIBILIOGRAPHY
 www.w3schools.com
 php.net
 en.wikipedia.org/wiki/PHP
 www.hotscripts.com/category/php/
 www.apache.org
 www.mysql.com/click.php?e=35050

103

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy