0% found this document useful (0 votes)
33 views121 pages

AGUA Final MANUSCRIPT

semi final copy of thesis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views121 pages

AGUA Final MANUSCRIPT

semi final copy of thesis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 121

AGUA BOO WATER WEB-BASED

MANAGEMENT SYSTEM

FRANCIS BEHING
CHRISTIAN ELEAZAR LAZANAS
JAYRALD ZAMBRANO

UNDERGRADUATE CAPSTONE PROJECT SUBMITTED TO THE FACULTY


OF THE INFORMATION TECHNOLOGY DEPARTMENT,
COLLEGE OF INFORMATION SCIENCES AND COMPUTING,
CENTRAL MINDANAO UNIVERSITY, IN PARTIAL FULFILLMENT OF THE
REQUIREMENTS FOR THE DEGREE

BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY

APRIL 2024
Republic of the Philippines
CENTRAL MINDANAO UNIVERSITY
Musuan, Maramag, Bukidnon

College of Information Sciences and Computing


Department of Information Technology

APPROVAL SHEET

The undergraduate capstone project attached hereto entitled, “AGUA


BOO WATER WEB-BASED MANAGEMENT SYSTEM” (Research No.
22899), prepared and submitted by FRANCIS BEHING, CHRISTIAN
ELEAZAR C. LAZANAS, and JAYRALD A. ZAMBRANO, in partial fulfillment of
the requirements for the degree Bachelor of Science in Information
Technology, is hereby endorsed.

FERDINAND D. BASCONES JR. Date


Chair, Capstone Project Committee

GLYRHIZ MARHIEL A. TABAMO Date


Member, Capstone Project Committee

JEREMY YVES P. CAPILI Date


Member, Capstone Project Committee

Recommending Approval:

EYERYL JUN J. TANO Date


Department Chair

NATHALIE JOY G. CASILDO Date


Research Coordinator

Accepted in partial fulfillment of the requirements for the degree in


Batchelor of Science in Information Technology

Approved:

JOHN D. TAJONES Date


College Dean

Noted:

JUPITER V. CASAS Date


Director for Research

ii
AUTHOR’S BIOGRAPHICAL SKETCH

Christian Eleazar C. Lazanas is a highly motivated professional with a


strong educational background in Information Technology. He graduated with
honors from Valencia City Central School and continued his studies at Valencia
National High School, earning his diploma with honors. Christian furthered his
education at Central Mindanao University, where he completed his Bachelor of
Science in Information Technology. During his Senior High School, Christian
gained practical experience as a Graphic Designer during a two-month On-the-
Job Training at the Olarte Advertising, showcasing his commitment to
professional excellence.

Christian possesses a diverse skill set in Information Technology,


including proficiency in Microsoft Office applications for creating
comprehensive reports and presentations. His technical expertise extends to
programming languages, with demonstrated proficiency in Python for data
analysis (Pandas and Numpy) and a solid foundation in PHP programming,
complemented by experience in HTML, CSS, and MySQL. Recognized for his
report writing abilities, Christian excels in creating professional arts with
effective data visualization and interpretation.

In acknowledgment of his achievements and dedication to System


Integration, Christian holds a System Integration Architecture certificate from
Greppo for his successful contribution to the integration of the CMU Homestay
Booking System.

With a commitment to excellence and a comprehensive skill set,


Christian Eleazar C. Lazanas is well-equipped to contribute to the dynamic field
of Information Technology.

iii
AUTHOR’S BIOGRAPHICAL SKETCH

With a strong academic background and a Bachelor of Science in


Information Technology, Francis Behing is a flexible and successful
professional with a deep expertise in both technical and artistic sectors. His
broad programming abilities, which he developed via both academic study and
real-world application, span a variety of languages, including Python, PHP,
Java, SQL, and basic web development. Francis's technical skill set is further
enhanced by his proficiency with Microsoft Office products, including Word,
Excel, and PowerPoint, in addition to his programming knowledge. Francis's
skills don't stop there. He is also proficient in design and layout, with a
specialization in utilizing Adobe Photoshop to produce eye-catching images.

Francis had a thorough education, going from primary school to college


and earning an information technology degree there. His extensive schooling
has given him a solid foundation in the arts and sciences, allowing him to
approach issues from a well-informed and impartial standpoint. He gained the
information and abilities needed to succeed in his job from his academic route,
which prepared him for his professional pursuits. For the past year, Francis has
used his skills as a Layout Artist professionally. His attention to detail and
design abilities have been crucial in producing layouts that are visually
appealing. He was able to hone his design abilities and obtain experience in
this job. Francis made significant contributions to the creation of the Barangay
Lumbo Information Management System and the Agua Boo Water Web-Based
Management System. These initiatives demonstrated not just his programming
and design abilities but also his capacity to manage complicated information
systems and use technology to support community development. Based on his
combination of technical expertise, artistic ability, and real-world experience,
Francis is an excellent contribution to any project involving software
development, information system management, or design.

His background in information technology was strengthened by an in-


depth education.

iv
AUTHOR’S BIOGRAPHICAL SKETCH

Jayrald Zambrano is an individual whose attributes include a remarkable


blend of patience, technical acumen, and an extensive background in
information technology. His educational journey began at Quezon Central
Elementary School, laying a solid foundation for his academic pursuits. He
continued to cultivate his knowledge at Bukidnon Comprehensive High School,
an institution formerly known as Quezon National High School, where he further
honed his skills. His achievement in obtaining National Certification II (NC2) in
Computer Systems Servicing/Information and Communications Technology
(CSS/ICT) further demonstrates his dedication to his field of interest.

With an expansive understanding of minor troubleshooting and cabling,


Jayrald's expertise is well-recognized. However, his proficiencies extend
beyond just hardware. He is also proficient in an array of Microsoft Office
products, enhancing his value in both administrative and technical workplaces.
Furthermore, his programming skills are impressive, spanning across
languages like Java, Python, and PHP, and he also possesses foundational
competencies in basic web development. These skills enable him to tackle a
variety of IT-related tasks with confidence.

Committed to personal growth and professional development, Jayrald


made the strategic decision to expand his horizons. Jayrald started his higher
education journey at Central Mindanao University, aiming to not only work in IT
but also achieve professional excellence in the field. At the university, he is
likely to be engaged in an intensive curriculum that will challenge and further
enhance his technical skills while providing him with new insights and advanced
knowledge in the realm of information technology. His enrollment at such a
reputable institution signifies a relentless pursuit of excellence and a drive to
achieve his dream of making a significant impact in the IT industry.

v
ACKNOWLEDGMENT

First and foremost, the proponents would like to praise and give their
deepest thanks to our Heavenly Father for His great love for the proponents,
for granting us this outstanding achievement, and for His showers of blessings
throughout the completion of this project.

Appreciation is extended to the esteemed panelists, Sir Jeremy Yves P.


Capili and Ma'am Glyrhiz Marhiel A. Tabamo, whose invaluable advice and aid
were instrumental in developing and establishing the project. The valuable,
constructive feedback received throughout the evaluation process played a
substantial role in improving the project.

Special recognition extends to Sir Ferdinand D. Bascones Jr., the


Capstone advisor, for his immeasurable guidance and commitment. His
invaluable assistance and advice have been crucial in overcoming obstacles
and guaranteeing the successful completion of the project.

Sincere gratitude is extended to Central Mindanao University and


College of Information Sciences and Computing for allowing the proponents to
fulfill their dream of being students at one of the most prestigious universities in
the country fostering an environment that benefits learning and offers
opportunities for individuals to grow.

Heartfelt and special thanks to our family, parents, guardians, siblings,


friends and classmates for their full and utmost support and motivation to
complete the capstone and for all the moments they shared, will be treasured
forever.

Furthermore, the proponent’s express gratitude to the stakeholders of


Agua Boo Water for their collaborative efforts, making this capstone project a
meaningful and enriching experience.

vi
EXECUTIVE SUMMARY

The "AGUA BOO WATER WEB-BASED MANAGEMENT SYSTEM," an


innovative solution to upgrade Agua Boo Water Refilling Station operations,
was created. Agua Boo struggles with partially automated activities like time-
consuming client transactions and inventory inputting, storing, and retrieving.
These issues have caused errors, data loss, and inefficiencies that hinder
business growth and consumer satisfaction.

Agua Boo's main functions have been meticulously digitized by the


system. The system has a consumer interface for ordering and tracking and an
administrative module for data management and decision-making. The
customer interface is well-designed to make ordering and tracking transactions
easy, boosting the customer experience. In addition, the administrative module
gives Agua Boo's personnel significant real-time data management capabilities.
These include customer data, order processing, delivery, and sales reporting.
This project uses agile development to emphasize flexibility. Flexibility,
repeated testing, and improvement are ensured. The Agua Boo Web-based
Management System was effective after extensive testing and feedback from
users. Administrators gave the system an average System Usability Scale
(SUS) score of 81.25%, indicating outstanding usability. Staff response was
strong, with an average SUS score of 80.33% indicating excellent usability. For
customers, the largest user group, the system scored 75 for SUS, indicating
good usability. The system's mean SUS score of 76.5% earned it a 'B' grade
and demonstrated its good usability

This project represents a substantial advancement towards digital


transformation for Agua Boo, while also recognizing the potential for additional
improvements. The "AGUA BOO WATER WEB-BASED MANAGEMENT
SYSTEM" solves operational issues and provides a scalable framework for
future technical updates. This project represents a purposeful shift toward using
technology to maximize water refilling efficiency.

vii
Copyright © 2024 by Francis Behing, Christian Eleazar C. Lazanas, and
Jayrald A. Zambrano

viii
TABLE OF CONTENTS

TITLE PAGE i
APPROVAL SHEET ii
AUTHOR’S BIOGRAPHICAL SKETCH iii
ACKNOWLEDGMENT vi
EXECUTIVE SUMMARY vii
COPYRIGHT PAGE viii
TABLE OF CONTENTS ix
LIST OF FIGURES xi
LIST OF TABLES xiii
LIST OF APPENDICES xiv
CHAPTER I 1
1. Background of the Project 1
2. Statement of the Problem 2
3. Objectives of the Project 3
4. Scope and Limitation of the Project 3
5. Significance of the Project 4
CHAPTER II 6
1. REVIEW OF RELATED CONCEPT 6
2. REVIEW OF RELATED SYSTEM 7
CHAPTER III 9
TECHNICAL BACKGROUND 9
CHAPTER IV 14
1. Conceptual Framework 14
2. Project Approach 14
3. System Development Methodology 15
4. System Analysis 17
i. Flowchart 17
ii. Context Level Data Flow Diagram 19
iii. Level 0 Data Flow Diagram 20
iv. Use Case Diagram 21
v. Entity Relationship Diagram 22
5. System Requirements Specification 22
i. Functional Requirements 22
ii. Non-functional Requirements 23

ix
iii. Other Project Requirements 23
6. Project Management 24
i. Gantt Chart 24
7. Plan for Implementation and Testing 25
i. Step 1 Unit Testing 25
ii. Step 2 Integration 25
iii. Step 3 Usability Testing 26
 3.1 Orientation 26
 3.2 System Demonstration 26
 3.3 System Testing 26
 3.4 Survey Using SUS Questionnaire 27
iv. Deployment 29
CHAPTER V 30
1. Results 30
i. Landing Page 30
ii. Customer Login 32
iii. Customer Password Reset 33
iv. Customer Registration 34
v. Customer Profile Page 35
vi. Customer Add Order Page 36
vii. Customer Order History Page 39
viii. Staff and Admin Login 41
ix. Staff Dashboard Page 42
x. Admin Dashboard Page 45
xi. Admin Account Page 45
xii. Admin Orders Page 49
xiii. Admin Resource Page 51
xiv. Admin Setting Page 54
xv. Admin Generate Reports 55
2. Discussion 57
CHAPTER VI 60
1. Conclusion 60
2.Recommendation 60
REFERENCES 61

x
LIST OF FIGURES

Figure 1. Conceptual Framework 14


Figure 2. Agile Development Model 15
Figure 3. Flowchart 18
Figure 4. Context Level Data Flow Diagram 19
Figure 5. Level 0 Data Flow Diagram 20
Figure 6. Use Case Diagram 21
Figure 7. Entity Relationship Diagram 22
Figure 8. Gantt Chart 24
Figure 9. Likert Scale 28
Figure 10. System Usability Scale Scoring 28
Figure 11. Landing Home Page 30
Figure 12. About Page 31
Figure 13. Contact Page 31
Figure 14. Customer Login Page 32
Figure 15. Customer Password Reset Link 33
Figure 16. Customer Reset & Type New Password 33
Figure 17. Customer Registration Page 34
Figure 18. Customer Profile Page 35
Figure 19. Customer Current Delivery Address 36
Figure 20. Customer Add Delivery Address 36
Figure 21. Customer Create and Submit Page 37
Figure 22. Customer Edit Details 38
Figure 23. Customer Changed Password 38
Figure 24. Customer Order History 39
Figure 25. Customer View Order History Details 40
Figure 26. Customer Active Orders 40
Figure 27. Customer View Active Order Details and Status 41
Figure 28. Staff and Admin Login Page 41
Figure 29. Staff Active Orders Dashboard 42
Figure 30. Staff Active Orders Update 43
Figure 31. Staff Delivered Orders Dashboard 44
Figure 32. Staff Canceled Orders Dashboard 44

xi
Figure 33. Admin Dashboard 45
Figure 34. Admin Customer Account Module 46
Figure 35. Admin Add New Customer 46
Figure 36. Admin Edit Customer Details 47
Figure 37. Admin Staff Account Module 47
Figure 38. Admin Add New Staff Account 48
Figure 39. Admin Edit Staff Details 48
Figure 40. Admin Orders Module 49
Figure 41. Admin Add New Order 49
Figure 42. Admin Update Order Status 50
Figure 43. Admin Truck Deliveries 50
Figure 44. Admin Resource (trucks, products, borrowed gallons) 51
Figure 45. Admin Add Truck 52
Figure 46. Admin Edit Truck 52
Figure 47. Admin Add Gallon Products 53
Figure 48. Admin Edit Product Details 53
Figure 49. Admin Settings 54
Figure 50. Admin Edit Settings 55
Figure 51. Generate Report 56
Figure 52. Print Generated Sale Report 56
Figure 53. SUS Survey Results 57
Figure 54. Data Gathering (1) 78
Figure 55. Data Gathering (2) 78
Figure 56. System Presentation & Testing (1) 79
Figure 57. System Presentation & Testing (2) 79
Figure 58. System Presentation & Testing (3) 80
Figure 59. SUS Survey (1) 80
Figure 60. SUS Survey (2) 81
Figure 61. SUS Survey (3) 81

xii
LIST OF TABLES

Table 1. Respondents Testing Results 58


Table 2. Add Staffs 71
Table 3. Customers 71
Table 4. Addresses 72
Table 5. Customer Forgot Password 73
Table 6. Orders 73
Table 7. Products 74
Table 8. Order Products 74
Table 9. Trucks 75
Table 10. Site Settings 75

xiii
LIST OF APPENDICES

APPENDIX TITLE PAGE

A Use Case Suite 64

B Data Dictionary 70

C Testing Documentation 77

D Summary of Answered Survey during Testing 82

E System’s Relevant Codes 88

xiv
CHAPTER I
INTRODUCTION

1. Background of the Project

Technology and Communication always try to make people’s lives easier


Magalona (2012). With the development of computers, software, and the
internet leading to unprecedented levels of connectivity and information
sharing. Web-based systems are one such application of technology, which
uses the internet and web browsers to deliver dynamic content to users. They
offer a more accessible and user-friendly experience than traditional desktop
applications, allowing users to access their content from any device with an
internet connection.

Water refilling stations are becoming increasingly popular as people


become more aware of the importance of clean and safe drinking water. They
organize user data, including the personal information of the customers, as well
as the payment on the transactions they purchased, gallon counts, and
accumulated sales. They also record the customer's information such as their
location, transaction date, delivery schedule, contact number, and other
information that assists with daily business transactions.

In the Philippines, water refilling stations are currently one of the fastest-
growing businesses. Agua Boo was established by Ms. Gamboa on June 16,
2014 in Valencia City and has been in operation for almost 9 years. It provides
clean and purified drinking water for customers through walk-in purchases and
deliveries. However, the company is currently still using the semi-manual
method, which includes recording customer information and keeping track of
their daily sales by writing it down in a notebook and inputting it into MS Office
and Excel, which can also be referred to as manual filing. The manual method
has led them to various problems and these include human errors, loss of
documents, duplication of data, difficulty, and slow retrieval of records.

1
The Agua Boo Water Web-based Management System revolutionizes
the operational efficiency of Agua Boo water refilling stations by replacing semi-
manual processes with advanced web-based technologies. This
comprehensive system not only tracks daily sales and customer information,
including orders and gallon counts, but also significantly mitigates common
issues like human errors, document loss, and slow record retrieval associated
with manual methods. Additionally, it offers a user-friendly online interface,
allowing customers to effortlessly place orders and track their transactions,
thereby enhancing the engagement and satisfaction of the users.

2. Statement of the Problem

Like other new businesses the Agua Boo Water, currently reliant on a
semi-manual system using Microsoft Office and Excel, faces significant
operational inefficiencies. The manual entry and tracking of transactions are
time-consuming and prone to errors, leading to inaccurate sales records and
customer information. This method results in cluttered documentation, slow
information retrieval, and security risks regarding sensitive data. Additionally,
the limited analytical capabilities of the current system hinder strategic decision-
making, impacting overall business performance and customer satisfaction.
The project aims to replace this system with a streamlined, automated
approach to enhance productivity, data accuracy, and customer service,
ultimately improving the company's decision-making process and business
efficiency.

1. Manual management of data is time-consuming and inconvenient. It may


result in lost documents, duplication of records, and human error which
will lead to inaccurate information.

2. Traditional filing techniques limit the amount of orders per time, which
might cost businesses during peak times. Traditional filing techniques
lack real-time inventory and sales data, making it difficult to track
performance and make data-driven decisions.

2
3. Manual tracking and management of gallons can be prone to human
error, leading to inaccurate record-keeping and inventory management.
The stakeholder offers service for borrowing water gallons; however,
manual and failure to track and manage gallons regularly will result in
the loss of borrowed gallons.

4. The company is currently relying on a manual way of monitoring and


managing deliveries which may consume a lot of time. It may cause a
delay in delivery and will result in low customer satisfaction.

5. Producing and generating sales reports manually will consume a lot of


time, just like manual filing, human error may also occur and lead to
inaccurate reports of sales.

3. Objectives of the Project

The general objective of this project is to develop the Agua Boo Water
Web-based Management System.
More specifically, this project aims to:

1. To design database management for the web-based management


system.
2. To develop a feature that will accept orders.
3. To develop a feature that will monitor order status.
4. To develop a feature that will manage orders, users, and gallons.
5. To develop a feature that will generate sales reports.

4. Scope and Limitation of the Project

The proposed project "Agua Boo Water Refilling Station Web-based


Management System" concentrates on the business's sales, customer
monitoring and gallon management. The system maintains admin, customer
information, and ordering details from customers. Allows for editing, updating,
and changing the delivery status as well as the gallon status. The manager will
act as the admin of the Agua Boo Water Web-based Management System and

3
he/she is permitted to maintain and update the system's data including the
number of gallons, managing customers order and information, monitoring the
gallon and sales report. The staff could only update the assigned orders. Online
payment will not be accepted by the admin. Cash on Delivery will only be the
mode of payment. The system features a dashboard that displays the total
number of users, total sales, number of gallons, number of orders as well as
other information that will assist the administrator in monitoring the system
activity.

5. Significance of the Project

The significance of this project is particularly relevant in today's digital


age where technology plays a critical role in society. The proposed system will
have a significant impact on the Agua Boo’s owner and manager and also for
the staff who manage the system. The system's key features include a user
account module, orders, and resource module which includes the management
of trucks, gallon products and borrowed gallons, and sales reports. While online
payment cannot yet be implemented due to certain prerequisites, the system
offers a more convenient way for customers to create and submit orders from
the comfort of their homes using their personal devices and internet connection.

Agua Boo Owner/Manager. This can help them monitor and track their all
transactions including the number of gallons, manage customer information
and orders, and generate sales reports.

Agua Boo Staff. It will provide them with a systematized method in monitoring
and managing the order, deliveries and gallons returned by the customers.

Customers. It will provide them with a systematized method in ordering water


via walk-in or online transactions.

Developers. The system will help them by gathering new ideas and improve
their knowledge and skills in creating a system that will benefit the owner of the
water station, staff, and users.

4
Future Developers. This project could be used as a guideline or reference for
the future developers who would plan to make any similar studies in the future
and provide system improvement

5
CHAPTER II

REVIEW OF RELATED LITERATURE

1. REVIEW OF RELATED CONCEPT

Water Refilling Station

According to Vegh (2017) one of the fast-expanding businesses


nationwide is the Water Refilling Station. Water Refilling Stations are small
water systems that have their own water purification facility producing potable
drinking water. Agua Boo Water is one of the best and good quality purified
water. Also, he states management and therefore the decision-making process,
financing, operations, and marketing considerations are studied, with actual
cases wanting to illustrate problems in small and large businesses.

Sustaining Beneficial Relationship with Clients

Pacinabao (2016), Developing and sustaining long-term, mutually


beneficial relationships with its clients. Finding potential clients every day is
going to be useless if the corporation cannot maintain an honest relationship
with them considering that water may be a continuous need and other people
will easily replace you if they're not satisfied with your services.

Significance of Water Filling Business

In 2016, Dela Cruz stated the water filling business is one of the fastest-
growing businesses here in the Philippines. As this business grows, the
complexity of managing customer accounts and transactions, product
inventory, control, and report generation also grows and can lead to the
business instinct not to survive. Most businesses have water refills, staff
working on their reports, and inventory of products manually. They sell purified
water of comparable quality with bottled water at a lower price Magtibay said
(2016). For example, the price per gallon of refilled water purified in Agua Boo
Water ranges from ₱ 20-30 per container per gallon.

6
Challenges in Water Refilling Station

According to a study of the operational performance of a purified water


refilling station in Batangas City, has conveyed that the lack of advertising,
equipment maintenance, and the inefficiency of employees are the factors
hindering the business from un
locking its full potential. Bottle inventory tracking, pilferage, and
undocumented sales are other concerns that need to be addressed. These are
all typical characteristics of a manual-based management system. Additionally,
a great deal of research focused on the business aspect of a water refilling
station; this includes the procurement of capital, location, permits, equipment,
and human resources. Other researches, like Drinking Water as a Source of
Income by Bayer (2013), are more focused on the challenges and reasons why
water-refilling stations are being established (Domingo, 2017).

2. REVIEW OF RELATED SYSTEM

Aqua Water Refilling Management System Database Design 3

The project by Glayy Eliver (2019), titled "Aqua Water Refilling


Management System Database Design," described how the system manages
the data, which the user fills out according to the information of the customers
in an organized manner that includes their personal details. Also, customers
pay for the transactions they make in the water refilling station system as well
as the services they wish to use. The primary goal of this project is to replace
the outdated, manually operated refilling station operation with a computerized
system in order to satisfy customers and resolve operational challenges.

Water Delivery System 1

According to them, a Water Delivery System easily facilitated the


essential process of the business like counting the daily sales and therefore the
number of delivered containers/gallons. A Water delivery system makes sure
the enterprise workers simply compute and document the everyday
transactions and compute their daily sales. Water delivery is the physical work

7
that delivers water from the water source to the intended end or user. The
Implementation of a Water Business System is very useful to the desired
company since it can lessen human error and will make their work efficient and
effective. They also stated that The system simply transforms the current
manual system to an automated one which lessens errors in using the manual
way of tabulating the sales. It is designed and quality to meet the requirements
of the customer, Galan, Semiano & Libertad (2020). So, the proponents
proposed a system to be easily accessible in online ordering, user-friendly,
easy transaction, and scheduled to have an order on time.

Water Refilling Station as Inventory Management System

Bucao (2020), stated that a water refilling stations an inventory


management system to permit owners to watch their items regularly. An in-
depth interview was conducted to collect the required data needed to make the
new inventory system by utilizing data system tools. A data system may be
software that will help organize and analyze the info by turning data into useful
information.

Information System Plan for Water Zip Purified Drinking Water

They stated, one is that the in-charge of administrative duties like keeping
records, logging and handling cash sales, and she/he is additionally the one
receiving the calls or SMS from the customer's order or delivery request for the
development of Information System Plan for Water Zip Purified Drinking Water,
Pilones et al., (2020).

Inventory System for Water Refilling Stations

The requirement for water replenishing stations has grown over time,
according to M.Young., et al (April 2020). These tiny firms must become more
efficient in order to keep up with the increased demand. This project aims to
develop an inventory system for water refilling stations that would allow owners
to keep track of their inventory on a regular basis.

8
CHAPTER III
TECHNICAL BACKGROUND

PHP

PHP is a server-side scripting language used on the Internet to create


dynamic web pages. It is often coupled with MySQL, a relational database
server that can store the information and variables the PHP files may use,
(Bradley, 2017). It is used as the scripting language, which is especially suited
for web development and can be embedded into HTML. PHP is a scripting
language specially designed to put up websites. A common use is data retrieval
from SQL databases. PHP is a scripting language that creates dynamic and
interactive HTML Web pages. A server processes PHP commands when a
website visitor opens a page and then sends results to the visitor’s browser.

The proponents chose PHP as the programming language due it is a


server-side scripting language designed specifically for web development. It is
easy to learn, widely used, and has a large community of developers who
contribute to its ongoing development and improvement. Additionally, PHP is
compatible with many popular databases, making it versatile for building
dynamic websites with interactive features.

Laravel

Laravel is a free, open-source PHP web application framework that


enables developers to create scalable, secure, and robust web applications. It
is one of the most widely used PHP frameworks and is renowned for its
expressive syntax, graceful and intuitive syntax, and extensive collection of
tools and libraries that help streamline web application development.

The proponents chose Laravel as PHP framework because it provides


an efficient, feature-rich, and user-friendly development environment that
makes it easier to build scalable, secure, and high-performance web
applications.

9
Hypertext Markup Language (HTML)

HTML stands for Hypertext Markup Language, the most widely used
language to write Web Pages. HTML is the language used to create web pages.
"Hypertext" refers to the hyperlinks that an HTML page may contain. "Markup
language" refers to the way tags are used to define the page layout and
elements within the page.

The proponents will use html to create the structure of the web page,
collect user input through forms, link elements and display images.

Cascading Style Sheet (CSS)

For customizing the frontend design of the system, Cascading Style


Sheets (CSS) will be used. Cascading Style Sheets, fondly referred to as CSS,
is a simple design language intended to simplify the process of making web
pages presentable.CSS handles the look and feel part of a web page. Using
CSS, developers can control the color of the text, the style of fonts, the spacing
between paragraphs, how columns are sized and laid out, what background
images or colors are used, layout designs, and variations in display for different
devices and screen sizes as well as a variety of other effects. CSS is easy to
learn and understand, but it provides robust control over the presentation of an
HTML document. Most commonly, CSS is combined with the markup
languages HTML.(TutorialsPoint Contributors, n.d.).

The proponents will use CSS because it separates the content of an


HTML document from the style and layout of that document. The proponents
writes CSS once, and then the same code could be applied to the groups of
HTML elements and reused in multiple HTML pages. Most pages from this
module use the CSS framework so the user could have a better experience
using the system interface.

Bootstrap

10
Bootstrap is one of the best and most used HTML/CSS/JS front-end
frameworks. It offers many ready-made components and resources; Bootstrap
significantly speeds up application development (Saniukaite, L., 2018). It is a
free, open-source front-end library, a collection of tools that helps developers
create websites or web applications. It provides a faster, easier, and less
repetitive solution for designing and building applications. Bootstrap quickly
became famous as a front-end framework that offered a wide set of tools, from
page grids to components that render a web page, all in the best possible way
for any device (Moreto, S., 2017). Unlike many web frameworks, it concerns
itself with front-end development only.

The proponents will use a bootstrap template in the system to make the
development faster and more convenient, especially in designing the whole
structure of the system.

Javascript

JavaScript is a client-side scripting language, which means the source


code is processed by the client's web browser rather than on the web server.
JavaScript has made modern web applications possible, applications with
which you can interact directly without doing a page reload for every action.
Traditional websites also use JavaScript to provide various forms of interactivity
and cleverness (Haverbeke, 2018).

The proponents will use JavaScript for the user interface of the system.
In some of the system's functions, especially in updating the list, the user
interface must change without refreshing the page to provide an interactive and
friendly user interface.

PHPMyAdmin

PhpMyAdmin is an open-source tool built on PHP that enables


proponents to administer MySQL and MariaDB databases online. To use it, the

11
developer must install the software on a server running either Windows or one
of the several Linux distros it supports. The software enables developers to
manage as many databases as possible. Developers can edit tables and
values, create and delete databases, or even import and export them (Hughes
J. , 2017).

The proponents chose to use PhpMyAdmin because installation is


straightforward and very fast. However, using PhpMyAdmin provides the
proponents with a web interface of the database structure. Hence, the
proponents use it to organize the database component of this module.

MYSQL

To add, access, and process data stored in a computer database,


developers need a database management system such as MySQL Server.
Since computers are very good at handling large amounts of data, database
management systems are central in computing as standalone utilities or as
parts of other applications. A relational database stores data in separate tables
rather than putting all the data in one big storeroom. The logical model, with
objects such as databases, tables, views, rows, and columns, offers a flexible
programming environment. Developers set up rules governing the relationships
between different data fields, such as one-to-one, one-to-many, unique,
required, or optional, and “pointers” between other tables. The database
enforces these rules so that with a well-designed database, the application
never sees inconsistent, duplicate, orphan, out-of-date, or missing data, as
stated (MySQL, 2017).

The purpose of using it is to provide a reliable and efficient way to store


and manage large amounts of data that is required by the website. MYSQL can
handle complex data structures and queries, making it a popular choice for
websites that require a high degree of data management. MySQL is used with
PHP as a back-end tool. MySQL is a popular online database that could be
interfaced with PHP. Therefore, PHP and MySQL are excellent choices for the
proponents.

12
XAMPP

XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP
(P), and Perl (P). It is a simple, lightweight Apache distribution that makes it
easy for developers to create a local web server for testing. Everything the
developer needs to set up a web server – server application (Apache),
database (MySQL), and scripting language (PHP) – is included in a simple
extractable file. XAMPP is also cross-platform, which works equally well on
Linux, Mac, and Windows. Since most actual web server deployments use the
same components as XAMPP, it also makes transitioning from a local test
server to a live server extremely easy. Web development using XAMPP is
especially beginner friendly, as stated by MIKOLUK (2013).

The proponent's purpose in using XAMPP is to run the project


development locally; running on a local machine speeds up the development
stage of this project. Installation of XAMPP is effortless and fast; all the tools
needed to set up a web server are included in a simple extractable file, as
mentioned above by Kasia Mikulok (2013). There is no need for the proponents
to upload the scripts to a live server.

Visual Studio Code

Visual Studio Code is a code editor that supports development


processes such as debugging, task execution, and version control. It tries to
give only the tools necessary for a speedy code-build-debug cycle, leaving
more sophisticated processes to IDEs with more features, such as Visual
Studio IDE.

Visual Studio Code will be utilized during the development of the system.
It provides easy access to folders, especially when utilizing the code. Visual
Studio Code is used for debugging, syntax highlighting, intelligent code
completion, snippets, and code refactoring.

13
CHAPTER IV

METHODOLOGY

1. Conceptual Framework

A conceptual framework is a written or visual representation of an


expected relationship between variables. Figure 1 Demonstrates how the
admin, staff and customer used their account credentials to process
information. The concept of the project includes the input, process and output
of the Agua Boo Water Web-based management. The inputs consist of the
given features of the system, including registrations and logins of admin, staff
& customers, management of customer orders and online ordering. Also, there
are processes that will be completed such as requirements gathering, interview
with the client, analysis of similar projects, developing a design of the project,
actual coding of the system, testing a project, deployment, and reviewing user
feedback. As a result, the Agua Boo Water Web-Based Management System
is developed and performs well as output.

Figure 1. Conceptual Framework

2. Project Approach

In conducting the project, an interview was conducted together with the


manager of the Agua Boo Water. The purpose of this interview is to learn about
the issues and challenges they faced while semi-manually managing the
transaction. Through this interview the proponents determined the problems
regarding the manual filing and management of records in the company.

14
According to the manager of Agua Boo, they find it hard to manually write and
record the sales of the company, customer information and orders, counts of
the gallons being borrowed, and sales reports. Also, they find it time-consuming
to manually check those previous transactions made by the customers. Some
of the customers also find it hard to determine the status of their orders.

With the support of several project studies, the challenges were then
assessed, and the idea of establishing a Web-based Management System to
conduct transactions between the admin and customers was established.

3. System Development Methodology

The agile technique was utilized during each phase of the completion of
this project. It begins with the preparation of the system that will be produced
for the analysis, then moves on to the development, construction, testing, and
assessment of the system to conduct the extra projects. Finally, it culminates
with the evaluation of the system. The objective of the agile software
development life cycle is to produce and deliver working software in an efficient
and timely manner. The capacity to design and deploy simultaneously inside a
predetermined environment is one of its many advantages. Other benefits
include rapid capability creation and demonstration, suitability for fixed or
changing demands, and suitability for both.

Figure 2. Agile Development Model

15
Figure 2 depicts the Agile Model SDLC model chosen for this project.
The agile model's stages are well-defined and easy to comprehend for
consumers. It also enables proponents to update the established system in the
future for the consumers' comfort. Plan, Design, Development, Testing,
Release, and Feedback were all followed by the proponents

Requirements go with Identifying and prioritizing the needs and


expectations of the customer and stakeholders for the project. The proponents
utilized an interview with the stakeholders in the first step to obtain more
information that would drive the creation of their project, which included
planning for required needs, ideas, and other system features.

Designing concerns with creating a high-level design for the product,


including user interfaces, and system architecture. The proponents begin
creating the GUI of the program and how the system will work in the second
stage. This is where the proponents establish the project's purpose and
objectives.

The development phase includes building and coding the product in


short, iterative sprints, with regular feedback and collaboration from the
customer. Following the design step, the proponents begin the actual coding
for the system to fulfill the system requirements. Algorithm design, coding,
program compilation, testing, and debugging of produced programs all begin
here.

Testing deals with performing rigorous testing throughout the


development phase to guarantee that the prodject works as it should. The
proponents test the system at this step to ensure that it is created according to
the users' demands and that any flaws are detected. If there are any difficulties
with the system, the proponents debug and correct it right away, and the
process is continued until the software program is fully functional.

16
Deployment concerns with releasing the project to production after
ensuring that it's stable and ready for use by end-users. The system is now
complete, and the proponents have released or are about to release it to their
client, which has been uploaded to the internet and is ready to use. Users tests
the web system in this phase to see if it satisfies their needs and will be valuable
to them.

The last phase is review. This phase includes evaluating the project's
progress and finding opportunities for improvement, with a focus on continual
improvement and collaboration among team members and stakeholders. The
user input or review was delivered to the system in the last stage. They were
given questionnaires to complete to grade the overall system's performance
and provide feedback. The users also looked for any issues so that proponents
may address them as quickly as feasible.

4. System Analysis

i. Flowchart
Figure 3 below illustrates a systematic approach to handling users and
their activities within the system. It begins with the initial system start-up,
leading to a user authentication phase where it's determined whether a login
page should be presented. New users are guided to a registration process
where they input credentials to create an account. Existing users login with their
credentials, which the system verifies for accuracy.

Upon successful login, the system allocates appropriate access rights,


segregating users into three categories: Admin, Staff, and Customer, each with
tailored functionalities. System administrators are granted comprehensive
control, enabling them to manage trucks, orders, products, gallons and user
accounts, and they can also generate detailed sales reports. Staff members
have the ability to manage orders assigned to them and updating the number
gallons returned by the customer. Customers are provided with a more limited
set of functions, allowing them to place orders, track their progression, and
review their transaction history.

17
The process flow is designed to ensure secure and role-specific access
to system functions, enhancing operational efficiency. The sequence concludes
when the user session is terminated, either through logging out or exiting the
system.

Figure 3. Flow Chart

18
ii. Context Level Data Flow Diagram

The data flow diagram at the Context Level represents the entire system,
including the essential inputs and outputs in addition to the system as a whole.
The context flow for Agua Boo's Web-Based Management System is depicted
in Figure 4. They are composed by three different users. Every customer makes
a request or produces and submits an order transaction to the admin/staff. The
admin then accesses the system to supply the necessary data for the
processes, and the system generates information based on the queries that the
admin performs whereas the staff will manage the assigned orders and
delivery.

Figure 4. Context Level Data Flow Diagram

19
iii. Level 0 Data Flow Diagram

Figure 5. Level 0 Data Flow Diagram

The level 0 flow diagram is a detailed context diagram. The explosive


flow diagram of the system is shown above in Figure 5. The system admin
manages all of the system information including the system info setting, user
info, managing orders, managing gallons, managing sales and generating
reports. The staff manages orders and gallons returned. The customer can only
manage his/her user information, create and submit orders, view order details,
and monitor or track order status.

iv. Use Case Diagram

This section provides a textual description of how users, specifically


customers, administrators and staff, could utilize the system to accomplish a

20
given task. This outlines how a system responds to a request from the point of
view of the customer, staff, and administrative modules. Customers can create
and submit orders, but admins have complete control over the system and can
do whatever they want with it. The staff can manage orders assigned to them
which includes viewing the assigned orders to deliver and changing their status
to delivered or canceled. They can also manage the gallons returned by the
customer.

Figure 6. Use Case Diagram

21
v. Entity Relationship Diagram

Figure 7. Entity Relationship Diagram

The Entity Relationship Diagram, which is seen in Figure 7, depicts the


structures and connection of each system data detailing customer profiles,
orders, and product information. It shows relationships where customers can
have multiple addresses and orders, orders can include various products, and
these are linked to specific delivery trucks. Additionally, the database manages
staff details, website settings, and password reset functionalities, with a design
that emphasizes normalization, and data integrity and supports the system's
scalability. Each table is equipped with timestamps for tracking data
modifications, ensuring a comprehensive and efficient data management
system.

5. System Requirements Specification

i. Functional Requirements

The web-based management system will contain a dashboard. The


system administrator will have access to a dashboard that displays important

22
information such as the total number of sales in daily, weekly and monthly, the
total number of orders, and the total number of gallons borrowed, as well the
sales reports.The admin runs as the head of the organization and has full
access to all features of the system. The staff can only view his assigned order
and allows recording of returned gallons. For the customer side, the system
provides an easy and hassle-free way to place orders online. Customers can
create an account and log in to view their order history, track their current
orders, and make new orders.

Administrator
● Can view the system.
● Can log in to the system.
● Can access dashboard
● Can access, add and manage users.
● Can access order list
● Can access the gallon management.
● Can access the products
● Can access trucks
● Can access and generate sales reports.
● Can access system settings

Staff
● Can view the system.
● Can log in to the system.
● Can access order list
● Can access gallons returned

Customer
● Can view the system.
● Can sign up and log in to the system.
● Can access online ordering orders and view status.
● Can access profile information

23
ii. Non-functional Requirements

The web-based system had non-functional requirements identified such as:

● The system should have separate system functionality based on the


roles.
● The customers should not be able to access the admin-level
management.
● The system should have a list of the orders and number of gallons for
every customer borrowed, sales reports, and user management
● The system should have details or profile information for every customer.

iii. Other Project Requirements

Software Requirements
Software requirements in building the system are:
● Operating Systems (at least Windows 7 or any equivalent OS or higher).
● Browsers like Google Chrome, Firefox, Safari, Internet Explorer and
Opera Mini.
● Text editors like Visual Studio and Sublime Text Editor, MYSQL, and
XAMPP.

6.Project Management

i. Gantt Chart

Figure 8 is a Gantt chart that depicts the amount of time needed to


complete the work necessary to accomplish the system's goals. In addition to
this, it presents a graphical illustration of the tasks or stages that are planned
out across a given period of time. At this phase, the proponents were
responsible for preparing and coordinating the numerous tasks that needed to
be finished in order to develop the project.

24
Figure 8. Gantt Chart

7. Plan for Implementation and Testing

After evaluating each unit, all the units developed during the
implementation phase were integrated into a system. Following system
integration, the entire system was thoroughly examined for bugs and errors. It
underwent a comprehensive evaluation, and suggestions were provided for
future revisions and enhancements. The system was then pushed beyond its
limitations to ensure that it would not crash under extreme conditions.

The website was tested across various browsers, during which errors
were noted, and the application was subsequently debugged. After the testing
phase, the proponents gathered all comments from those who participated in
the system test. These insights served as a guide for adding and eliminating
unnecessary features of the system, as well as determining whether the
software requirement specifications and the specific objectives of the system
had been successfully met.

I. Step 1 Unit Testing

During the testing phase, the proponents conducted comprehensive


tests on the system, focusing on each component as well as its functionality.
Additionally, the admin of the system was composed of the management and
staff who work at the Agua Boo Water Station. This allowed for the identification
and rectification of any issues, in addition to investigating the most likely cases
to determine whether or not the code was flawed. Before deploying the
management system, specific bugs in the code that were causing problems

25
were fixed. Furthermore, the graphical user interface and database design of
both modules were adjusted to conform to the requirements that were intended
for them.

II. Step 2 Integration

During this phase, all of the individual parts of the system were brought
together and evaluated in the context of the whole. This was crucial to ensure
that the system's subcomponents interacted properly with external
dependencies, guaranteeing the system's proper functioning. The devices that
were submitted by the stakeholders were investigated by the proponents to
determine whether or not they conformed to the specification.

III. Step 3 Usability Testing

During this stage of the process, the owner, manager, staff, and
customers tested the system. The proponents anticipated receiving feedback
from the participants regarding whether or not it satisfied the organization's
requirements, both functional and non-functional.

 3.1 Orientation

At this stage of the usability testing of the system, the proponents


presented the system to the stakeholders. In particular, they presented
it to the owner, manager, and staff of Agua Boo. Additionally, the
contents of the system, along with its objectives and functionality, were
discussed in detail.

 3.2 System Demonstration

This stage included hands-on experience with the system up to the


admin module, as well as step-by-step instruction on the execution of a
number of different tasks. Additionally, each of the navigational elements

26
and buttons were explained in terms of the function they serve and the
scope of the actions that are generated when they are triggered.

 3.3 System Testing

This step occurred after the system had been demonstrated, and it
required users to have a fundamental understanding of how to utilize the
system. The entire process of testing the system involved staff from
Agua Boo being chosen by the manager, which entailed using the
system in general. All functionalities of the system, from the
administrator side to the customer side, were tested and observed to see
if they adhered to the system's objectives without any errors. This testing
was performed by the manager, staff, and customers from Agua Boo.

 3.4 Survey Using System Usability Scale (SUS) Questionnaire

The following is a list of questions that were taken from the


System Usability Scale (SUS) template and were utilized by the
proponents to evaluate the level of satisfaction provided by the
respondents regarding the product.

1. I think that I would like to use this system frequently.


2. I found the system unnecessarily complex.
3. I thought the system was easy to use.
4. I think that I would need the support of a technical person to be able to
use this system.
5. I found the various functions in this system were well integrated.
6. I thought there was too much inconsistency in this system.
7. I would imagine that most people would learn to use this system very
quickly.
8. I found the system very cumbersome to use.
9. I felt very confident using the system.
10. I needed to learn a lot of things before I could get going with this system.

27
The final score was determined using a Likert scale with five points,
ranging from strongly agree to strongly disagree (as shown in Figure 9).

Figure 9. Likert Scale

Each response is assigned a value for the SUS score calculation. The
following is a breakdown of the points for the responses: Strongly Disagree
receives one point, disagree receives two points, Neutral receives three points,
agree receives four points, and Strongly Agree receives five points.

According to (Chinn, 2022), to calculate the overall SUS score the


following framework will be used.:

● Add up the total score for all odd-numbered questions, then


subtract 5 from the total to get (X).
● Add up the total score for all even-numbered questions, then
subtract that total from 25 to get (Y).
● Add up the total score of the new values (X+Y) and multiply by
2.5.

Figure 10. System Usability Scale Scoring

28
Figure 10 is a snapshot of the range of scores and what they mean after
adding the total score of the new values (X+Y) and multiplying it by 2.5. This
snapshot was created after calculating the total score of the new values.To
provide further clarification, a System Usability Scale score above 60 was
considered above average, while below 60 was deemed below average. A
score of 70 or above was considered acceptable, and an unacceptable score
corresponded to 50 percent. To assess if the system's capabilities and features
meet the users’ expectations.

IV. Deployment

The deployment took place in the Agua Boo Water Store. At this phase,
it was required that the handlers of the program administer the system that had
already been through and conformed to the steps that were described earlier.
The approach involved installing the system on the laptop owned by the
shareholder, as well as installing the system online. The design of the system
itself was adaptable, making it possible to accommodate any changes or
modifications that might have occurred in the future.

29
CHAPTER V

RESULTS AND DISCUSSION


1.Results

This chapter explains the module as implemented by the proponents.


The included interfaces were the final results with all specifications in relation
to the planning phase as shown in Gantt Chart Figure 8. The graphical user
interface was simple for a user-friendly interaction. Testing was done using
SUS survey questionnaires; and through this, the proponents gathered enough
data to provide the usability of the system.

I. Landing Page

Figure 11. Landing Home Page

The landing page for the "Agua Boo Water” utilizes a split layout design,
with a dominant purple color scheme on the left that effectively draws attention
to the company logo and the call-to-action button. This layout is optimized for
user engagement, directing visitors' eyes towards the ordering process.

30
Figure 12. About Page

The "About Us" section of the website features a headline "Quench your
thirst on time." which implies a promise of timely service, which is a valuable
aspect of customer satisfaction in the water refilling industry. The collage of
images supports this by showing different stages of the service, such as the
filtration systems, the delivery vehicles, and the storefront, giving customers a
visual tour of the efficiency and reach of Agua Boo's operations. This ties back
to the section's purpose by demonstrating the company's commitment to
delivering on its value proposition promptly.

Figure 13. Contact Page

31
The "Reach Us Out" section on the website’s Contact is designed for
accessibility and customer interaction. It prominently features a map to assist
customers in locating Agua Boo Water Refilling Station, enhancing physical
accessibility. The section also provides various means of communication
including a Facebook link, a phone number, and an email address, offering
multiple channels for customer inquiries and support.

ii Customer Login

Figure 14. Customer Login Page

The login form displayed is minimalist in design, focusing the user's


attention on the task of entering their credentials. The fields for email and
password are presented in a straightforward layout, with a clear option for those
who may have forgotten their password. The continuity of the brand's color
scheme with the purple and the background image of the refilling station subtly
reinforces the company's identity.

32
iii Customer Password reset

Figure 15. Customer Password Reset Link

Figure 16. Customer Reset & Type New Password

The password reset page features a clean and simple interface, guiding
users through a two-step process. The first step asks for the user's email
address to send a password reset link, maintaining a straightforward approach
with minimal distractions. In the second step, users are prompted to enter and
confirm their new password, which is a standard security measure for account

33
recovery processes. The design is consistent with the website's branding,
reinforcing trust and security while providing a user-friendly experience for
account retrieval.

Iv. Customer Registration

Figure 17. Customer Registration Page

The registration page is well-organized, requesting essential information


such as full name, email address, password, phone number, city, barangay,
and purok. The layout is intuitive and user-centric, with clear fields for input and
a contrasting "Register" button that stands out against the purple theme. A link
for users who are "Already registered?" suggests a thoughtful consideration for
navigation, ensuring that returning users can easily switch to the login page if
they've mistakenly accessed the registration form.

v. Customer Profile Page

34
Figure 18. Customer Profile Page

The Customer Profile Page on the website is designed for a personalized


and informative user experience. It neatly presents the user's information,
including full name, address, and contact details, with options to edit the profile
or change the password for account security. The panel also includes a
summary of account activity, showing the number of borrowed gallons and a
concise order summary that includes active orders, delivered, cancelled, and
total orders. The interface allows for easy tracking of user activity, which can
enhance customer satisfaction by providing a clear and manageable overview
of the user's interactions with the service. The "Add Order" button is
strategically placed to encourage continued engagement.

35
vi. Customer Add Order Page

Figure 19. Customer Current Delivery Address

Figure 20. Customer Add Delivery Address

The customer delivery address interface is designed to provide a


seamless and user-friendly experience. Initially, it presents the customer's
default address, with an option to change the recipient, indicating flexibility for
the delivery locations. Upon opting to change the recipient, a modal appears
listing multiple saved addresses, allowing the user to quickly select an
alternative delivery point without the need for manual re-entry. This system
enhances convenience, saves time, and reduces the potential for input errors,
catering to customers who may have different locations for receiving orders.

36
Figure 21. Customer Create and Submit OrderPage

The "Customer Create Order Page" not only serves as a functional


element of the website but also embodies one of the objectives of the project –
to facilitate a seamless ordering process. The design of the page, with its
intuitive product selection and bundle deal options, directly demonstrates the
realization of this objective by providing an effective, user-centered ordering
system. The simplicity and clarity of the page align with the study's goals of
enhancing customer experience and operational efficiency.

37
Figure 22. Customer Edit Details

The "Customer Edit Details" interface on the profile page is designed to


give users the ability to update their personal information easily. This feature is
essential for maintaining accurate records and ensuring that service delivery
can be performed efficiently. The modal window provides a straightforward form
where customers can quickly update their name, email, address, and phone
number, which are critical details for order processing and communication.

Figure 23. Customer Change password

38
vii. Customer Order History Page

Figure 24. Customer Order History

The "Customer Order History" page is designed to provide users with a


comprehensive view of their past transactions. The tabular format lists the order
number, recipient, total price, quantity returned, date ordered, and date
updated, giving users full visibility into their purchase history. The 'View' action
button for each order suggests that more detailed information can be accessed,
allowing users to review individual order specifics. This setup not only offers
users transparency regarding their interactions with the service but also aligns
with business objectives of fostering trust and accountability by keeping a clear
and accessible record of customer transactions.

39
Figure 25. Customer View Order History Details

The customer view order history details page is a detailed interface that
displays a list of past orders, showing the order ID, recipient, total price,
quantity, date ordered, and date updated. A modal window within the page
allows customers to delve into specific details about each order, such as the
types of water purchased and their individual prices, providing a transparent
and thorough account of transaction history. This enables customers to review
their orders comprehensively and is an essential feature for maintaining an
informative and user-friendly service.

40
Figure 26. Customer Active Orders

Figure 27. Customer View Active Order Details and Status

The figure 26 page offers a streamlined view for customers to monitor


their current engagements with the service. It lists active orders with details like
order ID, recipient name, total price, product ordered, and transaction status,
providing clarity on the progress of each order.

viii. Staff & Admin Login

41
Figure 28 Staff and Admin Login Page

The Staff and Admin Login Page presents a clean and professional
interface, with a straightforward form for login credentials. The backdrop
features a relevant image of water bottles, which immediately contextualizes
the page to the water refilling business. The login form itself is minimalistic,
requesting just the essential information—email and password—with a
prominent login button. This design suggests an efficient and secure entry point
for staff and administrative access, underscoring the importance of functionality
and ease of use for internal users who require access to the system's backend
for management and operational tasks.

ix. Staff Dashboard Page

Figure 29. Staff Active Orders Dashboard

Staff Active Orders Dashboard is efficient and easy to monitor. It shows


a table of active orders with columns for the customer's name, address, contact
number, total quantity of things ordered, total amount, date created, and actions
(check marked to update order status). Staff can evaluate and manage orders
in real time with this arrangement. The search capability and pagination controls

42
indicate a system that can handle a huge volume of orders, helping staff
streamline process and improve service.

Figure 30. Staff Active Orders Update

The "Staff Active Orders Update" page provides a structured interface


for staff to view and update the details of a customer's order. It is split into
sections for customer details and order details, presenting all the necessary
information such as the customer's name, address, contact number, assigned
truck, and the specifics of the order including item description and price. There's
also a section for the status of the order and the number of returned gallons.
Editable fields and 'Save' and 'Cancel' buttons suggest that the staff can modify
the order details and update the order's progress. This design prioritizes
functionality and operational management, allowing for efficient tracking and
modifications of ongoing orders.

43
Figure 31. Staff Delivered Orders Dashboard

The Staff Delivered Orders Dashboard is a tool designed for monitoring


the status of completed deliveries. It displays a list with columns for the
customer's name, address, contact number, total quantity of items delivered,
the total amount of the order, and the date delivered. This straightforward layout
aids in providing a quick reference for staff to review completed transactions.
The table is equipped with search functionality, enhancing the ability to filter
through records efficiently. Additionally, pagination is included, indicating the
system can handle and display a large volume of data, which is essential for
high-operational businesses.

Figure 32. Staff Canceled Orders Dashboard

44
The staff canceled orders dashboard is a specialized interface for
tracking orders that have not been completed, providing clear information such
as customer name, address, contact number, total quantity, total amount, and
reasons for cancellation.

x. Admin Dashboard Page

Figure 33. Admin Dashboard

The admin dashboard provides a comprehensive overview of key


business metrics at a glance, with widgets displaying sales data, sales returns,
pending order totals, and recovered cans. It includes graphical representations
like a daily sales trend line and a bar chart for sales per truck, enabling quick
analysis of business performance over time. This dashboard is a critical tool for
administrators to monitor, analyze, and make informed decisions to drive the
business forward.

xi. Admin Account Page

45
Figure 34. Admin Customer account module

The "Admin Customer Account Module" is a segment of the


administrative dashboard that provides a list of customer accounts. It features
sortable columns for ID, name, address, contact details, account status, and
actions—likely including functions such as edit, view, or delete. This module is
an essential tool for administrators to manage customer data, monitor account
activity, and perform necessary administrative actions efficiently.

Figure 35. Admin Add New Customer

46
Figure 36. Admin Edit Customer Details

Figure 37. Admin Staff account module

The Admin Staff Account Module displays a table listing staff members,
which is a key component of the internal management system for an
administrator. It shows essential details such as staff ID, first and last names,
addresses, and roles, and has an 'Actions' column with options to presumably
view, edit, or deactivate staff records.

47
Figure 38. Admin Add New Staff account

Figure 39. Admin Edit Staff Details

This feature allows the system administrator to oversee the list of users.
Each interface includes features for searching, displaying a specified number
of entries, and navigating between records. add and edit staff and customer
info.

48
xii. Admin Orders Page

Figure 40. Admin Orders Module

The Admin Orders Module exemplifies one of the project's objectives,


which is the effective management of orders. This system streamlines the
administrative oversight of customer transactions, enabling the tracking of order
statuses and updates. The implementation of such a module directly aligns with
the goal of enhancing operational efficiency and customer service management
within the business.

Figure 41. Admin Add New Order

49
Figure 42. Admin Update Order status

Figure 43. Admin Truck Deliveries

The order module allows the system administrator to access all features
of managing the orders. This includes the ability to filter orders by status, select
a date range for order display, search for specific orders, and perform actions
such as editing or updating order status, viewing orders per truck, viewing and
monitoring order list information The interface indicates an interactive, real-time

50
system for managing customer orders, designed to offer an overview of
transactions for efficient administration.

xiii. Admin Resource Page

Figure 44. Admin Resource


(truck, products and borrowed gallon management)

51
Figure 45. Admin Add Truck

Figure 46. Admin Edit Truck

52
Figure 47. Admin Add Products

Figure 48. Admin Edit Product Details

The resource module showcases an administrative panel for managing


trucks, products, and borrowed items within the Agua Boo Water Web-based
Management System. It presents a table listing trucks, each with an ID and
editable actions, alongside a similar table for products, detailing product names,
prices, and options for modification. The other table features tracking borrowed
items, such as water gallons, displaying customer information, address, phone

53
number, and quantity of items borrowed. These interfaces provide a
centralized, user-friendly platform for administrators to oversee and manage
resources critical to the delivery service, including vehicle logistics
maintenance, products and borrowed gallons highlighted from the project’s
objectives.

xiv. Admin Settings Page

Figure 49. Admin Settings

54
Figure 50. Admin Edit Setting

The figure 47 and 48 shows the "Settings" module, specifically the "Site
Settings" section. This user interface allows the super admin to view and edit
the company’s profile and contact information that appears on the website
landing page. It includes editable fields for the company's slogan, which is
currently set to a customer-centric message, "Quench your thirst,” and a brief
description of the business, defining Agua Boo as a water refilling station. On
the contact side, it lists the company's Facebook page for social media
presence, a phone number, and an email address for direct contact. The 'Edit'
button indicates that you can update these fields as needed, indicating a
dynamic system that allows you to manage site content directly through the
admin panel.

xv. Admin Generate Reports

55
Figure 51. Generate Report

Figure 52. Print Generated Sale Report

The figure 49 and 50 display the report generation and printing features
of the Agua Boo Water Management System's report generation and printing
features. In figure 49, the dashboard provides an interface for selecting a date
range to generate sales reports, with fields for the start and end dates and a
submit button to process the request. The second image shows the rendered
sales report within the system's interface, ready for printing. This functionality
provides the administrative user with a streamlined process for creating

56
periodical sales reports for analysis or record-keeping purposes, making it easy
to access printed versions of sales data for any given timeframe as reference
to project’s objectives.

2. Discussion

The SUS survey results for the "Agua Boo Web-based Management
System" showed a variation in perceived usability across different user roles
which are the admins, staff, and customers or consumers (as shown in Table
1).

As depicted in figure 53 below. Administrators rated the system highly,


with an average SUS score of 81.25%, indicative of an 'A' grade or excellent
usability. Staff members' scores were also strong, averaging 80.33%, a 'A'
grade that points to excellent usability. Customers, making up the largest group
with 15 participants, gave the system a SUS score of 75, which corresponds to
a 'B' grade, signifying good usability.

In general, the system's mean SUS score was 76.5%, translating to a 'B'
grade. This solid rating reflects the system’s generally good usability. The
relative score gap between customers compared to staff and administrators
highlights specific areas of improvement.

Figure 53. SUS Survey Results

57
Table 1. Respondents Testing Results

R# Module Q Q Q Q Q Q Q Q Q Q SUS Grade


1 2 3 4 5 6 7 8 9 10 SCORE

Resp. 1 Admin 5 2 5 5 5 1 5 1 4 4 77.50 B

Resp. 2 Admin 5 4 5 1 5 4 5 1 5 1 85.00 A

Resp. 3 Staff 5 5 5 4 5 1 4 2 5 2 75.00 B

Resp. 4 Staff 5 3 5 2 5 1 5 1 5 1 92.50 A

Resp. 5 Staff 5 5 5 3 5 1 5 1 3 3 75.00 B

Resp. 6 Customer 4 4 4 3 5 2 5 2 3 3 67.50 C

Resp. 7 Customer 3 2 5 3 4 1 5 1 5 2 82.50 A

Resp. 8 Customer 4 5 3 2 5 1 5 2 5 1 77.50 B

Resp. 9 Customer 2 4 3 4 5 3 5 1 3 3 57.50 D

Resp. 10 Customer 5 3 3 3 5 1 3 1 5 3 75.00 B

Resp. 11 Customer 3 2 5 3 5 1 5 1 5 4 80.00 A

Resp. 12 Customer 3 4 4 4 5 2 3 2 4 3 60.00 D

Resp. 13 Customer 4 3 3 2 5 2 4 1 4 2 75.00 B

Resp. 14 Customer 3 2 5 3 5 2 5 1 5 2 82.50 A

Resp. 15 Customer 5 5 3 2 5 1 5 1 5 1 82.50 A

Resp. 16 Customer 3 4 5 3 5 2 5 1 4 3 72.50 C

Resp. 17 Customer 3 4 4 3 5 1 4 1 3 2 85.00 A

Resp. 18 Customer 4 4 4 3 5 1 4 1 3 2 72.50 C

Resp. 19 Customer 4 5 3 2 5 1 5 1 5 1 80.00 A

Resp. 20 Customer 4 5 3 2 5 1 5 1 5 3 75.00 B

Average 76.5 B

58
The table above shows the individual testing results and how individual
SUS scores were calculated. The process involves summing the scores for all
odd-numbered questions and subtracting 5 to obtain (X). Simultaneously, the
total score for all even-numbered questions is summed, and the result is
subtracted from 25 to derive (Y). Combining these new values (X and Y) and
multiplying the sum by 2.5 yields the final SUS score. And for the overall mean
of the system's SUS score, all respondents' results are summed up and divided
to get the average mean score of the system.

59
CHAPTER VI
CONCLUSION AND RECOMMENDATION

1. Conclusion

Based on the conducted testing, the implementation of the Agua


Boo Web-based Management System was acceptable. Administrators
rated the system highly, with an average SUS score of 81.25%,
indicative of an 'A' grade or excellent usability. Staff members' scores
were also strong, averaging 80.33%, an 'A' grade that also points to
excellent usability. Customers, making up the largest group with 15
participants, gave the system a SUS score of 75, which corresponds to
a 'B' grade, signifying good usability.
Overall, the system's mean SUS score was 76.5%, translating to
a 'B' grade. This solid rating reflects the system’s generally good
usability, acceptable, well-integrated, and was able to provide solutions
to the problems of the current process, primarily for the stakeholder.

2. Recommendation

The following are the recommendations for this system:

1. To the developers that would enhance this system, they can add
a legend where it provides a distinction of colors on which delivery
van was the order assigned.
2. The developers of the system are encouraged to add another field
which is for the uploading of an ID photo of the customer for
validation and verification purposes.
3. Future developers of the system should put a restriction that
allows the customers to be changed into inactive for not making
new orders for the next 15 days.

60
REFERENCES

Bradley, A. (2018, March 10). Learn PHP. Retrieved from ThoughtCo.:


https://www.thoughtco.com/learn-php-2693925
Bucao, S. C., Carreon, A. G., Lauengco, T. D., & Young, M. N. (2020,
April). Designing a Computer Based Inventory System of Crystal Clear
Water Refilling Station: A Case Study. Retrieved from IEEEXplore:
https://ieeexplore.ieee.org/document/9101939/authors#authors
Chinn, A. (2022, July 22). What's the System Usability Scale (SUS) &
How Can You Use It? Retrieved from Hubspot:
https://blog.hubspot.com/service/system-usability-scale-sus
Clemmens, A. (1987). Delivery System Schedules and Required
Capacities. Retrieved from Semantic Scholar:
https://www.semanticscholar.org/paper/Delivery-System-Schedules-
and-Required-Capacities-
Clemmens/f03eac88d067b0ea1bb2bc07007f331ca07cc0e9
Contributors, T. P. (n.d.). What is CSS? . Retrieved from tutorialspoint:
http://www.tutorialspoint.com/css/what_is_css.htm
Dela Cruz, I. G. (2016, December). Water Refilling System. Retrieved
from Scribd: https://www.scribd.com/document/191086399/Water-
Refilling-System#
Eliver, G. (2019, September 20). Aqua Water Refilling Management
System Database Design. Retrieved from ItSourceCode:
https://itsourcecode.com/free-projects/database-design-projects/aqua-
water-refilling-management-system-database-design/
Eliver, G. T. (2019, March). AQUA WATER REFILLING MANAGEMENT
SYSTEM. Retrieved from Course Hero:
https://docs.google.com/document/d/1u1BZzkHkteQF0asVYAufgSZ0B
MtxpXz-/edit#
Haverbeke, M. (2018). Eloquent JavaScript 3rd edition. Retrieved from
Academia:
https://www.academia.edu/40513205/Eloquent_JavaScript_3rd_edition
Hughes, J. (2017, December 16). A Quick Guide to phpMyAdmin(And
How You User It). Retrieved from Elegant Themes:
https://www.elegantthemes.com/blog/resources/a-quick-guide-to-
phpmyadmin-and- how-you-can-use-it
Mikoluk, K. (2013, September 18). XAMPP Tutorial: How to Use XAMPP
to Run Your Own Web Server. Retrieved from Udemy:
https://blog.udemy.com/xampp-tutorial/

61
Moreto, S. (2017). Getting Started with Bootstrap 4 for Web
Development [Video]. Retrieved from PackPub:
https://www.packtpub.com/product/getting-started-with-bootstrap-4-for-
web-development-video/9781788999113
MySQL. (2017). What is MySQL? Retrieved from MySQL:
https://dev.mysql.com/doc/refman/5.7/en/what-is-%20Mysql.html
Norozpour, S., Momenzadeh, M., & Abolhasani, A. (2021, June).
Proposing new system for handling business data systems with more
functionality and usability. Retrieved from ResearchGate:
https://www.researchgate.net/publication/352298830_Proposing_new_
system_for_handling_business_data_systems_with_more_functionality
_and_usability
Olan, A. (2016). https://dev.mysql.com/doc/refman/5.7/en/what-is-
%20Mysql.html. Retrieved from Academia:
https://independent.academia.edu/ArleneOlan
Pacinabao, K. (2016, April). Marketing Plan: Water Refilling Station.
Retrieved from Course Hero:
https://www.coursehero.com/file/82278241/purified-water-refill-
stationdocx/
Pilones, D. G., Decasa, J. P., De Vera, V. E., & Alejandrino, J. (2020,
July). INFORMATION SYSTEMS DEVELOPMENT PLAN FOR WATER
ZIP PURIFIED DRINKING WATER. Retrieved from ResearchGate:
https://www.researchgate.net/publication/349895910_INFORMATION_
SYSTEMS_DEVELOPMENT_PLAN_FOR_WATER_ZIP_PURIFIED_D
RINKING_WATER
Saniukaite, L. (2018). Speeding up Application Development With
Bootstrap. Retrieved from Toptal: https://www.toptal.com/twitter-
bootstrap/speeding-up-development-bootstrap
UIUXTrend. (n.d.). Measuring and Interpreting System Usability Scale
(SUS). Retrieved from UIUXTrend: https://uiuxtrend.com/measuring-
system-usability-scale-sus/
Vegh, C. D. (2017, July). Water Refilling Station Management System.
Retrieved from Scribd: https://www.scribd.com/doc/141646258/Water-
Refilling-Station-Management-System

62
APPENDICES

1
APPENDIX A
USE CASE SUITE

64
● Administrator
○ UC-00 Manage System Settings
○ UC-01 Manage Accounts/Users
○ UC-02 Manage Orders
○ UC-03 Manage Trucks
○ UC-04 Manage Gallons
○ UC-05 Manage Products
○ UC-06 Manage Sales
○ UC-07 Generate Report
● Staff
○ UC-08 Update Order status
● Customer
○ UC-09 Create & Submit Order
○ UC-10 View/Track Order Status

Default Aspects of All Use Cases

Direct Actors Administrator Refers to the manager and


owner of the Agua Boo
Water that manages the
overall business
transaction

Staff Refers to the delivery guys


who manage the assigned
orders.

Customer Refers to the buyers or


consumers of Agua Boo
Water

Prerequisites The user login first using their credentials to be


able to use the system.

65
UC-00 Manage System Settings

Summary: The administrator can manage the system


settings such as updating the organization’s
tagline, fb page link, contact number , email
and description of the company

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator, staff

Main Success Scenario 1. On the bottom sidebar, click settings


2. Click the edit button to update the
tagline, description, facebook link,
contact number and email.

Alternative Scenario: None

UC-01 Manage Users

Summary: The administrator can manage the users of the


system, specifically registering new users such
as the staff or customer’ data.

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

Main Success Scenario 1. On the bottom sidebar, click Accounts

Alternative Scenario: None

UC-02 Manage Orders

Summary: The administrator can manage orders. This


include creation of orders, assigning to
deliveries as well as updating the order’s status.

66
Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

Main Success Scenario 1. On the bottom sidebar, click resource.


2. Inside of it “Van’s” Table can be found

Alternative Scenario: None

UC-03 Manage Trucks


Summary: The administrator can manage the delivery vans
by entering all the vehicles they’re using in
delivering gallons ordered by the customers

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

Main Success Scenario 3. On the bottom sidebar, click resource.


4. Inside of it “Trucks” table can be found

Alternative Scenario: None

UC-04 Manage Gallons

Summary: The administrator can manage the gallons, this


includes adding new gallon products and
tracking of borrowed gallons whereas the staff
can only update the number of returned gallons
by the customer

Priority: Expected

Use Frequency: Often

67
Direct Actors System Administrator, staff

Main Success Scenario 1. On the bottom sidebar, click resource.


2. Inside of it “Borrowed Gallons” table can
be found

Alternative Scenario: None

UC-05 Manage Products

Summary: The administrator can manage the products. It can


add, update, and delete products

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

Main Success Scenario 3. On the bottom sidebar, click resource.


4. Inside of it “Products” table can be found

Alternative Scenario: None

UC-06 Manage Sales

Summary: The administrator can manage and oversee the


sales. It provides real time monitoring of sales
per day, weekly, and monthly.

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

68
Main Success Scenario 1. On the bottom sidebar, click the
dashboard.
2. Inside of it is the graphical presentation
of sales.

Alternative Scenario: None

UC-07 Generate Reports

Summary: The administrator can generate sales reports.

Priority: Expected

Use Frequency: Often

Direct Actors System Administrator

Main Success Scenario 1.On the bottom sidebar, click the dashboard.

Alternative Scenario: None

UC-08 Update Order Status

Summary: The administrator and staff can update order


status as well as recording the number of gallons
returned.

Priority: Expected

Use Frequency: Often

Direct Actors staff

Main Success Scenario 1.On the top of staff dashboard, active orders
can be found and update it accordingly

Alternative Scenario: None

69
UC-09 Create, Submit order

Summary: The administrator can create and submit orders


as well as the customers who wish to order
online.

Priority: Expected

Use Frequency: Often

Direct Actors customer

Main Success Scenario 1. Inside the profile page, click the “Add
Order” button.
2. Enter delivery address and create and
submit orders.

Alternative Scenario: None

UC-10 View order status

Summary: The administrator and customers can view each


of the transaction orders.

Priority: Expected

Use Frequency: Often

Direct Actors customer

Main Success Scenario 1. In the profile page, scroll down and find
the active order table.
2. Click the specific order and view status

Alternative Scenario: None

70
APPENDIX B
DATA DICTIONARY

71
Table 2. Add Staffs

Database Table Name: addstaffs

Field Name Data Type Description

id BIGINT(20) Holds the STAFF ID, Auto


Generated, Acts as the Primary key

Truck id BIGINT(20) Holds the TRUCK ID

first_name VARCHAR(255) Holds the staff first name

last_name VARCHAR(255) Holds the staff lastname

address VARCHAR(255) Holds the staff address

contact_number VARCHAR(255) Holds the staff contact number

role VARCHAR(255) Type of user

email_address VARCHAR(255) Email of the user

password VARCHAR(255) The password of the user

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

Table 3. Customers

Database Table Name: customers

Field Name Data Type Description

customer_id BIGINT(20) Holds the customers or consumers


ID, Auto Generated, Acts as the
Primary key

customer_name VARCHAR(255) Holds the customers fullname name

customer_purok VARCHAR(255) Purok of the customer

customer_barang VARCHAR(255) Barangay of the customer


ay

customer_city VARCHAR(255) City of the customer

customer_phone VARCHAR(255) Contact number of the customer


num

72
borrowed INT(11) Quantity of the borrowed gallons of
the customer

is_active TINYINT(1) Status of the customer

customer_email VARCHAR(255) Email of the customer

customer_passw VARCHAR(255) The password of the customer


ord

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

Table 4. Addresses

Database Table Name: addresses

Field Name Data Type Description

id BIGINT(20) Holds the ID of the address, Auto


Generated, Acts as the Primary key

customer_id BIGINT(20) Holds theID of the customer

fullname VARCHAR(255) Holds the name of the customer

purok VARCHAR(255) Holds the purok address of the


customer

barangay VARCHAR(255) Holds the barangay address of the


customer

city VARCHAR(255) Holds the city address of the


customer

phonenum VARCHAR(255) Holds of the contact number of the


addresss

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

73
Table 5. Customer Forgot Password

Database Table Name: custom_forgotpassword

Field Name Data Type Description

customer_email VARCHAR(255) Holds the customer email where


reset link will be send

token VARCHAR(255) Holds the token

created_at VARCHAR(255) Date and time created

Table 6. Orders

Database Table Name: orders

Field Name Data Type Description

id BIGINT(20) Holds orders ID, Auto Generated,


Acts as the Primary key

customer_id BIGINT(20) Holds unique ID of the customer

order_cname VARCHAR(255) Holds the name of the customer

order_purok VARCHAR(255) Purok address of the order

order_barangay VARCHAR(255) Barangay address of the order

order_city VARCHAR(255) City of the order

order_pnumber VARCHAR(255) Contact number of the order

truck_id VARCHAR(255) Holds the truck id of the order

total_quantity INT(11) Holds the total quantity of the order

returned INT(11) Holds the quantity of returned


gallons of the customer

reason TEXT Reason for canceling order

total_price DECIMAL(8,2) Holds the total price of the order

order_status VARCHAR(255) Holds the status of the order

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

74
Table 7. Products

Database Table Name: products

Field Name Data Type Description

product_id BIGINT20) Holds ID of the products, Auto


Generated, Acts as the Primary key

product_name VARCHAR(255) Holds the name of the product

product_price DECIMAL(8,2) Holds the price of the product

bundle_quantity INT(11) Holds the bundle quantity of the


product

bundle_price DECIMAL(8,2) Holds the price of the bundle


product

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

Table 8. Order Products

Database Table Name: orders_products

Field Name Data Type Description

id BIGINT(20) Holds the ID of the created order,


Auto Generated, Acts as the
Primary key

order_id BIGINT(20) Holds the O

product_id BIGINT(20) Holds the dentist and employee


middle name

price DECIMAL(8,2) Holds the price of the ordered


product

quantity INT(11) Holds the quantity of ordered


products

is_bundle TINYINT(1) Is the the ordered product bundle

75
created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

Table 9. Trucks

Database Table Name: trucks

Field Name Data Type Description

id BIGINT(20) Holds the trucks ID, Auto


Generated, Acts as the Primary key

trucks VARCHAR(255) Holds the name of the tuck

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

Table 10. Site Settings

Database Table Name: site settings

Field Name Data Type Description

id BIGINT(20) Holds the info ID of the organization

slogan VARCHAR(255) Slogan or Tagline of the stakeholder

description TEXT Holds the short description of the


stakeholder

fb_account VARCHAR(255) Holds fb link account of the


stakeholder

phone_number VARCHAR(255) Contact number of the stakeholder

email_account VARCHAR(255) Holds the email of the company

created_at TIMESTAMP Date and time created

updated_at TIMESTAMP Date and time updated

76
APPENDIX C
TESTING DOCUMENTATION

77
Figure 52. Data Gathering (1)

Figure 53. Data Gathering (2)

78
Figure 54. System Presentation & Testing (1)

Figure 55. System Presentation & Testing (2)

79
Figure 56. System Presentation & Testing (3)

Figure 57. SUS Survey (1)

80
Figure 58. SUS Survey (2)

Figure 59. SUS Survey (3)

81
APPENDIX D

SUMMARY OF ANSWERED SUS SURVEY DURING TESTING

82
83
84
85
86
87
APPENDIX E
SYSTEM’S RELEVANT CODE

88
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\DB;
use App\Models\addstaff;
use App\Models\customers;
use App\Models\products;
use App\Models\trucks;
use App\Models\orders;
use App\Models\Sitesetting;
use App\Models\Address;
use Carbon\Carbon;

class AdminController extends Controller


{

public function __construct(){


$this->middleware('auth');
}

public function toDashboard(Request $request){

$timeFrame = $request->input('timeFrame', 'Daily');

switch ($timeFrame) {
case 'Weekly':
$groupBy = "CONCAT(YEAR(created_at), '-', WEEK(created_at))";
break;
case 'Monthly':
$groupBy = 'MONTH(created_at)';
break;
default:
$groupBy = 'DATE(created_at)';
}

// Sales data by Time (barangay)


$salesData = orders::selectRaw("$groupBy as period, SUM(total_price) as
total_sales")
->where('order_status', 'Delivered')
->groupBy('period')
->orderBy('period')
->get();

// Sales data by Trucks


// Get the start and end dates of the current week

89
$startOfWeek = Carbon::now()->startOfWeek()->format('Y-m-d H:i');
$endOfWeek = Carbon::now()->endOfWeek()->format('Y-m-d H:i');
$truckPerformance = orders::select('trucks.trucks',
DB::raw('SUM(orders.total_price) as total_sales'))
->join('trucks', 'orders.truck_id', '=', 'trucks.id')
->where('orders.order_status', 'Delivered')
->whereBetween('orders.created_at', [$startOfWeek, $endOfWeek])
->groupBy('trucks.trucks')
->orderBy('total_sales', 'desc')
->get();

// Sales data by location (barangay)


$salesByLocation = orders::select('order_barangay', DB::raw('SUM(total_price)
as total_sales'))
->where('order_status', 'Delivered')
->groupBy('order_barangay')
->orderBy('total_sales', 'desc')
->get();

// Sales data by Week (barangay)


$startDate = now()->startOfWeek();
$endDate = now()->endOfWeek();

$weeklyData = orders::selectRaw('DAYNAME(created_at) as day_of_week,


SUM(total_price) as total_sales')
->whereBetween('created_at', [$startDate, $endDate])
->where('order_status', 'Delivered')
->groupBy('day_of_week')
->orderByRaw("FIELD(day_of_week , 'Sunday', 'Monday', 'Tuesday',
'Wednesday', 'Thursday', 'Friday', 'Saturday')")
->get();

$daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',


'Friday', 'Saturday'];
$weeklyData = collect($daysOfWeek)->map(function ($day) use ($weeklyData)
{
return [
'day_of_week' => $day,
'total_sales' => $weeklyData->firstWhere('day_of_week', $day)-
>total_sales ?? 0
];
});

// Total sales of the week


$totalWeeklySales = $weeklyData->sum('total_sales');

// Total sales of the month


$beginOfMonth = Carbon::now()->startOfMonth()->format('Y-m-d H:i');
$endOfMonth = Carbon::now()->endOfMonth()->format('Y-m-d H:i');
$totalSalesThisMonth = orders::where('order_status', 'Delivered')
->whereBetween('created_at', [$beginOfMonth, $endOfMonth])
->sum('total_price');

90
// Total pending orders for this day
$startOfToday = Carbon::now()->startOfDay()->format('Y-m-d H:i:s');
$endOfToday = Carbon::now()->endOfDay()->format('Y-m-d H:i:s');
$totalOrdersToConfirmToday = orders::where('order_status', 'To Confirm')
->whereBetween('created_at', [$startOfToday, $endOfToday])
->count();

// Total borrowed.
$totalBorrowed = customers::sum('borrowed');

return view('admin.admindashboard',
compact(
'salesData',
'truckPerformance',
'salesByLocation',
'timeFrame',
'weeklyData',
'totalWeeklySales',
'totalSalesThisMonth',
'totalOrdersToConfirmToday',
'totalBorrowed'
));
}

public function toCustomer(){


$customers = customers::where('is_active', true)->get();

$inactiveCustomers = customers::where('is_active', false)->get();

return view('admin.customers', ['customers' => $customers, 'inactiveCustomers'


=> $inactiveCustomers]);
}

public function toStaff(){


$staffs = addstaff::all();
return view('admin.staff', ['staffs' => $staffs]);

public function toOrders(){


$orders = orders::with('customer', 'product')
->orderBy('updated_at', 'desc')
->get();
return view('admin.orders', compact('orders'));
}

public function toDeliveries(){


$orders = orders::with('customer', 'product', 'truck')
->orderBy('updated_at', 'desc')
->paginate(20);
return view('admin.deliveries', compact('orders'));
}

public function toResource(){

91
$trucks = trucks::all();
$products = products::all();
$borrowers = customers::where('borrowed', '>', 0)->get();
return view('admin.resource', ['trucks' => $trucks, 'products' => $products,
'borrowers' => $borrowers]);
}

public function toProducts(){


$products = products::all();
return view('admin.products', ['products' => $products]);

public function toTrucks(){


$trucks = trucks::all();
return view('admin.trucks', ['trucks' => $trucks]);

public function toSettings(){


$settings = Sitesetting::all();
return view('admin.settings', compact('settings'));
}

public function toAddCustomer(){


return view('admin.addcustomer');
}

public function toAddStaff(){


$trucks = trucks::all();
return view('admin.addstaff', compact('trucks'));
}

public function toAddProducts(){


return view('admin.addproduct');
}

public function toAddTruck(){


return view('admin.addtruck');
}

public function toAddOrders(){


$customers = customers::all();
$trucks = trucks::all();
$products = products::all();

return view('admin.addorder', [
'customers' => $customers,
'trucks' => $trucks,
'products' => $products
]);
}

public function toTrucksOrder(){

92
$trucks = trucks::with('order')->get();

return view('admin.bytruckorders', compact('trucks'));


}

public function toPrintables(){

return view('admin.printreport');
}

// --------------- logout ------------------


public function logoutStaff()
{
Auth::logout();
return redirect(route('display.login'));
}

// --------------- Staff Functions ------------------

// --------------- Add a Staff ------------------

function addStaff(Request $request){


$staffData = $request->validate([
'first_name'=>'required',
'last_name'=>'required',
'address'=>'required',
'contact_number'=>'required|numeric',
'role'=>'required',
'email_address'=>'required',
'password'=>'required',
'truck_id'=>'required'
]);

$staffData['password'] = Hash::make($staffData['password']);

$newStaff = addstaff::create($staffData);

return redirect(route('view.staff'))->with('success', 'Account added successfully');


}

// --------------- Edit Staff Route ------------------

public function editStaff(addstaff $id){


$trucks = trucks::all();
return view('admin.editstaff', ['id' => $id, 'trucks'=>$trucks]);

93
}

// --------------- Update Staff Details ------------------


public function updateStaff(addstaff $id, Request $request){
$staffData = $request->validate([
'first_name'=>'required',
'last_name'=>'required',
'address'=>'required',
'contact_number'=>'required|numeric',
'role'=>'required',
'email_address'=>'required',
'truck_id'=>'required'
]);

$id->update($staffData);

return redirect(route('view.staff'))->with('success', 'Account updated


successfully');
}

// --------------- Update Staff Details ------------------


public function updateStaffPassword(addstaff $id, Request $request){
$staffData = $request->validate([
'password'=>'required'
]);

// Hash the password only if it was entered


if (!empty($staffData['password'])) {
$staffData['password'] = Hash::make($staffData['password']);
}

$id->update($staffData);

return redirect(route('view.staff'))->with('success', 'Account updated


successfully');
}

// --------------- Delete ------------------

public function deleteStaff(addstaff $id){

// Prevent self-deletion
if (auth()->id() == $id->id) {
return redirect()->back()->withErrors(['error' => "Cannot delete currently
logged in account"]);
}

$id->delete();
return redirect(route('view.staff'))->with('success', 'Account deleted
successfully');

94
}

// --------------- Customer Functions ------------------

// --------------- Add Customer ------------------


function addCustomer(Request $request){
$customerData = $request->validate([
'customer_name'=>'required',
'customer_purok'=>'required',
'customer_barangay'=>'required',
'customer_city'=>'required',
'customer_phonenum'=>'required|numeric',
'customer_email'=>'required',
'customer_password'=>'required',
]);

$customerData['customer_password'] =
Hash::make($customerData['customer_password']);
$newCustomer = customers::create($customerData);

if ($newCustomer) {
// Create an address entry using the customer's information
Address::create([
'customer_id' => $newCustomer->customer_id,
'fullname' => $newCustomer->customer_name,
'purok' => $newCustomer->customer_purok,
'barangay' => $newCustomer->customer_barangay,
'city' => $newCustomer->customer_city,
'phonenum' => $newCustomer->customer_phonenum,
]);
}

return redirect(route('view.customers'))->with('success', 'Customer added


successfully');
}

// --------------- Edit Customer Route ------------------

public function editCustomer(customers $customer_id){

return view('admin.editcustomer', ['customer_id' => $customer_id]);


}

// --------------- Update Customer Information ------------------


public function updateCustomer(customers $customer_id, Request $request){
$customerData = $request->validate([
'customer_name'=>'required',
'customer_purok'=>'required',
'customer_barangay'=>'required',

95
'customer_city'=>'required',
'customer_phonenum'=>'required|numeric',
'is_active'=>'required|boolean',
'returned_gallons'=>'nullable|numeric',
'customer_email'=>'required'

]);

$currentBorrowed = $customer_id->borrowed;

$updatedBorrowed = max(0, $currentBorrowed -


$customerData['returned_gallons']);

$customer_id->customer_name = $customerData['customer_name'];
$customer_id->customer_purok = $customerData['customer_purok'];
$customer_id->customer_barangay = $customerData['customer_barangay'];
$customer_id->customer_city = $customerData['customer_city'];
$customer_id->borrowed = $updatedBorrowed;
$customer_id->customer_phonenum = $customerData['customer_phonenum'];
$customer_id->is_active = $customerData['is_active'];
$customer_id->customer_email = $customerData['customer_email'];
$customer_id->update();

return redirect(route('view.customers'))->with('success', 'Customer updated


successfully');
}

// --------------- Delete Customer ------------------


public function deleteCustomer(customers $customer_id){

$orderCount = $customer_id->order()->count();

if ($orderCount > 0) {
return redirect()->back()->with('warning', 'This customer has an order and
cannot be deleted.');
}

$customer_id->delete();
return redirect(route('view.customers'))->with('success', 'Customer deleted
successfully');
}

public function updateCustomerStatus(Request $request){


$customer = customers::find($request->id);
if ($customer) {
$customer->is_active = $request->status;
$customer->save();
return response()->json(['success' => 'Status updated successfully.']);

96
}

return response()->json(['error' => 'Customer not found.'], 404);


}

// --------------- Products Functions ------------------

// --------------- Add a Product ------------------


function addProduct(Request $request){
$productData = $request->validate([
'product_name'=>'required',
'product_price'=>'required|numeric',
'bundle_quantity' => 'nullable|numeric',
'bundle_price' => 'nullable|numeric'
]);

$newProduct = products::create($productData);

return redirect(route('view.resource'))->with('success', 'Products added


successfully');
}

// --------------- Edit Product Route ------------------

public function editProduct(products $product_id){

$orderCount = orders::whereHas('product', function ($query) use ($product_id) {


$query->where('orders_products.product_id', $product_id->product_id);
})->count();

// if ($orderCount > 0) {
// return redirect()->back()->with('warning', 'This product is part of an order
and cannot be edited.');
// }
return view('admin.editproduct', ['product_id' => $product_id]);
}

// --------------- Update Product Information ------------------


public function updateProduct(products $product_id, Request $request){
$productData = $request->validate([
'product_price'=>'required|numeric',
'bundle_price'=>'nullable|numeric'
]);

$product_id->update($productData);

return redirect(route('view.resource'))->with('success', 'Products updated


successfully');
}

97
// --------------- Delete Product ------------------
public function deleteProduct(products $product_id){

// Check if the product is part of any orders


$orderCount = orders::whereHas('product', function ($query) use ($product_id) {
$query->where('orders_products.product_id', $product_id->product_id);
})->count();

if ($orderCount > 0) {
return redirect()->back()->with('warning', 'This product is part of an order and
cannot be deleted.');
}

$product_id->delete();
return redirect(route('view.resource'))->with('success', 'Products deleted
successfully');
}

// --------------- Trucks Functions ------------------

// --------------- Add a Truck ------------------


function addTruck(Request $request){
$truckData = $request->validate([
'trucks'=>'required'
]);

$newTruck = trucks::create($truckData);

return redirect(route('view.resource'))->with('success', 'Truck added


successfully');
}

// --------------- Edit Truck Route ------------------

public function editTruck(trucks $id){


return view('admin.edittruck', ['id' => $id]);
}

// --------------- Update Truck Information ------------------


public function updateTruck(trucks $id, Request $request){
$truckData = $request->validate([
'trucks'=>'required'
]);

$id->update($truckData);

98
return redirect(route('view.resource'))->with('success', 'Truck updated
successfully');
}

// --------------- Delete Truck ------------------


public function deleteTruck(trucks $id){

$orderCount = $id->order()->count();

if ($orderCount > 0) {
return redirect()->back()->with('warning', 'This truck has an order and
cannot be deleted.');
}
$id->delete();
return redirect(route('view.resource'))->with('success', 'Truck deleted
successfully');
}

// --------------- Orders Functions ------------------

// --------------- add order ------------------


public function addOrder(Request $request){
$validation = $request->validate([
'customer_id'=>'required',
'order_cname'=>'required',
'order_purok'=>'required',
'order_barangay'=>'required',
'order_city'=>'required',
'order_pnumber'=>'required',
'truck_id'=>'required',
'total_price'=>'required'
]);

$orderStatus = 'For Delivery';


$total_price = 0;
$total_quantity = 0;
$selected_products = $request->input('selected_products', []);
foreach ($selected_products as $productId => $quantity) {
$quantityForm = $request->input('quantities.' . $productId, 0);
$product = products::find($productId);
$total_price += $product->product_price * $quantityForm;
$total_quantity += $quantityForm;
}

// Process bundle products


$selected_bundle_products = $request->input('selected_bundle_products',
[]);
foreach ($selected_bundle_products as $productId => $quantity) {
$quantityForm = $request->input('bundle_quantities.' . $productId, 0);

99
$product = products::find($productId);

// Check if product exists and is a bundle


if ($product && !is_null($product->bundle_quantity) && !is_null($product-
>bundle_price)) {
$total_price += $product->bundle_price * $quantityForm;
$bundleQuantity = $quantityForm * $product->bundle_quantity;
$total_quantity += $bundleQuantity;
}

// Attach the product to the order

$order = new orders;


$order->customer_id = $request->input('customer_id');
$order->order_cname = $request->input('order_cname');
$order->order_purok = $request->input('order_purok');
$order->order_barangay = $request->input('order_barangay');
$order->order_city = $request->input('order_city');
$order->order_pnumber = $request->input('order_pnumber');
$order->truck_id = $request->input('truck_id');
$order->total_quantity = $total_quantity;
$order->total_price = $total_price;
$order->order_status = $orderStatus;
$order->save();

foreach ($selected_products as $productId => $quantity) {


$quantityForm = $request->input('quantities.' . $productId, 0);
$product = products::find($productId);
$productPrice = $product->product_price;
$order->product()->attach($productId, ['price' => $productPrice, 'quantity'
=> $quantityForm]);

foreach ($selected_bundle_products as $productId => $quantity) {


$quantityForm = $request->input('bundle_quantities.' . $productId, 0);
$product = products::find($productId);
$order->product()->attach($productId, ['price' => $product->bundle_price,
'quantity' => $quantityForm, 'is_bundle' => true]);

// Update Customer's borrowed column


$customer = customers::find($request->input('customer_id')); // Ensure your
model name is correct
$customer->borrowed += $total_quantity;
$customer->save();

100
return redirect(route('view.orders'))->with('success', 'Order added
successfully');
}

// --------------- view order ------------------


public function viewOrder(orders $id){
$id->load('customer', 'product');
$trucks = trucks::all();
return view('admin.vieworder', compact('id', 'trucks'));
}

// --------------- Update Order Information ------------------


public function updateOrder(orders $id, Request $request){
$orderData = $request->validate([
'truck_id'=>'nullable',
'returned'=>'nullable',
'reason'=>'nullable',
'order_status'=>'nullable'
]);

if ($request->input('order_status') == 'Delivered') {

$orderData['reason'] = null;

// Get the customer associated with the order


$customer = customers::find($id->customer_id);

// Subtract the returned quantity from the customer's borrowed count


$customer->borrowed = max($customer->borrowed - $request->returned,
0);

// Save the customer


$customer->save();
}

$id->update($orderData);

return redirect(route('view.orders'))->with('success', 'Order updated


successfully');
}

public function selectStatus(Request $request){


$ordersQuery = orders::query();

// Filter based on status if provided

101
if ($request->has('status_filter') && $request->status_filter != '') {
$ordersQuery->where('order_status', str_replace('_', ' ', $request-
>status_filter));
}

if ($request->filled('date_filter')) {
$dateFilter = $request->date_filter;
switch ($dateFilter) {
case 'today':
$ordersQuery->whereDate('created_at', Carbon::today());
break;
case 'yesterday':
$ordersQuery->whereDate('created_at', Carbon::yesterday());
break;
case 'this_week':
$ordersQuery->whereBetween('created_at', [Carbon::now()-
>startOfWeek(), Carbon::now()->endOfWeek()]);
break;
}
}

$orders = $ordersQuery
->orderBy('updated_at', 'desc')
->get();

return view('admin.orders', compact('orders'));


}

// --------------- Delete order ------------------


public function deleteOrder(orders $id){
$id->delete();
return redirect(route('view.orders'))->with('success', 'Order deleted
successfully');
}

// --------------- Deliveries Functions ------------------

// --------------- search orders ------------------


public function searchDeliveries(Request $request) {
$query = strtolower($request->input('search')); // Convert the search query to
lowercase
$orders = orders::with('customer')
->whereHas('customer', function($q) use ($query) {
$q->whereRaw('LOWER(customer_name) LIKE ?', ['%' . $query .
'%']);
})
->paginate(20);

return view('admin.pages.partialsdeliveries_table', compact('orders'))-


>render();
}

102
// --------------- update deliveries ------------------
public function updateDeliveries(orders $id){
$id->load('customer', 'product');
return view('admin.updatedeliveries', compact('id'));
}

// --------------- save updated deliveries ------------------


public function UpdatedDelivery(orders $id, Request $request){
$orderData = $request->validate([
'returned'=>'nullable',
'order_status'=>'nullable'
]);

$id->update($orderData);

if ($request->input('order_status') == 'Delivered') {
// Get the customer associated with the order
$customer = customers::find($id->customer_id);

// Subtract the returned quantity from the customer's borrowed count


$customer->borrowed = max($customer->borrowed - $id->returned, 0);

// Save the customer


$customer->save();
}

return redirect(route('view.deliveries'))->with('success', 'Order updated


successfully');
}

// --------------- live update deliveries ------------------


public function toDeliveriesLive(){
$orders = orders::with('customer', 'product', 'truck')
->orderBy('updated_at', 'desc')
->paginate(20);
return view('admin.pages.partialsdeliveries_table', compact('orders'));
}

// --------------- Printable Functions ------------------

public function getMonthlySales(Request $request) {

$validation = $request->validate([
'start_date'=>'required',
'end_date'=>'required'
]);

$startDate = $request->start_date;
$endDate = $request->end_date;

$orders = orders::with('product')

103
->where('order_status', 'Delivered')
->whereBetween('created_at', [$startDate, $endDate])
->get();

// Total Sales
$orderstoSum = orders::where('order_status', 'Delivered')
->whereBetween('created_at', [$startDate, $endDate])
->get();
$totalSales = $orderstoSum->sum('total_price');

//Sales Per Truck


$salesPerTruck = orders::where('order_status', 'Delivered')
->whereBetween('orders.created_at', [$startDate, $endDate])
->join('trucks', 'orders.truck_id', '=', 'trucks.id')
->select('trucks.id as truck_id', 'trucks.trucks as truck_name',
DB::raw('SUM(orders.total_price) as total_sales'))
->groupBy('trucks.id', 'trucks.trucks')
->orderBy('total_sales', 'desc')
->get();

//Sales Per Day


$salesPerDay = orders::where('order_status', 'Delivered')
->whereBetween('created_at', [$startDate, $endDate])
->select(DB::raw('DATE(created_at) as order_date'),
DB::raw('SUM(total_price) as daily_sales'))
->groupBy('order_date')
->orderBy('order_date', 'asc')
->get();

// Get the total sales per product


$salesPerProduct = DB::table('orders_products')
->join('orders', 'orders.id', '=', 'orders_products.order_id')
->join('products', 'products.product_id', '=',
'orders_products.product_id')
->where('orders.order_status', 'Delivered')
->whereBetween('orders.created_at', [$startDate, $endDate])
->select(
'products.product_name',
DB::raw('SUM(orders_products.quantity) as total_quantity'),
DB::raw('SUM(orders_products.price * orders_products.quantity)
as total_sales'),
'orders_products.is_bundle'
)
->groupBy('products.product_name', 'orders_products.is_bundle')
->get();

// Prepare chart data


$labels = $salesPerProduct->pluck('product_name')->unique()->values()-
>all();;
$dataBundles = array_fill_keys($labels, 0);
$dataSingles = array_fill_keys($labels, 0);

foreach ($salesPerProduct as $sale) {

104
if ($sale->is_bundle) {
// Add to the total sales for bundles
$dataBundles[$sale->product_name] += $sale->total_sales;
} else {
// Add to the total sales for singles
$dataSingles[$sale->product_name] += $sale->total_sales;
}
}

$dataBundles = array_values($dataBundles);
$dataSingles = array_values($dataSingles);

$totalNumOrders = orders::whereBetween('created_at',[$startDate,
$endDate])
->where('order_status', 'Delivered')
->count();

$totalreturnedValue = orders::whereBetween('created_at',[$startDate,
$endDate])
->where('order_status', 'Delivered')
->sum('returned');

return view('admin.printreport',
compact(
'startDate',
'endDate',
'orders',
'totalSales',
'salesPerTruck',
'salesPerDay',
'labels',
'salesPerProduct',
'dataBundles',
'dataSingles',
'totalNumOrders',
'totalreturnedValue'
));

// --------------- Settings Functions ------------------


public function updateSiteSettings(Sitesetting $sitesettings, Request $request){
$siteData = $request->validate([
'slogan'=>'required',
'description'=>'required',
'fb_account'=>'required',
'phone_number'=>'required|numeric',
'email_account'=>'required'
]);

105
$sitesettings->update($siteData);

return redirect(route('view.settings'))->with('success', 'Account updated


successfully');
}

// --------------- Customer-Infos Functions ------------------

public function toCustomerinfos($customer_id){

$chistories = orders::where('customer_id', $customer_id)


->where('order_status', 'Delivered')
->get();

$customer = customers::with('addresses')->findorFail($customer_id);
return view('admin.customerinfos', compact('customer', 'chistories'));
}

public function addAddresses(Request $request, customers $customer){


$validation = $request->validate([
'Fullname'=>'required',
'Purok'=>'required',
'Barangay'=>'required',
'City'=>'required',
'Phonenumber'=>'required'
]);

$addressData = new Address;


$addressData->customer_id = $customer->customer_id;
$addressData->fullname = $request->input('Fullname');
$addressData->purok = $request->input('Purok');
$addressData->barangay = $request->input('Barangay');
$addressData->city = $request->input('City');
$addressData->phonenum = $request->input('Phonenumber');
$addressData->save();

return redirect(route('view.customerinfos', ['customer' => $customer-


>customer_id]))->with('success', 'Order added successfully');

public function getAddressesForCustomer($customerId)


{
$addresses = Address::where('customer_id', $customerId)->get();
return response()->json($addresses);
}

public function addAddressMethod(Request $request)


{

106
// Validate the incoming request data
$validatedData = $request->validate([
'Fullname' => 'required',
'Purok' => 'required',
'Barangay' => 'required',
'City' => 'required',
'Phonenumber' => 'required'
]);
// Create a new address
$address = new Address();
$address->fullname = $validatedData['Fullname'];
$address->purok = $validatedData['Purok'];
$address->barangay = $validatedData['Barangay'];
$address->city = $validatedData['City'];
$address->phonenum = $validatedData['Phonenumber'];
// Assuming you need to attach this address to a customer
// You should pass the customer ID to this method
$address->customer_id = $request->customer_id;
$address->save();
// Return a JSON response
return response()->json([
'success' => true,
'message' => 'Address added successfully.',
'address' => $address // Optionally send back the added address
]);
}

107

You might also like