You are on page 1of 85

Visvesvaraya Technological University

Belagavi, Karnataka-590 018

A
MINI PROJECT REPORT
ON
“Vehicle Service Management System”
Submitted in partial fulfilment of the requirements for the DBMS Laboratory with mini project
(18CLS58) course of the 5th semester

BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE AND ENGINEERING

Submitted by,

SRIVATSA B R THEJAS I M
1JS20CS165 1JS20CS173
Under the guidance of
Mrs. K S Rajeshwari Mrs. Pooja H
Assistant Professor, Dept of CSE Assistant Professor, Dept of CSE
JSSATE, Bengaluru JSSATE, Bengaluru

JSS ACADEMY OF TECHNICAL EDUCATION, BENGALURU


Department of Computer Science and Engineering
2022-2023
JSS MAHAVIDHYAPEETHA, MYSURU

JSS Academy of Technical Education


JSS Campus, Uttrahalli Kengeri Main road, Bengaluru – 560060

Department of Computer Science and Engineering

CERTIFICATE
This is to certify that the mini-project work entitled "VEHICLE SERVICE
MANAGEMENT SYSTEM" is a Bonafide work carried out by Mr. SRIVATSA
BHARADWAJ R (1JS20CS165) and Mr. THEJAS I M (1JS20CS173) in partial
fulfillment for the Database Management Systems Laboratory with Mini Project
(18CSL58) of 5th semester Bachelor of Engineering in Computer Science and
Engineering of the Visvesvaraya Technological University, Belgaum during the academic
year 2022-2023. It is certified that all corrections and suggestions indicated for Internal
Assessment have been incorporated in the report deposited in the department library. The
project report has been approved as it satisfies the academic requirements in respect of
project work prescribed for the said degree.

Mrs. K S Rajeshwari Mrs. Pooja H Dr.n P B Mallikarjuna


Assistant Professor, Assistant Professor, Associate Professor and Head
Dept of CSE Dept of CSE Dept of CSE
JSSATE, Bengaluru JSSATE, Bengaluru JSSATE, Bengaluru

NAME OF THE EXAMINERS SIGNATURE WITH DATE

1)…………………………………….. ……………………………………..

2)…………………………………….. …………………………………….
ACKNOWLEDGEMENT
We express our humble pranamas to His Holiness Jagadguru Sri Sri Sri Shivarathri
Deshikendra Mahaswamiji who has showered their blessings on us for framing our career
successfully.

We express our sincere thanks to our beloved principal, Dr. Bhimasen Soragaon for having
supported us in our academic endeavors.

We are also indebted to Dr. P B Mallikarjuna, Head of Department of Computer Science


and Engineering for the facilities and support extended towards us.

We are thankful to the resourceful guidance, timely assistance and graceful gesture of our
guide Mrs. K S Rajeshwari, Assistant Professor, Department of Computer Science and
Engineering, and Mrs. Pooja H, Assistant Professor, Department of Computer Science and
Engineering, who has helped us in every aspect of our project work.

And last but not the least, we would be very pleased to express our heart full thanks to all the
teaching and non-teaching staff of CSE department and our friends who have rendered
their help, motivation and support.

The completion of any project involves the efforts of many people. We have been lucky
enough to have received a lot of help and support from all quarters during the making of this
project, so with gratitude, we take this opportunity to acknowledge all those who have given
guidance and encouragement thereby helping us emerge successfully.

SRIVATSA BHARADWAJ R
1JS20CS165

THEJAS I M
1JS20CS173
ABSTRACT
Owners of vehicles can avoid unforeseen vehicle problems by maintaining their vehicles
regularly. Early detection of vehicle concerns is crucial to preventing them from developing
into serious difficulties. Owners of vehicles frequently inquire about service at auto shops.
Vehicle technicians examine crucial parts of the vehicle and fix problems to make sure they
are in good condition and won't break down suddenly. The study was carried out by the
researchers to evaluate the everyday activities and transactions carried out in auto repair
facilities.
The researchers gathered preliminary data and discovered that the majority of auto repair
companies or garages still handle their daily transactions manually. Customer records are still
entered manually, as are transactions with clients, tracking of vehicle repairs as they are
made, updates on vehicle services, and billing. The functioning of the garage and the
response time to client inquiries will be slowed by the ongoing usage of manual procedures.

The researchers have identified a need to modernize how auto repair shops work. Customers
and vehicle garages will both profit from the system's installation. Utilizing the technology to
run the company will help vehicle garages expand and improve operational efficiency.
Customers may do business for vehicle service easily and comfortably.
TABLE OF CONTENTS
CHAPTER TITLE PAGE NO.
ACKNOWLEDGEMENT
ABSTRACT
TABLE OF CONTENTS
TABLE OF FIGURES
1 INTRODUCTION 1
DESIGN 3
2 2.1 ER DIAGRAM 5
2.2 RELATIONAL SCHEMA 8
SYSTEM REQUIREMENTS 10
3.1 FRONT END 10
3.2 BACK END 11
3 3.3 WEB SERVER 12
3.4 OPERATING SYSTEM 13
3.5 FUNCTIONAL AND NON-FUNCTIONAL REQ 13
3.6 CLASS DIAGRAM 28
IMPLEMENTATION 29
4.1 CODE SNIPPET 29
4.2 TABLE DESCRIPTION 33
4 4.3 COMMANDS 35
4.4 INSERTION OF TUPLES 37
4.5 QUERIES 39
4.6 TRIGGERS 45
RESULTS 48
5.1 FRONT END 48
5.1.1 CUSTOMER SIDE 48
5
5.1.2 ADMIN SIDE 51
5.1.3 STAFF LOGIN 70
5.2 BACK END 72
6 CONCLUSION 76
7 REFERENCES 79
LIST OF FIGURES
SL NO. FIG NO WITH TITLE PAGE NO
1 Fig 2.1: ER- Diagram 6
2 Fig 2.2: Relational Schema 8
3 Fig 3.1: Class diagram 28
4 Fig 5.1: Customer Side home page 48
5 Fig 5.2: Customer Side home page 48
6 Fig 5.3: Service request form 49
7 Fig 5.4: Filled request form 50
8 Fig 5.5: Prompt upon successful submission 50
9 Fig 5.6: Individual service details 51
10 Fig 5.7: Admin side features 51
11 Fig 5.8: Admin dashboard page 52
12 Fig 5.9: Editing the admin credentials 53
13 Fig 5.10: Mechanics list page 53
14 Fig 5.11: Mechanic details updating 54
15 Fig 5.12: List of mechanics 54
16 Fig 5.13: Creating new mechanics 55
17 Fig 5.14: Service request page 56
18 Fig 5.15: Viewing individual service request details 57
19 Fig 5.16: Updating status of service request 57
20 Fig 5.17: Assigning status of service request 58
21 Fig 5.18: Admin creating service request 59
22 Fig 5.19: Filtering service requests in report tab 60
23 Fig 5.20: Filtered service request in pdf format 61
24 Fig 5.21: Category list 61
25 Fig 5.22: Editing individual category info 62
26 Fig 5.23: Creating new info 63
27 Fig 5.24: List of services 64
28 Fig 5.25: Editing individual service-related info 65
29 Fig 5.26: Creating new service 66
30 Fig 5.27: List of staffs created by user 66
31 Fig 5.28: Editing individual staff related info 67
32 Fig 5.29: Creating new staff 68
33 Fig 5.30: System information maintenance 69
34 Fig 5.31: System information maintenance 69
35 Fig 5.32: Staff login page 70
36 Fig 5.33: Staff dashboard page 71
Fig 5.34: A view of database structure in
37 72
PhpMyAdmin (Back-End)
38 Fig 5.35: Structure of table named categories 73
39 Fig 5.36: Inserting new category in Front-End by admin 74
40 Fig 5.37: Updated category list in Front-End 74
Fig 5.38: Back-End Snapshot of table categories before
41 75
inserting new category in Front-End
Fig 5.39: Back-End Snapshot of table categories after
42 75
inserting new category in Front-End
Vehicle Service Management System

Chapter 1. INTRODUCTION
A database management system (DBMS) is a software application that allows users to create,
manage and maintain a database. It provides a way to store, organize and retrieve data in an
efficient and secure manner. A DBMS allows users to interact with the data using a specific
language called SQL (Structured Query Language) which enables them to perform tasks such
as inserting, updating, and retrieving data from the database. In summary, DBMS provides a
reliable and efficient way to store, manage and retrieve data, and it is widely used in various
industries like healthcare, finance, retail and more. It enables organizations to make data-
driven decisions, automate processes and improve the overall performance of their business
operations.

Vehicle service management system is a database project implemented using CSS,


JAVASCRIPT, (For frontend) & PHP and MySQL (For backend). It primarily deals with the
management of the vehicle service, users, admin, mechanics and other vehicle services. It is
designed as per the vehicle service management needs. There are a total of 7 tables.

A vehicle service management system is a software application that helps businesses manage
their fleet of vehicles. This can include scheduling maintenance, tracking repairs, and
monitoring fuel consumption. The system can also provide valuable insights into the overall
health of the fleet, helping businesses make informed decisions about their vehicle
operations.

The system can be used by a variety of businesses, including transportation companies,


delivery services, and government agencies. It can also be used by companies that have a
fleet of vehicles for internal use, such as maintenance or construction companies.

The system is designed to be easy to use and navigate, with a user-friendly interface that
allows users to quickly and easily access the information they need. It can also be customized
to meet the specific needs of each business, with options such as vehicle tracking, driver
behaviour monitoring, and automated reporting.

Existing vehicle service management systems typically include features such as scheduling
and appointment management, customer and vehicle information tracking, inventory and
parts management, and invoicing and billing. These systems may also include additional

Page | 1
JSSATEB – Dept of CSE
Vehicle Service Management System

features such as automated reminders for service and maintenance, and the ability to track
and analyse service and repair history.

Limitations of these systems may include a lack of integration with other systems, such as
accounting software, and limited reporting and data analysis capabilities. Additionally, these
systems may not be customizable to the specific needs of a particular business, and may not
be able to handle large volumes of data or transactions. Some older systems may be on-
premise with difficulty in scalability and remote access capability.

This project has a Public Module and Admin Module. The admin module is the side of the
project where the management manages all the data recorded/will be recorded on the system.
The admin can manage the list of vehicle categories that the shop handles and other important
and relative data for this project such as the mechanic list and service requests list. On the
admin side, this side can be managed by the 2 types of users which are the admin and the
staff whereas the staff user has only limited. On the public side, the clients can explore the
list of services does the company/shops provide. The client can submit their service request at
this side and the submitted request will be marked as pending. This simple project also
generates a date-wise printable service request report.

A vehicle service management system (VSMS) database typically stores information about a
company's fleet of vehicles, including details such as:

Vehicle identification (e.g., make, model, year, license plate number)

Maintenance schedules and history (e.g., oil changes, tire rotations, brake inspections)

Repair history (e.g., parts replaced, repairs performed, costs incurred)

A VSMS database can also include reports and analytics that provide insights into the overall
performance of the fleet, such as fuel efficiency, maintenance costs, and downtime. This
information can be used to identify trends, identify areas for improvement, and make data-
driven decisions about vehicle operations.

In summary, a VSMS database stores all the information related to the company's fleet, this
information can be useful to schedule maintenance, track repairs and monitor fuel
consumption, it also can provide valuable insights into the overall health of the fleet and help
businesses make informed decisions about their vehicle operations.

Page | 2
JSSATEB – Dept of CSE
Vehicle Service Management System

Chapter 2: DESIGN
Entity types:
An entity type is a category of objects or things represented in a database, where each
instance of the entity type is represented by a row in the table and defined by a
set of attributes

For example: in our database there exists an entity type ‘categories’

Entity set:
An entity set is a collection of all entities of a particular entity type in a database. It is
represented by a table in the database, where each row corresponds to an instance of the
entity type. An entity set can be thought of as a set of all entities of a specific type.

In our database there exists entity sets in the table categories like (1, 2 Wheeler, 1), (2, 3
Wheeler , 1), (3, 4 Wheeler, 1)

Attributes:
Attributes are characteristics or properties of an entity in a database. They are used to
describe the entity and are typically represented as columns in a table. Each attribute has a
name and a data type, such as text, numbers, date, etc. An attribute can be considered as a
descriptor of the entity.

In our database the table ‘categories’ contains attribute like (id, category, status,
date_created)

Types of Attributes:

single-valued Attributes:
Most attributes have a single value for a particular entity For eg:Age is a single-
valued attribute of a person
In our database all the attributes used are single-valued attributes
Multivalued Attributes:
An entity having multiple values for that attribute
For eg: color of a color color={black,red}
Person’s degree degree={BE, MTech, PhD}
In our database there are no multivalued attributes.

Page | 3
JSSATEB – Dept of CSE
Vehicle Service Management System

Stored and Derived attributes:


Two (or more) attribute values are related—for eg: the Age and Birth_date attributes
of a person
The value of Age can be determined from the current (today’s) date and the value of
that person’s Birth_date
The Age attribute is hence called a derived attribute
Birth_date attribute is called a stored attribute
NULL Value Attributes:
In some cases, a particular entity may not have an applicable value for an attribute.
For eg: the Apartment_number attribute of an address applies only to addresses that
are in apartment buildings and not to other types of residences, such as single-family
homes College_degrees attribute applies only to people with college degrees
Complex Attributes:
composite and multivalued attributes can be nested arbitrarily
arbitrary nesting by grouping components of a composite attribute between
parentheses ( ) and separating the components with commas, and by displaying
multivalued attributes between braces { }. Such attributes are called complex
attributes
For example, if a person can have more than one residence and each residence can
have a single address and multiple phones, an attribute Address_phone for a person

RELATIONSHIP TYPES
One-to-one: A relationship in which one record in a table is related to one and only one
record in another table.
In Fig 2.1 one service request can have only one category of vehicle
One-to-many: A relationship in which one record in a table is related to multiple records in
another table.
In Fig 2.1 one service request can have more than one service from the list of services
Many-to-many: A relationship in which multiple records in a table are related to multiple
records in another table.
In Fig 2.1 many customers can place many service requests
Self-referencing: A relationship in which a table is related to itself.

Page | 4
JSSATEB – Dept of CSE
Vehicle Service Management System

Hierarchical: A relationship in which one record in a table is related to one or more records
in the same table, creating a parent-child relationship.
Associative: A relationship in which two or more tables are related through an additional
table, also known as a join table or junction table.

Structural constraints:
Structural constraints are rules and limitations that are placed on the design and structure of a
database in order to maintain its integrity and consistency. These constraints are used to
define the relationships between tables and columns, and to ensure that data is entered and
stored in a consistent and predictable manner.
In Fig 2.1 we have a structural constraint on the table 'mechanics_list' with total participation
as participation constraint and cardinality ratio as 1 meaning only one mechanic can be
assigned for one service request.

Min Max Notation:


In an Entity-Relationship (ER) diagram, the "min" and "max" notation is used to indicate the
minimum and maximum cardinality of a relationship between two entities. Cardinality refers
to the number of instances of one entity that can be associated with each instance
of another entity.
In Fig 2.1 there exists a min max notation like (n,1) between 2 entity types 'service_requests'
and 'mechanics_list' joined by the relation 'request_meta' meaning many service_requests can
be handled by one mechanic.

Page | 5
JSSATEB – Dept of CSE
Vehicle Service Management System

2.1 ER-Diagram:

Fig 2.1: ER- Diagram

Page | 6
JSSATEB – Dept of CSE
Vehicle Service Management System

2.2 ER-to-Relational mapping:


Step 1: For each regular (strong) entity type E in the ER schema, create a relation R that
includes all the simple attributes of E.

Step 2: For each weak entity type W in the ER schema with owner entity type E, create a
relation R, and include all simple attributes (or simple components of composite attributes) of
W as attributes. In addition, include as foreign key attributes of R the primary key attribute(s)
of the relation(s) that correspond to the owner entity type(s).

Step 3: For each binary 1:1 relationship type R in the ER schema, identify the relations S
and T that correspond to the entity types participating in R. Choose one of the relations, say
S, and include the primary key of T as a foreign key in S. Include all the simple attributes of
R as attributes of S.

Step 4: For each regular binary 1:N relationship type R identify the relation (N) relation S.
the primary key of T as a foreign key of S. Simple attributes of R map to attributes of S.

Step 5: For each binary M:N relationship type R, create a relation S. Include the primary
keys of participant relations as foreign keys in S. Their combination will be the primary key
for S. Simple attributes of R become attributes of S.

Step 6: For each multi-valued attribute A, create a new relation R. This relation will
include an attribute corresponding to A, plus the primary key K of the parent relation (entity
type or relationship type) as a foreign key in R. The primary key of R is the combination of A
and K.

Step 7: For each n-ary relationship type R, where n>2, create a new relation S to represent
R. Include the primary keys of the relations participating in R as foreign keys in S. Simple
attributes of R map to attributes of S. The primary key of S is a combination of all the foreign
keys that reference the participants that have cardinality constraint > 1. For a recursive
relationship, we will need a new relation.

Page | 7
JSSATEB – Dept of CSE
Vehicle Service Management System

2.3 Relational Schema

Fig 2.2: Relational Schema

Page | 8
JSSATEB – Dept of CSE
Vehicle Service Management System

Primary keys:
‘categories’: ‘id’

‘mechanics_list’: ‘id’

‘request_meta’: ‘request_id’

‘service_list’: ‘id’

‘service_requests’: ‘id’

‘system_info’: ‘id’

‘users’: ‘id’

Foreign key:
'request_id' is a foreign key in 'request_meta' which references 'id' of the table
'service_requests'

‘service_type’ is a foreign key in ‘service_requests’ which references ‘service’ of the


table ‘service_list’

‘category_id’ is a foreign key in ‘service_requests’ which references ‘id’ of the table


‘categories’

‘mechanics_id’ is a foreign key in ‘service_requests’ which references ‘id’ of the


table ‘mechanics_list’

Page | 9
JSSATEB – Dept of CSE
Vehicle Service Management System

CHAPTER 3: SYSTEM REQUIREMENTS

3.1 Front End

HTML: HTML (Hypertext Markup Language) is the standard language used to


create web pages. It uses a system of tags and attributes to structure and format the
content of a webpage, including text, images, and links. HTML documents are viewed
in web browsers and are rendered into a visual representation of the page, which can
include text, images, videos, and interactive elements. HTML is the foundation of all
websites and is used in conjunction with other languages such as CSS and JavaScript
to create dynamic and interactive web pages.

CSS: CSS (Cascading Style Sheets) is a language used to control the presentation
and layout of HTML documents. It allows developers to separate the presentation of a
webpage from its structure and content, defined in HTML. With CSS, you can control
the colors, fonts, spacing, and overall layout of a webpage, as well as add visual
effects such as hover states, animations, and transitions. CSS can be written in
separate files or included in the same document as the HTML, and it can be applied to
individual elements or groups of elements on a webpage. It's a powerful tool that
allows developers to create visually appealing and consistent designs across multiple
web pages and devices.

JAVASCRIPT: JavaScript is a programming language that is primarily used to


create interactive front-end web applications and dynamic website content. It is a
scripting language that runs in web browsers and enables developers to create
interactive elements such as forms, animations, and other dynamic features.
JavaScript is also commonly used on the back-end, through technologies such as
Node.js, to create server-side applications. It is a widely-used and versatile language
that is supported by all modern web browsers and is easy to learn for both beginners
and experienced programmers.

jQuery: jQuery is a fast, small, and feature-rich JavaScript library. It makes HTML
document traversal and manipulation, event handling, and animation much simpler
with an easy-to-use API that works across a multitude of browsers. With a

Page | 10
JSSATEB – Dept of CSE
Vehicle Service Management System

combination of versatility and extensibility, jQuery has changed the way that millions
of people write JavaScript

Ajax: Ajax (short for Asynchronous JavaScript and XML) is a set of web
development techniques used for creating interactive and responsive web applications.
It allows for the creation of dynamic web pages without the need for a page refresh.
This is achieved by using JavaScript to make asynchronous requests to a server, and
updating only the relevant parts of the page with the new data. This allows for a
smoother, faster user experience and enables web developers to create more complex
and interactive applications. jQuery provides a convenient API for making Ajax
requests, which makes it easy to use in a web development project.

Bootstrap: Bootstrap is a free and open-source front-end development framework


that helps developers create responsive, mobile-first web pages and web applications.
It is a collection of HTML, CSS, and JavaScript components and tools that are
designed to be used in conjunction with the Bootstrap CSS framework. Bootstrap
provides a consistent, easy-to-use set of classes and styles that can be used to create
common web design elements such as forms, buttons, navigation bars, and more. It
also includes JavaScript plugins for common web development tasks such as creating
modals, carousels, and other interactive elements. One of the benefits of Bootstrap is
that it makes it easy to create responsive designs that look and function well on a wide
range of devices, from desktop computers to smartphones

3.2 Back End

PHP v8.0.7: dynamic and interactive websites. PHP is executed on the server, and
the results are sent to the browser as plain HTML. This allows PHP to handle tasks
such as reading and writing to files, sending and receiving cookies, and creating and
manipulating databases.

PHP can be integrated with a variety of web development technologies, including


HTML, CSS, and JavaScript. It is often used in conjunction with other web
development technologies such as MySQL (a popular open-source database

Page | 11
JSSATEB – Dept of CSE
Vehicle Service Management System

management system) to create dynamic and interactive web applications. PHP is also
often used for creating RESTful web services, that can be consumed by other systems.

PHP is widely supported by web hosting providers, making it easily accessible and
easy to run on a variety of platforms, including Windows, Linux, and MacOS. It's one
of the most popular server-side scripting language and has a large community support
and many frameworks built on top of it, like Laravel, CodeIgniter,
CakePHP and many more.

MySQL Database: MySQL is a popular open-source relational database


management system (RDBMS) that is used to store, organize, and retrieve data in a
structured manner. It is widely used in web applications to store and manage data
such as user information, website content, and other data.

MySQL uses a structured query language (SQL) to manage the data in the databases,
which allows for tasks such as creating tables, inserting and updating data, and
retrieving data based on specific criteria. MySQL supports various data types
including integers, floating-point numbers, strings and date and time, and it also
supports advanced features such as stored procedures, triggers, views, and indexes
which are used to optimize the performance of data retrieval.

MySQL can be used on a variety of platforms, including Windows, Linux, and


MacOS. It's widely supported by a large community and has a wide range of tools and
libraries for management, administration and monitoring. It's also known for its high
performance and scalability. It's often used in conjunction with other web
development technologies such as PHP to create dynamic and interactive
web applications.

3.3 Web Server

XAMPP v3.3.0: XAMPP is a free, open-source, and cross-platform web server


solution that allows developers to create and test web applications on their local
machines. XAMPP stands for Cross-Platform (X), Apache (A), MariaDB (M), PHP
(P) and Perl (P). It is a package of software components that includes Apache web
server, MariaDB (MySQL) database, PHP, and Perl programming languages. This

Page | 12
JSSATEB – Dept of CSE
Vehicle Service Management System

bundle allows developers to set up a local web server environment with the necessary
components to run PHP and MySQL-based web applications without the need for an
internet connection.

XAMPP is easy to install and use, and it is particularly popular among developers
working on WordPress, Joomla, and other PHP-based web applications. With
XAMPP, developers can test their code and see how it behaves on a live web server,
without having to upload it to a remote web server. This can save time and money,
and it also allows developers to work offline. my local webserver that has a PHP
Version 8.0.7:

3.4 Operating System

Minimum Windows 7

3.5 Functional and non-functional requirements


Functional requirements for a vehicle service management database system would include
capabilities such as:

Storing information about vehicles and their service history

Generating invoices

Providing real-time updates on service status and progress

Providing a customer portal for customers to check the status of their vehicle service, check
history, and schedule service appointments

Non-functional requirements for a vehicle service management database system would


include aspects such as:

Performance (e.g. speed of accessing and updating vehicle service information)

Scalability (e.g. ability to handle a large number of vehicles and customers)

Security (e.g. protecting sensitive customer and vehicle information from unauthorized
access)

Page | 13
JSSATEB – Dept of CSE
Vehicle Service Management System

Reliability (e.g. ability to recover from system failures and ensure data integrity)

Usability (e.g. ease of use for service staff and customers)

Compliance with regulations (e.g. data privacy and retention laws)

Methods used in back end (PHP) :

Below are some methods used in the backend of our database

function save_category(){
extract($_POST);
$data = "";
foreach($_POST as $k =>$v){
if(!in_array($k,array('id','description'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
if(isset($_POST['description'])){
if(!empty($data)) $data .=",";
$data .= " `description`='".addslashes(htmlentities($description))."' ";
}
$check = $this->conn->query("SELECT * FROM `categories` where `category` =
'{$category}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())
return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Category already exist.";
return json_encode($resp);
exit;
}
if(empty($id)){
$sql = "INSERT INTO `categories` set {$data} ";
$save = $this->conn->query($sql);
}else{

Page | 14
JSSATEB – Dept of CSE
Vehicle Service Management System

$sql = "UPDATE `categories` set {$data} where id = '{$id}' ";


$save = $this->conn->query($sql);
}
if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Category successfully
saved.");
else
$this->settings->set_flashdata('success',"Category successfully
updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}
return json_encode($resp);
}
function delete_category(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `categories` where id = '{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Category successfully deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);

}
function save_service(){
extract($_POST);
$data = "";
$_POST['description'] = addslashes(htmlentities($description));

Page | 15
JSSATEB – Dept of CSE
Vehicle Service Management System

foreach($_POST as $k =>$v){
if(!in_array($k,array('id'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
$check = $this->conn->query("SELECT * FROM `service_list` where `service` =
'{$service}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())
return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Service already exist.";
return json_encode($resp);
exit;
}
if(empty($id)){
$sql = "INSERT INTO `service_list` set {$data} ";
$save = $this->conn->query($sql);
}else{
$sql = "UPDATE `service_list` set {$data} where id = '{$id}' ";
$save = $this->conn->query($sql);
}
if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Service successfully
saved.");
else
$this->settings->set_flashdata('success',"Service successfully
updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}

Page | 16
JSSATEB – Dept of CSE
Vehicle Service Management System

return json_encode($resp);
}
function delete_service(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `service_list` where id =
'{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Service successfully deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);

}
function save_mechanic(){
extract($_POST);
$data = "";
foreach($_POST as $k =>$v){
if(!in_array($k,array('id'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
$check = $this->conn->query("SELECT * FROM `mechanics_list` where `name` =
'{$name}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())
return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Mechanic already exist.";
return json_encode($resp);
exit;

Page | 17
JSSATEB – Dept of CSE
Vehicle Service Management System

}
if(empty($id)){
$sql = "INSERT INTO `mechanics_list` set {$data} ";
$save = $this->conn->query($sql);
}else{
$sql = "UPDATE `mechanics_list` set {$data} where id = '{$id}' ";
$save = $this->conn->query($sql);
}
if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Mechanic successfully
saved.");
else
$this->settings->set_flashdata('success',"Mechanic successfully
updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}
return json_encode($resp);
}
function delete_mechanic(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `mechanics_list` where id = '{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Mechanic successfully deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);

Page | 18
JSSATEB – Dept of CSE
Vehicle Service Management System

}
function save_request(){
extract($_POST);
$data = "";
foreach($_POST as $k=> $v){

if(in_array($k,array('owner_name','category_id','service_type','mechanic_id','status'))){
if(!empty($data)){ $data .= ", "; }

$data .= " `{$k}` = '{$v}'";

}
}
if(empty($id)){
$sql = "INSERT INTO `service_requests` set {$data} ";
}else{
$sql = "UPDATE `service_requests` set {$data} where id ='{$id}' ";
}
$save = $this->conn->query($sql);
if($save){
$rid = empty($id) ? $this->conn->insert_id : $id ;
$data = "";
foreach($_POST as $k=> $v){
if(!in_array($k,array('id','owner_name','category_id','service_type','mechanic_id','stat
us'))){
if(!empty($data)){ $data .= ", "; }
if(is_array($_POST[$k]))
$v = implode(",",$_POST[$k]);
$v = $this->conn->real_escape_string($v);
$data .= "('{$rid}','{$k}','{$v}')";
}
}
$sql = "INSERT INTO `request_meta`
(`request_id`,`meta_field`,`meta_value`) VALUES {$data} ";

Page | 19
JSSATEB – Dept of CSE
Vehicle Service Management System

$this->conn->query("DELETE FROM `request_meta` where `request_id` =


'{$rid}' ");
$save = $this->conn->query($sql);
if($save){
$resp['status'] = 'success';
$resp['id'] = $rid;
}else{
$resp['status'] = 'failed';
$resp['msg'] = $this->conn->error;
$resp['sql'] = $sql;
}
}else{
$resp['status'] = 'failed';
$resp['msg'] = $this->conn->error;
$resp['sql'] = $sql;
}
return json_encode($resp);
}
function delete_request(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `service_requests` where id = '{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Request successfully
deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);

}
}function save_category(){
extract($_POST);

Page | 20
JSSATEB – Dept of CSE
Vehicle Service Management System

$data = "";
foreach($_POST as $k =>$v){
if(!in_array($k,array('id','description'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
if(isset($_POST['description'])){
if(!empty($data)) $data .=",";
$data .= " `description`='".addslashes(htmlentities($description))."' ";
}
$check = $this->conn->query("SELECT * FROM `categories` where `category` =
'{$category}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())
return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Category already exist.";
return json_encode($resp);
exit;
}
if(empty($id)){
$sql = "INSERT INTO `categories` set {$data} ";
$save = $this->conn->query($sql);
}else{
$sql = "UPDATE `categories` set {$data} where id = '{$id}' ";
$save = $this->conn->query($sql);
}
if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Category successfully
saved.");
else

Page | 21
JSSATEB – Dept of CSE
Vehicle Service Management System

$this->settings->set_flashdata('success',"Category
successfully updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}
return json_encode($resp);
}
function delete_category(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `categories` where id = '{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Category successfully
deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);

}
function save_service(){
extract($_POST);
$data = "";
$_POST['description'] = addslashes(htmlentities($description));
foreach($_POST as $k =>$v){
if(!in_array($k,array('id'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
$check = $this->conn->query("SELECT * FROM `service_list` where `service` =
'{$service}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())

Page | 22
JSSATEB – Dept of CSE
Vehicle Service Management System

return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Service already exist.";
return json_encode($resp);
exit;
}
if(empty($id)){
$sql = "INSERT INTO `service_list` set {$data} ";
$save = $this->conn->query($sql);
}else{
$sql = "UPDATE `service_list` set {$data} where id = '{$id}' ";
$save = $this->conn->query($sql);
}
if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Service successfully
saved.");
else
$this->settings->set_flashdata('success',"Service successfully
updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}
return json_encode($resp);
}
function delete_service(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `service_list` where id =
'{$id}'");
if($del){
$resp['status'] = 'success';

Page | 23
JSSATEB – Dept of CSE
Vehicle Service Management System

$this->settings->set_flashdata('success',"Service successfully
deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);
}
function save_mechanic(){
extract($_POST);
$data = "";
foreach($_POST as $k =>$v){
if(!in_array($k,array('id'))){
if(!empty($data)) $data .=",";
$data .= " `{$k}`='{$v}' ";
}
}
$check = $this->conn->query("SELECT * FROM `mechanics_list` where `name` =
'{$name}' ".(!empty($id) ? " and id != {$id} " : "")." ")->num_rows;
if($this->capture_err())
return $this->capture_err();
if($check > 0){
$resp['status'] = 'failed';
$resp['msg'] = "Mechanic already exist.";
return json_encode($resp);
exit;
}
if(empty($id)){
$sql = "INSERT INTO `mechanics_list` set {$data} ";
$save = $this->conn->query($sql);
}else{
$sql = "UPDATE `mechanics_list` set {$data} where id = '{$id}' ";
$save = $this->conn->query($sql);
}

Page | 24
JSSATEB – Dept of CSE
Vehicle Service Management System

if($save){
$resp['status'] = 'success';
if(empty($id))
$this->settings->set_flashdata('success',"New Mechanic successfully
saved.");
else
$this->settings->set_flashdata('success',"Mechanic successfully
updated.");
}else{
$resp['status'] = 'failed';
$resp['err'] = $this->conn->error."[{$sql}]";
}
return json_encode($resp);
}
function delete_mechanic(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `mechanics_list` where id =
'{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Mechanic
successfully deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);
}
function save_request(){
extract($_POST);
$data = "";
foreach($_POST as $k=> $v){
if(in_array($k,array('owner_name','category_id','service_type','mechanic_id','status'))){
if(!empty($data)){ $data .= ", "; }
$data .= " `{$k}` = '{$v}'";

Page | 25
JSSATEB – Dept of CSE
Vehicle Service Management System

}
}
if(empty($id)){
$sql = "INSERT INTO `service_requests` set {$data} ";
}else{
$sql = "UPDATE `service_requests` set {$data} where id ='{$id}' ";
}
$save = $this->conn->query($sql);
if($save){
$rid = empty($id) ? $this->conn->insert_id : $id ;
$data = "";
foreach($_POST as $k=> $v){
if(!in_array($k,array('id','owner_name','category_id','service_type','mechanic_id','stat
us'))){
if(!empty($data)){ $data .= ", "; }
if(is_array($_POST[$k]))
$v = implode(",",$_POST[$k]);
$v = $this->conn->real_escape_string($v);
$data .= "('{$rid}','{$k}','{$v}')";
}
}
$sql = "INSERT INTO `request_meta`
(`request_id`,`meta_field`,`meta_value`) VALUES {$data} ";
$this->conn->query("DELETE FROM `request_meta` where `request_id` =
'{$rid}' ");
$save = $this->conn->query($sql);
if($save){
$resp['status'] = 'success';
$resp['id'] = $rid;
}else{
$resp['status'] = 'failed';
$resp['msg'] = $this->conn->error;
$resp['sql'] = $sql;
}
}else{

Page | 26
JSSATEB – Dept of CSE
Vehicle Service Management System

$resp['status'] = 'failed';
$resp['msg'] = $this->conn->error;
$resp['sql'] = $sql;
}
return json_encode($resp);
}
function delete_request(){
extract($_POST);
$del = $this->conn->query("DELETE FROM `service_requests`
where id = '{$id}'");
if($del){
$resp['status'] = 'success';
$this->settings->set_flashdata('success',"Request
successfully deleted.");
}else{
$resp['status'] = 'failed';
$resp['error'] = $this->conn->error;
}
return json_encode($resp);
}
}

Page | 27
JSSATEB – Dept of CSE
Vehicle Service Management System

3.6 CLASS DIAGRAM

Fig 3.1 Class diagram

A class diagram is a type of diagram in software engineering that describes the structure of a
system by showing the classes, attributes, and relationships between them. The Fig 3.1
describes a class diagram for our database system.

The class diagram has six classes: categories, mechanics_list, request_meta, service_list,
service_requests, and users. Each class has a set of attributes, such as id, name, and status,
and a primary key.

Additionally, there are several foreign key relationships between the classes. For example,
the request_id attribute in the request_meta class is a foreign key that references the id
attribute in the service_requests class. Similarly, the service_type attribute in the
service_requests class is a foreign key that references the service attribute in the service_list
class.

Page | 28
JSSATEB – Dept of CSE
Vehicle Service Management System

CHAPTER 4: IMPLEMENTATION

4.1 CODE SNIPPET

HOME PAGE CODE SNIPPET


<!--Header-->
<header class="bg-dark py-5" id="main-header">
<div class="container h-100 d-flex align-items-end justify-content-center w-100">
<div class="text-center text-white w-100">
<h1 class="display-4 fw-bolder"><?php echo $_settings->info('name') ?></h1>
<p class="lead fw-normal text-white-50 mb-0">We will take care of your vehicle</p>
<div class="col-auto mt-2">
<button class="btn btn-primary btn-lg rounded-0" id="send_request" type="button">Send
Service Request</button>
</div>
</div>
</div>
</header>
<!-- Section-->
<section class="py-5">
<div class="container px-4 px-lg-5 mt-5">
<div class="row">
<div class="col-md-4">
<h3 class="text-center">We Do Service For:</h3>
<hr class="bg-primary opacity-100">
<ul class="list-group">
<?php
$category = $conn->query("SELECT * FROM `categories` where status = 1 order by
`category` asc");
while($row=$category->fetch_assoc()):
?>
<li class="list-group-item"><b><?php echo $row['category'] ?></b></li>
<?php endwhile; ?>
</ul>

Page | 29
JSSATEB – Dept of CSE
Vehicle Service Management System

</div>

SEND REQUEST CODE SNIPPET


<div class="form-group">
<label for="owner_name" class="control-label">Owner Fullname</label>
<input type="text" name="owner_name" id="owner_name" class="form-control form-
control-sm rounded-0" required>
</div>
<div class="form-group">
<label for="contact" class="control-label">Owner Contact #</label>
<input type="text" name="contact" id="contact" class="form-control form-control-sm
rounded-0" required>
</div>
<div class="form-group">
<label for="email" class="control-label">Owner Email</label>
<input type="email" name="email" id="email" class="form-control form-control-sm
rounded-0" required>
</div>
<div class="form-group">
<label for="address" class="control-label">Address</label>
<textarea rows="3" name="address" id="address" class="form-control form-control-sm
rounded-0" style="resize:none" required></textarea>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="vehicle_name" class="control-label">Vehicle Name</label>
<input type="text" name="vehicle_name" id="vehicle_name" class="form-control form-
control-sm rounded-0" required>
</div>
<div class="form-group">
<label for="vehicle_registration_number" class="control-label">Vehicle Registration
Number</label>
<input type="text" name="vehicle_registration_number"
id="vehicle_registration_number" class="form-control form-control-sm rounded-0" required>
</div>
<div class="form-group">

Page | 30
JSSATEB – Dept of CSE
Vehicle Service Management System

<label for="vehicle_model" class="control-label">Vehicle Model</label>


<input type="text" name="vehicle_model" id="vehicle_model" class="form-control
form-control-sm rounded-0" required>
</div>
<div class="form-group">
<label for="service_id" class="control-label">Services</label>
<select name="service_id[]" id="service_id" class="form-select form-select-sm select2
rounded-0" multiple required>
<option disabled></option>
<?php
$service = $conn->query("SELECT * FROM `service_list` where status = 1 order by
`service` asc");
while($row = $service->fetch_assoc()):
?>
<option value="<?php echo $row['id'] ?>"><?php echo $row['service'] ?></option>
<?php endwhile; ?>
</select>
</div>

SUCCESS MESSAGE CODE SNIPPET


<div class="container-fluid">
<p>Your Request was submitted successfully. The management will contact you as soon
as they sees your request. Thank you!</p>
<div class="w-100 d-flex justify-content-end mx-2">
<div class="col-auto">
<button class="btn btn-dark btn-sm rounded-0" type="button" data-
dismiss="modal">Close</button>
</div>
</div>
</div>

VIEW REQUEST CODE SNIPPET


<div class="container-fluid">
<div class="row">

Page | 31
JSSATEB – Dept of CSE
Vehicle Service Management System

<div class="col-sm-6">
<dl>
<dt><b>Vehicle Type</b></dt>
<dd class="pl-2"><?php echo $category ?></dd>
<dt><b>Owner Name</b></dt>
<dd class="pl-2"><?php echo $owner_name ?></dd>
<dt><b>Owner Contact</b></dt>
<dd class="pl-2"><?php echo $contact ?></dd>
<dt><b>Owner Email</b></dt>
<dd class="pl-2"><?php echo $email ?></dd>
<dt><b>Owner Address</b></dt>
<dd class="pl-2"><?php echo $address ?></dd>
<dt><b>Request Type</b></dt>
<dd class="pl-2"><?php echo $service_type ?></dd>
<dt><b>Status</b></dt>
<dd class="pl-2">
<?php if($status == 1): ?>
<span class="badge badge-primary">Confirmed</span>
<?php elseif($status == 2): ?>
<span class="badge badge-warning">On-progress</span>
<?php elseif($status == 3): ?>
<span class="badge badge-success">Done</span>
<?php elseif($status == 4): ?>
<span class="badge badge-danger">Cancelled</span>
<?php else: ?>
<span class="badge badge-secondary">Pending</span>
<?php endif; ?>
</dd>
</dl>
</div>

Page | 32
JSSATEB – Dept of CSE
Vehicle Service Management System

REPORT GENERATION CODE SNIPPET


<?php
$i = 1;
$mechanic = $conn->query("SELECT * FROM mechanics_list");
$result = $mechanic->fetch_all(MYSQLI_ASSOC);
$mech_arr = array_column($result,'name','id');
$where = "where date(date_created) between '{$date_start}' and '{$date_end}'";
$qry = $conn->query("SELECT * from service_requests {$where} order by
unix_timestamp(date_created) desc");
while($row = $qry->fetch_assoc()):
$meta = $conn->query("SELECT * FROM request_meta where request_id =
'{$row['id']}'");
while($mrow = $meta->fetch_assoc()){
$row[$mrow['meta_field']] =$mrow['meta_value'];
}
$services = $conn->query("SELECT * FROM service_list where id in
({$row['service_id']}) ");
while($srow = $services->fetch_assoc()):
?>

4.2 Table descriptions


Table name:
categories

Page | 33
JSSATEB – Dept of CSE
Vehicle Service Management System

mechanics_list

request_meta

service_list

service_requests

Page | 34
JSSATEB – Dept of CSE
Vehicle Service Management System

system_info

users

4.3 Commands
-- Indexes for table `categories`
ALTER TABLE `categories` ADD PRIMARY KEY (`id`);

-- Indexes for table `mechanics_list`

ALTER TABLE `mechanics_list` ADD PRIMARY KEY (`id`);

-- Indexes for table `request_meta`

ALTER TABLE `request_meta` ADD KEY `request_id` (`request_id`);

-- Indexes for table `service_list`

ALTER TABLE `service_list` ADD PRIMARY KEY (`id`);

-- Indexes for table `service_requests`

Page | 35
JSSATEB – Dept of CSE
Vehicle Service Management System

ALTER TABLE `service_requests` ADD PRIMARY KEY (`id`);

-- Indexes for table `system_info`

ALTER TABLE `system_info` ADD PRIMARY KEY (`id`);

-- Indexes for table `users`

ALTER TABLE `users` ADD PRIMARY KEY (`id`);

-- AUTO_INCREMENT for table `categories`

ALTER TABLE `categories`

MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

-- AUTO_INCREMENT for table `mechanics_list`

ALTER TABLE `mechanics_list`

MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

-- AUTO_INCREMENT for table `service_list`

ALTER TABLE `service_list`

MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

-- AUTO_INCREMENT for table `service_requests`

ALTER TABLE `service_requests`

MODIFY `id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

-- AUTO_INCREMENT for table `system_info`

ALTER TABLE `system_info`

MODIFY `id` int(30) NOT NULL AUTO_INCREMENT,


AUTO_INCREMENT=15;

-- AUTO_INCREMENT for table `users`

ALTER TABLE `users`

MODIFY `id` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

Page | 36
JSSATEB – Dept of CSE
Vehicle Service Management System

-- Constraints for table `request_meta`

ALTER TABLE `request_meta`

ADD CONSTRAINT `request_meta_ibfk_1`


FOREIGN KEY (`request_id`) REFERENCES `service_requests` (`id`)
ON DELETE CASCADE ON UPDATE NO ACTION;

-- Constraints for table ‘service_requests’

ALTER TABLE `service_requests` ADD CONSTRAINT `MY_CONSTRAINT` FOREIGN


KEY (`mechanic_id`) REFERENCES `mechanics_list` (`id`) ON DELETE CASCADE ON
UPDATE NO ACTION;

ALTER TABLE `service_requests` ADD FOREIGN KEY (`category_id`) REFERENCES


`categories`(`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

ALTER TABLE `service_requests` ADD FOREIGN KEY (`service_type`) REFERENCES


`service_list`(`service`) ON DELETE CASCADE ON UPDATE NO ACTION;

4.4 Insertion of tuples


INSERT INTO `categories` (`id`, `category`, `status`, `date_created`)

VALUES (1, '2 Wheeler Vehicle', 1, '2021-09-30 09:42:40'),

(2, '3 Wheeler Vehicle', 1, '2021-09-30 09:43:00'),

(3, '4 Wheeler Vehicle', 1, '2021-09-30 09:43:48');

INSERT INTO `mechanics_list` (`id`, `name`, `contact`, `email`, `status`, `date_created`)


VALUES (1, 'John Smith', '09123456789', 'jsmith@sample.com', 1, '2021-09-30 10:26:11'),

(2, 'George Wilson', '09112355799', 'gwilson@gmail.com', 1, '2021-09-30 10:30:58');

INSERT INTO `request_meta` (`request_id`, `meta_field`, `meta_value`)

VALUES (1, 'contact', '09112355799'), (1, 'email', 'jsmith@sample.com'),

Page | 37
JSSATEB – Dept of CSE
Vehicle Service Management System

(1, 'address', 'Sample Address'),

(1, 'vehicle_name', 'Mitsubishi Montero Sport'),

(1, 'vehicle_registration_number', 'GBN 0623'),

(1, 'vehicle_model', 'CDM-10140715'),

(1, 'service_id', '1,3,4'),

(1, 'pickup_address', 'Here St., There City, Sample Only 623');

INSERT INTO `service_list` (`id`, `service`, `description`, `status`, `date_created`)

VALUES (1, 'Change Oil', 'During an oil change, the mechanic first drains it to change your
oil filter. Then, once a new filter is installed, they replace the oil in line with your
manufacturers recommendations. ', 1, '2021-09-30 14:11:21'),

(2, 'Overall Checkup', 'Engine inspection involves finding the specific symptom that the
engine gets knocking situation. Engine inspection is mainly meant for examining the overall
condition of the engine along with the parts. The main goal of engine inspection is to check
the critical components for any kind of wear and tear.', 1, '2021-09-30 14:11:38'),

(3, 'Engine Tune up', 'Today, engine tune-ups include checking, diagnosing, and replacing
bad spark plugs, spark plug wires, distributor caps, fuel filters, air filters, and oil filters. Tune-
ups can also include checking emission levels, fuel lines, wiring, coolant hoses, and
serpentine belts.', 1, '2021-09-30 14:12:03'),

(4, 'Tire Replacement', 'Step One: Get Safe. Before you exit your vehicle, you need to pull
over or find a place away from the rush of traffic on the road. ...

Step Two: Grab Your Tools. ...

Step Three: Loosen and Lift. ...

Step Four: Change the Tire. ...

Step Five: Lower and Tighten.', 1, '2021-09-30 14:12:24');

INSERT INTO `service_requests` (`id`, `owner_name`, `category_id`, `service_type`,


`mechanic_id`, `status`, `date_created`)

Page | 38
JSSATEB – Dept of CSE
Vehicle Service Management System

VALUES (1, 'Mike Williams', 3, 'Pick Up', 1, 2, '2021-09-30 14:48:57');

INSERT INTO `system_info` (`id`, `meta_field`, `meta_value`)

VALUES (1, 'name', 'Vehicle Service Management System'),

(6, 'short_name', 'VSMS'),

(11, 'logo', 'uploads/wall.jpg'),

(13, 'user_avatar', 'uploads/user_avatar.jpg'),

(14, 'cover', 'uploads/wall.jpg');

INSERT INTO `users` (`id`, `firstname`, `lastname`, `username`, `password`, `avatar`,


`last_login`, `type`, `date_added`, `date_updated`)

VALUES (1, 'Adminstrator', 'Admin', 'admin', '0192023a7bbd73250516f069df18b500',


'uploads/1624240500_avatar.png', NULL, 1, '2021-01-20 14:02:37', '2021-06-21 09:55:07'),

(6, 'Claire', 'Blake', 'cblake', 'cd74fae0a3adf459f73bbf187607ccea',


'uploads/1632990840_ava.jpg', NULL, 2, '2021-09-30 16:34:02', '2021-09-30 16:35:26');

4.5 Queries
The below mentioned queries are all embedded in the PHP scripting language in our database

 $category = $conn->query("SELECT * FROM `categories` where status = 1 order


by `category` asc");
this query fetches all the tuples of the table categories which are currently active
(denoted by status =1) sorted by category name in ascending order
 $services = $conn->query("SELECT * FROM `service_list` where status = 1
order by `service`");
this query fetches all the tuples of the table service_list which are currently active
(denoted by status = 1) sorted by service name
 $qry = $conn->query("SELECT * FROM `service_list` where id =
'{$_GET['id']}'");
Page | 39
JSSATEB – Dept of CSE
Vehicle Service Management System

This query fetches all the tuples from the table ‘service_list’ which is
corresponding to the input id given by the user
 $qry = $conn->query("SELECT * from `categories` where id = '{$_GET['id']}' ");
This query fetches all the tuples from the table ‘categories’ which is
corresponding to the input id given by the user
 $qry = $conn->query("SELECT * from `mechanics_list` order by (`name`) asc ");
This query fetches all the tuples from mechanics_list and sort according to name
in ascending order
 $qry = $conn->query("SELECT * from `mechanics_list` where id =
'{$_GET['id']}' ");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "mechanics_list" where the "id" column matches the value of
the "id" parameter in the $_GET superglobal array.
 $mechanic = $conn->query("SELECT * FROM mechanics_list");
This query fetches all the tuples from table mechanics_list
 $where = "where date(date_created) between '{$date_start}' and '{$date_end}'";
$qry = $conn->query("SELECT * from service_requests {$where} order by
unix_timestamp(date_created) desc");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "service_requests" with a where clause that filters the results
based on the "date_created" column. The where clause is constructed using the
$date_start and $date_end variables, which are used to specify a date range. The
results are ordered by the "date_created" column in descending order using the
unix_timestamp function.
 $meta = $conn->query("SELECT * FROM request_meta where request_id =
'{$row['id']}'");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "request_meta" where the "request_id" column matches the
"id" column of the current row of a results set.
 $services = $conn->query("SELECT * FROM service_list where id in
({$row['service_id']}) ");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "service_list" where the "id" column matches the values of the

Page | 40
JSSATEB – Dept of CSE
Vehicle Service Management System

"service_id" column of the current row of a results set. The IN operator is used to
match multiple values in the query.
 $sids = $conn->query("SELECT meta_value FROM request_meta where
request_id = '{$row['id']}' and meta_field = 'service_id'")-
>fetch_assoc()['meta_value'];
$services = $conn->query("SELECT * FROM service_list where id
in ({$sids}) ");
The first query is a SELECT statement that retrieves the "meta_value" column
from the "request_meta" table where the "request_id" column matches the "id"
column of the current row of a results set, and the "meta_field" column is equal to
"service_id" The second query is a SELECT statement that retrieves all columns
from the "service_list" table where the "id" column matches the values in the
variable $sids, using the IN operator.
 $qry = $conn->query("SELECT s.*,c.category FROM `service_requests` s inner
join `categories` c where s.id = '{$_GET['id']}' ");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "service_requests" as s and "categories" as c using an inner
join, where the "id" column of the service_requests table matches the value of the
"id" parameter in the $_GET superglobal array.
 $meta = $conn->query("SELECT * FROM `request_meta` where
request_id = '{$id}'");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "request_meta" where the "request_id" column matches the
variable $id.
 $services = $conn->query("SELECT * FROM service_list where id in
({$service_id}) ");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "service_list" where the "id" column matches the values of the
variable $service_id. The IN operator is used to match multiple values in the
query.
 $user = $conn->query("SELECT * FROM users where id ='".$_settings-
>userdata('id')."'");

Page | 41
JSSATEB – Dept of CSE
Vehicle Service Management System

The query being executed is a SELECT statement that is retrieving all columns
from a table called "users" where the "id" column matches the value of the "id"
property of the object returned by the $_settings->userdata() method
 $qry = $conn->query("SELECT *,concat(firstname,' ',lastname) as name from
`users` where id != '1' and id != '{$_settings->userdata('id')}' and `type` != 3 order
by concat(firstname,' ',lastname) asc ");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "users", a new column 'name' is created by concatenating the
firstname and lastname fields and displaying it as 'name' and it has a where clause
to filter the results. the clause filters the results by excluding the rows where the
"id" column is equal to 1 or the value of the "id" property of the object returned by
the $_settings->userdata() method, and where "type" column is not equal to 3.
Also, the results are ordered by the 'name' column in ascending order.
 $user = $conn->query("SELECT * FROM users where id ='{$_GET['id']}'");
The query being executed is a SELECT statement that is retrieving all columns
from a table called "users" where the "id" column matches the value of the "id"
parameter in the $_GET superglobal array.
 $inv = $conn->query("SELECT count(id) as total FROM categories ")-
>fetch_assoc()['total'];
The query being executed is a SELECT statement that is retrieving a count of all
the rows from a table called "categories" and returning it as a column named
"total". Then the fetch_assoc() method is used to return the result as an associative
array and the value of the total is saved into variable $inv.
 $mechanics = $conn->query("SELECT count(id) as total FROM `mechanics_list`
where status = '1' ");
The query being executed is a SELECT statement that is retrieving a count of all
the rows from a table called "mechanics_list" where the status column is equal to
1, and returning it as a column named "total".
 $services = $conn->query("SELECT count(id) as total FROM `service_list`
where status = 1 ");
The query being executed is a SELECT statement that is retrieving a count of all
the rows from a table called "service_list" where the status column is equal to 1,
and returning it as a column named "total".

Page | 42
JSSATEB – Dept of CSE
Vehicle Service Management System

 $services = $conn->query("SELECT sum(id) as total FROM `service_requests`


where status = 3 ");
The query being executed is a SELECT statement that is calculating the sum of all
the rows from a table called "service_requests" where the status column is equal
to 3, and returning it as a column named "total".
 $chk = $this->conn->query("SELECT * FROM `users` where username
='{$username}' ".($id>0? " and id!= '{$id}' " : ""));
The query is being executed using the "query" method of an object stored in the
"$conn" variable, and the result of the query is being stored in the "$chk" variable.

 $qry = $this->conn->query("INSERT INTO users set {$data}");


The query is being executed using the "query" method of an object stored in the
"$conn" variable, and the result of the query is being stored in the "$qry" variable.
 $qry = $this->conn->query("UPDATE users set $data where id = {$id}");
The query is using the "UPDATE" SQL command to update the table with the
data in the "$data" variable and filtering the row to update with the "where"
clause. The query is being executed using the "query" method of an object stored
in the "$conn" variable, and the result of the query is being stored in the "$qry"
variable.
 UPDATE users set $data where id = {$id}
The statement uses the "UPDATE" SQL command to update the table with the
data in the "$data" variable and filtering the row to update with the "where"
clause.
 $qry = $this->conn->query("DELETE FROM users where id = $id");
The query is using the "DELETE" SQL command to delete the row from the table
and filtering the row to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable,
and the result of the query is being stored in the "$qry" variable.
 $qry = $this->conn->query("UPDATE system_info set meta_value = '{$value}'
where meta_field = '{$key}' ");
The query is using the "UPDATE" SQL command to update the table with the
new value in the "meta_value" column, and filtering the row to update with the

Page | 43
JSSATEB – Dept of CSE
Vehicle Service Management System

"where" clause. The query is being executed using the "query" method of an
object stored in the "$conn" variable, and the result of the query is being stored in
the "$qry" variable.
 $qry = $this->conn->query("INSERT into system_info set meta_value =
'{$value}', meta_field = '{$key}' ");
The query is using the "INSERT INTO" SQL command to insert the new row into
the table. The query is being executed using the "query" method of an object
stored in the "$conn" variable, and the result of the query is being stored in the
"$qry" variable.

 $qry = $this->conn->query("SELECT * from users where username = '$username'


and password = md5('$password') ");
The query is using the "SELECT" SQL command to retrieve the rows that match
the conditions, and the "MD5()" function to hash the password before comparing
it to the hashed password stored in the database. The query is being executed
using the "query" method of an object stored in the "$conn" variable, and the
result of the query is being stored in the "$qry" variable.
 $del = $this->conn->query("DELETE FROM `categories` where id = '{$id}'");
The query is using the "DELETE" SQL command to delete the row from the table
and filtering the row to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable,
and the result of the query is being stored in the "$del" variable.
 $del = $this->conn->query("DELETE FROM `service_list` where id = '{$id}'");
The query is using the "DELETE" SQL command to delete the row from the table
and filtering the row to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable,
and the result of the query is being stored in the "$del" variable.
 $sql = "UPDATE `mechanics_list` set {$data} where id = '{$id}' ";
The query uses the "UPDATE" SQL command to update the table with the data in
the "$data" variable and filtering the row to update with the "where" clause. This
query is not executed yet, you need to use a method such as "query" or "prepare"
of a database connection object to execute this query and make changes in the
table. It is important to note that this statement should be written with the

Page | 44
JSSATEB – Dept of CSE
Vehicle Service Management System

appropriate syntax and using prepared statements to avoid security issues like
SQL Injection.
 $del = $this->conn->query("DELETE FROM `mechanics_list` where
id = '{$id}'");
The query is using the "DELETE" SQL command to delete the row from the table
and filtering the row to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable,
and the result of the query is being stored in the "$del" variable.

 $this->conn->query("DELETE FROM `request_meta` where


`request_id` = '{$rid}' ");
The query is using the "DELETE" SQL command to delete the rows from the
table and filtering the rows to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable.
 $del = $this->conn->query("DELETE FROM `service_requests` where
id = '{$id}'");
The query is using the "DELETE" SQL command to delete the row from the table
and filtering the row to delete with the "where" clause. The query is being
executed using the "query" method of an object stored in the "$conn" variable,
and the result of the query is being stored in the "$del" variable.
 $sql = "UPDATE `categories` set {$data} where id = '{$id}' ";
The query uses the MySQL syntax, but the same concept applies in other SQL
dialects.
 $sql = "UPDATE `service_list` set {$data} where id = '{$id}' ";
This is a SQL query that updates a row in a table called "service_list" with new
data. The specific columns and values to be updated are determined by the
variable $data, and the row to be updated is specified by the value of the variable
$id in the "id" column. The query uses single quotes around the values of
variables $id and $data.

Page | 45
JSSATEB – Dept of CSE
Vehicle Service Management System

4.6 TRIGGERS

CREATE TRIGGER check_unique_name

BEFORE INSERT OR UPDATE ON mechanics_list

FOR EACH ROW

BEGIN

DECLARE duplicate_mechanic INTEGER;

SET duplicate_mechanic = (SELECT COUNT(*) FROM mechanics_list WHERE name =


NEW.name);

IF (duplicate_mechanic > 0) THEN

SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Duplicate mechanic name is not


allowed';

END IF;

END;

a trigger named "check_unique_name" is being created on the "mechanics_list" table, that


will execute "BEFORE INSERT OR UPDATE" on the table. It will execute the following
instructions for each row of the table: Declare a variable "duplicate_mechanic" of type
INTEGER Set the value of "duplicate_mechanic" to the count of rows in the "mechanics_list"
table where the "name" column is equal to the "name" column of the new row being inserted
or updated. If the value of "duplicate_mechanic" is greater than 0, then it will raise an error
with the SQLSTATE '45000' and the message 'Duplicate mechanic name is not allowed'. This
trigger will prevent the insertion or update of a row in the "mechanics_list" table if the name
column already exists in the table.

Page | 46
JSSATEB – Dept of CSE
Vehicle Service Management System

CREATE TRIGGER check_duplicate_user_name

BEFORE INSERT OR UPDATE ON users

FOR EACH ROW

BEGIN

DECLARE duplicate_username INTEGER;

SET duplicate_username = (SELECT COUNT(*) FROM users WHERE username =


NEW.username);

IF (duplicate_username > 0) THEN

SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Duplicate user name is not


allowed';

END IF;

END

a trigger named "check_duplicate_user_name" is being created on the "users" table, that will
execute "BEFORE INSERT OR UPDATE" on the table. It will execute the following
instructions for each row of the table: Declare a variable "duplicate_username" of type
INTEGER Set the value of "duplicate_username" to the count of rows in the "users" table
where the "username" column is equal to the "username" column of the new row being
inserted or updated. If the value of "duplicate_username" is greater than 0, then it will raise
an error with the SQLSTATE '45000' and the message 'Duplicate user name is not allowed' .
This trigger will prevent the insertion or update of a row in the "users" table if the username
column already exists in the table.

Page | 47
JSSATEB – Dept of CSE
Vehicle Service Management System

CHAPTER 5: RESULTS

5.1 Front End

5.1.1 CUSTOMER SIDE:

Customer Side home page features


Home Page

Fig 5.1: Customer Side home page

Fig 5.2: Customer Side home page

Page | 48
JSSATEB – Dept of CSE
Vehicle Service Management System

 Fig:5.1 and Fig:5.2 shows page which includes a basic layout of a cover picture along
with a button called “About us” which gives a brief description about the vehicle
service management agency.
 Next feature is the send request button which the user can use to send a service
request to the admin side of the database.

Fig 5.3: Service request form

Upon pressing the send request button, we get a small window as seen in Fig 5.3 which user
can enter details regarding fields like

 Vehicle type: 2-wheeler or 3-wheeler or 4-wheeler


 Owner full name: name of the owner
 Owner contact: contact no of the owner
 Owner email: email of the owner
 Address: address of the owner
 Vehicle name: name of the owner’s vehicle
 Vehicle registration no: registration no of the owner’s vehicle
 Vehicle model: model pertaining to owner’s vehicle
 Services: this includes a drop-down list which includes
o Engine tune up
o Overall check up
o Tire replacement
o Change oil

Page | 49
JSSATEB – Dept of CSE
Vehicle Service Management System

 User can select one or more services from the drop down.
 Request type: this also includes a drop-down list of 2 elements:
o Pickup - Pick up means an agent from the service agency picks up
the customer’s vehicle
o drop-off - Dropoff means the customer itself drops off the vehicle
at the service agency location

Fig 5.4: Filled request form

Fig 5.5: Prompt upon successful submission

 Upon clicking submit button we get a prompt as seen in the Fig 5.5
picture.

Page | 50
JSSATEB – Dept of CSE
Vehicle Service Management System

 Apart from this user can also search for a particular service and also have a look at the
description of each of the services offered by the service agency by clicking on the
name of the service the user wants to view like in Fig 5.6

Fig 5.6: Individual service details

 User can search for a specific service by making use of search field.
 This is an overall view of the features that the customers get on their side of our
database

5.1.2 ADMIN SIDE

Admin Side features:

Fig 5.7: Admin side features

 The Fig 5.7 depicts the view of the login page of the admin side where both admin
and staff can login using the credentials provided to them (note that the credentials to
the staff are provided by the admin)

Page | 51
JSSATEB – Dept of CSE
Vehicle Service Management System

 Upon successful login by the administrator, we get an admin dashboard

Fig 5.8: Admin dashboard page

Admin dashboard features:


 The Fig 5.8 dashboard displays name of the vehicle service agency.
 It gives an overall picture of the current state of the vehicle service agency to the
admin by displaying fields like:
 Total category: gives the count of the number of categories (currently
active) of vehicles the agency is currently servicing.
 Mechanics: gives a count of number of mechanics (currently active) in the
agency.
 Services: gives a count of number of services the agency is currently
offering.
 Finished requests: gives a count of numbers of services requests that have
been successfully completed.
 Apart from this there is also a button on the top right corner which can be used to edit
admin credentials and also for logging out.

Page | 52
JSSATEB – Dept of CSE
Vehicle Service Management System

 Editing the admin credentials:

Fig 5.9: Editing the admin credentials

MECHANICS LIST tab features:

Fig 5.10: Mechanics list page

 The Fig 5.10 displays a list of all mechanics with 10 entries per page (active and
inactive) with information like:
 Date created: refers to the date when the mechanic joined the agency.
 Name: refers to the name of the mechanic.

Page | 53
JSSATEB – Dept of CSE
Vehicle Service Management System

 Contact and email: displays the contact no. and email address of the
mechanic.
 Status: refers to the status of the mechanic in the agency.
 Active: the mechanic is currently working in the agency.
 In-active: the mechanic is currently not working in the agency.
 Action: provides 2 options
o EDIT- can be used to edit the mechanic’s profile

Fig 5.11: Mechanic details updation


o DELETE- is used to remove a mechanic’s entry from the agency
 There is also a search field in this tab which can be used to search for a specific
mechanic’s name in the list of mechanics

Fig 5.12: List of mechanics

Page | 54
JSSATEB – Dept of CSE
Vehicle Service Management System

Create new option:

Fig 5.13: Creating new mechanics

 With reference to Fig 5.13, this option lets the admin to create a new entry for a new
mechanic in the agency by entering information pertaining to fields like :
 Name: name of the new mechanic
 Contact: contact number of the new mechanic
 Email: email address of the new mechanic
 Status: provides a drop-down of 2 elements
o Active : currently active
o In-active : currenctly not active
 Upon clicking the save button a new entry for the mechanic is created and the same is
updated in the backed database which can be seen in PHPMYADMIN page

Page | 55
JSSATEB – Dept of CSE
Vehicle Service Management System

SERVICE REQUESTS tab features:

Fig 5.14: Service request page

 The Fig 5.14 displays a list of all service requests with 10 entries per page that have
been sent from customer side with fields like
 Date created : refers to the date and time when the request from the customer
has been places
 Client name : refers to the customer’s name who has places the request
 Service : gives the name of the services which the customer has opted for
 Status : there are 5 option for status
o Pending (status code 0) : means that the service request is yet to be
viewed and action is to be taken by admin
o Confirmed (status code 1) : means that the service request is confirmed
by the admin
o On-progress (status code 2) : means that the service request is
underway and is in progress
o Done (status code 3) : means that the services opted by the customer
has been completed
o Cancelled (status code 4) : means that the admin has cancelled/rejected
the serice request
 Action : this has 3 options

Page | 56
JSSATEB – Dept of CSE
Vehicle Service Management System

o VIEW : gives the service request description sent from customer side

Fig 5.15: Viewing individual service request details

o EDIT : the service request being assigned to a mechanic and its status
can be controlled through this option

Fig 5.16: Updating status of service request

o Assigned To: gives a drop down list of mechanics among which one of
the mechanic can be assigned for a service request.
o Status: gives a drop down list of 5 options ( as explained above )
among which the appropriate one can be chosen by the admin

Page | 57
JSSATEB – Dept of CSE
Vehicle Service Management System

Fig 5.17: Assigning status of service request

o Upon clicking save request button, the service request’s state is now
successfully updated and the same gets reflected in the service requests
list and in the back end.
o DELETE: this option under Action can be used by admin to delete a
particular service request from the list of service requesets.
 Apart from this we can also search for a particular request places by a customer by
entering a specific customer’s name in the search field in this tab

Page | 58
JSSATEB – Dept of CSE
Vehicle Service Management System

Create new option:

 Instead of the customer placing from the customer side page, the admin himself can
create new service requests by using this option as seen in Fig 5.18

Fig 5.18: Admin creating service request

 Upon clicking create new request option we get a window as seen above where the
details pertaining to the customer and his vehicle(as explained before) are to be
entered by the admin and also the mechanic has to assigned for that particular service
request and also status has to updated.
 Upon entering all the details and clicking the save request button, this service request
which has been placed from admin side also gets reflected in the list of service
requests.

Page | 59
JSSATEB – Dept of CSE
Vehicle Service Management System

REPORT tab features:

Fig 5.19: Filtering service requests in report tab

 The Fig 5.19 displays a list of all service requests that have been placed in between
the dates “date start” and “date end” that can be chosen by the admin, upon clicking
the filter button, the service requests that have been placed between “date start” and
“date end” will be listed below with all related fields like:
 Date time: refers to the date and time when that particular request was created
 Owner name: refers to the customer who placed the request
 Vehicle name: refers to the name of the customer’s vehicle which was
serviced
 Registration No: refers to the regestration number of the vehicle serviced
 Assigned to: refers to the name of the mechanic who was assigned this service
request
 Service: refers to the services which the customer opted for
 Status: the status coresponding to the service request
 This tab displays all service requests irrespective of their status (whether completed or
still in progress or cancelled)
 This tab helps admin in the analytics of:
 number of service requests getting placed between specfic dates
 number of times a customer has services his/her vehicle in his agency
between specific dates
 the type of vehicles being serviced

Page | 60
JSSATEB – Dept of CSE
Vehicle Service Management System

 Upon clicking PRINT button, as seen in the Fig 5.20 this tab also generates report in
PDF format that can be downloaded into the system and can be used for viewing later.

Fig 5.20: Filtered service request in pdf format

SYSTEM INFORMATION MAINTAINENCE:

CATEGORY LIST:

Fig 5.21: Category list

Page | 61
JSSATEB – Dept of CSE
Vehicle Service Management System

 The Fig 5.21 displays a list of categories of vehicles that are currently supported for
servicing in the agency with fields like:
 Date created : refers to the date when a particular category was added in that
agency
 Category : refers to the category/type of vehicle that can be serviced by the agency
 Status : has two option
o Active : means, that particular category of vehicle servicing support is
currently active
o In-active : means, that particular category of vehicle servicing support
is currently in-active

Action : provides 2 options

 EDIT : lets the admin edit information realated to a particular category

Fig 5.22: Editing individual category info

 DELETE: lets the admin delete a particular category in the list of category of
vehicles and the same will be reflected on the backend database

Page | 62
JSSATEB – Dept of CSE
Vehicle Service Management System

Create new option:

Fig 5.23: Creating new info

 With reference to Fig 5.23, the create new option lets the admin to create a new
category of vehicles that the agency can service

The fields include:

 Category name : refers to the name of the category which the admin wants to add
as a new category
 Status : can be either active or inactive depending on admin’s decisions
o Active : the agency currently supports servicing of that category of
vehicles
o In-active : the agency currently doesn’t supports servicing of that category
of vehicles

Apart from these features this tab also provides a search field which the admin can use to
search for a particular category from a list of categories available

Page | 63
JSSATEB – Dept of CSE
Vehicle Service Management System

MAINTAINENCE SERVICE list features:

Fig 5.24: List of services

The Fig 5.24 displays a list of services that the agency currently undertakes with fields like:

 Date created : refers to the date and time when a particular service was created
 Service name : refers to the name of the service being offerred
 Description : refers to a short description of a general procedure involved in a
particular service
 Status : can be either active or inactive depending on admin’s decisions
o Active : the agency currently supports that particular service
 In-active : the agency currently doesn’t support that particular service

Page | 64
JSSATEB – Dept of CSE
Vehicle Service Management System

Action : provides 2 options

 EDIT : lets the admin change the particulars related to a specific service like
changing description, changing status.

Fig 5.25: Editing individual service related info

 DELETE : lets the admin remove a type of service from the list of services
and the same will be reflected in the backend database

Apart from these features, this tab also provides a search field where the admin can search for
a particular service by specifying its name

Page | 65
JSSATEB – Dept of CSE
Vehicle Service Management System

Create new option:

Fig 5.26: Creating new service

With reference to the Fig 5.26, this option lets the admin to create a new service by entering
information into fields like:

 Servcie name : refers to the name of the new service which the admin wants to
add into agency
 Description : refers to a short description involving a general procedure relating to
the new service being listed
 Status : can be either active or inactive (as explained above)

Upon clicking save button the new service will be added on to the list of the services and the
sane will be reflected in the backend database

MAINTAINENCE USER list features:

Fig 5.27: List of staffs created by user

Page | 66
JSSATEB – Dept of CSE
Vehicle Service Management System

 Apart from administrator, the staff working in the vehicle service agency can also
access the admin page but with restricted access to functionalitites
 The Fig 5.27 displays a list of users who have been authorized by the admin to access
the admin page but with limited access
 Admin is the one who created users in the system and provides credentials for them
for login purposes
 Admin has full authoirty to either add or remove a user from the system

With reference to the Fig 5.27, this tab includes fields like:

 Name : refers to name of the user who’s been given access by the admin
 Username : refers to the username which that particular user should use as a
credential in order to login
 Type : refers to the type of user a particular user is (type code (1) – admin and
code (2) - staff)
 A user in admin side can only be either an admin or a staff
 Action : provides 2 options
o EDIT : lets the admin change the information relating to a user like
name,username, password.

Fig 5.28: Editing individual staff related info

Upon clicking save button the edited information pertaining to a user gets reflected in
the list of users and also in the backend database

Page | 67
JSSATEB – Dept of CSE
Vehicle Service Management System

o DELETE : lets the admin remove a user from the list of users and this also
gets reflected in the backend database

Create new option:

Fig 5.29: Creating new staff

 With reference to Fig 5.29, this option lets admin add a new user by entering
information into fields like:
 First name : first name of the new user
 Last name : last name of the new user
 Username : username of the new user
 Password : password used to login for the new user
 Login type : provides 2 choices – admin or staff
o Admin : has full access to the admin side page
o Staff : has limited access to the admin side page

Upon clicking save button the information of this new user gets inserted in the backend
database and also is reflected in the list of users in the frontend.

Page | 68
JSSATEB – Dept of CSE
Vehicle Service Management System

MAINTAINENCE SETTINGS tab features:

Fig 5.30: System information maintenance

Fig 5.31: System information maintenance

The Fig 5.30 and Fig 5.31 allows admin to maintain system information such as

 System name : refers to the name of the vehicle service agency


 System short name : refers to an acronym of the same system name

Page | 69
JSSATEB – Dept of CSE
Vehicle Service Management System

 About us : this field is used to provide description of the details pertaining to the
vehicle service agency (like location of the agency, date established, types of services
provided etc)
 System logo : refers to an avatar/image that the admin can choose from his local
system and use it as trademark for representing his vehicle service agency ( this also
appears in the tab of web browsesr )
 Website cover : refers to the cover pictiure which will be displayed in the customer
side and this is customisable by the admin to enhance the look of the customer side
page
 Upon clicking update button in this tab the details relating to the system information
is saved in the backend database and also is reflected in the customer side page (about
us, cover page, system logo)

5.1.3 STAFF LOGIN:

Fig 5.32: Staff login page

 As we know admin has created a user named “thejas” in the Fig 5.32 who is a staff in
the agency ,
 The staff named “Thejas” can now login to the admin page with limited access by
specifying his login credentials in the login page as in Fig 5.32

Page | 70
JSSATEB – Dept of CSE
Vehicle Service Management System

Upon logging in the staff dashboard looks like:

Fig 5.33: Staff dashboard page

 In the top right corner we can now see THEJAS B who has logged in as staff and not
as ADMINISTRATOR
 Unllike administrator, staff has limited access to functionalities meaning, The staff
has only access to mechanic list, service requests and report.
 But the staff doesn’t have access to maintainence features i.e category list, servcie list,
user list and system information which is only limited to administrator.
 The staff like the admin can view the mechanic list, edit the mechanic information ,
remove a mechanic from list and also create a new mechanic.
 the same functionalitites accessible by admin in case of mechanic list, service requests
and report are also accessible by staff also but the only differrence is that staff cannot
access category,service,user lists and cannot maintain system information

Page | 71
JSSATEB – Dept of CSE
Vehicle Service Management System

5.2 Back End

Fig 5.34: A view of database structure in phpMyAdmin(Back-End)

 The Fig 5.34 illustrates how the database in created and managed in the backend by
using PHP server-side scripting language
 As seen in above we have created a database named vehicle_service_db and the tables
existing in the database are as follows
 Categories: contains information about categories of vehicles supported for
servicing by the agency
 Mechanics_list: contains information about mechanics working in the agency
 Request_meta: this table is used to store information received from a service
request form which the customer fills for placing a service request
 Service_list: contains information regarding types of services provided by the
vehicle service agency
 Service_requests: contains information on the service request placed by the
customer, this table is accessible by the admin and staff only
 System_info: this table stores information related to the vehicle service agency
like a short description about the vehicle service agency, logo of the vehicle
service agency etc.

Page | 72
JSSATEB – Dept of CSE
Vehicle Service Management System

 Users: this table stores information related to the users of the database system
i.e it contains information about the staff (user who is authorized by admin)
like username, password, name etc.

Fig 5.35: Structure of table named categories

 In Fig 5.35 we can have a look at the structure of the table categories where,
 Id: is a primary key of type int restricted to length 30
 Category: is a non-prime attribute of type varchar with length restricted to 250
 Status: is also a non-prime attribute of type tinyint restricted to length 1
 Date_created: is a non-prime attribute of type datetime which means it holds both
the date and time
 In Fig 5.35 we can see various options like
 SQL: can be used to run SQL queries in the backend
 Insert: can be used to insert tuples into an existing table
 Export: is used to export SQL code of the current table
 Import: is used to import SQL code of a table or database
 Triggers: can be used to create triggers to place restrictions on the type of data
entering the table

Page | 73
JSSATEB – Dept of CSE
Vehicle Service Management System

 Apart from these features we can also have a look at the data in the tab category list
in the front end.

Fig 5.36: Inserting new category in Front-End by admin

Fig 5.37: Updated category list in Front-End

Page | 74
JSSATEB – Dept of CSE
Vehicle Service Management System

 As seen in the Fig 5.38, before we create a new category in the front end, the contents
of category table looks like-

Fig 5.38: Back-End Snapshot of table categories before inserting new category in Front-End

 We can now see in the Fig 5.39, after we create a new category ”6-wheeler” in the
front end, the contents of category table is-

Fig 5.39: Back-End Snapshot of table categories after inserting new category in Front-End

We can see in the above pictures that when we create a new category in the front end, the
same data is being sent to the backend database and being inserted into the table categories

Page | 75
JSSATEB – Dept of CSE
Vehicle Service Management System

CHAPTER 6: CONCLUSION

SUMMARY
The package was designed in such a way that future modifications can be done
easily.

The following conclusions can be deduced from the development of the project.

Automation of the entire system improves the efficiency

It provides a friendly graphical user interface which proves to be better when


compared to the existing system.

It gives appropriate access to the authorized users depending on their permissions.

It effectively overcomes the delay in communications.

Updating of information becomes so easier.

System security, data security and reliability are the striking features.

The System has adequate scope for modification in future if it is necessary.

Limitations
Limited performance: Both PHP and MySQL can be less performant than other languages
and databases when handling large amounts of data or performing complex calculations,
particularly when dealing with high concurrency.

Limited scalability: While MySQL and PHP can handle large amounts of data, they may
not scale as well as other languages and databases in terms of handling a large number of
concurrent users or requests.

Security vulnerabilities: As with any system, if the PHP code and MySQL database are
not properly secured, there may be security vulnerabilities that can be exploited by
attackers.

Limited support for modern features: Both PHP and MySQL are older technologies and
may not have built-in support for newer technologies and features, such as machine
learning or web assembly.

Page | 76
JSSATEB – Dept of CSE
Vehicle Service Management System

Limited integration with other systems: If the system is not able to integrate with other
systems, such as inventory management or accounting software, it may be difficult to
effectively manage all aspects of the vehicle service process.

Future Enhancements

A billing system may be required for our database which may be taken up for future
enhancement.

A message notification service upon reception and completion of a service request could
be another future enhancement.

We can have a separate section for integrating with insurance agencies for covering
vehicle damages in case of vehicle accidents.

Page | 77
JSSATEB – Dept of CSE
Vehicle Service Management System

CHAPTER 7: REFERENCES

BOOK REFERENCES
Fundamentals of Database Systems, Ramez Elmasri and Shamkant B. Navathe, 7th
Edition, 2017, Pearson.

Database management systems, Ramakrishnan, and Gehrke, 3rd Edition, 2014, McGraw
Hill

Silberschatz Korth and Sudharshan, Database System Concepts, 6th Edition, Mc-
GrawHill, 2013.

Coronel, Morris, and Rob, Database Principles Fundamentals of Design, Implementation


and Management, Cengage Learning 2012.

WEB REFERENCES
https://stackoverflow.com/

https://www.youtube.com/

https://www.w3schools.com/php/default.asp

Page | 78
JSSATEB – Dept of CSE

You might also like