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

Construction Management System

CHAPTER 1: INTRODUCTION

Construction management system is Web Application to manage all day to day operations
related to events for an organization. There are mainly 4 modules in this website CCD,
Account, admin, super admin. In this website admin can register the members and assign a
roles to member.

1. 1 PROJECT SUMMERY

Construction management provide information in a quick time according to the


requirements that are to be fulfilled. This website provides inconsistency of data and reduce
the paper work.

pg.
1.2 PROJECT PROFILE
Project Title Construction Management System

Operating System Windows 7,8

Front end tool PHP

Back end tool MySQL

Editor Notepad++

1.3 PURPOSE

The purpose of this project is to develop the user friendly and interactive website which will
reduce the paper work, faster and easy work and save the time.

1
1.4 SCOPE

The aim of the project is to build a simple, effective computerized Construction Management
System. It starts from the process of collecting relevant details and requirements from the
Companies. The Scope of this application deals with the administrator of the software. The
administrator here is the advocate who deals with the handling of addition, deletion and
updating the detail This Daily Board software is limited to advocates only who is the
administrator of the software, who manages all the working and allows the client to enroll
and handle the data of clients in their respective registered cases and its details

DRAWBACKS OF EXISTING SYSTEM


 It is very difficult and time consuming to maintain all the details in to the
registers when the organization is very big.

 Modifying the records is not very easy, since for a minute change the whole
record would be required to re-entered. For instance, if, the details of any
employee changes then locating that employee and doing modification in
registers is very tedious.

 It also take much time for doing entry and checking of records.

 There is also possibility of mismatching of entries during entry of records.

 To make and maintain the different reports is also very tough and tedious
job.

 Information is stored into registers, which requires large storage space.

 Searching particular record is very tedious job, since as a time passes the
condition of the registers becomes bad.

2
 Every year, they have to maintain new registers.

ADVANTAGES OF PROPOSED SYSTEM

 Provide information in a quick time according to the requirements that are to be


fulfilled.
 Easier retrieval will be possible as multiple search facilities will be available.
 Security of data.
 The important process is integrated together for a proper functioning.
 Redundancy of data is removed.
 Inconsistency of data is removed.
 The Paper Work would be reduced to a greater extent.

MODULES

 Login : this is the login module in which admin can login with his/her credentials.
 Dashboard : In Dashboard, it shows a brief of no. of tools and equipments as wella s
no. of employees
 List of Borrowed Equipment/Tools: It shows list of the number of equipment or
tools borrowed.
 Borrowed Tools : It shows tools borrowed.
 Borrowed Equipment : in this module, It shows Equipment borrowed.
 Transferred Equipment : in this module, It shows Equipment Transferred
 List of tools : in this module, It shows list of tools.
 List of Equipment : in this module, It shows list of Equipment.
 Add Employee : In this module we can add or edit employees.
 Add Locations : In this module we can add or edit Locations.

Reports : In these modules it shows the reports of following ,

3
• Borrowed Tools

• Borrowed Equipment

• List of tools

• List of Equipment

• Transferred Equipment

1.5 TECHNOLOGY & LITERATURE REVIEW

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.

4
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

<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

5
<FORM> : Creating a HTML forms

<INPUT TYPE=BUTTON> : Creating a buttons

<INPUT TYPE=CHECKBOX> : Creating a checkboxes

<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?

6
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.

EX: <HTML>

<HEAD>

<TITLE></TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE=”JavaScript”>

</SCRIPT>

</BODY></HTML>

JAVASCRIPTS OBJECTS

7
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 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

8
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.

JAVASCRIPTS FUNCTIONS

Declaration of function

Syntax: function function name ()

Write these functions in <SCRIPT> tag.

9
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”.

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.

10
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.

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,

11
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:

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.

12
Features Of SQL

1. SQL is an interactive query language.

2. SQL is a database administration language.

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.

13
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.

14
CHAPTER 2: PROJECT MANAGEMENT

2.1 PROJECT PLANNING AND SCHEDULING

For getting project on time and getting functionality completely working we have
to follow some plan. That means if you have not plan to work then you will not get
project on time. So for getting project on time we have to do some plan and we
have to follow it also. And if you have made perfect plan and you follow it also then
you will be surly got project on time.

2.1.1 PROJECT DEVELOPMENT MODEL

Water fall Model:-

[Fig 2.1.1 Stages of the Incremental model]

WATER FALL MODEL was being chosen because all requirements were known
beforehand and the objective of our software development is the

15
computerization/automation of an already existing manual working system.
Reasons to choose waterfall model are:

• Waterfall model is simple to implement and also the amount of


resources required for it are minimal.
• When to use the waterfall model:

o This model is used only when the requirements are very well
known, clear and fixed. o Product definition is stable. o Technology
is understood.
o There are no ambiguous requirements
o Ample resources with required expertise are available freely o
The project is short.

• Advantages of waterfall model:

o Simple and easy to understand and use.


o Easy to manage due to the rigidity of the model – each phase has
specific deliverables and a review process.
o Phases are processed and completed one at a time. Phases do not
overlap.
o Works well for smaller projects where requirements are very well
understood.
• Disadvantages of waterfall model:

o Once an application is in the testing stage, it is very difficult to go


back and change something that was not well-thought out in the
concept stage.

o No working software is produced until late during the life cycle.


o High amounts of risk and uncertainty.
o Not a good model for complex and object-oriented projects. o Poor
model for long and ongoing projects.

16
o Not suitable for the projects where requirements are at a moderate
to high risk of changing.

2.1.2 PROJECT PLAN

In the development of this project, we will first check to see if our project is
feasible functionally, technically and economically. Then we collect the
requirements from the end users and analyze it. We also analyze similar systems
to get an exact idea of how to create this system. Hence, we gather all the
requirements which we need to develop our system. Then, after thoroughly
understanding the need of end user, we will develop the Graphical User Interface
(GUI).

The GUI is viewed by the user and the user communicates with the system and
hence, it should be appealing an attractive. After this comes the coding part, which
involves handling databases and manages queries and forms etc. There are certain
coding standards to be followed so that the flow of program is easily understood.

2.1.3 PROJECT SCHEDULING

Software life cycle phase Completion


date/duration

System Analysis: Problem definition and description. 3 weeks

Hardware Software analysis 1 weeks

17
Constraints/Goals of implementation 1 week

Requirement gathering 1 week

Requirement analysis 1 week

Requirement specification 1 week

System Design 2 weeks

GUI form design 2 weeks

Coding Standard Conversion 1 week

Coding 2 week

Testing and deployment 1 week

2.2 RISK MANAGEMENT

Risk management consists of a series of steps that help a software development


team to understood and manage uncertain problems that may arise during the
course of software development and can plague a software project.

Risks are the dangerous conditions or potential problems for the system which
may damage the system functionalities to very high level which would not be
acceptable at any cost. so in order to make our system stable and give its 100%
performance we must have identify those risks, analyze their occurrences and
effects on our system and must prevent them to occur .

2.2.1 RISK IDENTIFICATION

Each and every software project is developed under the shadow of risk. All
software development groups have three prime concerns with risk.

18
1. Future – what risk might cause the software project to go awry?
2. Change concern – how will change in requirement and
development in technologies will occur.
3. Choice – what methods and tools should be used, how to
distribute the work, what level of emphasis is to be given on
quality.

2.2.2 RISK ANALYSIS

Regardless of the prevention techniques employed, possible threats that could


arise inside or outside the organization need to be assessed. Although the exact
nature of potential disasters or their resulting consequences are difficult
to determine, it is beneficial to perform a comprehensive risk assessment of all
threats that can realistically occur to the organization.

 Types of Risks:-

• Performance Risk - The degree of uncertainty that the product will


meet its requirements and be fit for its intended use. -As we are trainees,
the performance risk is there in our project.

• Cost Risk - The degree of uncertainty that the project budget will be
maintained. The cost of our project is already decided by management.

• Support Risk - The degree of uncertainty that the resultant software will
be easy to correct, adapt, and enhance. Client of this project is in different
premises.

• Project Risks - Threaten the project plan. If project risk become real, it is
likely that project schedule will slip and that costs will increase. The budget
of this project was decided before starting the project and it is enough to
complete it. -All the works are divided between team members. Required
all the resources are available.

19
• Technical Risks - Threaten the quality and timeliness of the s/w to be
produced. If technical risk becomes real, implementation may
become difficult or impossible. -Technology is already decided for this
project.

• Business Risks - Threaten the viability of the s/w to be built. This is live
project so no business risk is there.

• Known Risks - are those that can be uncovered after careful


evaluation of the project plan.

• Experience Risks - Are extrapolated from past project experience. As we


are trainees, make this project no such experience is there.

2.2.3 RISK PLANNING

Risk Type Remedies/Plans

Hardware Failure Back up must be taken at each specific interval.

Reorganize team so that there is proper


understanding of project and people therefore
Schedule Slippage understand each other’s job.

For this risk we must have to analyze new


requirements that proper changes made.
Rapidly Change in requirements

20
2.3 ESTIMATION

2.3.1 EFFORT ESTIMATION

While doing effort estimation we must keep in mind that the software must be
user friendly. That is this software can be used by any person who has a bit
knowledge about the software

2.3.2 COST ESTIMATION

The target software aims at the person who will not find jobs and resources Hence
the cost effectiveness of the software was the important factor which had to be
taken care of throughout the development process

It is done mainly in two categories.


Hardware used

• Processor : dual core or above


• Hard disk : 60GB
• Memory : 512MB

21
CHAPTER 3: SYSTEM REQUIREMENT STUDY

3.1 HARDWARE REQUIRMENTS

• Processor : dual core or above


• Hard disk : 60GB
• Memory : 512MB RAM(minimum)

3.2 SOFTWARE REQUIRMENTS

• Web server : Wamp/Xamp server.


• OS : Windows/Linux
• Platform : PHP
• Editor : Notepad++ Editor Browser : All

CHAPTER 4: SYSTEM ANALYSIS

22
4.1 REQUIREMENT OF SYSTEM

This Website is a very important feature used for construction management. The
primary goal of this website is to store or keep all records of construction project.

In this project only admin will have to create new user, than they create the
records, create purchase order, create vendors, etc. and super admin will provide
the role like ccd, account and admin to users.

 ADMINISTATOR
• Editing/Deleting/Creating the database.
• Super admin can give roles to users.

 MEMBER
• Logging into the system.
• He/she can change or create the records when access is granted by super
admin.
• Can update /edit its records.

4.2 FEASIBILITY STUDY


4.2.1 Operational Feasibility

In this we check the entire task by operation. That means when we get task at the
time first we search for what operation will going on during this task. What will
be input, output and what condition we have to put. And from this kind of
operation we get more clear idea, and thus we can understand more about client
requirement and functionality which client want. So, operational feasibility is
helpful to get more idea about task and client requirement.

4.2.2 Technical feasibility


• Technically my project was feasible enough.

23
• But the sources for guidance was not enough for my development.

4.2.3 Economic feasibility


• For any system if the expected benefits equal or exceed the expected costs,
the system can be economically feasible.
• In economic feasibility, cost benefit analysis is done in which expected costs
and benefits are evaluated.
• I consider economic analysis for checking how much my project would cost.

24
CHAPTER 5: SYSTEM DESIGN

5.1 USE CASE DIAGRAM

Member

Construction Management System

Login

Create Branch

Create Project

Member Create Vendor

Add New Item

Create Purchase
Order

Create Instructions

Logout

Admin

25
Construction Management System

Login

Create Member

Assign Roles
Admin

Manage Database

Logout

5.2 DATA FLOW DIAGRAM (0 & 1 LEVEL)

26
Level – 0

27
Level - 1

28
5.4 Sequence Diagram

Login Member Branch Logout

Login

Login Succesfull

Branch

View Branches

Create Branch

Logout

Logout Succesfull

29
SOURCE CODE
LOGIN.PHP

<?php

include "include/connect.php";

session_start();

if(isset($_SESSION["name"])){

header("Location: index.php");

}else{

?>

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

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


scale=1, shrink-to-fit=no">

<meta name="description" content="">

30
<meta name="author" content="">

<title>Login</title>

<!-- Bootstrap core CSS-->

<link href="vendor/bootstrap/css/bootstrap.min.css" rel="styles


heet">

<!-- Custom fonts for this template-->

<link href="vendor/fontawesome-
free/css/all.min.css" rel="stylesheet" type="text/css">

<!-- Custom styles for this template-->

<link href="css/sb-admin.css" rel="stylesheet">

</head>

<body style="background-color: gray">

<div class="container">

<div class="card card-login mx-auto mt-5">

31
<div class="card-header">ADMIN LOG IN</div>

<div class="card-body">

<center><h1><i class="fas fa-


lock"></i></h1></center><br><br>

<form method="POST" action="login1.php">

<div class="form-group">

<div>

<input type="text" id="inputEmail" class="form-


control" placeholder="Username" name="user" required="require
d" autofocus="autofocus">

</div>

</div>

<div class="form-group">

<div>

<input type="password" id="inputPassword" class="form-


control" placeholder="Password" name="pass" required="required
">

</div>

</div>

32
<button type="submit" class="btn btn-primary btn-
block fas fa-key">Login</button>

</form>

</div>

</div>

</div>

<!-- Bootstrap core JavaScript-->

<script src="vendor/jquery/jquery.min.js"></script>

<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></sc
ript>

<!-- Core plugin JavaScript-->

<script src="vendor/jquery-
easing/jquery.easing.min.js"></script>

</body>

</html>

<?php

33
}

?>

EMPLOYEES.PHP

<?php

include('include/connect.php');

include('include/header.php');

include('include/sidebar1.php')

?>

<div id="content-wrapper">

<div class="container-fluid">

<h2>List of Employee(s)<a href="#" data-toggle="modal" data-


target="#AddEmployee" class="btn btn-sm btn-
info">Add New</a></h2>

<div class="card-body">

<div class="table-responsive">

<table class="table table-


bordered" id="dataTable" width="100%" cellspacing="0">

<thead>

34
<tr>

<th>Name</th>

<th>Age</th>

<th>Address</th>

<th>Contact Number</th>

<th>Position</th>

<th>Options</th>

</tr>

</thead>

<?php

$query = "SELECT * FROM employees";

$result = mysqli_query($db, $query) or die (mysqli_error


($db));

while ($row = mysqli_fetch_assoc($result)) {

echo '<tr>';

35
echo '<td>'. $row['name'].'</td>';

echo '<td>'. $row['age'].'</td>';

echo '<td>'. $row['address'].'</td>';

echo '<td>'. $row['contact_number'].'</td>';

echo '<td>'. $row['position'].'</td>';

echo " ";

echo '<td><a type="button" class="btn btn-sm btn-


warning fa fa-edit fw-fa" href="#" data-toggle="modal" data-
target="#UpdateEmployee'.$row['emp_id'].'">Edit</a>';

?>

<div id="UpdateEmployee<?php echo $row['emp_id'];?>" class="m


odal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-header"><h3>Modify Employee</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

36
<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputName1" class="form-


control" placeholder="Name" name="name" value="<?php echo $r
ow['name']; ?>" autofocus="autofocus" required>

<input type="hidden" id="inputName1" class="form-


control" name="id" value="<?php echo $row['emp_id']; ?>" autofoc
us="autofocus" required>

<label for="inputName1">Name</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="number" id="inputAge1" class="form-


control" placeholder="Age" name="age" value="<?php echo $row['
age']; ?>" required>

<label for="inputAge1">Age</label>

37
</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputAddress1" class="form-


control" placeholder="Address" value="<?php echo $row['address'
]; ?>" name="add" required>

<label for="inputAddress1">Address</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputContact1" class="form-


control" placeholder="Contact Number" value="<?php echo $row['
contact_number']; ?>" name="contact" required>

<label for="inputContact1">Contact Number</label


>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

38
<input type="text" id="position" class="form-
control" placeholder="Position" value="<?php echo $row['position'
]; ?>" name="position" required>

<label for="position">Position</label>

</div>

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="update" value="Update" cl


ass="btn btn-success">

</div>

</form>

39
</div>

</div>

</div>

</div>

<?php

if(isset($_POST['update'])){

$id = $_POST['id'];

$name = $_POST['name'];

$age = $_POST['age'];

$add = $_POST['add'];

$contact = $_POST['contact'];

$position = $_POST['position'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

$remarks="employee $name was updated";

40
$query = "UPDATE `employees` SET `name`='$name',`age`='$age',`
address`='$add',`contact_number`='$contact',`position`='$position'
WHERE `emp_id`='$id'";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('


$remarks','$date1')")or die(mysqli_error($db));

?>

<script type="text/javascript">

alert("Employee Updated Successfully!.");

window.location = "employees.php";

</script>

<?php

echo '</td> ';

echo '</tr> ';

41
?>

</table>

</div>

</div>

<div id="AddEmployee" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Add New Employee</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

42
<div class="form-label-group">

<input type="text" id="inputName" class="form-


control" placeholder="Name" name="name" autofocus="autofocus"
required>

<label for="inputName">Name</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="number" id="inputAge" class="form-


control" placeholder="Age" name="age" required>

<label for="inputAge">Age</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputAddress" class="form-


control" placeholder="Address" name="add" required>

<label for="inputAddress">Address</label>

</div>

43
</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputContact" class="form-


control" placeholder="Contact Number" name="contact" required>

<label for="inputContact">Contact Number</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="position1" class="form-


control" placeholder="Position" name="position" required>

<label for="position1">Position</label>

</div>

</div>

<div class="modal-footer">

44
<button type="button" class="btn btn-default" data-
dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

</form>

</div>

</div>

</div>

</div>

<?php

if(isset($_POST['submit'])){

$name = $_POST['name'];

$age = $_POST['age'];

$add = $_POST['add'];

45
$contact = $_POST['contact'];

$position = $_POST['position'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

$remarks="employee $name was Added";

$query = "INSERT INTO employees(name,age,address,contact_nu


mber,position)

VALUES ('".$name."','".$age."','".$add."','".$contact."','".$posi
tion."')";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('


$remarks','$date1')")or die(mysqli_error($db));

?>

<script type="text/javascript">

alert("New Employee Added Successfully!.");

window.location = "employees.php";

</script>

46
<?php

include('include/scripts.php');

include('include/footer.php');

?>

EQUIPMENTS.PHP

<?php

include('include/connect.php');

include('include/header.php');

include('include/sidebar1.php')

?>

<div id="content-wrapper">

<div class="container-fluid">

47
<h2>List of Equipment(s)<a href="#" data-toggle="modal" data-
target="#AddEquipment" class="btn btn-sm btn-
info">Add New</a></h2>

<div class="card-body">

<div class="table-responsive">

<table class="table table-


bordered" id="dataTable" width="100%" cellspacing="0">

<thead>

<tr>

<th>Code</th>

<th>Name</th>

<th>Category</th>

<!-- <th>Quantity</th>

<th>Available Quantity</th> -->

<th>Status</th>

<th>Options</th>

</tr>

</thead>

<?php

48
$query = "SELECT * FROM equipments";

$result = mysqli_query($db, $query) or die (mysqli_error


($db));

while ($row = mysqli_fetch_assoc($result)) {

echo '<tr>';

echo '<td>'. $row['uniquec'].'</td>';

echo '<td>'. $row['name'].'</td>';

echo '<td>'. $row['category'].'</td>';

// echo '<td>'. $row['quantity'].'</td>';

// echo '<td>'. $row['available_quantity'].'</td>';

echo '<td>'. $row['status'].'</td>';

echo '<td><a type="button" class="btn btn-sm btn-


warning fa fa-edit fw-fa" href="#" data-toggle="modal" data-
target="#UpdateEquipment'.$row['equip_id'].'">Edit</a></td>';

?>

49
<div id="UpdateEquipment<?php echo $row['equip
_id']; ?>" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Modify Equipment</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<div class="form-label-group">

<input type="hidden" id="inputName1" class="for


m-
control" value="<?php echo $row['equip_id']; ?>" name="id" autofo
cus="autofocus" required>

50
<input type="text" id="inputName1" class="form-
control" placeholder="Name" value="<?php echo $row['name']; ?>"
name="name" autofocus="autofocus" required>

<label for="inputName1">Name</label>

</div>

</div>

<select name="category" class="form-


control" id="selectType">

<option disabled>--Select Category--</option>

<option value="<?php echo $row['category']; ?>">HE


AVY</option>

<option value="<?php echo $row['category']; ?>">N


OT HEAVY</option>

</select><br>

<div class="form-group">

<div class="form-label-group">

<input type="number" hidden id="inputQty1" class=


"form-
control" placeholder="Quantity" name="qty" value="<?php echo $r
ow['quantity']; ?>" required>

<!-- <label for="inputQty1">Quantity</label> -->

</div>

51
</div>

<div class="form-group">

<div class="form-label-group">

<input type="number" hidden id="inputQty1" class=


"form-
control" name="avail_qty" value="<?php echo $row['available_qua
ntity']; ?>" required>

<!-
- <label for="inputQty1">Available Quantity</label> -->

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="number" id="inputQty1" class="form-


control" name="status" value="<?php echo $row['status']; ?>">

<label for="inputQty1">Status</label>

</div>

</div>

52
<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="update" value="Update" cl


ass="btn btn-success">

</div>

</form>

</div>

</div>

</div>

</div>

<?php

if(isset($_POST['update'])){

$name = $_POST['name'];

$category = $_POST['category'];

53
$qty = $_POST['qty'];

$id = $_POST['id'];

$avail_qty = $_POST['avail_qty'];

$status = $_POST['status'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

$remarks="equipment $name was updated";

$query = "UPDATE `equipments` SET `name`='$name',`category`='


$category',`quantity`='$qty',`available_quantity`='$avail_qty',`status
`='$status' WHERE `equip_id`='$id'";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('$


remarks','$date1')")or die(mysqli_error($db));

?>

<script type="text/javascript">

alert("Equipment Updated Successfully!.");

window.location = "equipments.php";

54
</script>

<?php

echo '</tr> ';

?>

</table>

</div>

</div>

<div id="AddEquipment" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Add New Equipment</h3>

55
<button type="button" class="close" data-
dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputNamee" class="form-


control" placeholder="Code" name="code" autofocus="autofocus" r
equired>

<label for="inputNamee">Code</label>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

<input type="text" id="inputName" class="form-


control" placeholder="Name" name="name" autofocus="autofocus"
required>

<label for="inputName">Name</label>

56
</div>

</div>

<select name="category" class="form-


control" id="selectType">

<option disabled>--Select Category--</option>

<option value="HEAVY">HEAVY</option>

<option value="NOT HEAVY">NOT HEAVY</option>

</select><br>

<div class="form-group">

<div class="form-label-group">

<input type="number" id="inputQty" value="1" hidd


en class="form-
control" placeholder="Quantity" name="qty" required>

<!-- <label for="inputQty">Quantity</label> -->

</div>

</div>

<div class="modal-footer">

57
<button type="button" class="btn btn-default" data-
dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

</form>

</div>

</div>

</div>

</div>

<?php

if(isset($_POST['submit'])){

$query = "SELECT * FROM equipments where uniquec ='".$_POST['


code']."' ";

58
$result = mysqli_query($db, $query) or die (mysqli_error($db));

$row = mysqli_fetch_assoc($result);

if ($row>0) {

?>

<script type="text/javascript">

alert("Unique Code Already Exist!.");

window.location = "equipments.php";

</script>

<?php

}else{

$code = $_POST['code'];

$name = $_POST['name'];

$category = $_POST['category'];

$qty = $_POST['qty'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

59
$remarks="equipment $name was Added";

$query = "INSERT INTO equipments(uniquec,name,category,quant


ity,available_quantity)

VALUES ('".$code."','".$name."','".$category."','".$qty."','".$qt
y."')";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('$


remarks','$date1')")or die(mysqli_error($db));

?>

<script type="text/javascript">

alert("New Equipment Added Successfully!.");

window.location = "equipments.php";

</script>

<?php

include('include/scripts.php');

include('include/footer.php');

60
?>

LOCATIONS.PHP

<?php

include('include/connect.php');

include('include/header.php');

include('include/sidebar1.php')

?>

<div id="content-wrapper">

<div class="container-fluid">

<h2>List of Locations(s)<a href="#" data-toggle="modal" data-


target="#AddLocation" class="btn btn-sm btn-
info">Add New</a></h2>

<div class="card-body">

<div class="table-responsive">

<table class="table table-


bordered" id="dataTable" width="100%" cellspacing="0">

<thead>

<tr>

61
<th>Location Address</th>

<th>Options</th>

</tr>

</thead>

<?php

$query = "SELECT * FROM location";

$result = mysqli_query($db, $query) or die (mysqli_error


($db));

while ($row = mysqli_fetch_assoc($result)) {

echo '<tr>';

echo '<td>'. $row['location_address'].'</td>';

echo '<td><a type="button" class="btn btn-sm btn-


warning fa fa-edit fw-fa" href="#" data-toggle="modal" data-
target="#UpdateLocation'.$row['location_id'].'">Edit</a></td>';

?>

62
<div id="UpdateLocation<?php echo $row['location
_id']; ?>" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-header"><h3>Modify Location</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<div class="form-label-group">

<input type="hidden" name="id" value="<?php echo


$row['location_id']; ?>">

<textarea type="text" id="inputName" class="form-


control" placeholder="Location Address" name="address" autofocu

63
s="autofocus" required><?php echo $row['location_address']; ?></
textarea>

</div>

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="update" value="Update" cl


ass="btn btn-success">

</div>

</form>

</div>

</div>

</div>

</div>

64
<?php

if(isset($_POST['update'])){

$address = $_POST['address'];

$id = $_POST['id'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

$remarks="location $address was updated";

$query = "UPDATE location SET location_address = '$address' WH


ERE location_id = '$id'";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('$


remarks','$date1')")or die(mysqli_error($db));

?>

<script type="text/javascript">

alert("Location Has Been Updated Successfully!.");

window.location = "locations.php";

</script>

<?php

65
}

echo '</tr> ';

?>

</table>

</div>

</div>

<div id="AddLocation" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-header"><h3>Add New Location</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

66
<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<div class="form-label-group">

<textarea type="text" id="inputName" class="form-


control" placeholder="Location Address" name="address" autofocu
s="autofocus" required></textarea>

</div>

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

67
</form>

</div>

</div>

</div>

</div>

<?php

if(isset($_POST['submit'])){

$address = $_POST['address'];

date_default_timezone_set("Asia/Manila");

$date1 = date("Y-m-d H:i:s");

$remarks="location $address was Added";

$query = "INSERT INTO location(location_address)

VALUES ('".$address."')";

mysqli_query($db,$query)or die (mysqli_error($db));

mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES('$


remarks','$date1')")or die(mysqli_error($db));

68
?>

<script type="text/javascript">

alert("New Location Has Been Added Successfully!.");

window.location = "locations.php";

</script>

<?php

include('include/scripts.php');

include('include/footer.php');

?>

BORROWED_TOOLS.PHP

<?php

include('include/connect.php');

include('include/header.php');

include('include/sidebar1.php')

?>

69
<!-- DataTables Example -->

<!-- DataTables Example -->

<div id="content-wrapper">

<div class="container-fluid">

<h2>List of Borrowed Tool(s)<a href="#" data-


toggle="modal" data-target="#borrowedtool"class="btn btn-
sm btn-success" >Add New</a></h2>

<div class="card-body">

<div class="table-responsive">

<table class="table table-


bordered" id="dataTable" width="100%" cellspacing="0">

<thead>

<tr>

<th>Tools</th>

<th>Qty</th>

<th>Assigned Employee</th>

<th>Location</th>

70
<th>Date/Time Borrowed</th>

<th>Due Date</th>

<th>Date Returned</th>

<th>Status</th>

<th>Options</th>

</tr>

</thead>

<?php

$query = "SELECT borrowed_tools.borrow_id,tools.name,e


mployees.name as 'Employee',borrowed_tools.borrowed_date,borr
owed_tools.borrowed_time,borrowed_tools.due_date,borrowed_too
ls.date_returned,borrowed_tools.status,borrowed_tools.qty,location
.location_address, borrowed_tools.location_id, borrowed_tools.emp
_id, borrowed_tools.tool_id, tools.tool_type FROM borrowed_tools l
eft join tools on tools.tool_id = borrowed_tools.tool_id left join empl
oyees on employees.emp_id = borrowed_tools.emp_id left join locat
ion on location.location_id = borrowed_tools.location_id";

$result = mysqli_query($db, $query) or die (mysqli_error


($db));

while ($row = mysqli_fetch_assoc($result)) {

echo '<tr>';

71
echo '<td>'. $row['name'].'</td>';

echo '<td>'. $row['qty'].'</td>';

//echo '<td>'. $row['remaining_qty'].'</td>';

echo '<td>'. $row['Employee'].'</td>';

echo '<td>'. $row['location_address'].'</td>';

echo '<td>'. $row['borrowed_date'].' '.$row['borro


wed_time'].'</td>';

echo '<td>'. $row['due_date'].'</td>';

echo '<td>'. $row['date_returned'].'</td>';

echo '<td>'. $row['status'].'</td>';

if($row['status']=='RETURNED'){

echo '<td class="bg-


success"><i>Returned Successfully!</i>

';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


warning fas fa-
print" href="printtool.php?borrow_id='.$row['borrow_id'].'">Print
</a>';

'</td>';

}else if($row['tool_type']=='CONSUMABLE'){

72
echo '<td class="bg-
info"><i>This is a Consumable Tool</i></td>';

}else{

echo "<td>";

//echo '<td><a type="button" class="btn btn-


sm btn-warning fas fa-pencil-
alt" href="tools.php?action=add & id='.$row['borrow_id'] . '">Edit<
/a>';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


success fas fa-history" href="#" data-toggle="modal" data-
target="#returnConfirm">Return</a>';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


warning fas fa-
print" href="printtool.php?borrow_id='.$row['borrow_id'].'">Print
</a>';

?>

<div class="modal fade" id="returnConfirm" tabinde


x="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-
hidden="true">

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

<div class="modal-content">

<div class="modal-header">

73
<h5 class="modal-
title" id="exampleModalLabel">Are You Sure You Want To Return
This Tool(s)</h5>

<button class="close" type="button" data-


dismiss="modal" aria-label="Close">

<span aria-hidden="true">×</span>

</button>

</div>

<div class="modal-
body">Select "Return" below if you want to confirm.</div>

<div class="modal-footer">

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


dismiss="modal">Cancel</button>

<a class="btn btn-


success" href="returnTool.php?action=add &id=<?php echo $row['
borrow_id'];?>">Return</a>

</div>

</div>

</div>

</div>

<?php

echo " ";

74
echo '</td>';

echo '</tr> ';

?>

<tbody>

</tbody>

</table>

</div>

</div>

<?php

$query = "SELECT * FROM tools";

$result = mysqli_query($db,$query);

$query1 = "SELECT * FROM employees";

$result1 = mysqli_query($db,$query1);

75
?>

<!--

<div id="borrowedtool" class="modal fade" role="dialog">

<div class="modal-dialog">

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Add New Equipment</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<h3>Tool:</h3>

<div class="form-group">

<select name="type" class="form-control">

76
<option>---Select Tool---</option>

<?php// while($row = mysqli_fetch_array($result)):


; ?>

<option value="<?php // echo $row[0]; ?>"><?php


//echo $row[1]; ?></option>

<?php// endwhile; ?>

</select>

</div>

<h3>Employee:</h3>

<div class="form-group">

<select name="type" class="form-control">

<option>---Select Employee---</option>

<?php// while($row1 = mysqli_fetch_array($result


1)):; ?>

<option value="<?php// echo $row1[0]; ?>"><?php


// echo $row1[1]; ?></option>

<?php //endwhile; ?>

</select>

</div><br>

77
<div class="form-group">

<div class="form-label-group">

<input type="date" id="inputDate" class="form-


control" placeholder="Quantity" name="qty" required>

<label for="inputDate">Date</label>

</div>

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

78
</form>

</div>

</div>

</div>

</div> -->

<div id="borrowedtool" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Assigned Employee & Location</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

79
<form method="POST" action="#">

<div class="form-group">

<label for="date">Code</label>

<?php

$query4=mysqli_query($db,"select * from auto where desc


ription = 'BORROWED-TOOL'")or die(mysqli_error());

$row4=mysqli_fetch_array($query4);

?>

<input type="text" class="form-


control" readonly name="unique" value="<?php echo $row4['descr
iption'].'-'.($row4['auto_start']+$row4['auto_end']); ?>">

</div>

<div class="form-group">

<label for="date">Select Employee</label>

<select class="form-
control" name="emp" tabindex="1" autofocus required>

<?php

$query2=mysqli_query($db,"select * from employees")or


die(mysqli_error());

while($row=mysqli_fetch_array($query2)){

80
?>

<option value="<?php echo $row['emp_id'];?>"><?php ec


ho $row['name'];?></option>

<?php }?>

</select>

</div>

<div class="form-group">

<label for="date">Select Location</label>

<select class="form-
control" name="loc" tabindex="1" autofocus required>

<?php

$query3=mysqli_query($db,"select * from location")or di


e(mysqli_error());

while($row3=mysqli_fetch_array($query3)){

?>

<option value="<?php echo $row3['location_id'];?>"><?p


hp echo $row3['location_address'];?></option>

<?php }?>

</select>

81
</div>

<div class="form-group">

<label for="date">Due Date</label>

<input type="date" class="form-


control" required placeholder="Due Date" name="due">

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

</form>

82
</div>

</div>

</div>

</div>

<?php

if(isset($_POST['submit'])){

$emp = $_POST['emp'];

$loc = $_POST['loc'];

$code = $_POST['unique'];

$due = $_POST['due'];

$querys=mysqli_query($db,"select * from temp1 where emp_id = '


".$emp."'")or die(mysqli_error());

$rows=mysqli_fetch_array($querys);

if($rows==0){

mysqli_query($db,"UPDATE auto SET auto_end = auto_end+1 wher


e description='BORROWED-TOOL'") or die(mysqli_error($db));

83
?>

<script type="text/javascript">

window.location = "borrowedtool.php?emp_id=<?php echo $em


p; ?>&location_id=<?php echo $loc; ?>&code=<?php echo $code; ?>
&due=<?php echo $due; ?>";

</script>

<?php

}else{

?>

<script type="text/javascript">

window.location = "borrowedtool.php?emp_id=<?php echo $em


p; ?>&location_id=<?php echo $loc; ?>&code=<?php echo $rows['u
nique_id']; ?>&due=<?php echo $due; ?>";

</script>

<?php

include('include/scripts.php');

include('include/footer.php');

?>

84
</body>

</html>

BORROWED EQUIPMENTS.PHP

<?php

include('include/connect.php');

include('include/header.php');

include('include/sidebar1.php')

?>

<div id="content-wrapper">

<div class="container-fluid">

<h2>List of Borrowed Equipment(s)<a href="#" data-


toggle="modal" data-target="#AddBorrowed" class="btn btn-
sm btn-success">Add New</a></h2>

<div class="card-body">

<div class="table-responsive">

85
<table class="table table-
bordered" id="dataTable" width="100%" cellspacing="0">

<thead>

<tr>

<th>Code</th>

<th>Equipment</th>

<th>Qty</th>

<th>Assigned Employee</th>

<th>Location</th>

<th>Date/Time Borrowed</th>

<th>Due Date</th>

<th>Date Returned</th>

<th>Status</th>

<th>Options</th>

</tr>

</thead>

<?php

86
$query = "SELECT equip_mapping.map_id,equipments.name,equip
ments.uniquec,employees.name as 'Employee',employees.emp_id,e
quip_mapping.date_borrowed,equip_mapping.time_borrowed,equi
p_mapping.due_date,equip_mapping.date_returned,equip_mapping.
status,equip_mapping.qty,location.location_address, equip_mappin
g.location_id, equip_mapping.emp_id, equip_mapping.equip_id FRO
M equip_mapping left join equipments on equipments.equip_id = eq
uip_mapping.equip_id left join employees on employees.emp_id = e
quip_mapping.emp_id left join location on location.location_id = eq
uip_mapping.location_id";

$result = mysqli_query($db, $query) or die (mysqli_error


($db));

while ($row = mysqli_fetch_assoc($result)) {

echo '<tr>';

echo '<td>'. $row['uniquec'].'</td>';

echo '<td>'. $row['name'].'</td>';

echo '<td>'. $row['qty'].'</td>';

//echo '<td>'. $row['remaining_qty'].'</td>';

echo '<td>'. $row['Employee'].'</td>';

echo '<td>'. $row['location_address'].'</td>';

echo '<td>'. $row['date_borrowed'].' '.$row['time_b


orrowed'].'</td>';

87
echo '<td>'. $row['due_date'].'</td>';

echo '<td>'. $row['date_returned'].'</td>';

echo '<td>'. $row['status'].'</td>';

if($row['status']=='RETURNED'){

echo '<td class="bg-


success"><i>Returned Successfully!</i>

';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


warning fas fa-
print" href="print.php?map_id='.$row['map_id'].'">Print</a>';

echo '</td>';

}else if($row['status']=='TRANSFERED'){

echo '<td class="bg-


success"><i>Transfered Successfully!</i>';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


warning fas fa-
print" href="print.php?map_id='.$row['map_id'].'">Print</a>';

echo '</td>';

}else{

88
echo "<td>";

//echo '<td><a type="button" class="btn btn-


sm btn-warning fas fa-pencil-
alt" href="equipments.php?action=add & id='.$row['map_id'] . '">E
dit</a>';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


success fas fa-history" href="#" data-toggle="modal" data-
target="#returnConfirm'.$row['map_id'].'">Return</a>';

echo " ";

echo '<a type="button" class="btn btn-sm btn-


warning fas fa-
print" href="print.php?map_id='.$row['map_id'].'">Print</a>';

?>

<div class="modal fade" id="returnConfirm<?php ec


ho $row['map_id']; ?>" tabindex="-1" role="dialog" aria-
labelledby="exampleModalLabel" aria-hidden="true">

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

<div class="modal-content">

<div class="modal-header">

<h5 class="modal-
title" id="exampleModalLabel">Are You Sure You Want To Return
This Equipment(s)</h5>

89
<button class="close" type="button" data-
dismiss="modal" aria-label="Close">

<span aria-hidden="true">×</span>

</button>

</div>

<div class="modal-
body">Select "Return" below if you want to confirm.</div>

<div class="modal-footer">

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


dismiss="modal">Cancel</button>

<a class="btn btn-


success" href="returnE.php?action=add &id=<?php echo $row['ma
p_id'];?>">Return</a>

</div>

</div>

</div>

</div>

<?php

echo " ";

echo '<a type="button" class="btn btn-sm btn-


info fas fa-arrow-right" href="#" data-toggle="modal" data-
target="#transfer">Transfer</a>

90
</td>';

?>

<div id="transfer" class="modal fade" role="dialog"


>

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

<div class="modal-
header"><h3>Transfer Equipment</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="transfer.php">

<input type="hidden" class="form-


control" value="<?php echo $row['map_id']; ?>" name="map_id">

91
<input type="hidden" class="form-
control" value="<?php echo $row['equip_id']; ?>" name="equipmen
t">

<input type="hidden" class="form-


control" value="<?php echo $row['emp_id']; ?>" name="employee"
>

<input type="hidden" class="form-


control" value="<?php echo $row['location_id']; ?>" name="locatio
n_from">

<label>Transfer To</label>

<div class="form-group">

<div class="form-label-group">

<select class="form-
control" name="location_to" tabindex="1" autofocus required>

<?php

$querys2=mysqli_query($db,"select * from location")or d


ie(mysqli_error());

while($rows2=mysqli_fetch_array($querys2)){

?>

<option value="<?php echo $rows2['location_id'];?>"><?


php echo $rows2['location_address'];?></option>

<?php }?>

</select>

92
</div>

</div>

<label>Assign Employee</label>

<div class="form-group">

<div class="form-label-group">

<select class="form-
control" name="assign" tabindex="1" autofocus required>

<?php

$querys3=mysqli_query($db,"select * from employees")o


r die(mysqli_error());

while($rows3=mysqli_fetch_array($querys3)){

?>

<option value="<?php echo $rows3['emp_id'];?>"><?php


echo $rows3['name'];?></option>

<?php }?>

</select>

</div>

</div>

<div class="form-group">

<div class="form-label-group">

93
<input type="date" id="inputQty" class="form-
control" placeholder="Due" name="due" required>

<label for="inputQty">Due Date</label>

</div>

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

<span class="glyphicon glyphicon-remove-


sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

</form>

94
</div>

</div>

</div>

</div>

<?php

echo '</tr> ';

?>

</table>

</div>

</div>

<div id="AddBorrowed" class="modal fade" role="dialog">

<div class="modal-dialog">

<!-- Modal content-->

<div class="modal-content" style="width: 130%">

95
<div class="modal-
header"><h3>Assigned Employee & Location</h3>

<button type="button" class="close" data-


dismiss="modal">&times;</button>

</div>

<div class="modal-body">

<form method="POST" action="#">

<div class="form-group">

<label for="date">Code</label>

<?php

$query4=mysqli_query($db,"select * from auto where desc


ription = 'BORROWED'")or die(mysqli_error());

$row4=mysqli_fetch_array($query4);

?>

<input type="text" class="form-


control" readonly name="unique" value="<?php echo $row4['descr
iption'].'-'.($row4['auto_start']+$row4['auto_end']); ?>">

</div>

<div class="form-group">

96
<label for="date">Select Employee</label>

<select class="form-
control" name="emp" tabindex="1" autofocus required>

<?php

$query2=mysqli_query($db,"select * from employees")or


die(mysqli_error());

while($row=mysqli_fetch_array($query2)){

?>

<option value="<?php echo $row['emp_id'];?>"><?php ec


ho $row['name'];?></option>

<?php }?>

</select>

</div>

<div class="form-group">

<label for="date">Select Location</label>

<select class="form-
control" name="loc" tabindex="1" autofocus required>

<?php

97
$query3=mysqli_query($db,"select * from location")or di
e(mysqli_error());

while($row3=mysqli_fetch_array($query3)){

?>

<option value="<?php echo $row3['location_id'];?>"><?p


hp echo $row3['location_address'];?></option>

<?php }?>

</select>

</div>

<div class="form-group">

<label for="date">Due Date</label>

<input type="date" class="form-


control" required placeholder="Due Date" name="due">

</div>

<div class="modal-footer">

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


dismiss="modal">

Close

98
<span class="glyphicon glyphicon-remove-
sign"></span>

</button>

<input type="submit" name="submit" value="Save" class


="btn btn-success">

</div>

</form>

</div>

</div>

</div>

</div>

<?php

if(isset($_POST['submit'])){

$emp = $_POST['emp'];

$loc = $_POST['loc'];

$code = $_POST['unique'];

$due = $_POST['due'];

// date_default_timezone_set("Asia/Manila");

99
// $date = date("Y-m-d H:i:s");

// $remarks="";

$querys=mysqli_query($db,"select * from temp where emp_id = '".


$emp."'")or die(mysqli_error());

$rows=mysqli_fetch_array($querys);

if($rows==0){

mysqli_query($db,"UPDATE auto SET auto_end = auto_end+1 wher


e description='BORROWED'") or die(mysqli_error($db));

// mysqli_query($db,"INSERT INTO logs(action,date_time) VALUES


('$remarks','$date')")or die(mysqli_error($db));

?>

<script type="text/javascript">

window.location = "borrowedequip.php?emp_id=<?php echo $e


mp; ?>&location_id=<?php echo $loc; ?>&code=<?php echo $code; ?
>&due=<?php echo $due; ?>";

</script>

<?php

}else{

?>

100
<script type="text/javascript">

window.location = "borrowedequip.php?emp_id=<?php echo $e


mp; ?>&location_id=<?php echo $loc; ?>&code=<?php echo $rows['
unique_id']; ?>&due=<?php echo $due; ?>";

</script>

<?php

include('include/scripts.php');

include('include/footer.php');

?>

101
CHAPTER 6: TESTING

Software Testing is an empirical investigation conducted to provide


stakeholders with information about the quality of the product or service under
test, with respect to the context in which it is intended to operate.

Software Testing also provides an objective, independent view of the


software to allow the business to appreciate and understand the risks at
implementation of the software. Test techniques include, but are not limited to,
the process of executing a program or application with the intent of finding
software bugs.

It can also be stated as the process of validating and verifying that a software
program/application/product meets the business and technical requirements
that guided its design and development, so that it works as expected and can be
implemented with the same characteristics.

Software Testing, depending on the testing method employed, can be


implemented at any time in the development process, however the most test
effort is employed after the requirements have been defined and coding process
has been completed.

6.1 Unit Testing

The primary goal of unit testing is to take the smallest piece of testable
Software in the application, isolate it from the remainder of the code, and
determine whether it behaves exactly as you expect. Each unit is tested separately
before integrating them into modules to test the interfaces between modules. Unit
testing has proven its value in that a large percentage of defects are identified
during its use.

102
Unit testing is a software verification and validation method where the
programmer gains confidence that individual units of source code are fit for use.
A unit is the smallest testable part of an application. In procedural programming
a unit may be an individual program, function, procedure, etc., while in
objectoriented programming, the smallest unit is a class, which may belong to a
base/super class, abstract class or derived/child class.

6.2 Integration testing

Integration testing, also known as integration and testing (I&T), is a


software development process which program units are combined and tested as
groups in multiple ways. In this context, a unit is defined as the smallest testable
part of an application. Integration testing can expose problems with the interfaces
among program components before trouble occurs in real-world program
execution. Integration testing is a component of Extreme Programming (XP), a
pragmatic method of software development that takes a meticulous approach to
building a product by means of continual testing and revision.

There are two major ways of carrying out an integration test, called the
bottom-up method and the top-down method. Bottom-up integration testing
begins with unit testing, followed by tests of progressively higher-level
combinations of units called modules or builds. In top-down integration testing,
the highest-level modules are tested first and progressively lower-level modules
are tested after that. In a comprehensive software development environment,
bottom-up testing is usually done first, followed by top-down testing.

6.3 Validation Testing

At the validation level, testing focuses on user visible actions and user
recognizable output from the system. Validations testing is said to be successful
when software functions in a manner that can be reasonably expected by the
customer. Two types of validation testing,

103
• Alpha testing: alpha testing is simulated or actual operational testing by
potential users/customers or an independent test team at the developers'
site. Alpha testing is often employed for off-the-shelf software as a form of
internal acceptance testing, before the software goes to beta testing.

• Beta testing: beta testing comes after alpha testing. Versions of the
software, known as beta version, are released to a limited audience outside
of the programming team. The software is released to groups of people so
that further testing can ensure the product has few faults or bugs.
Sometimes, beta versions are made available to the open public to increase
the feedback field to a maximal number of future users.

• Gray box testing: Grey box testing is the combination of black box and
white box testing. Intention of this testing is to find out defects related to
bad design or bad implementation of the system. it is used for web
application.

Case 1: Login
Condition Action

Correct user id and correct password Accepted

Correct user id Incorrect Password Rejected

Incorrect user id Correct Password Rejected

Incorrect user id Incorrect Password Rejected

104
CHAPTER 7: USER INTERFACE

105
106
107
108
109
110
CHAPTER 8: LIMITATION AND FURTHER ENHANCEMENT

8.1 Limitation

• Only admin can create a new Member.


• User cannot print whole data only admin can.
• Members can change or create the records when access is granted by
admin.

8.2 Further Enhancement

This system is developed based upon the basics requirement so may there is some
limitation in development. But as per global requirement it may be enhanced to
following points in next release.

• Member can give orders online.


• Member can do online bidding.
• Data security can be enhanced.
• Reminder System can be enhanced.
• User Tracking.

111
CHAPTER 9: CONCLUSION

This website is basically used for keep data on related construction. This website
provides features that member can create Projects, Branches, Vendors, items, etc.
of construction. And also they can change the created records. This website is fast
and easy retrieval and to reduce the work and time. Use of this project would
make the website interactive.

112
CHAPTER 10: REFERENCES

Reference for PHP

http://www.w3schools.com/php/
http://www.w3schools.com/css/ http://www.php.net

113

You might also like