You are on page 1of 106

Al-Qaim Vehicle Management System

Muhammad Naveed BCS183205


Muhammad Jasim BCS183161
Usama Ahmed BCS183113

Fall-2021

Supervised By
Mr. Salman Ahmed

Department of Computer Science

Capital University of Science & Technology, Islamabad

1
Capital University of Science and Technology, Islamabad Department of Computer Science
Submission Form for Final-Year

PROJECT REPORT

NUMBER OF
Version V 2.0 MEMBERS
3

TITLE Al-Qaim Vehicle Management System

SUPERVISOR NAME Mr. Salman Ahmed

MEMBER NAME REG. NO. EMAIL ADDRESS

Muhammad Naveed BCS183205 BCS183205@cust.pk

Muhammad Jasim BCS183161 BCS183161@cust.pk

Usama Ahmed BCS183113 BCS183113@cust.pk

MEMBERS’ SIGNATURES

Note 1: This paper must be signed by your supervisor


Note 2: The soft-copies of your project report, source codes, schematics, and executable should be delivered in a CD

2
Capital University of Science and Technology, Islamabad Department of Computer Science
DECLARATION

We, hereby, declare that “No portion of the work referred to, in this project has been
submitted in support of an application for another degree or qualification of this or any
other university/institute or other institution of learning”. It is further declared that this
undergraduate project, neither as a whole nor as a part there of has been copied out from
any sources, wherever references have been provided.

MEMBERS’ SIGNATURES

3
Capital University of Science and Technology, Islamabad Department of Computer Science
Table of Contents

Contents
Chapter 1 ........................................................................................................................ 8
Introduction ..................................................................................................................... 8
1.1. Project Introduction ............................................................................................ 8
1.2. Existing Example / Solution .............................................................................. 12
1.3. Business Scope ............................................................................................... 12
1.4. Useful Tools and Technologies ........................................................................ 13
In this project we will be using Visual Code, React JS and Laravel. .......................... 13
1.5. Project Work Break Down ................................................................................ 14
1.6. Project Time Line ............................................................................................. 15
Chapter 2 ...................................................................................................................... 16
Requirement Specification and Analysis ....................................................................... 16
2.1. Functional Requirements .................................................................................... 16
2.2. Non-Functional Requirements ............................................................................ 17
2.3. Selected Functional Requirements .................................................................. 18
2.4. System Use Case Modeling ............................................................................. 19
2.5. Use Case Descriptions: .................................................................................... 21
2.6. System Sequence diagrams ............................................................................ 42
2.7. Domain Model .................................................................................................. 57
Chapter 3 ...................................................................................................................... 58
System Design .............................................................................................................. 58
3.1. Software Architecture ....................................................................................... 59
3.2. Class Diagram.................................................................................................. 60
3.3. Sequence Diagram .......................................................................................... 61
3.4. Entity Relationship Diagram ............................................................................... 78
3.5. User Interface Design ...................................................................................... 79

4
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 4 ...................................................................................................................... 83
Software Development .................................................................................................. 83
4.1. Coding Standards ............................................................................................... 83
4.1.1. Indentation................................................................................................................................ 83
4.1.2. Declaration ................................................................................................................................ 83
4.1.3 Statement Standards ................................................................................................................. 83
4.1.4 Naming Convention ................................................................................................................... 84
4.2. Development Environment ............................................................................... 84
4.3. Database Management System.......................................................................... 85
4.4. Software Description ........................................................................................ 85
Chapter 5 .................................................................................................................... 100
Software Testing ......................................................................................................... 100
5.1. Testing Methodology ...................................................................................... 100
5.2. Testing Environment ......................................................................................... 100
5.3. Test Cases........................................................................................................ 100
5.3.1 Admin Log in...................................................................................................................... 100
5.3.2 Admin Add Vehicle ............................................................................................................ 101
5.3.3 Admin Update Vehicle ...................................................................................................... 102
5.3.4 Admin Delete Vehicle:....................................................................................................... 102
5.3.5 Admin Add Customer ........................................................................................................ 103
5.3.6 Admin Update Customer ......................................................................................................... 103

5
Capital University of Science and Technology, Islamabad Department of Computer Science
List of Figures

Figure 1.Admin and Customer receipt .................................................................................. 9


Figure 2.Track Damages ................................................................................................... 10
Figure 3.Rules ................................................................................................................. 11
Figure 4.Project Work Breakdown ..................................................................................... 14
Figure 5.Project Time Line ............................................................................................... 15
Figure 6.Use case for Admin ............................................................................................. 19
Figure 7.Use case of Customer .......................................................................................... 20
Figure 8.Use case for system ............................................................................................. 20
Figure 9.Admin Login (SSD) ............................................................................................ 42
Figure 10.Accept Reservation (SSD).................................................................................. 43
Figure 11.Reject Reservation (SSD) .................................................................................. 44
Figure 12.Add Customer (SSD) ......................................................................................... 45
Figure 13.Update Customer (SSD) .................................................................................... 46
Figure 14.Disable Customer (SSD) .................................................................................... 47
Figure 15.Add Vehicle (SSD) ........................................................................................... 47
Figure 16.Update Vehicle (SSD) ....................................................................................... 48
Figure 17.Delete Vehicle (SSD) ........................................................................................ 48
Figure 18.Track Damages (SSD) ....................................................................................... 49
Figure 19.Logout Admin (SSD) ........................................................................................ 49
Figure 20.Customer Register (SSD) ................................................................................... 50
Figure 21.Customer Login (SSD) ...................................................................................... 51
Figure 22.Reserve Vehicle (SSD) ...................................................................................... 52
Figure 23.Update Reservation (SSD) ................................................................................. 53
Figure 24.Check Reservation Details (SSD) ....................................................................... 53
Figure 25.Search Vehicles (SSD) ...................................................................................... 54
Figure 26.Customer Logout (SSD) .................................................................................... 55
Figure 27.Show Maintenance (SSD) .................................................................................. 55
Figure 28.Calculate Amount (SSD) ................................................................................... 56
Figure 29.Show Feedback (SSD ........................................................................................ 56
Figure 30.Domain Model .................................................................................................. 57
Figure 31.Software Architecture Diagram .......................................................................... 59
Figure 32.Class Diagram .................................................................................................. 60
Figure 33.Admin Login (SD) ............................................................................................ 61
Figure 34.Admin Logout (SD) .......................................................................................... 62
Figure 35 Admin add customer (SD) ............................................................................. 63
6
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 36 Admin Update Customer (SD)....................................................................... 64
Figure 37Admin deleting customer (SD) ....................................................................... 65
Figure 38.Admin Accept Reservation ............................................................................ 66
Figure 39 Admin Add Vehicle (SD)................................................................................ 67
Figure 40 Admin Update vehicle (SD) ........................................................................... 68
Figure 41 Admin Delete Reservation (SD) .................................................................... 69
Figure 42 Admin reject reservation (SD) ....................................................................... 70
Figure 43 Admin Track Damages (SD) ......................................................................... 71
Figure 44.Customer Login (SD) .................................................................................... 72
Figure 45 Customer Reserve Vehicle (SD) ................................................................... 73
Figure 46 Customer Check Reservation (SD) ............................................................... 74
Figure 47 Customer Update Reservation (SD) .............................................................. 75
Figure 48 Customer Delete Reservation (SD) ............................................................... 76
Figure 49 Customer Logout (SD) .................................................................................. 77
Figure 50. ER Diagram.................................................................................................. 78
Figure 51.Admin Panel .................................................................................................. 79
Figure 52Add Customer ................................................................................................ 80
Figure 53.Add New Car ................................................................................................. 80
Figure 54. Add New Booking ......................................................................................... 81
Figure 55. Customer panel ............................................................................................ 81
Figure 56. Add New Car ................................................................................................ 82
Figure 57. Admin Login ................................................................................................. 88
Figure 58. Add New Customer ...................................................................................... 89
Figure 59. Update Customer ......................................................................................... 91
Figure 60. Add Vehicle .................................................................................................. 93
Figure 61. Edit Driver Details ........................................................................................ 98

7
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 1

Introduction

This chapter provides a brief summary of our project scope, project specification, a
comparison study with the available existing solutions and existing tools and
technologies may be used for the development of this vehicle management system.
This chapter also includes a project work breakdown structure and a proposed timeline.

1.1. Project Introduction


Here in this project we are creating the automated system for Al-Qaim vehicle
management system. This Al-Qaim vehicle management system is basically located in
Islamabad sector G-9. Basically, they are running their system manually and here they
gave us the task to automate their system.

8
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 1 is about the term and conditions of our customer for their customers:

Figure 1.Admin and Customer receipt


9
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 2 is about how our customer will manage the damages for vehicles:

Figure 2.Track Damages

10
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 4 is about terms and conditions for their customers:

Figure 3.Rules

Same like this system other systems are also facing such type of problems and
the customers are also facing different types of problems which are given below:

Transport facility is a matter of headache for those people who do not have any
personal transport. On occasions like wedding, vacation and tour outside city and on
many other situations they feel the necessity of a vehicle to sort out the problems. So if it
is possible to design or develop a web based application for availing transport whenever
and wherever possible, then it will be beneficial for both renter and transport provider.
Now a days, by some clicks only, we can get whatever you want at home. We already
know about the online shopping, e-banking etc Similarly, The Al-Qaim vehicle
management system is the online facility to book cars online within few clicks only. Some
people cannot afford to have a car, for those people this system becomes very helpful.

11
Capital University of Science and Technology, Islamabad Department of Computer Science
This system includes various cars, as per the customer order and comfort, it place their
orders. For travelling a long distance, booking can be done also by this system.

1.2. Existing Example / Solution


Table 1 is about existing examples:
Table 1.Existing Examples

Sr no. Existing Examples Features Our Implementations


1. RentSyst This is the automated They have the software
software which will but they don’t have
controls the billing & implemented the web
invoicing, Rate Tables, base system for the
Reservation. vehicle management
system.
2. Easy Rent Pro This is basically a This is basically the
window based window based
software edition that is application and they
for all auto cars rental don’t have the online
system. The features of system for the
this system is billing & customers.
invoicing, Rate Tables,
Reservation of vehicles.
3. Prime Car Rental (PCR) This organization gives They don’t have the
Vehicle rental services automated system like
for their customers. online reservation of
They use the phone the cars.
calls for reservations of
vehicles and during
renting the car they
have a manual system.

1.3. Business Scope


 Due to Covid-19 pandemic people prefer everything online.
 This system makes life a lot more comfortable. If we want to visit a city and we are
at the any place in the city, then we can easily rent a car and move around the city
and then before leaving that place we can drop it at the rental station.
 In many of the cases many people go for a tourism and in this way sometimes they
want a vehicle or for any other purpose they want a vehicle so they will open this
Al-Qaim vehicle management system and book their vehicle as they want.
12
Capital University of Science and Technology, Islamabad Department of Computer Science
 To utilize resources in an efficient manner by increasing their productivity through
automation.
 It satisfy the user requirement.
 Be expandable.
 This Al-Qaim rental helps us to save a lot of money. By renting a car from a
company, we get to save a lot of money which we would have otherwise wasted
on our travel from one end to the other.

1.4. Useful Tools and Technologies


In this project we will be using Visual Code, React JS and Laravel.
Here basically the React JS is used for front end and for the backend we will use the
laravel.
React. js is an open-source JavaScript library that is used for building user interfaces
specifically for single-page applications. It's used for handling the view layer for web.
Laravel is a free open source PHP web framework and intended for web applications
based on MVC (Model View Controller).

Visual Code

React. JS, Bootstrap, HTML, CSS

Laravel

13
Capital University of Science and Technology, Islamabad Department of Computer Science
1.5. Project Work Break Down
The project breaks down structure show the complete project divided into sub tasks
and given each subtask to different members.
Figure 4 is about project work breakdown:

Figure 4.Project Work Breakdown

14
Capital University of Science and Technology, Islamabad Department of Computer Science
1.6. Project Time Line
Figure 5 is about project time line:

Figure 5.Project Time Line

15
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 2

Requirement Specification and Analysis


Requirements specification involves frequent communication with system users to
determine specific feature expectations, resolution of conflict or ambiguity in requirements
as demanded by the various users or groups of users and documentation of all aspects
of the project development process from start to finish. Requirements are a description of
how a system should behave or a description of system properties or attributes. It can
alternatively be a statement of 'what' an application is expected to do.

2.1. Functional Requirements


Table 2 is about functional requirements for admin:
Table 2.Financial Requirements for Admin

S. No. Functional Requirement Type Status


1 Admin can directly login to the Core Incomplete
system.
2 Admin can accept the customer Core Incomplete
reservation.
3 Admin can reject the customer Core Incomplete
reservation.
4 Admin can register the customer. Core Incomplete
5 Admin can delete the customer. Core Incomplete
6 Admin can add new vehicle. Core Incomplete
7 Admin can update the vehicle Core Incomplete
details.
8 Admin can delete the vehicle. Core Incomplete
9 Admin can keep the track of Core Incomplete
damages.
10 Admin can view stats for vehicle. Core Incomplete
11 Admin can view customers. Core Incomplete
12 Admin can logout from the system. Core Incomplete

Table 3 is about functional requirements for customer:


Table 3.Functional requirements for Customer

S. No. Functional Requirement Type Status


1 Customers can register into the Core Incomplete
system.
16
Capital University of Science and Technology, Islamabad Department of Computer Science
2 Customers can login into the Core Incomplete
system.
3 Customer can logout from the Core Incomplete
system.
4 View vehicle details for Core Incomplete
reservations.
5 Customer can reserve the vehicle. Core Incomplete
6 Customer can search the available Core Incomplete
vehicles.

Table 4 is about functional requirements for system:


Table 4.Functional requirements for system

S. No. Functional Requirement Type Status


1 System show the maintenance and Core Incomplete
repair alerts to admin.
2 Calculate the cost. Core Incomplete
3 Calculate feedback from customer. Core Incomplete

2.2. Non-Functional Requirements


Table 5 is about non-functional requirements for our system:
Table 5.Non-functional requirements of system

S. No. Non Functional Requirements Category


1 System should keep customers/admin information Confidentiality.
anonymously.
2 Collection of sensor data after every 24 hours. Availability.
3 Admin must manage all reservations, vehicles & Manageability.
customers.

17
Capital University of Science and Technology, Islamabad Department of Computer Science
2.3. Selected Functional Requirements
Table 6 is about selected functional requirements:
Table 6.Selected Functional Requirements

S. No. Functional Requirement Type


1 Login for admin. Core
2 Admin can add vehicle(with image) Core
3 Admin can update vehicle Core
4 Admin can delete vehicle Core
5 Admin can add customer Core
6 Admin can update customer Core
7 Admin can delete customer Core
8 Admin add driver details Core
9 Admin update driver details Core
10 Admin delete driver details Core
11 Logout for admin Core

18
Capital University of Science and Technology, Islamabad Department of Computer Science
2.4. System Use Case Modeling
Use case of the overall system in which graphic depiction of the interactions among
the elements of a system and the relationships between and among the actors (admin,
customers & system) and the figure are given below:

Figure 6 is about use case diagram for admin:

Figure 6.Use case for Admin

19
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 7 is the use case diagram for customer:

Figure 7.Use case of Customer

Figure 7 is the use case diagram for system:

Figure 8.Use case for system

20
Capital University of Science and Technology, Islamabad Department of Computer Science
2.5. Use Case Descriptions:
Table 7 is the admin login use case description:
Table 7.Use case description for admin login

Use Case ID: Veh-1

Use Case Login


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin can login to his/her account on the system.

Trigger: Admin clicks on Login button.

Preconditions: Admin must be registered.

Post conditions: Admin go to the admin panel.

1. Admin press login 2. System provides login


button. form.

3. Admin enters 4. System verifies it.


username and
password.

5. System logins admin.

Alternative Flows: Admin enters wrong username or password.

System fails to login.

System asks for credentials again.

Exceptions: Admin already logged in.

21
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 8 is the accept reservation use case description:
Table 8.Accept Reservation

Use Case ID: Veh-2

Use Case Accept reservation


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin accepts the customer’s reservations.

Trigger: Click on the accept button.

Preconditions: First customer must have to reserve a vehicle.

Post conditions: Customer reservation will be fulfilled by the admin.

1. Admin first must login 2. System shows the


to system. admin panel to admin.

3. Admin clicks on 4. System shows all the


reservation button. reservations to admin.

5. Admin click accept of 6. System sent


any customer notification to
reservation. customer (reservation
confirmed).

Alternative Flows: The reservation will on pending until admin accepts it.

Exceptions: No reservation present.

22
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 9 is for reject reservation use case description:
Table 9.Reject Reservation

Use Case ID: Veh-3

Use Case Reject reservation


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin reject the customer’s reservations.

Trigger: Click on the reject button.

Preconditions: First customer must have to reserve a vehicle.

Post conditions: Customer reservation will be rejected by the admin.

1. Admin first must login 2. System shows the


to system. admin panel to admin.

3. Admin clicks on 4. System shows all the


reservations. reservations to admin.

5. Admin click reject. 6. System sent


notification to
customer (reservation
rejected).

Alternative Flows: The reservation is on pending until admin rejects it.

Exceptions: No reservation present.

23
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 10 is for admin add new customer use case description:
Table 10.Add Customer

Use Case ID: Veh-4

Use Case Add customer


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin can add new customer manually.

Trigger: Click on add customer button.

Preconditions: Customer not found till now in system.

Customer must have come to the admin for registration.

Customer must have all the required data to registration.

Post conditions: Customer added by the admin in system.

1. Admin click on add 2. System shows the


customer. form to add new
customer.

3. Admin fill all required


fields.

4. Admin click on submit 5. System adds that


button. record to database.

Alternative Flows: The system show a popup message (customer is not


added).

24
Capital University of Science and Technology, Islamabad Department of Computer Science
Exceptions: Customer already exist in system.

Table 11 is for admin update customer details use case description:


Table 11.Update Customer

Use Case ID: Veh-5

Use Case Update Customer


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin update customer details.

Trigger: Click on update button.

Preconditions: Customer must exist in the database.

Post conditions: Customer updated by admin.

1. Admin clicks on 2. System shows the


update button. existing details.

3. Admin change details.

4. Click update button. 5. System update data in


database.

Alternative Flows: Internet gets fluctuate.

Enter empty field.

Exceptions: Unable to update customer profile.

25
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 10 is for admin disable customer details use case description:
Table 12.Disable Customer

Use Case ID: Veh-6

Use Case Disable Customer


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin delete customer details.

Trigger: Admin Click delete button.

Preconditions: Customer must exist in database.

Post conditions: Customer disable by admin.

Normal Flow: 1. Admin click on disable 2. System shows a pop


button. up that (Are you sure
to disable).

3. Admin clicks on ok 4. System disable


button. customer.

Alternative Flows: Internet gets fluctuate.

Exceptions: Unable to disable customer’s profile.

26
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 13 is for adding new vehicle detail use case description:
Table 13.Add Vehicle

Use Case ID: Veh-7

Use Case Add Vehicle


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin adds new vehicle.

Trigger: Click add vehicle button.

Preconditions: All details for vehicle.

Post conditions: Vehicle added by admin.

1. Admin click add new 2. System shows form.


vehicle

3. Admin add details of


vehicle.

4. Click submit button. 5. System adds new


vehicle details in
database.

Alternative Flows: Internet gets fluctuate.

Enter empty field.

Vehicle details already exist.

Exceptions: Admin unable to add new vehicle.

27
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 14 is for updating vehicle details use case description:
Table 14.Update Vehicle

Use Case ID: Veh-8

Use Case Update Vehicle


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin update vehicle details.

Trigger: Admin click update vehicle button.

Preconditions: Vehicle must exist in system.

Post conditions: Vehicle details updated by admin.

1. Admin click on update 2. System shows form.


button.

3. Admin change details.

4. Click submit button. 5. System update details


in database.

Alternative Flows: Internet gets fluctuate.

Admin enter empty fields.

Exceptions: Unable to update vehicle details.

28
Capital University of Science and Technology, Islamabad Department of Computer Science
Table 15 is for delete vehicle use case description:
Table 15.Delete Vehicle

Use Case ID: Veh-9

Use Case Delete Vehicle


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin can delete vehicle details.

Trigger: Admin click delete vehicle button.

Preconditions: Vehicle details must exist in system.

Post conditions: Vehicle details deleted by the admin.

1. Admin click on delete 2. System delete vehicle


button. from database.

Alternative Flows: Internet gets fluctuate.

Exceptions: Unable to delete customer’s profile.

29
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 16 is about track damages use case description:
Table 16.Track Damages

Use Case ID: Veh-10

Use Case Track Damages

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin track vehicle damages.

Trigger: Admin clicks track damages button.

Preconditions: Vehicle previous damages detail must exist.

Post conditions: Vehicle new damages tracked by system.

1. Admin first must login. 2. System take admin to


panel.

3. Admin click track 4. System show new


damages. damages.

Alternative Flows: The system shows popup message no new damages


occurred.

Exceptions: Unable to show track new damages.

30
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 17 is about logout admin use case description:
Table 17.Admin Logout

Use Case ID: Veh-11

Use Case Logout


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Admin

Description: Admin logout to system.

Trigger: Admin clicks logout button.

Preconditions: Admin must be logged in.

Post conditions: Admin logout successfully.

Normal Flow: 1. Admin click logout 2. System successfully


button. logout the admin.

Alternative Flows: Internet gets fluctuate.

Exceptions: Unable to logout.

31
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 18 is about register customer use case description:
Table 18.Register

Use Case ID: Veh-12

Use Case Register


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer register to system by providing information.

Trigger: Customer click sign up button.

Preconditions: Customer must be connected to internet.

Post conditions: Customer’s registered to system successfully.

1. Customer press sign 2. System provides


up button. registration form.

3. Customer enter all 4. System verifies it.


details.

5. System adds customer


in database.

Alternative Flows: User enters wrong information.

System fails to send request.

Internet fluctuation.

Exceptions: User enter wrong input and system throw errors.

32
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 19 is about login admin use case description:
Table 19.Customer Login

Use Case ID: Veh-13

Use Case Login


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer login to system.

Trigger: Customer click’s on login button.

Preconditions: Customer must be registered.

Post conditions: Customer successfully login to system.

1. Customer press login 2. System provides login


button. page.

3. Customer enters 4. System verifies it.


username and
password.

. 5. System login to
customer’s panel.

Alternative Flows: User enter wrong credentials.

System fails to login.

System asks for credentials again.

Exceptions: Customers enter wrong input then system throw errors.

33
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 20 is about reserve vehicle use case description:
Table 20.Reserve Vehicle

Use Case ID: Veh-14

Use Case Reserve vehicle

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer reserves a vehicle.

Trigger: Customer click on reserve vehicle button and select his/her


desired vehicle from currently available vehicles.

Preconditions: Customer must registered and logged in to the system.

Post conditions: Customer successfully reserves a vehicle.

1. Customer click on 2. The system show all


reserve vehicle. available vehicles.

3. Customer select 4. System send request


desired vehicle and to admin for vehicle
click ok button. reservation.

Alternative Flows: System fails to login the customer.

System fails to send request to admin.

Exceptions: Unable to reserve vehicle.

34
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 21 is about update reservation details use case description:
Table 21.Update Reservation

Use Case ID: Veh-15

Use Case Update reservation

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer updates reservation.

Trigger: Customer click on update reservation button.

Preconditions: Customer must registered and login first.

Post conditions: Customer update reservation details successfully.

1. Customer click on 2. System shows form of


update button. existing details about
reservation.

3. Customer updates the 4. System update these


required details and details.
click submit button.

Alternative Flows: Enter empty field and system didn’t update these details.

Internet gets fluctuate.

Exceptions: Unable to update reservation details.

35
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 22 is about check reservation use case description:
Table 22.Check reservation

Use Case ID: Veh-16

Use Case check reservation

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer views his/her reservation details.

Trigger: Click on reservation details button.

Preconditions: Customer must login first.

Post conditions: Customer view his reservations.

1. Customer clicks check 2. System shows all


reservation button. his/her reservations
and their details.

Alternative Flows: System shows nothing due to internet fluctuating.

No reservation exist for that user.

Exceptions: If no reservation exist then system show nothing.

36
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 23 is about check reservation use case description:
Table 23.Search Vehicle

Use Case ID: Veh-17

Use Case Search available vehicles

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer

Description: Customer view available vehicles.

Trigger: Customer click on available vehicles button.

Preconditions: Customer must register and login.

Post conditions: Customer view all available vehicles.

1. Customer click on 2. Search box will be


search box. active to get vehicle
details.

3. Customer write details 4. System shows all


of vehicle. available vehicles
against searched
vehicle

Alternative Flows: System shows nothing due to internet fluctuating.

No available vehicle exist.

Exceptions: If vehicle is not available system show nothing to customer.

37
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 24 is about customer logout use case description:
Table 24.Customer Logout

Use Case ID: Veh-18

Use Case Logout


Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: Customer.

Description: Customer logout from system.

Trigger: Customer click on logout button.

Preconditions: Customer must login.

Post conditions: Customer logout successfully.

1. Customer click logout 2. System get out the


button. customer from
customer panel.

Alternative Flows: Internet gets fluctuate.

Exceptions: Unable to logout.

38
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 25 is about system maintenance alerts use case description:
Table 25.Maintenance Alert

Use Case ID: Veh-19

Use Case Show maintenance alerts

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: System

Description: System shows maintenance alerts (battery water level,


battery voltage).

Trigger: Admin click alerts button.

Preconditions: Maintenance system must exist in vehicle and admin must


be logged in to system.

Post conditions: System shows maintenance (battery water level, battery


voltage and oil level of the system) on admin panel of a
specific vehicle.

1. Admin click on alerts 2. System shows:


button against a
specific vehicle. a. Battery water level.

b. Battery voltage.

c. Oil level of engine.

Alternative Flows: If this maintenance system is not deployed system shows


nothing.

Internet gets fluctuate

39
Capital University of Science and Technology, Islamabad Department of Computer Science
Exceptions: Unable to get data about the maintenance of the vehicle.

The table 26 is about calculate reservation amount use case description:


Table 26.Calculate Total Amount

Use Case ID: Veh-20

Use Case Calculate reservation amount.

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: System.

Description: System calculate total amount for customer.

Trigger: N/A

Preconditions: Customer must reserve vehicle.

Post conditions: System calculate total amount for reservation successfully.

1. Admin accept 2. System shows him/her


reservation. the total reservation
amount.

Alternative Flows: Reservation not confirmed by admin.

Exceptions: N/A

40
Capital University of Science and Technology, Islamabad Department of Computer Science
The table 27 is about system maintenance alerts use case description:
Table 27.Show Feedback

Use Case ID: Veh-21

Use Case Shows customer feedback.

Name:

Created By: Muhammad Naveed Last Updated By: Muhammad Naveed

Date Created: 11/08/2021 Last Revision 11/08/2021


Date:

Actors: System

Description: System shows feedback to customer.

Trigger: N/A

Preconditions: Customer must reserve vehicle.

Post conditions: System as result shows feedback to customer.

1. The customer pay 2. The system shows the


amount. feedback form.

3. Customer fill feedback 4. System send feedback


and click submit. to admin panel.

Alternative Flows: If this customer don’t reserve a vehicle then system so


nothing.

Exceptions: Customer submit feedback as empty feedback.

41
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6. System Sequence diagrams
A system sequence diagram represents the sequence in which different
components of the system work to achieve a goal.

2.6.1. Login (Admin):


Admin gets login to the system by providing correct username and
password.

The figure 9 is for admin login:

Figure 9.Admin Login (SSD)

42
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.2. Admin Accept Reservation:
Figure 10 shows the acceptance of reservation of vehicle.

Figure 10.Accept Reservation (SSD)

43
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.3. Admin Reject Reservation:
Figure 11 shows the rejection of reservation of vehicle.

Figure 11.Reject Reservation (SSD)

44
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.4. Admin Add Customer:
Figure 12 shows the registration of new customer by the ADMIN.

Figure 12.Add Customer (SSD)

45
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.5. Admin Update Customer:
Figure 13 shows the update of customer by the ADMIN.

Figure 13.Update Customer (SSD)

46
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.6. Admin Disable Customer:
Figure 14 shows how admin disable the customer.

Figure 14.Disable Customer (SSD)

2.6.7. Admin Add Vehicle:


Figure 15 shows adding of new vehicle by admin.

Figure 15.Add Vehicle (SSD)


47
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.8. Admin Update Vehicle:
Figure 16 shows the update of vehicle by customer.

Figure 16.Update Vehicle (SSD)

2.6.9. Admin Delete Vehicle:


Figure 17 shows the deletion of vehicle by customer.

Figure 17.Delete Vehicle (SSD)

48
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.10. Admin Track Damages:
Figure 18 shows how admin tract damages of the vehicle.

Figure 18.Track Damages (SSD)

2.6.11. Admin (Logout):


Figure 19 shows logging out of admin.

Figure 19.Logout Admin (SSD)

49
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.12. Customer Register:
Figure 20 shows the registration of customer.

Figure 20.Customer Register (SSD)

50
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.13. Customer (Login):
Figure 21 shows login in of customer in the system.

Figure 21.Customer Login (SSD)

51
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.14. Customer Reserve Vehicle:
Figure 22 shows the reservation of vehicle by the customer.

Figure 22.Reserve Vehicle (SSD)

52
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.15. Customer Update Reservation Detail:
Figure 23 shows the updating of vehicle by the customer.

Figure 23.Update Reservation (SSD)

2.6.16. Customer Check Reservation:


Figure 24 shows the checking of details of reservation by the
customer.

Figure 24.Check Reservation Details (SSD)

53
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.17. Customer Search for Vehicle:
Figure 25 shows the searching of vehicle by the customer.

Figure 25.Search Vehicles (SSD)

54
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.18. Customer (Logout):
Figure 26 shows the logging out of customer from the system.

Figure 26.Customer Logout (SSD)

2.6.19. System Show Maintenance Alert:


Figure 27 shows the maintenance alert to the admin.

Figure 27.Show Maintenance (SSD)

55
Capital University of Science and Technology, Islamabad Department of Computer Science
2.6.20. System Calculate Reservation Amount:
Figure 28 shows the calculation of total amount of reservation.

Figure 28.Calculate Amount (SSD)

2.6.21. System show Feedback:


Figure 29 shows the feedback to the admin.

Figure 29.Show Feedback (SSD

56
Capital University of Science and Technology, Islamabad Department of Computer Science
2.7. Domain Model
Figure 30 shows the domain model of the system.

Figure 30.Domain Model

57
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 3

System Design
The purpose of this chapter is to provide information that is complementary to the code.
Without an adequate design that delivers required function as well as quality attributes,
the project will fail. But communicating architecture to its stakeholders is as important
a job as creating it in the first place.

58
Capital University of Science and Technology, Islamabad Department of Computer Science
3.1. Software Architecture
Software architecture is decribed as the organization or structure of the system.

Figure 31.Software Architecture Diagram

59
Capital University of Science and Technology, Islamabad Department of Computer Science
3.2. Class Diagram
Figure 22 shows the class diagram of the system.

Figure 32.Class Diagram

60
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3. Sequence Diagram
Sequence diagrams, when used in conjunction with class diagrams; provide an
extremely effective communication mechanism.

3.3.1 Admin Login:

The figure 33 shows login for Admin.

Figure 33.Admin Login (SD)

61
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.2 Admin Logout:

Figure 34 shows logging out of admin.

Figure 34.Admin Logout (SD)

62
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.3 Admin ADD Customer:

Figure 35 shows the registration of new customer by the ADMIN.

Figure 35 Admin add customer (SD)

63
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.4 .Admin Update Customer:

Figure 36 shows the update of customer by the ADMIN.

Figure 36 Admin Update Customer (SD)

64
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.5 .Admin delete Customer:

Figure 37 shows the deletion of customer by Admin.

Figure 37Admin deleting customer (SD)

65
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.6 .Admin Accept Reservation:

Figure 38 shows the acceptance of reservation of vehicle.

Figure 38.Admin Accept Reservation

66
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.7 .Admin Add Vehicle:

Figure 39 shows adding of new vehicle by admin.

Figure 39 Admin Add Vehicle (SD)

67
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.8 .Admin update Vehicle:

Figure 40 shows the update of vehicle by Admin.

Figure 40 Admin Update vehicle (SD)

68
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.9 . Admin Delete Vehicle:

Figure 41 shows the deletion of vehicle by admin

Figure 41 Admin Delete Reservation (SD)

69
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.10 . Admin Reject Reservation:

Figure 42 shows the rejection of reservation of vehicle.

Figure 42 Admin reject reservation (SD)

70
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.11 . Admin track damages:

Figure 43 shows how admin tract damages of the vehicle.

Figure 43 Admin Track Damages (SD)

71
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.12 . Customer Login:

Figure 44 shows login in of customer in the system

Figure 44.Customer Login (SD)

72
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.13 . Customer Reserve Vehicle:
Figure 45 shows the reservation of vehicle by the customer.

Figure 45 Customer Reserve Vehicle (SD)

73
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.14 . Customer Check Reservation Detail:
Figure 46 shows the checking of details of reservation by the customer.

Figure 46 Customer Check Reservation (SD)

74
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.15 . Customer Update Reservation Detail:
Figure 47 shows the updating of vehicle by the customer.

Figure 47 Customer Update Reservation (SD)

75
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.16 Customer Delete Reservation:
Figure 48 shows the deletion of reservation by customer.

Figure 48 Customer Delete Reservation (SD)

76
Capital University of Science and Technology, Islamabad Department of Computer Science
3.3.17 Customer Logout:

Figure 49 shows the logging out of customer from the system.

Figure 49 Customer Logout (SD)

77
Capital University of Science and Technology, Islamabad Department of Computer Science
3.4. Entity Relationship Diagram
This diagram/Figure 50 tells us that which entities are connected together and how their
attributes lies in our database.

Figure 50. ER Diagram

78
Capital University of Science and Technology, Islamabad Department of Computer Science
3.5. User Interface Design
User Interface (UI) Design focuses on anticipating what users might need to do and
ensuring that the interface has elements that are easy to access, understand, and use
to facilitate those actions. UI brings together concepts from interaction design, visual
design, and information architecture.

Figure 51.Admin Panel

79
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 52Add Customer

Figure 53.Add New Car

80
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 54. Add New Booking

Figure 55. Customer panel

81
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 56. Add New Car

82
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 4

Software Development
This chapter will provide the details about the coding standards that has been adopted during
implementation phase.

4.1. Coding Standards


The adopted coding standards are discussed in the following subsections.

4.1.1. Indentation
Four spaces are used as the unit of indentation. The indentation pattern should be consistently
followed throughout.

4.1.2. Declaration
One declaration per line is used to enhance the clarity of code. The order and position of
declaration is as follows:
 First the static/class variables are placed in the sequence: First public class variables,
protected, package/default level i.e., with no access modifier and then the private. As far as
possible static or class fields are explicitly instantiated.
 Instance variables are placed in the sequence: First public instance variables, protected,
package level with no access modifier and then private.  Next the class constructors are
declared.
 Class methods are grouped by functionality rather than by scope or accessibility to make
reading and understanding the code easier.
 Declarations for local variables are only at the beginning of blocks e.g. at the beginning of a
try/catch construct.

4.1.3 Statement Standards


Each line contains at most one statement. While compound statements are statements that
contain lists of statements enclosed in braces. The enclosed statements are indented one more
level than the compound statement. The opening brace at the end of the line that begins the
compound statement. The closing brace to begin a line and be indented to the beginning of the
compound statement. Braces are used around all statements, even single statements, when they
are part of a control structure, such as an if-else or for statement. A Boolean expression /
83
Capital University of Science and Technology, Islamabad Department of Computer Science
function is compared to a Boolean constant.

4.1.4 Naming Convention


Naming conventions make programs more understandable by making them easier to read.
Following conventions are followed while naming a class or a member:
 We used full English descriptors that accurately describe the variable, method or class.
 Terminology applicable to the domain is used.
 Mixed case is used to make names readable with lower case letters in general capitalizing the
first letter of class names and interface names.

4.2. Development Environment

Visual Studio Code:

Visual Studio Code combines the simplicity of a source code editor with powerful
developer tooling, like IntelliSense code completion and debugging.

First and foremost, it is an editor that gets out of your way. The delightfully frictionless
edit-build-debug cycle means less time fiddling with your environment, and more time
executing on your ideas.

At its heart, Visual Studio Code features a lightning fast source code editor, perfect for
day-to-day use. With support for hundreds of languages, VS Code helps you be instantly
productive with syntax highlighting, bracket-matching, auto indentation, box-selection,
snippets, and more. Intuitive keyboard shortcuts, easy customization and community-
contributed keyboard shortcut mappings let you navigate your code with ease.

For serious coding, you'll often benefit from tools with more code understanding than just
blocks of text. Visual Studio Code includes built-in support for IntelliSense code
completion, rich semantic code understanding and navigation, and code refactoring. And
when the coding gets tough, the tough get debugging. Debugging is often the one feature
that developers miss most in a leaner coding experience, so we made it happen.

Visual Studio Code includes an interactive debugger, so you can step through source
code, inspect variables, view call stacks, and execute commands in the console. VS Code
also integrates with build and scripting tools to perform common tasks making everyday
84
Capital University of Science and Technology, Islamabad Department of Computer Science
workflows faster. VS Code has support for Git so you can work with source control without
leaving the editor including viewing pending changes diffs.

Visual Studio Code is an interactive IDE which we will use to code the application. Here
we will define different modules of the application. Each module will have its own set of
components on which the application is based. VS Code will also be used to implement
the API’s.

4.3. Database Management System


MySQL is an open-source relational database management system (RDBMS). Its name is a
combination of "My", the name of co-founder Michael Widenius's daughter and "SQL", the
abbreviation for Structured Query Language.
A relational database organizes data into one or more data tables in which data types may be related
to each other; these relations help structure the data. SQL is a language programmers use to create,
modify and extract data from the relational database, as well as control user access to the database.
In addition to relational databases and SQL, an RDBMS like MySQL works with an operating
system to implement a relational database in a computer's storage system, manages users, allows
for network access and facilitates testing database integrity and creation of backups.

4.4. Software Description


Main module of our projects are:

 Sign In and Authentication

 Admin Add Customers

 Admin Delete Customers

 Admin Update Customers

 Admin Add Vehicles

 Admin Delete Vehicles

 Admin Update Vehicles

 Admin Add Driver

 Admin Update Driver


85
Capital University of Science and Technology, Islamabad Department of Computer Science
 Admin Delete Driver

 Admin Logout from System.

4.4.1. Sign In and Authentication

Basically here we will sign up the admin that will login to the system through a given
email and login and if these credentials are correct then he will go to the admin
panel/dashboard.

CODE

function login(Request $request){

$validator=Validator::make($request->all(),[

'email'=> 'required|email',

'password'=> 'required|string|min:4'

]);

if($validator->fails()){

return response()->json($validator->errors(),422);

if(!$token=auth()->attempt($validator->validated())){

return response()->json(['error'=>'Unauthorized'],401);

return $this->createNewToken($token);

86
Capital University of Science and Technology, Islamabad Department of Computer Science
function createNewToken($token)

return response()->json([

'access_token'=>$token,

'token_type'=>'bearer',

'expires_in'=>auth()->factory()->getTTL()*60,

'user'=>auth()->user()

]);

Output

If admin will add wrong name or password then they will not get access on system and system

will response that user do not exist.

87
Capital University of Science and Technology, Islamabad Department of Computer Science
Figure 57. Admin Login

4.4.2. Admin Add Customer

In this module Admin will get access on dashboard and will add new customer to the database.

CODE

function create(Request $request){

//insert data into database

$customer = new Customer;

$customer->first_name = $request->first_name;

$customer->last_name = $request->last_name;

$customer->email = $request->email;

$customer->password = Hash::make($request->password);

$customer->Dob = $request->Dob;

88
Capital University of Science and Technology, Islamabad Department of Computer Science
$customer->gender = $request->gender;

$customer->contact_number = $request->contact_number;

$customer->cnic = $request->cnic;

$customer->save();

return response()->json($customer);

Output

Figure 58. Add New Customer

89
Capital University of Science and Technology, Islamabad Department of Computer Science
4.4.3. Admin Update Customer

In this module Admin will get access on dashboard and will update customer details to the
database.

CODE

function updatebyid(Request $request, $id)

$customer = Customer::find($id);

$customer->first_name = $request->first_name;

$customer->last_name = $request->last_name;

$customer->email = $request->email;

$customer->password = Hash::make($request->password);

$customer->Dob = $request->Dob;

$customer->gender = $request->gender;

$customer->contact_number = $request->contact_number;

$customer->cnic = $request->cnic;

$customer->update();

return response()->json($customer);

90
Capital University of Science and Technology, Islamabad Department of Computer Science
Output

Figure 59. Update Customer

4.4.4. Admin Delete Customer

In this module Admin will get access on dashboard and will delete customer using his default id
that is used as a primary key.

CODE

function deletebyid($id)

$customer = Customer::find($id);

$customer->delete();

return response()->json($customer);

91
Capital University of Science and Technology, Islamabad Department of Computer Science
4.4.5. Admin Add Vehicle

In this module Admin will get access on dashboard and will add new vehicle to the system.

CODE

function create(Request $request){

//insert data into database

$vehicle = new Vehicle;

$vehicle->veh_reg = $request->veh_reg;

$vehicle->veh_type = $request->veh_type;

$vehicle->chesis_no = $request->chesis_no;

$vehicle->company = $request->company;

$vehicle->veh_color = $request->veh_color;

$vehicle->veh_reg_date = $request->veh_reg_date;

$vehicle->veh_description = $request->veh_description;

if($request->hasfile('veh_photo')){

$file = $request->file('veh_photo');

$extention = $file->getClientOriginalExtension();

$filename = time().'.'.$extention;

$file->move('uploads/vehicles/',$filename);

$vehicle->veh_photo = $filename;

$vehicle->veh_available = $request->veh_available;

$vehicle->save();

92
Capital University of Science and Technology, Islamabad Department of Computer Science
return response()->json($vehicle);

Output

Figure 60. Add Vehicle

4.4.6. Admin Update Vehicle

In this module Admin will get access on dashboard and will update the vehicle to the database
using the vehicle table id.

CODE

function updatebyid(Request $request, $id)

$vehicle = Vehicle::find($id);

$vehicle->veh_reg = $request->veh_reg;
93
Capital University of Science and Technology, Islamabad Department of Computer Science
$vehicle->veh_type = $request->veh_type;

$vehicle->chesis_no = $request->chesis_no;

$vehicle->company = $request->company;

$vehicle->veh_color = $request->veh_color;

$vehicle->veh_reg_date = $request->veh_reg_date;

$vehicle->veh_description = $request->veh_description;

if($request->hasfile('veh_photo')){

$destination = 'uploads/vehicles/'.$vehicle->veh_photo;

if(File::exists($destination))

File::delete($destination);

$file = $request->file('veh_photo');

$extention = $file->getClientOriginalExtension();

$filename = time().'.'.$extention;

$file->move('uploads/vehicles/',$filename);

$vehicle->veh_photo = $filename;

$vehicle->veh_available = $request->veh_available;

$vehicle->update();

return response()->json($vehicle);

94
Capital University of Science and Technology, Islamabad Department of Computer Science
}

4.4.7. Admin Delete Vehicle

In this module Admin will get access on dashboard and will delete the vehicle details to the
database.

CODE

function deletebyid($id)

$vehicle = Vehicle::find($id);

$destination = 'uploads/vehicles/'.$vehicle->veh_photo;

if(File::exists($destination))

File::delete($destination);

$vehicle->delete();

return response()->json($vehicle);

4.4.8. Admin Add Driver

In this module Admin will get access on dashboard and will add new driver to the database.

CODE:

function create(Request $request)

$driver = new Driver;

$driver->dr_name = $request->dr_name;
95
Capital University of Science and Technology, Islamabad Department of Computer Science
$driver->dr_join = $request->dr_join;

$driver->dr_mobile = $request->dr_mobile;

$driver->dr_licence = $request->dr_licence;

$driver->dr_licence_valid = $request->dr_licence_valid;

$driver->dr_address = $request->dr_address;

if($request->hasfile('dr_photo')){

$file = $request->file('dr_photo');

$extention = $file->getClientOriginalExtension();

$filename = time().'.'.$extention;

$file->move('uploads/drivers/',$filename);

$driver->dr_photo = $filename;

$driver->dr_available = $request->dr_available;

$driver->save();

return response()->json($driver);

4.4.9. Admin Update Driver

In this module Admin will get access on dashboard and will update driver to the database using
driver id.

CODE

function updatebyid(Request $request,$id)

{
96
Capital University of Science and Technology, Islamabad Department of Computer Science
$driver = Driver::find($id);

$driver->dr_name = $request->dr_name;

$driver->dr_join = $request->dr_join;

$driver->dr_mobile = $request->dr_mobile;

$driver->dr_licence = $request->dr_licence;

$driver->dr_licence_valid = $request->dr_licence_valid;

$driver->dr_address = $request->dr_address;

if($request->hasfile('dr_photo')){

$destination = 'uploads/drivers/'.$driver->dr_photo;

if(File::exists($destination))

File::delete($destination);

$file = $request->file('dr_photo');

$extention = $file->getClientOriginalExtension();

$filename = time().'.'.$extention;

$file->move('uploads/drivers/',$filename);

$driver->dr_photo = $filename;

$driver->dr_available = $request->dr_available;

$driver->update();

97
Capital University of Science and Technology, Islamabad Department of Computer Science
return response()->json($driver);

Output

Figure 61. Edit Driver Details

4.4.10. Admin Delete Driver

In this module Admin will get access on dashboard and will delete driver to the database using
driver id.

CODE:

function deletebyid($id)

$driver = Driver::find($id);

$destination = 'uploads/drivers/'.$driver->dr_photo;

98
Capital University of Science and Technology, Islamabad Department of Computer Science
if(File::exists($destination))

File::delete($destination);

$driver->delete();

return response()->json($driver);

4.4.11. Admin Logout from System

In this module Admin will get access on dashboard and will be able to logout from the system
and redirected toward the sign in page.

99
Capital University of Science and Technology, Islamabad Department of Computer Science
Chapter 5
Software Testing
This chapter provides a description about the adopted testing procedure. This includes the
selected testing methodology, test suite and the test results of the developed software.

5.1. Testing Methodology


We have used black box testing in our testing phase. Black box contains certain benefits that
include following:
• Black box testing examines the functionality of application without peering into its internal
structure.
• This method can be applied to every level of the software testing which include unit,
integration, system and acceptance. Black Box unit testing is used in our project. Unit testing
is a software testing method by which individual units of source code, sets of one or more
computer program modules, together with associated control data, usage procedures and
operating procedures are tested to determine whether they are fit for purpose.

5.2. Testing Environment


Black Box unit testing is used in our project. Unit testing is a software testing method by which
individual units of source code, sets of one or more computer program modules, together with
associated control data, usage procedures and operating procedures are tested to determine
whether they are fit for purpose.

5.3. Test Cases


A test case is a specification of the inputs, execution conditions, testing procedure and expected
results that define a single test to be executed to achieve a particular software testing objective.

5.3.1 Admin Log in

Date: 7 Feb, 2022


System: menu drive
Objective: Admin can sign in here Test ID:1

100
Capital University of Science and Technology, Islamabad Department of Computer Science
Version:1 Test Type: Unit testing

Input:
Email= xyz@gmail.com
Password= 1 2 3 4 5

Expected Result: Match credentials in database and Login user into the system.

Actual Result: passed


Table 28 Admin Login Test Case

5.3.2 Admin Add Vehicle

Date: 7 Feb, 2022


System: menu drive
Objective: admin add vehicle Test ID:2
Version:1 Test Type: Unit testing

Input:
Vehicle _reg= xyz1234
Vehicle _type= Car, SUV etc.
Chesis_no= 12345xyz
Company= (Honda, Toyota etc.)
Vehicle color= (Black, White etc.)
Vehicle_Reg_date = yyyy-mm-dd
Vehicle -Description= xyz
Vehicle _Photo= Image link
Vehicle _Available= (o/I)

Expected Result: vehicle added in database.

Actual Result: passed


Table 29 Admin Add Vehicle Test Case

101
Capital University of Science and Technology, Islamabad Department of Computer Science
5.3.3 Admin Update Vehicle

Date: 7 Feb, 2022


System: menu drive
Objective: admin update vehicle Test ID:3
Version:1 Test Type: Unit testing

Input:
Vehicle _reg= xyz1234
Vehicle _type= Car, SUV etc.
Chesis_no= 12345xyz
Company= (Honda, Toyota etc.)
Vehicle color= (Black, White etc.)
Vehicle_Reg_date = yyyy-mm-dd
Vehicle -Description= xyz
Vehicle _Photo= Image link
Vehicle _Available= (o/I)

Expected Result: vehicle updated in database.


Actual Result: passed

Table 30 Admin Update Vehicle Test Case

5.3.4 Admin Delete Vehicle:

Date: 7 Feb, 2022


System: menu drive
Objective: admin delete vehicle Test ID:4
Version:1 Test Type: Unit testing

Input:
Vehicle _ID =1234

Expected Result: vehicle removed from database


.
Actual Result: passed
Table 31 Admin delete Vehicle Test Case

102
Capital University of Science and Technology, Islamabad Department of Computer Science
5.3.5 Admin Add Customer

Date: 7 Feb, 2022


System: menu drive
Objective: admin add customer Test ID:5
Version:1 Test Type: Unit testing

Input:
First Name= xyz
Last Name= xyz
CNIC= 1234-1234-1
Phone No= +1234567
Gender= (male/female)
DOB= yyyy-mm-dd
Email= xyz@gmail.com
Password= 1234

Expected Result: customer added in database.

Actual Result: passed


Table 32 Admin Add Customer Test Case

5.3.6 Admin Update Customer

Date: 7 Feb, 2022


System: menu drive
Objective: admin update customer Test ID:6
Version:1 Test Type: Unit testing

Input:
First Name= xyz
Last Name= xyz
CNIC= 1234-1234-1
Phone No= +1234567
Gender= (male/female)
DOB= yyyy-mm-dd
Email= xyz@gmail.com
Password= 1234

103
Capital University of Science and Technology, Islamabad Department of Computer Science
Expected Result: customer updated in database.

Actual Result: passed


Table 33 Admin Update Customer Test Case

5.3.7 Admin Delete Customer

Date: 7 Feb, 2022


System: menu drive
Objective: admin delete customer Test ID:7
Version:1 Test Type: Unit testing

Input:
Customer ID= 1234

Expected Result: customer deleted from database.

Actual Result: passed

Table 34 Admin Delete Customer Test Case

5.3.8 Admin Add Driver

Date: 7 Feb, 2022


System: menu drive
Objective: admin add driver Test ID:8
Version:1 Test Type: Unit testing

104
Capital University of Science and Technology, Islamabad Department of Computer Science
Input:
Driver name= xyz
Driver join date= (yyyy-mm-dd)
Drive mobile no= +1234567
Driver license no= 1234
Driver license valid= (yyyy-mm-dd)
Driver address=xyz123
Driver photo= image link
Driver available= (1/0)

Expected Result: driver added in database.

Actual Result: passed

Table 35 Admin Add Driver Test Case

5.3.9 Admin Update Driver

Date: 7 Feb, 2022


System: menu drive
Objective: admin update driver Test ID:9
Version:1 Test Type: Unit testing

Input:
Driver name= xyz
Driver join date= (yyyy-mm-dd)
Drive mobile no= +1234567
Driver license no= 1234
Driver license valid= (yyyy-mm-dd)
Driver address=xyz123
Driver photo= image link
Driver available= (1/0)=

Expected Result: driver updated in database.

Actual Result: passed

Table 36 Admin Update Driver Test Case

105
Capital University of Science and Technology, Islamabad Department of Computer Science
5.3.10 Admin Delete Driver

Date: 7 Feb, 2022


System: menu drive
Objective: admin delete driver Test ID:10
Version:1 Test Type: Unit testing

Input:
Driver ID= 1234

Expected Result: driver updated in database.

Actual Result: passed


Table 37 Admin Delete Driver Test Case

5.3.11 Admin Logout

Date: 7 Feb, 2022


System: menu drive
Objective: Admin can logout Test ID:11
Version:1 Test Type: Unit testing

Input:
Email= xyz@gmail.com

Expected Result: session expire

Actual Result: passed


Table 38 Admin Logout Test Case

106
Capital University of Science and Technology, Islamabad Department of Computer Science

You might also like