Gypsygo_ an Android Application for Travel Assistance, Lodging & Dining Reservations

You might also like

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

GYPSYGO: AN ANDROID APPLICATION FOR TRAVEL ASSISTANCE,

LODGING & DINING RESERVATIONS

A Capstone Presented to
The Faculty of the Department of Information Technology
Bulacan State University – Meneses Campus
Matungao, Bulakan, Bulacan

In Partial Fulfillment
of the Requirements for the Degree
Bachelor of Science in Information Technology

AUBREY ADELINE ISABELLE S. LAZARO


MARK KENNETH A. MANUMBILAO
MARCUS LHERWYN G. GOMEZ
REINDEL DG. CASTRO

Month Year
December, 2023
Republic of the Philippines
BULACAN STATE UNIVERSITY
Matungao, Bulakan, Bulacan

MENESES CAMPUS

APPROVAL SHEET

In partial fulfilment of the requirements for the degree of Bachelor of Science


in Information Technology, this thesis is titled "GYPSYGO: AN ANDROID
APPLICATION FOR TRAVEL ASSISTANCE, DINING, LODGING
RESERVATIONS”, which was prepared and submitted by AUBREY ADELINE
ISABELLE S. LAZARO, MARK KENNETH A. MANUMBILAO, MARCUS
LHERWYN G. GOMEZ, and REINDEL DG. CASTRO is hereby recommended for
approval and acceptance.

i
BULACAN STATE UNIVERSITY MENESES CAMPUS
Republic of the Philippines
BULACAN STATE UNIVERSITY
Matungao, Bulakan, Bulacan

MENESES CAMPUS

CERTIFICATE OF EDITING

This is to certify that the thesis titled

“GYPSYGO: AN ANDROID APPLICATION FOR TRAVEL ASSISTANCE, DINING,


LODGING RESERVATIONS”

prepared by

AUBREY ADELINE ISABELLE S. LAZARO


MARK KENNETH A. MANUMBILAO
MARCUS LHERWYN G. GOMEZ
REINDEL DG. CASTRO

has been edited for grammar and composition.

MARY JOY V. YAMBAO, LPT


Signature over Printed Name

BULACAN STATE UNIVERSITY – MENESES CAMPUS


Affiliation

December, 2023
Date

BULACAN STATE UNIVERSITY MENESES CAMPUS ii


Republic of the Philippines
BULACAN STATE UNIVERSITY
Matungao, Bulakan, Bulacan

MENESES CAMPUS

DECLARATION OF ORIGINALITY

We certify that this thesis is the product of our work and that we have acknowledged all
the sources used in its preparation. We understand what plagiarism is all about, and we are aware
of the policy of the University pertaining to plagiarism (as stipulated in the Student Conduct and
Discipline section of the Student Handbook).

We also certify that the manuscript has been subjected to plagiarism scan/test through an
anti-plagiarism software. We are attaching a copy of the originality report in the Appendices
section.

AUBREY ADELINE ISABELLE S. LAZARO

MARK KENNETH A. MANUMBILAO

MARCUS LHERWYN G. GOMEZ

REINDEL DG. CASTRO

Authors/Developers

BULACAN STATE UNIVERSITY MENESES CAMPUS iii


ABSTRACT

Travel applications can assist travellers in easy access bookings during their trip. Give Hotel

and restaurant information management and handle reservations. They are possibly increasing

the portability of the system. They can also browse the local locations here in Bulacan using

Google Map integration for location-based service to find the best hotel they like and the best

restaurant according to their taste and make a reservation. This application helps tourists and the

owners of hotels and restaurants to communicate with each other regarding their reservations and

other inquiries with no hassle and less stress for the client and the owner. The system also collects

travellers' valid IDs to avoid fake identities and fake bookings during the process. The hotel or

restaurant owner also needs valid IDS like BIR, DTI, and TIN IDS for the safety of the business.

The system works properly, is efficient for tourists and the owners of hotels and restaurants, and

is user-friendly. The system has been developed using the Agile methodology, and the formula

was implemented based on the size of the study population, the desired level of precision, and

the allowable margin of error, which has also been utilized in the language, implementation

strategy, and software end-user satisfaction. A survey was conducted among 100 travellers, hotel

and restaurant managers, and staff to indicate that travel applications are practical for travellers

here in Bulacan. GypsyGo is efficient with a minimum knowledge requirement and learning

motivation without causing significant slowdowns.

Keywords: Android application, travel assistance, lodging, dining, reservations.

BULACAN STATE UNIVERSITY MENESES CAMPUS iv


ACKNOWLEDGEMENTS

We, the developers, thank the Almighty God for His enduring grace, guidance, and

protection that He has bestowed upon us during this capstone project.

The researchers would also like to express their sincerest gratitude to their adviser, Mr.

Michael John D. Mabanta, MSIT, for his continuous support in their capstone and his patience,

motivation, and immense knowledge. His guidance helped them throughout their capstone and

the writing of their capstones.

Special gratitude to the Hotel and Restaurant owners and staff who gave their time and

cooperation to answer the interview questions honestly.

The developers would also like to express their appreciation to their Capstone

coordinator, Mrs. Sheryl D. Ellamil, MIT, for her trust, advice, support, patience, and guidance

from the start to the completion of the study.

To their parents, who have continuously supported them financially to accomplish this

study, and for their guidance, encouragement, and inspiration throughout their capstone project,

an exceptional thanks for the parental presence and constant advice to them.

They would also like to thank their classmates and friends for the stimulating discussions,

the sleepless nights they spent working together to meet deadlines, and all the fun they have had

over the past few months.

Aubrey Adeline Isabelle S. Lazaro


Mark Kenneth A. Manumbilao
Marcus Lherwyn G. Gomez
Reindel DG. Castro

BULACAN STATE UNIVERSITY MENESES CAMPUS v


This work is dedicated to our Family.

AAISL
MKAM
MLGG
RDGC

BULACAN STATE UNIVERSITY MENESES CAMPUS vi


TABLE OF CONTENTS

Approval Sheet........................................................................................................... i

Certificate of Editing.................................................................................................. ii

Declaration of Originality .......................................................................................... iii

Abstract ...................................................................................................................... iv

Acknowledgements .................................................................................................... v

Dedication .................................................................................................................. vi

CHAPTER I – THE PROBLEM AND ITS BACKGROUND ............................

Introduction ....................................................................................................

Statement of the Problem ............................................................................... 3

Significance of the Study ............................................................................... 4

Scope and Delimitation .................................................................................. 5

CHAPTER II – REVIEW OF RELATED LITERATURE AND STUDIES .....

Relevant Theories ..........................................................................................

Related Literature........................................................................................... 9

Related Studies............................................................................................... 13

Synthesis ........................................................................................................ 17

Conceptual Framework .................................................................................. 19

Definition of Terms........................................................................................ 20

CHAPTER III – METHODS OF RESEARCH ...................................................

Methods and Techniques of the Study ...........................................................

Sampling Design ............................................................................................ 24

Population and Sample of the Study .............................................................. 25

Research Instrument....................................................................................... 25

BULACAN STATE UNIVERSITY MENESES CAMPUS vii


Data Gathering Process .................................................................................. 26

Ethical Consideration ..................................................................................... 27

Data Analysis ................................................................................................. 27

CHAPTER IV – PRESENTATION, ANALYSIS, AND INTERPRETATION OF DATA

Agile Developmental Approach ....................................................................

Thematic Analysis ......................................................................................... 54

Evaluated Criteria of the International Standard for Organization (ISO) ...... 60

Summary ........................................................................................................ 68

CHAPTER V – SUMMARY OF FINDINGS, CONCLUSIONS, AND


RECOMMENDATIONS

Summary of Findings .....................................................................................

Conclusions .................................................................................................... 72

Recommendations .......................................................................................... 74

APPENDICES .......................................................................................................... 80

APPENDIX A: Letter of Request for Thesis Adviser ......................................................... 80

APPENDIX B: Letter of Request to Conduct the Study ..................................................... 81

APPENDIX C: Research Instrument (Questionnaire) ......................................................... 82

APPENDIX D: Research Instrument (Interview Guide) ..................................................... 84

APPENDIX E: Letter for Permission to Validate Instrument ............................................. 89

APPENDIX F: Research Instrument (Tally of System Evaluation) .................................... 91

APPENDIX G: Data Flow Diagram .................................................................................... 93

APPENDIX H: Entity Relationship Diagram ...................................................................... 94

APPENDIX I: R esearch Instrument ................................................................................... 95

APPENDIX J: User Manual ................................................................................................ 96

APPENDIX K: Survey Pictures......................................................................................... 114

APPENDIX L: Permission Letter for Respondent’s Information ..................................... 115

APPENDIX M: Transcript of Interview ............................................................................ 122

BULACAN STATE UNIVERSITY MENESES CAMPUS viii


APPENDIX N: Sample Survey ......................................................................................... 126

APPENDIX O: Plagiarism Result ..................................................................................... 133

APPENDIX P: Codes of the System ................................................................................. 225

LIST OF TABLES

Table 3.1 Distribution of the Respondents ............................................................... 25

Table 3.2 Measurement Used to Access the Developed System .............................. 29

Table 4.1 Function Sustainability Interpretation ...................................................... 60

Table 4.2 Performance Efficiency Interpretation...................................................... 61

Table 4.3 Compatibility Interpretation ..................................................................... 62

Table 4.4 Usability Interpretation .............................................................................. 63

Table 4.5 Readability Interpretation ......................................................................... 64

Table 4.6 Maintainability Interpretation ................................................................... 65

Table 4.7 Security Interpretation .............................................................................. 66

Table 4.8 Portability Interpretation ........................................................................... 67

Table 4.9 Overall Weighted Mean Interpretation ...................................................... 67

LIST OF FIGURES
Figure 2.1 Conceptual Framework ............................................................................ 19

Figure 3.1 Agile diagram ........................................................................................... 23

Figure 4.1 Login Page ................................................................................................ 34

Figure 4.2 Tourist Signup Page .............................................................................. 35


Figure 4.3 Destination Page .................................................................................. 36
Figure 4.5 Lodging Page ....................................................................................... 37
Figure 4.6 Chat Room Page .................................................................................. 38
Figure 4.7 Set Route Page ..................................................................................... 39

BULACAN STATE UNIVERSITY MENESES CAMPUS ix


Figure 4.8 Hotel Booking Form Page ................................................................... 40
Figure 4.9 Restaurant Page.................................................................................... 41
Figure 4.10 Restaurant Reservation Form Page .................................................... 42
Figure 4.11 Profile Page ........................................................................................ 43
Figure 4.12 Hotel Reservation .............................................................................. 44
Figure 4.13 Restaurant Reservation Page ............................................................. 45
Figure 4.14 Host Signup Page ............................................................................... 46
Figure 4.15 Host Login Reminder Page ................................................................ 47
Figure 4.16 Hotel and Restaurant Preview Page ................................................... 48
Figure 4.17 Hotel and Restaurant Management Page ........................................... 49
Figure 4.18 Notification Page ............................................................................... 50
Figure 4.19 Recent Conversation Page ................................................................. 51
Figure 4.20 Host Profile Page ............................................................................... 52
Figure 4.21 Admin Login Page ............................................................................. 53
Figure 4.22 Signup Form List Page....................................................................... 53
Figure 4.23 Signup Form Details Page ................................................................. 54
Figure 4.24 Themes and Sub-Themes of Restaurant Data Questions no. 1-3....... 55
Figure 4.25 Themes and Sub-Themes of Restaurant Data Questions no. 4-7....... 56
Figure 4.6 Themes and Sub-Themes of Hotel Data Questions no. 1-4 ................. 57
Figure 4.27 Themes and Sub-Themes of Hotel Data Questions no. 5-9 ............... 58

BULACAN STATE UNIVERSITY MENESES CAMPUS x


CHAPTER I

THE PROBLEM AND ITS BACKGROUND

Introduction

Digital technology has altered the way individuals plan, book, and enjoy their

journeys (Sigala, 2020). The use of smartphone applications, which give travelers

actual and straightforward accessibility to data, services, and suggestions, ranks as one

of the most promising digital tourism innovations. (Buhalis & Amaranggana, 2015). In

accordance with a study by Euromonitor International (2019), travel applications have

grown to be an essential element of the travel sector, offering tourists a broad spectrum

of knowledge and services, including details on destinations, housing alternatives,

transportation, and activities. Due to the rising need for travel applications, businesses

that concentrate on travel technology have appeared. These companies have developed

innovative approaches to improve the user experience for both travellers and service

providers (Bilgihan & Bujisic, 2015). One of the most crucial ways of distributing hotel

accommodations is online. So, when it comes to the hotel industry, implementing a

practical e-commerce approach is crucial (Law, Buhalis, & Cobanoglu, 2014).

Travel-related details and amenities need to be seamlessly integrated into

mobile travel applications' user interfaces. Further investigation can focus on user

interface (UI) design approaches that make it simple for users to navigate through a

variety of travel-related services and information, including real-time flight updates,

lodging and dining reservations, maps, including methods of payment, all inside a

single application. This can increase consumers' journey scheduling and reservation

productivity and comfort. (Xiang, Du, Ma, & Fan., 2017). Yet even with the increase

in the popularity of travel applications in recent years, there is still an


essential need for further research in this field due to the ever-changing tourism industry

and travellers' fluctuating demands and preferences. The COVID-19 pandemic has

severely impacted the tourism industry, as practically all nations, including the

Philippines, have secured borders to travellers and instituted quarantines. To prevent

the virus from spreading, rigorous quarantine precautions were implemented. The

abrupt halt in growth in demand for travel and activities associated with tourism brought

about significant financial consequences. Revenue losses and an increase in

unemployment affect all tourism businesses (Caynila et al., 2022).

The development of a travel application that features tourist attractions and a

list of hotel and restaurant options with booking capabilities can help promote tourism

and ensure a more comfortable and pleasurable journey for tourists. The developed

application has three user interfaces for the travellers/customers, each one for the hotel

and restaurant's information management. Users of the traveller interface are able to

access relevant information about tourist attractions and hotel and restaurant options,

capable of booking hotel rooms and restaurant tables/events and receive updates

regarding their reservations. The hotel and restaurant management interface will enable

managers to handle their room listings and availability, answer client questions, and

track performance.

Although studies on various travel-related topics, including accessibility, user-

friendliness, and information quality, have been conducted, more research is still

required to understand these applications' development and design fully. This study

entails considering the needs and preferences of tourists and the application's technical

capabilities and constraints. Thorough research is also required to assess the efficiency

and performance of travel applications regarding how they affect user fulfilment.

BULACAN STATE UNIVERSITY MENESES CAMPUS 2


Assuring the reliability and excellence of the information offered by these types

of applications is one of the critical issues. Given these facts, visitors significantly rely

on mobile applications to learn about locations, accommodations, and food alternatives;

nevertheless, there is no assurance that the information provided is accurate or current,

and as a result, passengers risk having a bad experience. The outcomes of this project

also guide future studies about how travellers use online mobile applications and

contribute to establishing best practices in this area. Gypsy Go was developed to give

traveler users comprehensive information on tourist sites, hotels and resorts,

restaurants, and cafés. User feedback will be gathered and analyzed throughout the

development procedure to guarantee the effectiveness and usability of the travel

application. These responses will enhance the application's functionality and recognize

areas that need further research and development.

Statement of the Problem

The general problem of this study is to develop a comprehensive travel

application that offers travellers a user-friendly interface for discovering tourist

attractions, making hotel reservations, and locating local restaurants.

1. How to effectively develop the system using Agile Methodology?

2. What are the essential features the application must provide to hotels and

restaurants in order to efficiently manage their reservations?

3. How will the system be evaluated based on the evaluation criteria of ISO

(International Standard for Organization) 25010 such as follows;

3.1. Function Suitability

3.2.Performance Efficiency

3.3.Compatibility

3.4. Usability

BULACAN STATE UNIVERSITY MENESES CAMPUS 3


3.5. Reliability

3.6. Maintainability

3.7. Security

3.8. Portability

Significance of the Study

The significance of this project stems from its ability to improve the efficiency

and convenience of traveling by offering a comprehensive and user-friendly online

mobile platform for discovering tourist destinations, a place to stay and dine that allows

them to make reservations.

Developers. This application's development will improve the developers'

capacity to develop and design mobile applications. The developers will build expertise

in getting user feedback, doing usability testing, and implementing it into the design

and functionalities of the application. This project will be a great asset to the developers'

portfolio, and that might open the doors to additional initiatives and partnerships.

Future researchers. This project may also add to the tourism and travel

application development information. This project can give perspectives on the design

and development of future travel apps by observing the elements that determine the

efficacy and usability of travel applications.

Hotel and restaurant managers. The system offers them a more extensive

reach among potential customers by providing features that thoroughly showcase their

establishments' information. This study would boost their visibility and reservations,

leading to increased gains.

BULACAN STATE UNIVERSITY MENESES CAMPUS 4


Local businesses. The system may also assist local companies in respective

areas, such as hotels, restaurants, and souvenir stores. By promoting tourists in the

locality, the application can enhance local businesses' prominence and profitability,

benefiting the local economy.

Local government units. Governmental organizations engaged in the

promotion and development of tourism in their local regions may find use for the

project's outcomes. Government agencies may customize their procedures and

operations to fit the demands and preferences of tourists, hence contributing to a better

tourism experience in their areas by recognizing the factors that impact tourist

satisfaction.

Travelers. The project's outcomes may assist travelers in preparing for a trip by

presenting them with a practical and user-friendly travel app. The app can help tourists

traverse, locate local sights, and learn about available hotels and restaurants.

Scope and Delimitation

This system was designed for users under the category of "traveler," "hotel,"

and "restaurant" managers using Android devices who have an internet connection.

This system is intended to be used locally in Bulacan, but its initial focus is on tourist

destinations in the local tourist spots of the province of Bulacan. The development of

the Gypsy Go took place from January 2023 to December 2023. The system includes

various features and functionalities, including User authentication: Users can create

accounts using their email address, name, and password. Tourist attraction information:

The application provides comprehensive information about tourist attractions,

including images, descriptions, and directions through Google Maps. Hotel and

restaurant information: The application includes detailed information about hotels and

BULACAN STATE UNIVERSITY MENESES CAMPUS 5


restaurants, including images, addresses, descriptions, contact details, amenities, room

types, cancellation policies, and booking availability. Booking functionality: Travelers

can easily book hotels and restaurants through the application. Chat system: Travelers

can communicate with hotel and restaurant staff through the application's chat system.

Profile management: Travelers can manage their profile information, including their

profile picture and booking history. The development of the travel application

employed a user-centered design approach. This approach involved iteratively

designing and testing the application with users to ensure it met their needs and

expectations. The host user can list their business inside the system and upload it to the

traveler interface, with the capability to receive updates and real-time communication

with the guests and customers.

The travel application is currently available for Android devices with minimum

compatibility with API 27 and maximum compatibility with API 33. Furthermore, the

application requires a continuous internet connection to function correctly. The amount

of data available for tourist attractions, hotels, and restaurants limits the application's

effectiveness. The application relies solely on Google Maps for navigation. The

application currently focuses exclusively on hotel and restaurant reservations.

BULACAN STATE UNIVERSITY MENESES CAMPUS 6


CHAPTER II

REVIEW OF RELATED LITERATURE AND STUDIES

This chapter presents an in-depth analysis selection of literature, studies, and

the theories related to our project, guiding our application's development along with its

main features. This chapter is broken down into different sections covering relevant

ideas, related studies, related literature, synthesis, and conceptual framework. Each part

seeks to deliver thoughtful observation and understanding of the topic and point out the

gaps in the existing literature and studies the project aims to fill.

Relevant theories

User Experience (UX). A framework for planning and assessing the way users

interact with the application. The developers designed and developed an application

that allows users to browse information about travel destinations and locate and reserve

lodgings and dining options over their phones. The primary goal is to offer users a

comfortable and simple-to-operate user interface. Making the software graphically

pleasant, simple to use, and understandable are all part of the UX design concepts,

offering users a smooth experience.

According to the concepts of UX theory, users are going to have an enjoyable

time when they feel at ease and secure by using the application. To ensure that

customers can schedule reservations without difficulties, the application must be simple

to operate and comprehend. In accordance with the theory, effective UX design may

boost user engagement since satisfied users are much more inclined to use the

application again. Therefore, to enhance the user experience with our application, one

of the many things we must prioritize in developing the application is the UX design.
Technology Acceptance Model (TAM). It is a generally recognized theory in

the field of tech innovation that focuses on clarifying how consumers embrace

technology. The TAM claims that apparent usability and accessibility are significant

components when assessing user acceptance along with their technological adoption.

The perceived value and usability of a travel application can be critical factors in

determining how widely travelers use it. Users have a greater tendency to embrace and

utilize a mobile application if they find it beneficial and straightforward to use, which

can eventually lead to the app's success. Designers can grow accustomed to the

application to users' demands by being mindful of the factors that affect user

acceptability and technological acceptance.

By this theory, TAM can be especially beneficial for gaining insight and

bringing awareness into how users assess the worth of the great functionality and

simplicity of a travel application. Whereas if the application gives accurate and up-to-

date information on tourist attractions, hotels, and restaurants, the users of tourists will

be more inclined to consider the app as handy. Hotel and restaurant managers who are

going to utilize the hotel and restaurant management interface could have varying

viewpoints on how beneficial and straightforward it is to operate. The performance

expectancy for the host interface can be analyzed based on its capacity to offer

necessary information on bookings with clarity and simplicity. By taking into account

the necessities and requirements of the hotel and restaurant, the developers prioritized

improving the performance expectancy and usability of the host management interface

in order to enhance the acceptance of technology.

Expectancy-value theory explains what causes consumers to utilize specific

products. In the matter of our travel application, this implies that customers are more

inclined to engage with it if they believe it is beneficial. The theory suggests that

BULACAN STATE UNIVERSITY MENESES CAMPUS 8


individuals have certain preconceptions of how they would like to experience the

application and that they will solely make use of it when these expectations are fulfilled.

The concept of the Expectancy-Value Theory may be adapted towards the travel app

by ensuring the application is simple to operate and delivers the conveniences that

consumers seek. The application should be developed with the user's needs prioritized,

providing easy navigation and order to get accurate results of essential information like

hotel and restaurant reservations and tourist destination guides. The app is more likely

to be embraced and utilized by travelers if it meets their needs and expectations.

Related Literature

In this subsection, the developers analyze related pieces of literature that address

the ideas and factors associated with travel applications, explicitly studying the

literature that emphasizes the significance of user experience, the incorporation of

technology in travel applications, and the impact that social media has on the travel

planning process. The developers are hoping to acquire a better knowledge of the

components that impact the performance of travel applications and their potential to be

enhanced to fit the demands of modern travelers by studying these concepts and

variables.

Local literature:

In the context of this study, travel assistance developers (V Concepcion et al.,

2021) developed the Isabella travel app in order to assist the Provincial Tourism Office

in Isabela's Ilagan Capitol in distributing information concerning the province's tourist

destinations and enable visitors to pinpoint various tourist destinations inside the area

utilizing their smartphones. The researchers came up with the concept to develop a

portable tourist application. The researchers developed the idea to build an android

BULACAN STATE UNIVERSITY MENESES CAMPUS 9


application or a mobile tourism application that would assist travelers in locating a more

suitable place quickly. The only thing the travelers can do through the application is

browse the province's tourist destinations because the platform is restricted to Isabela.

The application features tourism information for both nature and man-made

destinations, including parks, waterfalls, rivers, caverns, renowned restaurants,

museums, shopping centres, and department stores. The application additionally offers

details on the municipality's profile and a route selection planner to help users choose

the most efficient path from their present location to the target destination.

Another study about travel assistance (Vicente M Jr & Cecil G, 2019) goal to

ascertain the connection between user satisfaction and usability among DOT in their

aim to utilize information and communication technology, authorized travel businesses

in Cebu City using ICT to foresee user behavior. The primary responses as of 2017

were from Cebu City's authorized travel agencies. Using the Davis Technological

Acceptance Model (TAM), respondents believed that ICT was helpful for completing

tasks efficiently, increasing efficiency and productivity, and was simple to operate and

engage with. Respondents are more inclined to utilize technology at work for marketing

and sales purposes and to advocate for it to others in the business world. However, there

is not any correlation between effectiveness to the user (PEOU) and simplicity of use

(PEOU) in the desire to utilize. As a result, the respondents' adoption of ICT may or

may not be influenced by non-technological factors' technical rationalizations.

The study about online reservations, trust in e-commerce acceptance and use in

the Philippines (Capistrano PhD, 2021), the study seeks to add to the topic by utilizing

an integrated theoretical framework of trust theory and the Unified Theory of

Acceptance and Use of Technology (UTAUT). The study examines various

characteristics that influence Filipino online users' behavioral intentions to utilize

BULACAN STATE UNIVERSITY MENESES CAMPUS 10


technology, particularly the websites and smartphone apps among these services,

analyzing data from 399 consumers who use online food delivery and tourism online

reservations. The study found that trust enormously adds to these customers' views of

their economic, environmental, and hedonic expectancies for utilizing mobile

applications and websites through a series of statistical analyses. Yet, only some of

these expectancies have a significant impact on their technological behavior intentions.

The provides both theoretical and practical possibilities for enhancing the strengths and

solving the problems of these specific mobile applications and websites. There is also

a discussion of other issues and potential research directions.

Foreign literature:

A study about travel assistance conducted by (S. Hussein E Ahmed, 2022)

developed and assessed the functionality of a proposed smartphone application for the

Egyptian tourism industry. In accordance with the characteristics of smartphone apps

developed by tourists, a poll with 53 participants was done. After that, functionality

testing was conducted on the proposed smartphone application. A measurement

framework was employed in order to check the app's interface's usefulness and make

sure it satisfies user needs. In this study, three key functionality measures were used:

satisfaction, effectiveness, and efficiency. By offering a better understanding and in-

depth comprehension of the concerns connected to the acceptance of an innovative

smartphone application for tourism in Egypt, this research strengthens the existing

literature on mobile tourism and mobile applications. It provides valuable knowledge

for the tourism ministry, software companies, mobile application developers, and, of

course, smartphone users in relation to business owners, politicians, professionals,

researchers, and education professionals.

BULACAN STATE UNIVERSITY MENESES CAMPUS 11


According to the investigation of travel assistance and reservations into the roles

of self-efficacy, compatibility, perceived ease of use, and perceived convenience of

users' loyalty to mobile hotel booking by (AB Ozturk et al.), mobile hotel booking

(MHB) become an important distribution channel for hotels and online travel agencies

and so far for them Understanding MHB users' loyalty intentions toward this

technology have become equally important for MHB service providers. Therefore, the

online distribution of services, including hotel rooms, flights, attraction tickets, cruises,

and car rentals, has been on the rise due to the benefits that both travelers and companies

have gotten. Therefore, for the researchers, adopting an effective e-commerce strategy

is a crucial matter for the lodging industry because more consumers use their mobile

devices to shop online. According to the researchers, more than 70% of people reported

owning a smartphone in the U.S. According to them, nine out of ten smartphone users

use their devices daily for their scope for this study is their offering hotel information

such as location, facilities and entities and also travelers can books their room on one

go as for their delimitations is they do not have reservations for restaurants. There needs

to be some Google Maps or GPS.

Furthermore, they do not have tourist attractions, and the result of this study is that This

study further analyzed the influence of self-efficacy on PEOU and the impact of PEOU

on convenience. The study results are related to H1. Their instrument for this study is

Empirical observation and experimentation.

According to the study about mobile hotel booking (J. Wu, 2018) the business

world entered into a new era with the rapid progress also according to him now a days

consumer utilized i.t to search, identity and purchased tourism product/services and

supplies in the internet and according to him online sale over the world has been

increase and continuously growing in recent years and the total worldwide of the online

BULACAN STATE UNIVERSITY MENESES CAMPUS 12


travel sales in year 2015 was over $533 billion and also according to him more and

more's travelers are finding travel information and making travel reservation through

various online channels including website from computer or laptops and also on mobile

devices and also for him the bringing of mobile tourism added benefits of enhancement

flexibility and mobility and as for his study the dramatic grown of mobile travel

bookings does not necessarily mean that m-booker will surpass the d- booker and as for

him most of the online travel reservations are still made through computers website and

as for him the rate of mobile booking is over 50% and this number will predicted to

continue increase as for him in spite of the rapidly growing online travel sales in chins

the Chinese e-tourism market cannot be regard as healthy also in this study they talked

about the impact of perceived value in satisfaction but the construct value merely

measures the value of money it has also been argued that this matter not should be

measured just from the price but also from the perspective of value of time. As for the

scope of this study, they allow the supplier to have its presence on their customers'

mobile devices while automatically keeping their customers information on the app.

Also, they focus on a mobile app rather than a mobile website, and they have hotel

bookings via mobile. The app's delimitation is they only focus on the satisfaction of

customers for their hotel booking. They do not offer any tourist spots or restaurant

reservations. Their instrument for this study is Empirical observation and

experimentation, and also, for the result of this study, all of the objectives of this study

were achieved.

Related Studies

In this subsection, existing related studies that have delved into various areas of

travel and booking applications will be analyzed. The studies have investigated user

habits and preferences, including the effectiveness of features and functionalities and

BULACAN STATE UNIVERSITY MENESES CAMPUS 13


the influence of travel applications in the tourist industry. In hopes of studying these

studies, the developers want to acquire insights into the strengths and limitations of the

existing travel and booking applications and contribute to the development of more

comprehensive and user-friendly travel booking applications down the road.

A study regarding reservations conducted by (iNetTutor, 2022) integrated an

SMS (Short Message Service) notification using iTexMo API, which has plans for

creating a smartphone application that will simplify the booking and reservation

process among hotel management and hotel guests. The researchers claimed that the

current reservation and booking system could be more efficient in meeting customer

wants and increasing the revenue of the hotels by bringing in a large number of visitors.

The hotel industry is in need of a powerful tool to reach a large audience and give their

customers ease when making reservations or bookings. The researchers proposed

developing a smartphone application that will simplify the process of hotel bookings.

Their goal is to give hotel bookers a platform wherein they can quickly, accurately, and

easily reserve their schedules and accommodations in advance. The traditional

technique, which is prone to several difficulties, will be replaced by the suggested

technology. The application will be used by users who want to plan and reserve their

hotel stays in advance. The solution enables the hotel to increase revenue while also

enhancing the whole experience of its visitors. The researchers concluded that the

manual technique could be more effective and convenient for both the hotel customers

and the hotel employees after carrying out an extensive study and analysis. The study's

researchers developed a smartphone application that makes it possible to make hotel

bookings through a mobile application in order to address the issues with the manual

technique. The study's findings demonstrated that the smartphone app satisfied the

needs and demands of the respondents. Most of them have recognized the application's

BULACAN STATE UNIVERSITY MENESES CAMPUS 14


potential to simplify the hotel booking procedure. And so consequently, the researchers

concluded that the application is an effective and productive tool to be utilized by

individuals in the hotel sector and their clients. Hotel bookings will be made simple,

quick, and convenient for visitors by the designed application. The use of the

application will increase the amounts of guests the hotel can serve and host each day.

The developed project will boost the hotel's revenue while also enhancing the quality

of its services and the overall satisfaction of its patrons.

On the contrary, another study about travel assistance (Shin-Yi et al., 2020), a

TAM (Technology Acceptance Model) Framework, has been conducted with another

study we have gathered that aims to analyze the impact of mobile phones in the tourism

industry. The study has some valuable insights. However, it also retains some

restrictions. The subjects of the investigation are Taiwanese FITs between the ages of

eighteen (18) to sixty-five (65) who have utilized mobile APPs to pick travel

information for their most recent vacation. At Taiwan Taoyuan International Airport

between December 2012 and March 2013, surveys were handed out as a component of

the research using a random sample technique. A hardcopy questionnaire in Traditional

Chinese was created using Taiwanese FITs as the primary demographic. Travellers who

stated they were not carrying a phone were not taken into account in the research since

the survey's central emphasis was on phone users, specifically individuals who have

utilized their devices to seek out knowledge on the latest visit overseas. For the analysis

of the data in this research, researchers used SPSS and AMOS. They used structural

equation modelling (SEM) to evaluate the model, test research hypotheses, and

investigate the causal connection between the model's components. The sampling

methods used in the study, which only surveyed Taiwanese FITS (Foreign et al.), could

compromise the reliability of the findings. The outcome might not be generalizable as

BULACAN STATE UNIVERSITY MENESES CAMPUS 15


a result. Second, Taiwanese FITs may have had a restricted experience because of their

reluctance to use their smartphones due to the poor internet and Wi-Fi service abroad.

Moreover, only smartphone research was done for this study. As a result, the

research findings cannot be applied to other technological devices, namely tablets,

computers, notebook PCs, or smartwatches. According to Distimo's Review, the most

popular paid software in Apple's App Store is a navigation system for tourists; the

application is almost twice as expensive as the one that comes in at number two, a

business app. Future studies should examine any potential problems with applications

that affect the price of tourism. Taiwanese citizens can already utilize the majority of

smartphone travel applications for internal travel; however, there are few Mandarin-

language travel apps available for usage abroad. As a result, Taiwanese FITs do not

frequently utilize those APPs, which makes the study of these researchers' study more

challenging.

Conversely to the previous study regarding reservations, (Swaid, S., 2018)

evaluated two applications: the VoirginHotel.com app and the StayConnected.com app,

which mainly focused on the mobile application for hotel reservations. The app Lucy

from Virgin Hotels assists with requests for services and amenities, serves as the

temperature in the room, streams private material, and more. The ExtendedStay app

functions similarly to the ExtendedStayAmerica.com website (ESA). Four usability

experts evaluated the usability of the m-commerce apps. Each assessor examined the

components of each app in comparison to Nielsen's heuristics. A correlational stage has

been conducted in a study to identify the characteristics that the usability heuristics for

specific applications should have. The assessors developed a set of heuristics for mobile

apps for hotel booking, but the 13 usability heuristics recommended by the study had

many usability violations. The assessors tested the usability of the Virgin Hotels, Lucy,

BULACAN STATE UNIVERSITY MENESES CAMPUS 16


and ESA mobile apps during an experimental phase. The Virgin Hotel app occasionally

showed a blank screen during the onboarding process, the Lucy app does not display

dots or anything similar to let users know how many slides or pictures are in the gallery,

and the ExtendedStayAmerica app does not offer dynamic participation.

A study examining the causes and outcomes of a mobile application (Tian et al.,

2021) contradicts the previous research discussed, as the researcher claims that it adds

to the body of knowledge on user engagement, although it has limits. To begin with,

despite the fact that it may not be entirely accurate, we considered "buy intention" to

be a predictor of the actual activity. In the future, longitudinal experimental approaches

can be used to make sure that our findings reflect actual customer behaviour.

Furthermore, we largely disregard the impact of personality traits and social influence

on the engagement of mobile travel apps in this article and instead concentrate on the

app's features. The proposed model can eventually include personality elements (like

consumer ingenuity or personal qualities) and social influences (like referrals from

friends).

Moreover, because China makes up a portion of our research sample, cultural

factors may influence the causes and effects of using mobile travel apps. The

proponents are curious to know if our findings apply to people from various cultural

backgrounds. To generalize our findings, a further study utilizing random samples from

different nations is required.

Synthesis

In this section examines various studies on mobile technology in the travel and

tourist industry. This study aims to offer perspective on the usage of mobile technology

in the tourist sector by combining the data from various research.

BULACAN STATE UNIVERSITY MENESES CAMPUS 17


According to the research results of related studies, a mobile application's visual

appearance significantly impacts users' engagement with an application. The first

related study the developers have explicitly analyzed contends that regardless of

whether an application is simple to use, its capacity to affect users' views about its

utilization favourably is constrained if viewed as being of low value. Consequently,

mobile applications must offer users a highly efficient yet simple-to-use interface that

can raise users' perceptions of the application's effectiveness.

Users have a greater chance to adopt a favourable view of the application and

increase their regularity of usage if this is done. On the other hand, the system

prioritized developing elements that increase users' perceptions of the application's

utility, such as comprehensive trip destination details, user-friendly interfaces for

tourist and hotel restaurant managers, and real-time updates. Through this approach,

the developers ensure that the system stands out from the competition and draws in a

sizable user base since people are more inclined to favour an application that offers

them the most benefit and ease.

It is significant to highlight that, unlike the developed system, many studies

referenced do not come with two user interfaces or levels of access. The system offers

a more specialized and effective user experience for each group by having separate

interfaces for travellers and host management. This may raise excellent user experience,

encouraging additional reservations for the establishments listed on the application.

Adding to the argument, unlike many studies that merely focus exclusively on hotel

reservations or general travel guides, Gypsy Go combines features and functionalities

such as the lists of travel destinations, lodging, and dining establishments that accept

reservations through the application and lets the host users (hotel and restaurant)

manage and upload their information, get in touch with the guests, and customers via

BULACAN STATE UNIVERSITY MENESES CAMPUS 18


the application's chat system, and get updates regarding their reservation has a location-

based service and accepts reservations. The presence of a location-based service may

significantly enhance user satisfaction and simplify the process for travellers to

schedule their journeys.

Conceptual Framework

The conceptual framework presented aims to give a thorough knowledge of the

aspects that help lead the development of an Agile application through a structured

approach. Planning, prototyping, development and testing, deployment, and

maintenance are every framework component. The agile approach was used in the

framework to improve cooperation and communication among the developers and

stakeholders through the development process.

Process

Output
Input

GypsyGO

Figure 2.1 This figure shows the conceptual framework of the system

BULACAN STATE UNIVERSITY MENESES CAMPUS 19


The first part outlines the project's initial needs, such as the research questions,

questionnaire, related literature, related studies, questionnaire, and interview, as well as

the programming language (Java), user preferences, project plan, and software

requirements: for designing (Adobe XD), Android studio, and for the Database

Management System (Firebase), lastly the Hardware requirements (laptop).

The second part outlines the development of the system as adhering to the

modern UX design standards, evaluating the source materials, and recognizing the gaps

that need more research and their limitations. In the development of the system, the

Agile Methodology was implemented. Finally, the developed system meets the needs

of the system requirements.

Definition of terms

Cloud Messaging. is a cross-platform Firebase service that allows developers

to deliver messages and notifications to users’ Android devices reliably.

Functionality. The specific features allow the application to carry out particular

functions and provide certain services, including the system's ability to provide travel

assistance by listing the local attractions, making reservations and payment processes,

and using Google Maps.

Host. Hotel and restaurant managers who are registered as business managers

on the application.

Operating system. It is the software that controls the software and hardware

assets of the devices that execute the travel application. It provides the resources and

services required for the travel application to perform successfully, such as memory

management, processing capacity, internet connectivity, and user interfaces.

BULACAN STATE UNIVERSITY MENESES CAMPUS 20


Realtime Database. It is a cloud-hosted database supplied by Firebase that

provides real-time data storage and synchronization over different devices. Firebase's

real-time database allows the application to store and retrieve real-time data, including

user information, booking details, and other pertinent information.

User Experience (UX). It is the umbrella term encompassing several user-

application interaction elements, including the user interface, usability, responsiveness,

functionality, and overall performance.

User Interface (UI). Refers to the application's graphics and design. It includes

the buttons in the application, the data entry fields, iconography, all of the images, and

many other features that encourage user interaction in the application.

User-friendly. Refers to several features of the application's layout and

functioning, including straightforward navigation, intuitiveness of the user interface,

convenience of the booking system, and information quality.

BULACAN STATE UNIVERSITY MENESES CAMPUS 21


CHAPTER III

METHODS OF RESEARCH

This chapter aims to deliver a concise and comprehensive discussion of the

study's methodology. The subsections under this chapter describe different facets of the

research process. The subsections of this chapter cover the following: methods and

techniques of the study, population and sample of the study, sampling design, research

instrument, data collection process, ethical consideration, and finally, data analysis.

Methods and Techniques of the Study

Descriptive Design. The developers sought to understand the traits of users of

travel applications, including their preferences for its services, user interfaces, and user

satisfaction. Descriptive design was selected to serve as the initial phase of the study

since it enabled the collection of thorough knowledge through interviewing the chosen

hotels and restaurants regarding their current reservation process and their preferences

for an application that caters to their needs. The data gathered from the interview was

subsequently utilized to drive the development method.

Developmental Method. The developers implemented the developmental

process to establish a practical travel application for assistance, lodging, and dining

reservations that adapt to the preferences of travellers, hotel managers, and restaurant

managers. This project used the Agile Methodology, which permitted incremental and

iterative development alongside continual responses and adjustments. Using this

technique allowed the developers to promptly recognize and fix problems, leading to

an effective procedure for the development of the system that resulted in a functional

and user-friendly application.


Mixed method. A mixed methodology was applied in this project given that

initially, the developers interviewed the hotel and restaurant managers to understand

the current ways of the reservation process online and to understand which functions

and features help them to showcase their business online. Then, a quantitative approach

was applied with the Likert Scale to acquire data regarding the level of satisfaction of

the travellers, hotel, and restaurant managers with the system based on the ISO.

Agile Method

The agile approach was implemented for the development of the system. This

method allowed the developers to pinpoint problems as early as feasible by iterating on

each task for a flexible development flow. The feedback from the system stakeholders

will be used for further improvement throughout the process, guaranteeing that the

system meets the specified goals as planned.

Figure 3.1 This figure shows the Agile diagram.

1.1. Planning – In this process, an iterative process was implemented that

entails identifying the scope of the system, the calculation of the timescale

necessary to finish the development of the system, and the requirements as to

why the system is crucial to develop.

BULACAN STATE UNIVERSITY MENESES CAMPUS 23


1.2 Designing – At this stage, where the initial user interface is created, the

system's functionalities and technical.

1.3 Development – In this stage, the system's code is being written.

1.4 Testing – As an essential element of the development phase, this guarantees

that the system's defined requirements are satisfied.

1.5 Deployment – This is the stage at which the system is launched and made

available to users.

1.6 Review – Lastly, the stage applies to analyzing the results of the

development process and seeking room for improvements in the system.

Sampling Design

A purposive sampling was implemented in the study to generate a varied

population representation.

Purposive sampling. The developers implemented purposive sampling to

choose a group of respondents selectively. The rationale behind employing this

sampling design is to guarantee that the information acquired is in accordance with the

criteria and that the data gathered is relevant to the project. This method involves

selecting the respondents based on the shared traits and characteristics between the

population that the developers believe to be relevant for the project, which are the

individuals who manage hotels and restaurants, as well as those who use travel apps in

their travels, were chosen as respondents.

Population and Sample of the Study

The participants in this project are the locals consisting of Travelers, Hotel

managers, and Restaurant Managers in selected places in Bulacan. The respondents had

BULACAN STATE UNIVERSITY MENESES CAMPUS 24


an essential role in the project as they evaluated and assessed the system developed by

the developers. Their participation in this project was the basis that determined the

efficiency of the developed system.

Distribution of the Respondents

Respondents Total Percentage

Travelers 88 88%

Hotel Managers 8 8%

Restaurant Managers 4 4%

Total 100 100%

Table 3.1 shows the distribution of respondents in the study.

With the objective of generating a sample population size that would be

representative of the specific traits sought in the population, the developers carefully

selected particular individuals that fall under the category of Travelers, Hotel managers

and Restaurant managers within the chosen places in Bulacan. By concentrating on

these specific individuals, the developers hoped to obtain knowledge that could be

extrapolated to accurate and relevant data gathered, thereby contributing to a deeper

comprehension of the issue at hand.

Research Instrument

Survey. One of the two research instruments used for this study was a self-made

questionnaire aligned with the objectives of the project. Three phases comprise the

survey's structure. The first section collects information on the respondents' names

(optional), ages, and the category they fall under (traveller, hotel, restaurant). The

second section provides them with an overview of the system for better understanding.

The last part of the survey examines respondents' degree of satisfaction with the

BULACAN STATE UNIVERSITY MENESES CAMPUS 25


application's features using the Likert scale, starting with the browsing inside the

application, map navigation, reservation process, and hotel and restaurant features. The

feedback and suggestions from the respondents are gathered in the last part for further

application improvement.

Interview. The developers acquired relevant information from the service

providers directly, which was used throughout the development of the system to

comprehend further how to meet their specifications for efficient integration of the

companies they represent into the application. The features and capabilities of the

application may then be improved to satisfy the requirements of the hospitality sector

better, resulting in higher utilization and contentment among travelers, hotels, and

restaurants.

Data Gathering Process

The developers wrote letters to formally and legally bind requests from their

Capstone adviser and Capstone coordinator to validate their research instrument for the

data gathering. A letter requesting authorization to conduct face-to-face interviews

involving hotel managers and restaurant managers was approved and signed by their

Capstone Adviser. A letter request to complete online survey questionnaires involving

individuals who fall under the traveller category as well as hotel managers and

restaurant managers.

The survey questionnaire was generated with Google Forms and distributed to

the intended respondents online. The questionnaire was accessible to responders for

two weeks, when they may access it and complete it at their own pace. The developers

showed the letter signed by their thesis adviser to the ones participating for legal

consent and waited for the respondent's most available time to perform the interview.

BULACAN STATE UNIVERSITY MENESES CAMPUS 26


Before the interview, the developers asked for support from the participants in the face-

to-face interview to record the entire interview for transcribing the conversation later.

Lastly, the developers gave thanks to them and ensured that the data gathered was

confidential and solely used for the project's data gathering.

Ethical Consideration

The privacy and security of the respondents remained protected during the

research by following ethical guidelines.

Informed Consent. Before getting involved with the study, respondents were

given a thorough overview of the study's objective. This includes discussing the kind

of information that would be gathered and how their data would be utilized throughout

the study.

Confidentiality and Anonymity. The respondents were made aware that the

study's developers ensured that no personally identifiable information, such as names

or contact information, was gathered. All data remained fully protected, and only the

developers had access to them; anonymity and confidentiality remained preserved.

Voluntary Participation. Respondents were made aware that their

involvement was voluntary and that they could withdraw from participating at any

moment.

Data Analysis

The statistical tool enabled a more thorough analysis of the results, which took

into account the level of satisfaction and dissatisfaction of the respondents and gave a

detailed assessment of their perspectives on each evaluated criterion.

BULACAN STATE UNIVERSITY MENESES CAMPUS 27


Weighted Mean. The data acquired from the remarks on the Likert scale were

analyzed statistically using the weighted mean. A widely used evaluation technique that

enables participants to express how strongly they agree or disagree using the Likert

scale. A variant of the standard compromise known as the "weighted mean" considers

the weights given for every response type on the Likert scale. In this study, the formula

that follows was applied to determine the weighted mean:

Formula: X = Fx/N

X is the weighted mean

F is the frequency

x is the weight of each item

N is the number of cases

The quantitative response was analyzed with the applied statistics. Applied

statistics was used to manage, analyze, interpret, and draw conclusions from data and

to identify the problems, solutions, and opportunities using the analysis.

Evaluation Procedure. The acceptability of the Android application for travel

assistance, lodging, and dining reservations was assessed based on its effectiveness and

efficacy. The evaluation criteria included Functional Stability, Performance,

Compatibility, Usability, Reliability, Maintainability, Security and Portability.

Numeric ratings were acquired implementing the Likert's Scale, with the following

interpretation of the ranking ranges: "Strongly Agree" for rankings between 4. 60 and

5.00, "Agree" for rankings between 3. 70 and 4.30, "Neutral" for rankings between 2.

70 and 3.50, "Disagree" for rankings between 1. 80 and 2.70, finally, "Strongly

Disagree" for rankings between 1.00 and 1.80.

BULACAN STATE UNIVERSITY MENESES CAMPUS 28


Measurement Used to Access the Developed System

Numeric Rating Scale Qualitative Interpretation

4.61 – 5.00 5 Strongly Agree

3.71 – 4.60 4 Agree

2.71 – 3.70 3 Neutral

1.81 – 2.70 2 Disagree

1.00 – 1.80 1 Strongly Disagree

Table 3.2 This table shows the measurement used to access the developed system

Evaluation Criteria. To create the Android application for travel assistance,

lodging, and dining reservations for travelers, the developers adopted the evaluation

criteria of ISO (International Standard for Organization) 25010, which is targeted at

enhancing the functionality and efficiency of the system. Such as follows:

Functional Stability. The capacity of a system to reliably carry out the

tasks for which it was designed was running without error. Operational Stability

suggests that the system or product may fulfil its requirements or serve its

intended purpose without experiencing major setbacks or flaws.

Performance Efficiency. It is the efficiency and productivity of a

system in carrying out its specified tasks while making the best use of available

resources. It measures and assesses how effectively a design or product carries

out its intended activities or operations while considering variables like time,

expense, energy, and various other resources used.

Compatibility. It entails ensuring that various elements are developed

and used to enable them to collaborate effectively and serve the desired purpose.

BULACAN STATE UNIVERSITY MENESES CAMPUS 29


Make sure that systems can efficiently share data, interact, and function as

intended in various settings.

Usability. How straightforwardly and efficiently a system can be utilized

by its targeted users to complete their tasks with efficacy, productivity, and

contentment.

Reliability. Ensuring a system's trustworthiness will reduce the risks,

expenses, and effects of faults or failures.

Maintainability. A system can be upgraded or maintained in order for it

to function as planned for its planned lifespan. It entails creating a system so

that it may be designed, developed, and put into use in a way that promotes

continuous maintenance, reduces downtime, and allows for quick repairs or

adjustments with cost-effective resources.

Security. Protecting a system against illegal access, modification, or

other types of harm. In order to protect against potential risks to security or

dangers and to guarantee the safety, integrity, and accessibility of systems, they

must be designed, implemented, and maintained per this principle.

Portability. A system's capacity to be quickly moved between platforms

without negatively impacting its effectiveness, functionality, or data integrity.

It entails creating systems that enable efficient usage or deployment across

several operating systems, hardware setups, software iterations, or other

pertinent settings.

BULACAN STATE UNIVERSITY MENESES CAMPUS 30


CHAPTER IV

PRESENTATION, ANALYSIS, AND INTERPRETATION OF DATA

This chapter covers the interpreted data acquired through the data gathering

seeking answers to the general problems, including the development of the system using

Agile methodology, essential features, and functionalities to provide the hotel and

restaurant management, and evaluating the developed system through ISO evaluations

and suggestions of the respondents that helped the developers improve the design and

meet all standards.

Agile Development Approach

1. Planning

Planning stage, which corresponds to the Agile Approach's initial phase,

the developers held brainstorming sessions to envision developing a system that

will assist travellers and management capabilities for hotel and restaurant

managers to simplify the traveling and reservation process. Once concepts were

combined and finalized, the developers identified the requirements to develop

the system. The essential features and functionalities of the management

interface were identified through interviews with the hotel and restaurant

managers. The planning phase serves as the foundation and starting point for

the developers in developing the system.

2. Designing

The developers studied material design and applied what they learned

during the designing phase. The User Interface was intended to look and feel

modern, emphasizing a clear and consistent visual style across different.


platforms and devices. The system aims to be easy to use, offer a positive user

experience accessible from needless complexity or confusion, and be simple

enough for travellers, hotel, and restaurant manager users to navigate through

easily. The developers created vectors with Figma and Adobe XD.

3. Development

The developers proceeded from the conceptualization stages to coding

the system's features and functionalities, putting the thoroughly planned layout

and design into an accessible approach. This phase involves developing the

system with Android Studio as the IDE, Java for the programming language,

and XML for layout that serves as the foundation for Gypsy Go. Throughout

the development phase, the developers collaborated, giving ideas and fixing

errors and bugs. Gypsy Go underwent a steady yet progressive development

process. The development was primarily focused on the system's primary

functions, followed by the side functions, with design modifications and

improvements. Meetings address changes, difficulties, and updates on the

development process. Each member has tasks to accomplish by the time range

of the arrangements. Aside from the in-depth discussions, regular

communication is maintained to keep track of everyone's jobs.

4. Testing

The developers thoroughly examined and verified the system's and the

database connection's smoothness and high efficiency. The developers took

precautions to ensure the longevity of this connection. Demonstrating that the

data they had taken from the database was accurate to ensure everything had

been categorized appropriately.

BULACAN STATE UNIVERSITY MENESES CAMPUS 32


To ensure that a broad user base can enjoy the Gypsy Go application's

functionalities, The developers conducted extensive evaluations to ensure its

compatibility and performance across various Android devices. This phase

guaranteed that the Gypsy Go application operates efficiently and seamlessly

on different Android devices. The results indicated that it is fully compatible

with Android 8.0 Oreo and later versions, with specific optimizations for

Android 13, while remaining accessible to users with earlier Android iterations.

To validate the system through its functional stability, performance efficiency,

compatibility, usability, reliability, maintainability, security, and portability.

The developers regularly consulted with their capstone adviser to identify the

functions they needed to improve and include to enhance the system's credibility

and user experience. Lastly, the developers examined and tested that all the

components in the system were working according to their function, including

buttons, validations, dates, and messaging.

5. Deployment

During the deployment phase of the travel app, the developers have been

closely monitored to ensure that all its features work correctly. Moreover, to

ensure that the system will work flawlessly in a live environment to be

accessible to travellers, hotel, and restaurant owners. The result of the said

launch made use of the application more promising in the future.

6. Review

For The review phase of the travel app, the developers have been closely

monitored to know all the reviews that the system gets and to focus on some

critical components to fix or to improve, like integrating real-time updates using

BULACAN STATE UNIVERSITY MENESES CAMPUS 33


a chat system, ensuring smooth navigation, and implementing interactive

features. The result of the said review was to ensure that the application is more

promising in the future.

Management User Interface

In providing the hotel and restaurant management interface capabilities to

handle bookings and engage with the customers and guests, the developers then

developed these features and functionalities based on the data acquired from

interviewing the selected hotels and restaurants' responses.

Figure 4.1 Login Page

Login Page: The splash screen welcomes the user to the login page after the

user enters their password and authenticated email address to access the system.

BULACAN STATE UNIVERSITY MENESES CAMPUS 34


Figure 4.2 Traveler Signup Page

Tourist Signup Page: The system requires the traveler user to enter their

information upon the account creation, such as their name, email, and password. The

user is also required to comprehend and agree to the terms and conditions of the system

before signing up.

BULACAN STATE UNIVERSITY MENESES CAMPUS 35


Figure 4.3 Destination Page

Destination Page: This page showcases a list of tourist destinations. Clicking

each item redirects the user to the detailed relevant information about the destination.

A location button attached, as shown in Figure 4.3, links users to a Google Map for

improved navigation of the destinations localized to the coordinates.

BULACAN STATE UNIVERSITY MENESES CAMPUS 36


Figure 4.4 Lodgings Page

Lodgings Page: Figure 4.4, shown above, showcases the Hotels that have

registered with the system. The detailed information provided by the hotel, including

images, addresses, descriptions, contact information, amenities, room types, and

cancellation policies, can be accessed by clicking each hotel. There are three (3) other

buttons for messaging, mapping, and booking forms.

BULACAN STATE UNIVERSITY MENESES CAMPUS 37


Figure 4.5 Chat Room Page

Chat Room Page: The one-to-one (1:1) private chat room page allows users

between tourists and hotels/restaurants to conduct negotiations and inquiries to

facilitate better communication.

BULACAN STATE UNIVERSITY MENESES CAMPUS 38


Figure 4.6 Host’s Map Page Host’s Map Pages: Figure 4.6 is the page

redirected upon clicking the “Map” button on the Lodgings Page. Google Maps is a

location service implemented for seamless navigation.

BULACAN STATE UNIVERSITY MENESES CAMPUS 39


Figure 4.7 Hotel Booking Form Page

Hotel Booking Form Page: Upon reserving a room, the user is presented with

a form in which they must enter the information the hotel needs to process their

booking. The information needed, as shown in Figure 4.7 such as their full name, the

check-in and check-out dates, how many persons, contact number, email, room

preference, their payment information such as Gcash name and number, along with the

reference number of the transaction for the proof of their payment procedure.

BULACAN STATE UNIVERSITY MENESES CAMPUS 40


Figure 4.8 Restaurant Page

Restaurant Page: Figure 4.8 showcases the Restaurants that have registered

with the system. The detailed information provided by the restaurant, including images,

addresses, descriptions, contact information, amenities, room types, and cancellation

policies, can be accessed by clicking each restaurant. There are three other (3) buttons

for messaging, map, and booking form..

BULACAN STATE UNIVERSITY MENESES CAMPUS 41


Figure 4.9 Restaurant Reservation Form Page

Restaurant Reservation Form Page: Upon reservation, the user is presented

with a form in which they must enter the required information that the restaurant needs

to process their booking. The information needed, as shown in Figure 4.9 such as their

full name, the reservation date, how many persons, contact number, email, room

preference, their payment information such as Gcash name and number, along with the

reference number of the transaction for the proof of their payment procedure.

BULACAN STATE UNIVERSITY MENESES CAMPUS 42


Figure 4.10 Profile Page

Profile Page: Figure 4.10 shows the email and name of the user registered in the

system, and they can also change their profile pictures. The two tabs below load their

confirmed bookings and the information they provided earlier.

BULACAN STATE UNIVERSITY MENESES CAMPUS 43


Figure 4.11 Hotel Reservations Page

Hotel Reservation Page: On this page, the traveler’s reservation will be saved

promptly. After the traveler submits the reservation, it will be saved under the pending

reservations to let the user know they have successfully made the reservation and

review their details. Confirmed reservations are the ones that the hotel has confirmed;

past reservations are the ones they have made in the application throughout their

BULACAN STATE UNIVERSITY MENESES CAMPUS 44


account creation, while declined is where the declined reservations made by the hotel

will display.

Figure 4.12 Restaurant Reservation Page

Restaurant Reservation Page: The same as in Figure 4.11, the traveler’s

reservation will be saved promptly. After the traveler submits the reservation, it will be saved

under the pending reservations to let the user know they have successfully made the

BULACAN STATE UNIVERSITY MENESES CAMPUS 45


reservation and review their details. Confirmed reservations are the ones that the hotel has

confirmed; past reservations are the ones they have made in the application throughout their

account creation, while declined is where the declined reservations made by the hotel will

display.

Figure 4.13 Host Signup Page

Host Signup Page: The system requires the user to enter their information upon

the account creation, such as their name, email, and password. The host user must

provide the images of their BIR, DTI, and TIN ID as proof of the user’s business

legitimacy. Lastly, to complete their signup procedure, the user has to comprehend and

agree to the terms and conditions of the system before signing up.

BULACAN STATE UNIVERSITY MENESES CAMPUS 46


Figure 4.14 Host Login Reminder Page

Host Login Reminder Page: This reminder will appear when the user tries to

log in after submitting the signup form. The admin must review their form before

verifying their account to be a host in the system.

BULACAN STATE UNIVERSITY MENESES CAMPUS 47


Figure 4.15 Hotel and Restaurant Preview Page

Hotel Preview Page: On this page, the information provided by the hotel and

restaurant will show as a preview; clicking the edit button will redirect them to the page

where they can edit their information as to what their hotel and restaurant needs.

BULACAN STATE UNIVERSITY MENESES CAMPUS 48


Figure 4.16 Hotel and Restaurant Management Page

Hotel and Restaurant Management Page: Figure 4.14 displays the page

where the user can quickly provide the needed information. Clicking “save changes”

will upload their restaurant and hotel into the tourist interface. Clicking the cancel

button will discard the alteration of the information.

BULACAN STATE UNIVERSITY MENESES CAMPUS 49


Figure 4.17 Notification Page

Notification Page: This page updates the hotel and the restaurant about the new

reservations made by the tourist users. The detailed information that the tourist user

entered in the reservation form will appear by clicking on each notification. The

BULACAN STATE UNIVERSITY MENESES CAMPUS 50


message button facilitates communication between the user and the traveler who

booked the reservation. Finally, the user can accept the reservation and submit the

update into the tourist interface by clicking the confirm booking button.

Figure 4.18 Recent Conversation Page

Recent Conversation Page: In Figure 4.16, the recent conversations page

shows the lists of the conversations the user has had, and clicking on each item will

redirect them to the respective chat rooms.

BULACAN STATE UNIVERSITY MENESES CAMPUS 51


Figure 4.19 Host Profile Page

Host Profile Page: The email and name that the user has registered in the

system can also change their profile pictures. The system's information about the

system, as well as its terms and conditions, are located underneath the user data.

BULACAN STATE UNIVERSITY MENESES CAMPUS 52


Figure 4.20 Admin Login Page

Admin Login Page: The system has only one administrator who uses a pre

authenticated password and email address.

Figure 4.21 Signup Forms List Page

Signup Forms List Page: The signup forms retrieved from the signup pages

for hotels and restaurants are displayed in the Signup Forms Lists, as Figure 4.19 shows.

BULACAN STATE UNIVERSITY MENESES CAMPUS 53


Figure 4.22 Signup Form Details Page

Signup Forms Details Page: The details of each retrieved signup form are

displayed on the form details page. The validate button verifies the account of the hotel

or restaurant, now allowing them to log in. When a hotel or restaurant submits a form

that does not meet the application requirements, the admin will manually contact them

via the email address they have provided to inform them about the specific problem.

Thematic Analysis

The developers performed a thematic analysis on the qualitative data obtained

from interviewing the selected hotel and restaurant managers and citing relevant data

online to find patterns and relationships among the responses from the transcripts and

the data cited sources. Shown and discussed are themes and sub-themes.

BULACAN STATE UNIVERSITY MENESES CAMPUS 54


Current booking • Online reservations
management and • Face-to-face reservation
challenges • Customers not showing up

• Gcash common payment option


Current Payment
• Reservation fee
transactions
• Face-to-face-full payment

Reservation
• Name, contact number, group size,
information
reservation date, resservation fee
collection

Figure 4.23 Themes and Sub-Themes of Restaurant Data Questions Numbers 1-3

The first theme, "Current Booking Management and Challenges", compares the

collected data, which gained typical sub-themes: “Online reservations”, “face-to-face

communication”, and challenges of “customers not showing up”. The second theme is

“Current Payment Transactions,” which compares collected data, which gained Gcash

as the standard payment method for online transactions, which requires reservation fee

and face-to-face for full payment. The third theme, "Reservation information

collection," gained the data by collecting names, contact numbers, group sizes,

reservation dates, and reservation fees.

BULACAN STATE UNIVERSITY MENESES CAMPUS 55


Information to • Showcasing the menu and
attract customers prices

Features and • Ability to showcase menu and


functionalities specialities
expectations • Reservation capabilities

Payment Fraud • Payment gateway with legal


Prevention requirements (online), Money
Bill checker (offline)
• Money Bill checker (offline)
Cancellation • require reservation fee, early
policies cancellation

Figure 4.24 Themes and Sub-Themes of Restaurant Data Questions Numbers 4-7

The fourth theme, "Information to attract customers," compares the collected

data, which gained a common sub-theme of showcasing the restaurants' menus and their

prices. The fifth theme, "Features and functionalities expectations," gained typical sub-

themes of the ability to showcase their menu and specialities, capable of handling

reservations. The sixth theme, "Payment Fraud Prevention," earned the sub-theme of

the payment gateway with legal requirements if online and then the Money bill checker

if offline. Lastly, the seventh theme, “Cancellation policies,” gained the sub-theme that

requires reservation fees and early cancellation.

BULACAN STATE UNIVERSITY MENESES CAMPUS 56


Current booking • Walk-ins, phone calls, online
management and
challenges • Non-refundable bookings

Current
• Remote, online
communication

Current Online
• Gcash and PayMaya
Payment Method

Information
• Contact information, number
collected from
guests of guests, chosen room rates

Figure 4.25 Themes and Sub-Themes of Hotel Data Questions Numbers 1-4

The first theme, “Current Booking Management and Challenges” compares the

collected data which gained typical sub-themes: Walk-ins, phone calls, online, non-

refundable bookings. The second theme, "Current communication", achieved the sub-

themes of remote or online communication. "Current online payment method" was the

third theme, which gained the sub-themes of the commonality of Gcash and Paymaya

as their current online payment methods. The fourth theme, "Information collected from

guests", gained sub-themes of contact information, number of guests, and chosen room

rates.

BULACAN STATE UNIVERSITY MENESES CAMPUS 57


Information to
• Rooms, Amenities
attract customers

Features and • Showcasing room rates and


functionalities amenities, contacts, resevation
expectations capabilities
• Payment gateway with legal
Payment Fraud
requirements (online), Money
Prevention
Bill checker (offline)

Data Security • Proper data storage and data


encryption

Cancellation
policies • Require early cancellations,
no cancellations.

Figure 4.26 Themes and Sub-Themes of Restaurant Data Questions Numbers 5-9

The fifth theme, “Information to attract customers", compares the collected data,

which gained typical sub-themes of room rates and amenities. The sixth theme

"Features and functionalities expectations", gained sub-themes about showcasing room

rates and amenities, contacts, with reservation capabilities. "Payment Fraud

Prevention" serves as the seventh theme, which earned the sub-theme payment gateway

with legal requirements for online payment handling and money bill checker for offline.

Eight articles, "Data Security", which gained a sub-theme of proper data storage and

encryption. Lastly, the ninth theme, "Cancellation Policies", gained a sub-theme of

requiring early cancellations and no cancellations.

1. Business Authenticity and Legitimacy

As part of this process, before signing up with the application, a business

host must present certain documents to prove their legitimacy and authenticity for

the application's security to avoid trolls. Signing up includes their DTI (Department

of Trade and Industry), BIR (Bureau of Internal Revenue) Form, and TIN ID (Tax

BULACAN STATE UNIVERSITY MENESES CAMPUS 58


Identification Number). Upon submitting the requirements, the administrator will

be the one to validate their documents, whether they are legitimate or dummy. After

confirming that these are authentic, the administrator will verify their account. Once

the administrator has verified the business account, it will send their email so that

they can log in to the system, and they can now start managing their information

and upload it to the travellers' interface.

2. Listing

Information management. Lodgings and dining establishments can

showcase their information, including pictures, location, contacts, business

description, room rates (for accommodation), and cancellation policies.

3. Updates

Notification. The hotel and restaurant must receive updates regarding with

the new reservation made by the user in the traveler interface.

Reservation Handling. The reservation process includes more than real-time

updates for incoming reservations. However, they need to be able to let the guests

and customers know whenever they have confirmed their reservation or declined

the reservation, so following that, the developers added the functionality to sort out

the notifications—starting from new notifications with the ability to show detailed

information from the guest and customers along with the buttons confirming and

declining the reservation. The OK button lets the managers notify the

guest/customer that the hotel/restaurant manager has just confirmed their

reservation. Same with the decline button, but in this case, upon clicking decline,

the hotel/restaurant must provide a reason for declination to let the guest and

customer know the reason. Then, this notification will fall under the declined

BULACAN STATE UNIVERSITY MENESES CAMPUS 59


reservations with the traveller interface. Sorting out the messages is important

because it organizes the list of reservations and avoids creating unnecessary

confusion that will stir up the updates in one place, decreasing the user experience.

4. Communication

Messaging system. The system includes a direct messaging system for

faster and real-time communication between the host and travelers.

5. Payment

According to the qualitative data gathered through interviewing, the

most used online payment method is Gcash. The developers implemented the

payment gateway inside the system, letting the hotel and restaurant upload their

Gcash information to receive the reservation fee. The users of the travler

interface must provide the reference number and the receipt photo of the

transaction.

Evaluated Criteria of the International Standard for Organization (ISO)

Function Sustainability Mean Interpretation

1. The system caters to the needs of tourists in 4.79 Strongly Agree

accessing tourist spot information, lodging

booking, and dining reservations.

2. The system is capable of managing hotel and 4.53 Agree

restaurant details and receiving updates and

messages that are simple to use.

3. Communicating via messaging between tourists and 4.54 Agree

hosts is relatively straightforward and practical.

Total Mean 4.62 Strongly Agree

BULACAN STATE UNIVERSITY MENESES CAMPUS 60


Table 4.1 Function Sustainability Interpretation

The functional Stability category has three criteria which determine the general

rating. These criteria include whether the system meets the needs of tourists in

accessing information about tourist spots, booking lodging, and making dining

reservations with the highest rating of 4.79 and interpretation Strongly Agree; second,

whether it is capable of managing hotel and restaurant details, receiving updates, and

providing easy-to-use messaging features with a mean rating of 4.53 and interpretation

of Agree; and lastly, whether communication between tourists and hosts via messaging

is clear and practical with a 4.54 rating mean and Agree on interpretation. The overall

mean rating for this category is 4.62, which is interpreted as Strongly Agree.

Performance Efficiency Mean Interpretation

1. The system conveniently provides access to 4.57

browsing tourist spot information, lodging and Agree

restaurant reservations.

2. The system seamlessly integrates third-party 4.61 Strongly Agree

functions such as Google Maps and chat systems.

3. Effortlessly communicate with the system to 4.54 Agree

maintain the accuracy of host data and quickly

handle inquiries and reservations.

Total Mean 4.57 Agree

Table 4.2 Performance Efficiency Interpretation

Performance Efficiency has three criteria that determine its overall mean rating

and interpretation. The first criterion concerns the system's ability to conveniently

provide access to browsing tourist spot information, lodging, and restaurant

BULACAN STATE UNIVERSITY MENESES CAMPUS 61


reservations. This criterion has a rating of 4.57, and the interpretation is Agree. The

second criterion is related to its ability to seamlessly integrate third-party functions such

as Google Maps and chat systems. This criterion has a rating of 4.61, and the

interpretation is also strongly Agreed. The third criterion concerns the ability to

effortlessly communicate with the system to maintain the accuracy of hosts' data and

quickly handle inquiries and reservations. This criterion has received the lowest mean

rating of 4.54, but the interpretation is still agreeable. The respondents of this capstone

project have approved the system's performance efficiency with a mean rating of 4.57,

and the interpretation is Agree.

Compatibility Mean Interpretation

1. The system continues to work reliably across 4.49 Agree

different Android versions.

2. The system is responsive to user actions and runs 4.51 Agree

smoothly.

Total Mean 4.5 Agree

Table 4.3 Compatibility Interpretation

The compatibility category has two criteria determining its overall rating. The

first criterion is related to the system's ability to work reliably across different Android

versions, with a rating mean of 4.49 and the interpretation of Agree. The second

criterion is related to its responsiveness to user actions and ability to run smoothly, with

a rating mean of 4.51, and the interpretation is also Agree. The total mean compatibility

rating is 4.5, and the interpretation is Agreeable.

BULACAN STATE UNIVERSITY MENESES CAMPUS 62


Usability Mean Interpretation

1. The system eases booking hotel rooms and 4.62 Strongly Agree

making restaurant reservations.

2. Tourist users found the interface to be simple and 4.57 Agree

convenient for using Google Maps integration

for seamless navigation.

3. Effectively keep track of incoming reservations. 4.62 Strongly Agree

Total Mean 4.60 Strongly Agree

Table 4.4 Usability Interpretation

Usability has three criteria that determine its overall mean rating and

interpretation. The first criterion is related to the system's ability to make hotel room

booking and restaurant reservations easier, has a mean rating of 4.62 and is interpreted

as Strongly Agree. The second criterion is related to its effectiveness in keeping track

of incoming reservations. The requirements have a mean rating of 4.52 is interpreted as

Agree. The third criterion is associated with the interface's simplicity and convenience

for tourist users who use Google Maps integration for seamless navigation. This

criterion has received the lowest mean rating of 4.57, but the interpretation is still

Agreeable. The respondents of this capstone project have approved the system's

performance efficiency with a mean rating of 4.60, and the arrangement is Strongly

Agree.

BULACAN STATE UNIVERSITY MENESES CAMPUS 63


Reliability Mean Interpretation

1. It offers neatly structured content, enabling 4.58 Agree

users to navigate throughout the system with

ease.

2. The system’s user interface is modern and suited 4.47 Agree

to a satisfactory user experience.

3. The content structure of the host interface is 4.59 Agree

feasible, allowing for easier management of their

details and communication with guests and

customers.

Total Mean 4.52 Agree

Table 4.5 Reliability Interpretation

The reliability category has three criteria to determine its overall mean rating

and interpretation. The first criterion is related to the content structure, which should be

neatly organized and help users navigate the system quickly. This criterion has a rating

of 4.58, and the interpretation is Agree. The second criterion concerns the user interface,

which should be modern and provide a satisfactory user experience. This criterion has

a rating of 4.47, and the interpretation is also Agreeable. The third criterion is related

to the content structure of the host interface, which should be feasible and allow for

easier management of their details and communication with guests and customers. This

criterion has the highest mean rating of 4.59, and the interpretation is also Agree.

Overall, the respondents of this capstone project have approved the system's

performance efficiency with a mean rating of 4.52, and the interpretation is Agree.

BULACAN STATE UNIVERSITY MENESES CAMPUS 64


Maintainability Mean Interpretation

1. The system's interface and features for 4.58 Agree

managing and updating information make it

more accessible.

2. The system upholds its primary features 4.54 Agree

throughout time and functions as intended.

3. The ability of the system to inform users about 4.55 Agree

their reservations in response to updates made by

hosts via the chat system.

Total Mean 4.56 Agree

Table 4.6 Maintainability Interpretation

Maintainability has three criteria that determine its total mean rating and

interpretation. The first criterion is related to the system's interface and features

responsible for managing and updating information. This criterion has received the

highest rating of 4.58, and the interpretation is Agree. The second criterion is if the

system upholds its primary features over time and functions as intended. This criterion

has received the lowest rating of 4.54, but still with the interpretation of Agree. The

ability of the system to inform users about their reservations in response to updates

made by hosts via the chat system. This criterion has a mean rating of 4.55 and the

interpretation of Agree. Overall, the respondents of this capstone project have approved

the system's performance efficiency with a mean rating of 4.56 and the interpretation

of Agree.

BULACAN STATE UNIVERSITY MENESES CAMPUS 65


Security Mean Interpretation

1. Prioritizes data security so that some user data is 4.65 Strongly Agree

only accessible to authorized users, hence

increasing privacy.

2. The system informs the user about how their data 4.59 Agree

is stored before signing up.

3. Tourists and hosts can connect comfortably 4.62 Agree

without worrying about data breaches via

messaging.

Total Mean 4.62 Agree

Table 4.7 Security Interpretation

Security has three criteria to determine the overall rating. The first criterion is

whether the system informs the user about how their data is stored before signing up,

with a lowest rating of 4.65 and an interpretation of 'Strongly Agree.' The second

criterion is whether the hosts and guests can connect comfortably without worrying

about data breaches via messaging, with a mean rating of 4.59 and an interpretation of

Agree.' Lastly, the third criterion is whether the system prioritizes data security and

only allows authorized users to access some user data, increasing privacy, with the

highest mean rating of 4.62 and an interpretation of Strongly Agree.'. The system's

performance efficiency is approved by the respondents of this capstone project, with a

total mean of 4.62 and an interpretation of Strongly Agree.'

BULACAN STATE UNIVERSITY MENESES CAMPUS 66


Portability Mean Interpretation

1. Offers essential information and functionality in 4.69 Strongly Agree

one place within the system that is convenient

and user-friendly.

2. The system's simplicity and ease of use enhance 4.56 Agree

user experience.

3. Gathers all necessary travel resources in a single 4.66 Strongly Agree

place, which ensures users can quickly find what

they need.

Total Mean 4.64 Strongly Agree

Table 4.8 Portability Interpretation

Portability has three criteria to determine the overall rating: (1) The system's

simplicity and ease of use enhance user experience with a mean score of 4.69,

interpreted as Strongly Agree.' (2) The criterion 'Gathers all necessary travel resources

in a single place' ensures that users can easily find what they need, with a mean rating

of 4.56, also interpreted as Agree.' (3) The criteria 'Offers essential information and

functionality in one place within the system' is convenient and user-friendly, achieving

the highest mean rating of 4.66, interpreted as 'Strongly Agree.' Overall, the system's

performance efficiency is approved by the respondents of this capstone project with a

total mean of 4.64, interpreted as 'Strongly Agree.'

Summary Table for the Level of Acceptability of the Developed System

Software Criteria Computed Mean Descriptive

Interpretation

1. Functional Sustainability 4.62 Strongly Agree

BULACAN STATE UNIVERSITY MENESES CAMPUS 67


2. Performance Efficiency 4.57 Agree

3. Compatibility 4.5 Agree

4. Usability 4.6 Agree

5. Readability 4.55 Agree

6. Maintainability 4.56 Agree

7. Security 4.62 Agree

8. Portability 4.64 Strongly Agree

OVERALL WEIGHTED 4.58


Agree
MEAN

Table 4.9 Overall Weighted Mean Interpretation

Summary

The objective of this project is to develop a versatile travel application that

enables users to browse various trip locations, lodging options, and dining

establishments while having the ability to book reservations. Additionally, users can

become hosts in the application by offering hotel and restaurant management services

that showcase their establishment.

The developers applied the Agile methodology that allowed them to

collaboratively develop the system with an understanding of the users' needs, from

planning to reviewing phases iteratively. The conducted interviews that gained

thorough data enough to understand the user's needs for the hotel and restaurant

management interface have been analyzed and applied. The survey was conducted to

evaluate the system, such as functional sustainability, performance efficiency,

compatibility, usability, maintainability, security, and portability. Interviews have also

been undertaken to identify the features, functionalities, and needs of the businesses in

the application were analyzed and interpreted.

BULACAN STATE UNIVERSITY MENESES CAMPUS 68


CHAPTER V

SUMMARY OF FINDINGS, CONCLUSIONS, AND

RECOMMENDATIONS

This chapter represents the summary of findings, conclusions of the study and

the recommendations for improvements to be made in the system.

Summary of Findings

The project's main objective is to design and develop a system to assist travellers in

their travel journey by providing them with a list of travel destinations, lodgings, and

dining establishments, allowing them to find and reserve a place to stay and dine. The

system also aims to provide information management for hotels and restaurants by

offering management services that could display their establishments through the

system.

1. The development of the Gypsy Go system adhered to the Agile Methodology,

effectively progressing through critical phases:

Planning Phase: Initiated brainstorming sessions to conceptualize a user-

friendly travel and reservation system. Stakeholder interviews were conducted

to identify essential features of the management interface.

Designing Phase: Applied material design principles to create a modern

interface with an emphasis on consistency across platforms. Development tools

like Figma and Adobe XD were utilized for vector creation, enhancing the

system's aesthetic appeal.

Development Phase: Transited from conceptualization to coding using

Android Studio, Java, and XML. The development process is prioritized

primarily.
functions and collaboration among developers were maintained through regular

meetings for issue resolution.

Testing Phase: Conducted thorough testing to ensure the efficiency of the

system and its database connection. Emphasis was placed on data accuracy, and

extensive compatibility and performance testing validated seamless operation

across various Android devices.

Deployment Phase: Closely monitored the live deployment to ensure correct

functionality for travelers and managers. The successful launch indicated

promising prospects for the application's future.

Review Phase: Focused on user feedback, addressing key components such as

real-time updates and navigation. The results of the review reinforced the

application's trajectory for continuous improvement and future success.

2. The application's hotel and restaurant management features are designed to offer

a comprehensive and efficient Management User Interface, empowering

establishments to handle bookings and engage with customers seamlessly.

Drawing insights from interviews with selected hotels and restaurants, the

development team ensured that the features and functionalities within the

management interface aligned with the specific needs and preferences of

business hosts. Security is a top priority, requiring establishments to submit

documents such as DTI, BIR Form, and TIN ID during the sign-up process to

authenticate their legitimacy. The administrator validates these documents,

mitigating potential security risks within the system.

Within the Management User Interface, establishments can efficiently

manage their listings, showcasing essential details, including pictures, location,

BULACAN STATE UNIVERSITY MENESES CAMPUS 70


contacts, business descriptions, room rates (for lodging), and cancellation

policies. This comprehensive information sharing enhances the visibility of

businesses, providing potential customers with the necessary details for

informed decision-making.

Real-time updates play a crucial role in the system, with a notification

feature keeping hotels and restaurants informed of new reservations made

through the traveller interface. The reservation handling process includes real-

time updates, allowing establishments to confirm or decline reservations.

Detailed notifications streamline communication, fostering transparency for

both business hosts and travelers.

Effective communication is further facilitated through the integration of

a direct messaging system within the Management User Interface, enabling fast

and real-time communication between hosts and travelers. This feature

contributes to enhanced customer service and ensures seamless communication,

positively impacting the user experience for both hosts and guests.

Addressing the prevalent use of Gcash as an online payment method, a

dedicated payment gateway is implemented within the system. Business hosts

can upload their Gcash information, allowing them to receive reservation fees.

Users on the traveler interface provide reference numbers and receipt photos for

transaction verification.

3. The system used ISO (International Standard For Organization) 25010, which

has eight aspects: Function Suitability, Performance Efficiency, Compatibility,

Usability, Reliability, Maintainability, Security, and Portability. The developers

used the Likert scale and conducted a software evaluation on tourists, Hotel

BULACAN STATE UNIVERSITY MENESES CAMPUS 71


managers, and restaurant managers in selected places in Bulacan. Functional

sustainability was interpreted as strongly agreeing with a total mean of 4.62;

Performance efficiency was construed as agreeing with a real mean of 4.57.

Compatibility was interpreted and agreed with a total mean of 4.5. Usability

interpreted a Strongly agree with a total mean of 4.60. Reliability was

interpreted as agreeing with a total mean of 4.52; maintainability was

interpreted as agreeing with a total mean of 4.56. Security interpreted and

arranged with a total mean of 4.62. Lastly, portability is interpreted as

enormously agreeable, with a total mean of 4.64. A total of 100 respondents

were surveyed, including travelers (88), hotel managers (8), and restaurant

managers (4). The ISO software evaluation's overall weighted mean gained a

total of 4.58, concluding all eight criteria that interpreted an "Agree."

Conclusions

1. The development of the Gypsy Go system, following the Agile Methodology,

has demonstrated a systematic and collaborative approach to creating a user-

friendly travel and reservation platform. The comprehensive planning phase,

with its emphasis on stakeholder engagement and requirement identification,

laid a robust foundation. The design phase, guided by material design principles

and implemented through tools like Figma and Adobe XD, ensured a modern

and consistent interface. Transitioning to the development phase, the use of

Android Studio, Java, and XML allowed for a structured coding process, while

collaboration and regular communication among developers facilitated efficient

progress.

Thorough testing in the subsequent phase ensured the system's smooth

operation, with an emphasis on data accuracy and compatibility across diverse

BULACAN STATE UNIVERSITY MENESES CAMPUS 72


Android devices. The deployment phase, closely monitored, validated the

correct functionality of features in a live environment, promising accessibility

for travelers and managers. The review phase, focusing on user feedback and

critical enhancements, underlined the application's trajectory for continuous

improvement and future success.

In essence, the Agile approach's iterative and adaptable nature has

proven instrumental in addressing user needs and refining Gypsy Go at each

stage. The successful deployment and positive reception during the review

phase indicate not only the current effectiveness of the system but also its

potential for sustained growth and enhancement in the dynamic landscape of

travel and reservation applications.

2. The examination of the hotel and restaurant management features within the

Gypsy Go application reveals a holistic approach geared towards providing

business hosts with powerful tools for efficient reservation management. The

Management User Interface serves as the central hub, offering a seamless

experience for establishments to handle bookings and engage with customers.

The emphasis on business authenticity and legitimacy, requiring documents like

DTI, BIR Form, and TIN ID, demonstrates a commitment to security, ensuring

only legitimate businesses are part of the platform.

The comprehensive listing capabilities empower hotels and restaurants to

showcase vital information, fostering transparency and aiding users in making

well-informed decisions. Real-time updates and a sophisticated notification

system contribute to effective reservation handling, offering both hosts and

BULACAN STATE UNIVERSITY MENESES CAMPUS 73


travelers timely and detailed information, thus enhancing communication and

transparency in the booking process.

The integration of a direct messaging system within the Management User

Interface further streamlines communication, providing a platform for fast and

real-time interactions between hosts and travelers. Additionally, the

incorporation of Gcash as a popular payment method through a dedicated

payment gateway aligns with user preferences, facilitating a convenient and

secure transaction process. Gypsy Go application's hotel and restaurant

management features not only prioritize the operational efficiency of businesses

but also underscore a commitment to transparency, communication, and user-

friendly interactions. The findings emphasize the application's potential to serve

as a comprehensive and reliable platform for both business hosts and travelers,

fostering trust and contributing to a positive experience within the dynamic

realm of travel and reservation management.

3. The researcher concluded that the application had met the requirements and

passed the software evaluation. The Function Suitability, Performance

Efficiency, Compatibility, Usability, Reliability, Maintainability, Security, and

Portability are said to be passed and accepted based on the conducted survey,

and the respondents' comments are all Interpretation as Strongly Agree.

Recommendations

After reviewing the data acquired from developing the system through the agile

method, conducting interview data, and interpreting the data obtained from the survey,

the following recommendations were identified to enhance the system's functionality.

BULACAN STATE UNIVERSITY MENESES CAMPUS 74


1. Considering the success of the system through Agile development, In future

project phases, the development team should embrace and iterate on the Agile

Methodology. The collaborative and iterative nature of Agile has proven

instrumental in addressing user needs and fostering continuous improvement.

To sustain the positive trajectory, the team should maintain regular

communication channels, ensuring ongoing collaboration and the quick

resolution of issues.

Additionally, incorporating user feedback as a central aspect of the

development process should be prioritized. Establishing mechanisms for real-

time feedback collection and implementing a responsive feedback loop will

contribute to the system's adaptability and user satisfaction.

Furthermore, considering the dynamic nature of technology and user

expectations, the team should stay abreast of emerging trends, technologies, and

user preferences in the travel and reservation domain. This proactive approach

will enable the integration of innovative features and functionalities, keeping

Gypsy Go competitive and aligned with evolving industry standards.

In summary, by staying committed to Agile principles, incorporating user

feedback, and remaining vigilant to industry trends, the development team can

not only sustain the current success of Gypsy Go but also position the

application for continued growth and excellence in the dynamic landscape of

travel and reservation systems.

2. Implementing weather tracking tools, transportation availability, user reviews,

or user feedback under the hotel and restaurant posts is recommended for much

more convenience for the users.

BULACAN STATE UNIVERSITY MENESES CAMPUS 75


3. Although most respondents agree with the system, the developers still

recommend improving the Function Suitability, Performance Efficiency,

Compatibility, Usability, Reliability, Maintainability, Security, and Portability

to keep the system more stable and up-to-date information. Investigating new

design trends and technological advancements may present chances for Gypsy

Go to maintain its lead in the competitive field of travel apps.

BULACAN STATE UNIVERSITY MENESES CAMPUS 76


References:
Buhalis, D., & Amaranggana, A. (2015). Smart Tourism Destinations Enhancing
Tourism Experience Through Personalisation of Services. Springer
International Publishing EBooks, 377–389. https://doi.org/10.1007/978-3-319-
14343-9_28
Caynila, K. A. M., Luna, K. T., & Milla, S. A. A. (2022, May). THE
PHILIPPINE TOURISM SECTOR AMID THE PANDEMIC: Developments
and Prospects. ECONOMIC NEWSLETTER.
Euromonitor International. (2019). Travel intermediaries in the Philippines.
Retrieved from https://www.euromonitor.com/travel-intermediaries-in-the-
philippines/report
Hussein, S., & Ahmed, E. (2022). Mobile Application for Tourism: The Case of Egypt.
https://www.igi
global.com/pdf.aspx?tid=290415&ptid=278031&ctid=4&oa=true&isxn=9781
683181552
iNetTutor.com. (2022, September 9). Mobile App Hotel Reservation System - Free
Capstone 2023. https://www.inettutor.com/source-code/mobile-app-hotel-
reservation-system-with-sms-notification-using-itexmo-api/
Lin, S., Juan, P., & Lin, S. (2020). A TAM Framework to Evaluate the Effect of
Smartphone Application on Tourism Information Search Behavior of Foreign
Independent Travelers. Sustainability, 12(22), 9366.
https://doi.org/10.3390/su12229366

ISO 25000 Portal. iso25000.com. (n.d.). Retrieved April 30, 2023, from
https://iso25000.com/index.php/en/iso-25000-standards/iso-25010

Mistry, S. (2023, November 20). How to deal with common challenges in hotel
industry in 2023?. eZee Absolute. https://www.ezeeabsolute.com/blog/how-to-
deal-with-challenges-in-hotel-industry/

Öztürk, A., Bilgihan, A., Nusair, K., & Okumus, F. (2016). What keeps the mobile
hotel booking users loyal? Investigating the roles of self-efficacy, compatibility,
perceived ease of use, and perceived convenience. International Journal of
Information Management, 36(6), 1350–1359.
https://doi.org/10.1016/j.ijinfomgt.2016.04.005
Swaid, S. (2018, November 1). M-Commerce Apps Usability: The Case of Mobile
Hotel Booking Apps. ResearchGate.
https://www.researchgate.net/publication/328662819_M-
Commerce_Apps_Usability_The_Case_of_Mobile_Hotel_Booking_Apps?fbc
lid=IwAR3qSyt-
MmNGFFcVqD2oPTTtFllYxq5gZ4DI8aH059ltIYW8Xj37JEijAw0

BULACAN STATE UNIVERSITY MENESES CAMPUS 77


Tian, Z., Shi, Z., & Cheng, Q. (2021). Examining the antecedents and consequences
of mobile travel app engagement. PLOS ONE, 16(3), e0248460.
https://doi.org/10.1371/journal.pone.0248460
Vicente, M., Jr. (2019, July 8). E-Tourism Adoption of the Travel Agencies in Cebu
City, Philippines.
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3416057
View of Isabela Travel App: An Android Based Tour Guide Application for the
Province of Isabela. (n.d.).
http://tjct.isujournals.ph/index.php/tjct/article/view/17/9
View of Trust in E-commerce Acceptance and Use: The Case of the Philippine Online
Food Delivery and Tourism Booking Services. (n.d.).
https://pmr.upd.edu.ph/index.php/pmr/article/view/355/354
Xiang, Z., Du, Q., Ma, Y., & Fan, W. (2017, February). A comparative analysis
of Major Online Review Platforms: Implications ...Zheng. A comparative
analysis of major online review platforms: Implications for social media
analytics in hospitality and tourism. Retrieved April 23, 2023, from
https://www.researchgate.net/publication/309344417_A_comparative_analysis
_of_major_online_review_platforms_Implications_for_social_media_analytic
s_in_hospitality_and_t

BULACAN STATE UNIVERSITY MENESES CAMPUS 78


ABOUT THE DEVELOPERS

I am Aubrey Adeline Isabelle S.


Lazaro, 20 years old from Pritil,
Guiguinto, Bulacan. I am living by the
motto “if you never bleed, you’re never
gonna grow".

I am Mark Kenneth A. Manumbilao


from Bagumbayan Bulakan, Bulacan
22 years old. Aiming to have a better
version of myself. My motto in my life
is "time is gold so don't waste it.”.

I am Marcus Lherwyn G. Gomez from


Pitpitan Bulakan, Bulacan 22 years old.
Aiming to have a better successful life.
My motto in my life is "Don't Hate the
player, Hate the game".

I am Reindel D.G. Castro, 23 years of


age.My motto in life is "Chase dreams
relentlessly, embrace growth, and let
your resilience be the compass that
guides your extraordinary journey."

BULACAN STATE UNIVERSITY MENESES CAMPUS 79


APPENDICES

APPENDIX A
Letter of Request for Thesis Adviser

BULACAN STATE UNIVERSITY MENESES CAMPUS 80


APPENDIX B
Letter of Request to Conduct the Study

BULACAN STATE UNIVERSITY MENESES CAMPUS 81


APPENDIX C
Research Instrument (Questionnaire)

5 4 3 2 1
Function Sustainability
1. The system caters to the needs of tourists in accessing
tourist spots information, lodging booking, and dining
reservations.
2. The system is capable of managing hotel and
restaurant details, receiving updates, and messages are
simple to use.
3. Communicating via messaging between tourists and
hosts is relatively clear and practical.
Performance Efficiency
1. The system conveniently provide access to browsing
tourist spot information, lodging and restaurant
reservations.
2. The system is responsive to user actions and runs
smoothly.
3. Effortlessly communicate with the system to maintain
the accuracy of hosts data and quickly handle inquiries
and reservations.
Compatibility
1. The system retains to work reliably across different
Android versions.
2. The system seamlessly integrates third-party functions
such as Google maps and chat system.
Usability
1. The system eases booking hotel rooms and making
restaurant reservations.
2. Tourist users found the interface to be simple and
convenient for using Google Maps integration for
seamless navigation.
3. Effectively keep track of incoming reservations.
Readability
1. It offers a neatly structured content, enabling users to
navigate throughout the system with ease.
2. The system’s user interface is modern and suited to a
satisfactory user experience.
3. The content structure of the host interface is feasible,
allowing for easier management of their details and
communication with guests and customers.
Maintainability
1. The system’s interface and features managing and
updating information makes it more accessible.
2. The system guaranteeing that users can depend on its
functionality during their vacation.
3. The system upholds its primary features throughout
time and function as intended.
4. The ability of the system to inform users about their
reservations in response to updates made by hosts via
chat system.

BULACAN STATE UNIVERSITY MENESES CAMPUS 82


Security
1. Prioritizes data security that some user data is only
accessible to authorized user, hence increasing privacy.
2. The system informs the user about how their personal
data is stored before signing up.
3. Tourists and hosts can connect comfortably without
worrying regarding data breaches via messaging.
Portability
1. Offers essential information and functionality in one
place within the system is convenient and user-
friendly.
2. The system’s simplicity and ease of use enhances user
experience.
3. Gathers all necessary travel resources in a single place,
which ensures users can quickly find what they need.
Table: Evaluation Form

BULACAN STATE UNIVERSITY MENESES CAMPUS 83


APPENDIX D
Research Instrument (Interview Guide)

Guide Questionnaire for the Interviews of GYPSYGO: AN ANDROID


APPLICATION FOR TRAVEL ASSISTANCE, LODGING & DINING
RESERVATIONS

Company Name:

Interviewee/s:

For Hotel Owners:

Question 1: How does the hotel currently manage bookings? Are there any challenges
that is the hotel encountering with the existing methods?

Answer 1:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 2: How does the hotel get in touch with book in guests?

Answer 2:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 3: Does the hotel handle payment transactions online? If so, could you explain
the management of this approach?

Answer 3:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 4: What information does the hotel would need to collect from the guests
when booking for a room?

BULACAN STATE UNIVERSITY MENESES CAMPUS 84


Answer 4:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 5: What specific information and details about the hotel would you need to
showcase in order to attract guests?

Answer 5:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 6: What features and functionalities would you expect from an application
that allows you to showcase your hotel for guests?

Answer 6:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 7: What safeguards does your hotel have in place to prevent payment fraud?

Answer 7:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

BULACAN STATE UNIVERSITY MENESES CAMPUS 85


Question 8: What security measures do you consider essential for protecting guest and
hotel data?

Answer 8;

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 9: What are your reservation charge policies? What about in terms of
cancellations?

Answer 9:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

BULACAN STATE UNIVERSITY MENESES CAMPUS 86


Guide Questionnaire for the Interviews of GYPSYGO: AN ANDROID
APPLICATION FOR TRAVEL ASSISTANCE, LODGING & DINING
RESERVATIONS

Business Name:

Interviewee/s:

For Restaurant Owners:

Question 1: How does the restaurant currently manage bookings? Are there any
challenges that is the restaurant encountering with the existing methods?

Answer 1:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 2: Do you handle payment transactions online? If you do, could you explain
the management of this approach?

Answer 2:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 3: What information does the restaurant would need to collect from the diners
when making a reservation?

Answer 3:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

BULACAN STATE UNIVERSITY MENESES CAMPUS 87


Question 4: What specific information about your restaurant would you need to present
to customers in order to attract customers?

Answer 4:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 5: What features and functionalities would you expect from an application
that allows you to list your restaurant for customers?

Answer 5:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 6: What safeguards does your restaurant have in place to prevent payment
fraud?

Answer 6:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

Question 7: What are your reservation charge policies? What about in terms of
cancellations?

Answer 7:

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

BULACAN STATE UNIVERSITY MENESES CAMPUS 88


APPENDIX E
Letter for Permission to Validate Instrument

BULACAN STATE UNIVERSITY MENESES CAMPUS 89


BULACAN STATE UNIVERSITY MENESES CAMPUS 90
APPENDIX F
Research Instrument (Tally of System Evaluation)
No. 5 4 3 2 1 Total

Functional Sustainability
1. 80 18 1 0 0 4.79
2. 58 38 2 0 1 4.53
3. 63 28 7 1 0 4.54
Overall Weighted Mean 4.63 Strongly Agree

Performance Efficiency
1. 60 36 3 0 0 4.57
2. 70 20 9 0 0 4.61
3. 58 37 4 0 0 4.54
Overall Weighted 4.5 Strongly Agree

Compatibility
1. 61 26 12 0 0 4.49
2. 57 36 6 0 0 4.51
Overall Weighted 4.44 Strongly Agree

Usability
1. 66 30 2 1 0 4.62
2. 64 28 7 0 0 4.57
3. 64 33 2 0 0 4.62
Overall Weighted 4.55 Strongly Agree

Reliability
1. 64 31 2 2 0 4.58
2. 55 37 6 1 0 4.47
3. 64 31 3 1 0 4.59

BULACAN STATE UNIVERSITY MENESES CAMPUS 91


Overall Weighted 4.54 Strongly Agree

Maintainability
1. 61 36 1 1 0 4.58
2. 61 33 3 2 0 4.54
3. 61 34 6 0 0 4.55
Overall Weighted 4.51 Strongly Agree

Security
1. 66 32 1 0 0 4.65
2. 63 33 2 1 0 4.59
3. 56 29 4 0 0 4.62
Overall Weighted 4.59 Strongly Agree

Portability
1. 72 25 1 1 0 4.69
2. 60 35 4 0 0 4.56
3. 69 27 3 0 0 4.66
Overall Weighted 4.64 Strongly Agree

BULACAN STATE UNIVERSITY MENESES CAMPUS 92


APPENDIX G
Data Flow Diagram

Figure: This figure shows the Data Flow Diagram Level 0

Figure: This figure shows the Data Flow Diagram Level 1

BULACAN STATE UNIVERSITY MENESES CAMPUS 93


APPENDIX H
Entity Relationship Diagram

Figure: This figure shows the Entity Relationship Diagram of the proposed system

BULACAN STATE UNIVERSITY MENESES CAMPUS 94


APPENDIX I
Research Instrument (Gantt Chartt/Timetable for the Conduct of Research)
GANTT CHART

Initial analysis shows that the application will take approximately twelve

months. The planning of the application takes place over month of January up to second

week of February. The reasoning behind developing such an application is provide a

comprehensive and seamless navigation for the travelers. For the month of March , the

application is undergoing the progress of the analysis phase, in order to connect the

problems' causes and solutions, the researchers gathered and reviewed relevant

literature and studies from local and foreign that were similar to our study’s focus.

While designing the application, which takes about two months from April until the last

week of May , the developers believed that the application's design should be user-

friendly because a travel guide application should be accessible to users of all ages.

while the development of the application—which is a crucial component—takes a bit

of time during the five months starting from the month of june up to October. For

instance, the implementation phase took place during the entire month of November.

Finally, the application's maintenance was performed throughout the month of

December.

BULACAN STATE UNIVERSITY MENESES CAMPUS 95


APPENDIX J
User Manual

BULACAN STATE UNIVERSITY MENESES CAMPUS 96


BULACAN STATE UNIVERSITY MENESES CAMPUS 97
BULACAN STATE UNIVERSITY MENESES CAMPUS 98
BULACAN STATE UNIVERSITY MENESES CAMPUS 99
BULACAN STATE UNIVERSITY MENESES CAMPUS 100
BULACAN STATE UNIVERSITY MENESES CAMPUS 101
BULACAN STATE UNIVERSITY MENESES CAMPUS 102
BULACAN STATE UNIVERSITY MENESES CAMPUS 103
BULACAN STATE UNIVERSITY MENESES CAMPUS 104
BULACAN STATE UNIVERSITY MENESES CAMPUS 105
BULACAN STATE UNIVERSITY MENESES CAMPUS 106
BULACAN STATE UNIVERSITY MENESES CAMPUS 107
BULACAN STATE UNIVERSITY MENESES CAMPUS 108
BULACAN STATE UNIVERSITY MENESES CAMPUS 109
BULACAN STATE UNIVERSITY MENESES CAMPUS 110
BULACAN STATE UNIVERSITY MENESES CAMPUS 111
BULACAN STATE UNIVERSITY MENESES CAMPUS 112
BULACAN STATE UNIVERSITY MENESES CAMPUS 113
APPENDIX K
Survey Pictures

BULACAN STATE UNIVERSITY MENESES CAMPUS 114


APPENDIX L
Permission Letter for Respondent’s Information

BULACAN STATE UNIVERSITY MENESES CAMPUS 115


BULACAN STATE UNIVERSITY MENESES CAMPUS 116
BULACAN STATE UNIVERSITY MENESES CAMPUS 117
BULACAN STATE UNIVERSITY MENESES CAMPUS 118
BULACAN STATE UNIVERSITY MENESES CAMPUS 119
BULACAN STATE UNIVERSITY MENESES CAMPUS 120
BULACAN STATE UNIVERSITY MENESES CAMPUS 121
APPENDIX M
Transcript of Interview
RESTAURANT

Question 1: How does the restaurant currently manage bookings? Are there any

challenges that is the restaurant encountering with the existing methods?

Answer 1: Pag booking reservation pinapapunta namin sila dito, kung tatawag ka

hindi kasi malinaw pag sa cellphone na uusap, kailangan hanggat maari face to
face kami nag uusap ng client para siguradong malinaw yung usapan pag mag
papareserve sila sa ganitong resto.

Sa ngayon meron kamuka kagabi merong customer na kinalmot ng pusa yung


anak syempre isesettle nalang namin yon at babayaran talaga kasi hindi naman
samin yung mga pusa na gala gala lang, marami din yung mga lasing kadalsan
pero hindi naman gano karamihan madali naman nahahandle yon.

Meron lalo yung mga mahihirap na pinapagawa nila sa mga customer iba iba,
kasi tumatanggap kami ng catering minsan may mga request na hindi namin
kayang ibigay mejo mahirap pero kahit papaano nagagawan nammin n paraan
para kahit pano yung customer is satisfied.

Question 2: Do you handle payment transactions online? If you do, could you explain

the management of this approach?

Answer 2: Online Gcash lang

Question 3: What information does the restaurant would need to collect from the diners

when making a reservation?

Answer 3: Information sa customer asi nag kinukuha lang namin telephone number or

contact number lang yung mahalaga para kung magkaroon kami ng problema
sa reservation madal namin sila ma contact.

Question 4: What specific information about your restaurant would you need to present

to customers in order to attract customers?

BULACAN STATE UNIVERSITY MENESES CAMPUS 122


Answer 4: yung mga native na pagkain yun talaga yung pinupush namin sa mga

customer like palaka,higat at iba pa.

Question 5: What features and functionalities would you expect from an application

that allows you to list your restaurant for customers?

Answer 5: hindi pa napag uusapan ng boss namin , pwede mga commercial, tarpaulin

post sa fb ganon.

Question 6: What safeguards does your restaurant have in place to prevent payment

fraud?

Answer 6: minsan nnapepekean kami ng pera , hindi na namin nasusubaybayan minsan,

pero meron kaming gamit na pang detect sa 1000 at 500, tsaka meron na din

kaming ginagawa sa papel na resibo sa mga puregold na pag iniscratch mo mag


iiwan ng stain once na kumulay yon automatic totoo yung pera.

Question 7: What are your reservation charge policies? What about in terms of

cancellations?

Answer 7: sa cancellation pag may nagpa reserve samin ano 1 week before ang

hinihingi namin sakanila.kunwari nagpa reserve ka ng december hanggat maari

1 week before maicancel na kasi 3 days or 2 days namimili na kami ng pang

rekado tska kailangan fresh yung pagkain na ihahain sakanila.

BULACAN STATE UNIVERSITY MENESES CAMPUS 123


HOTEL

Question 1: How does the hotel currently manage bookings? Are there any challenges

that is the hotel encountering with the existing methods?

Answer 1: yung iba nag pupunta dito tapos bay call. oo madalas pero no refund kami

Question 2: How does the hotel get in touch with book in guests?

Answer 2:.Ineexplain namin yung about sa resort namin kung ano yung available

para sakanila for private or public.

Question 3: Does the hotel handle payment transactions online? If so, could you

explain the management of this approach?

Answer 3: Gcash deposit

Question 4: What information does the hotel would need to collect from the guests

when booking for a room?

Answer 4:.details nya number nya tska yubg tagasaan sya para completo yung

information nila.

Question 5: What specific information and details about the hotel would you need to

showcase in order to attract guests?

Answer 5:.sa tubig lang kami walang chemical or chlorine pure water ang gamit

namin.

Question 6: What features and functionalities would you expect from an application

that allows you to showcase your hotel for guests?

Answer 6:.sa ngayon wala kami kaya open cottage kami at wala kaming mga room.

Question 7: What safeguards does your hotel have in place to prevent payment fraud?

BULACAN STATE UNIVERSITY MENESES CAMPUS 124


Answer 7: Meron kaming machine na nadedect kung peke yung pera or lulukutin

namin once na hindi bmalik peke yon

Question 8: What security measures do you consider essential for protecting guest and

hotel data?

Answer 8: Samin bawat groupo may name samin incase na may mangyari pwede sila

macontact.

Question 9: What are your reservation charge policies? What about in terms of

cancellations?

Answer 9: dapat 1 week before para kung may problema ma adjust nila or kelan sila

available pero kung one day before nag cancel ka ano dimo makukuha yung

deposit.

BULACAN STATE UNIVERSITY MENESES CAMPUS 125


APPENDIX N
Sample Survey

SOFTWARE EVALUATION FOR "GYPSYGO: AN ANDROID APPLICATION


FOR TRAVEL ASSISTANCE, LODGING & DINING RESERVATIONS"
We are the students of Bachelor of Science in Information Technology (BSIT 4A) of Bulacan State University —Meneses Campus are
currently conducting a capstone project titled “GYPSYGO: AN ANDROID APPLICATION TRAVEL ASSISTANCE, LODGING, AND DINING
RESERVATION“. Which serves as a Partial Fulfillment of the Requirements for the Course (CAPSTONE II) for the Degree in Bachelor of
Science in Information Technology.

In this regard, please evaluate the developed system by using the scale below and placing a mark beside its corresponding numerical rating

Data Privacy: We assure you that the information you provide in this survey will be kept and treated with the utmost confidentiality. It will
only be used for the purpose of data gathering and evaluating our software. Your responses will not be shared with any third parties, and
all data will be anonymized and aggregated for analysis.

Name (Optional)

Please select the category that best describes you: *

Traveler

Hotel Owner/Staff

Restaurants
Owner/Staff

Untitled Section

We kindly request that you watch the provided video below before proceeding with the evaluation. Your insights are valuable, and this video will provide essential
context for your answers. Thank you for your cooperation!

GypsyGo | Software
Evaluation

Kindly indicate your level of satisfaction with the system on a scale of one to five, where five (5) corresponds to "Strongly Agree", four (4) corresponds to "Agree", three (3)
corresponds to "Neutral", two (2) corresponds to "Disagree", and lastly, one (1) corresponds to "Strongly Disagree".

BULACAN STATE UNIVERSITY MENESES CAMPUS 126


1.1 The system caters to the needs of tourists in accessing tourist spots information, lodging booking, and dining reservations. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

1.2 The system is capable of managing hotel and restaurant details, receiving updates, and messages are simple to use. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

1.3 Communicating via chat system between tourists and hosts is relatively clear and practical. *

5 - Strongly

Agree 4 -

Agree

2.1 The system conveniently provide access to browsing tourist spot information, lodging and restaurant reservations. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

BULACAN STATE UNIVERSITY MENESES CAMPUS 127


2.2 The system is responsive to user actions and runs smoothly. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

2.3 Effortlessly communicate with the system to maintain the accuracy of hosts data and quickly handle inquiries and reservations. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

3.1 The system retains to work reliably across different Android versions. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

3.2 The system seamlessly integrates third-party function like Google maps. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

BULACAN STATE UNIVERSITY MENESES CAMPUS 128


4.1 The system eases booking hotel rooms and making restaurant reservations. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

4.2 The design contributed positively to the overall user experience. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

4.3 Effectively keep track of incoming reservations. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

5.1 It offers a neatly structured content, enabling users to navigate throughout the system with ease. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

BULACAN STATE UNIVERSITY MENESES CAMPUS 129


5.2 The system’s user interface is modern and suited to a satisfactory user experience. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

5.3 The content structure of the host interface is feasible, allowing for easier management of their details and communication with guests and
customers. *
5 - Strongly

Agree 4 -

Agree

6.1 The system’s interface and features managing and updating information makes it more accessible. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

6.2 The system upholds its primary features throughout time and function as intended. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

6.3 The ability of the system to inform users about their reservations in response to updates made
by hosts via chat system. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

BULACAN STATE UNIVERSITY MENESES CAMPUS 130


7.1 Prioritizes data security that some user data is only accessible to authorized user,
hence increasing privacy. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

7.2 The system informs the user about how their personal data is stored before signing up. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

7.3 Tourists and hosts can connect comfortably without worrying regarding data breaches via messaging. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

8.1 Offers essential information and functionality in one place within the system is convenient and user-friendly. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

BULACAN STATE UNIVERSITY MENESES CAMPUS 131


8.2 The system’s simplicity and ease of use enhances user experience. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

8.3 Gathers all necessary travel resources in a single place, which ensures
users can quickly find what they need. *

5 - Strongly

Agree 4 -

Agree

3 - Neutral

Feedback or any additional thoughts you may have regarding the presented system. *

BULACAN STATE UNIVERSITY MENESES CAMPUS 132


APPENDIX O
PLAGIARISM RESULT

BULACAN STATE UNIVERSITY MENESES CAMPUS 133


BULACAN STATE UNIVERSITY MENESES CAMPUS 134
BULACAN STATE UNIVERSITY MENESES CAMPUS 135
BULACAN STATE UNIVERSITY MENESES CAMPUS 136
BULACAN STATE UNIVERSITY MENESES CAMPUS 137
BULACAN STATE UNIVERSITY MENESES CAMPUS 138
BULACAN STATE UNIVERSITY MENESES CAMPUS 139
BULACAN STATE UNIVERSITY MENESES CAMPUS 140
BULACAN STATE UNIVERSITY MENESES CAMPUS 141
BULACAN STATE UNIVERSITY MENESES CAMPUS 142
BULACAN STATE UNIVERSITY MENESES CAMPUS 143
BULACAN STATE UNIVERSITY MENESES CAMPUS 144
BULACAN STATE UNIVERSITY MENESES CAMPUS 145
BULACAN STATE UNIVERSITY MENESES CAMPUS 146
BULACAN STATE UNIVERSITY MENESES CAMPUS 147
BULACAN STATE UNIVERSITY MENESES CAMPUS 148
BULACAN STATE UNIVERSITY MENESES CAMPUS 149
BULACAN STATE UNIVERSITY MENESES CAMPUS 150
c

BULACAN STATE UNIVERSITY MENESES CAMPUS 151


BULACAN STATE UNIVERSITY MENESES CAMPUS 152
BULACAN STATE UNIVERSITY MENESES CAMPUS 153
BULACAN STATE UNIVERSITY MENESES CAMPUS 154
BULACAN STATE UNIVERSITY MENESES CAMPUS 155
BULACAN STATE UNIVERSITY MENESES CAMPUS 156
BULACAN STATE UNIVERSITY MENESES CAMPUS 157
BULACAN STATE UNIVERSITY MENESES CAMPUS 158
BULACAN STATE UNIVERSITY MENESES CAMPUS 159
BULACAN STATE UNIVERSITY MENESES CAMPUS 160
BULACAN STATE UNIVERSITY MENESES CAMPUS 161
BULACAN STATE UNIVERSITY MENESES CAMPUS 162
BULACAN STATE UNIVERSITY MENESES CAMPUS 163
BULACAN STATE UNIVERSITY MENESES CAMPUS 164
BULACAN STATE UNIVERSITY MENESES CAMPUS 165
BULACAN STATE UNIVERSITY MENESES CAMPUS 166
BULACAN STATE UNIVERSITY MENESES CAMPUS 167
BULACAN STATE UNIVERSITY MENESES CAMPUS 168
BULACAN STATE UNIVERSITY MENESES CAMPUS 169
BULACAN STATE UNIVERSITY MENESES CAMPUS 170
BULACAN STATE UNIVERSITY MENESES CAMPUS 171
BULACAN STATE UNIVERSITY MENESES CAMPUS 172
BULACAN STATE UNIVERSITY MENESES CAMPUS 173
BULACAN STATE UNIVERSITY MENESES CAMPUS 174
BULACAN STATE UNIVERSITY MENESES CAMPUS 175
BULACAN STATE UNIVERSITY MENESES CAMPUS 176
BULACAN STATE UNIVERSITY MENESES CAMPUS 177
BULACAN STATE UNIVERSITY MENESES CAMPUS 178
BULACAN STATE UNIVERSITY MENESES CAMPUS 179
BULACAN STATE UNIVERSITY MENESES CAMPUS 180
BULACAN STATE UNIVERSITY MENESES CAMPUS 181
BULACAN STATE UNIVERSITY MENESES CAMPUS 182
BULACAN STATE UNIVERSITY MENESES CAMPUS 183
BULACAN STATE UNIVERSITY MENESES CAMPUS 184
BULACAN STATE UNIVERSITY MENESES CAMPUS 185
BULACAN STATE UNIVERSITY MENESES CAMPUS 186
BULACAN STATE UNIVERSITY MENESES CAMPUS 187
BULACAN STATE UNIVERSITY MENESES CAMPUS 188
BULACAN STATE UNIVERSITY MENESES CAMPUS 189
BULACAN STATE UNIVERSITY MENESES CAMPUS 190
BULACAN STATE UNIVERSITY MENESES CAMPUS 191
BULACAN STATE UNIVERSITY MENESES CAMPUS 192
BULACAN STATE UNIVERSITY MENESES CAMPUS 193
BULACAN STATE UNIVERSITY MENESES CAMPUS 194
BULACAN STATE UNIVERSITY MENESES CAMPUS 195
BULACAN STATE UNIVERSITY MENESES CAMPUS 196
BULACAN STATE UNIVERSITY MENESES CAMPUS 197
BULACAN STATE UNIVERSITY MENESES CAMPUS 198
BULACAN STATE UNIVERSITY MENESES CAMPUS 199
BULACAN STATE UNIVERSITY MENESES CAMPUS 200
BULACAN STATE UNIVERSITY MENESES CAMPUS 201
BULACAN STATE UNIVERSITY MENESES CAMPUS 202
BULACAN STATE UNIVERSITY MENESES CAMPUS 203
BULACAN STATE UNIVERSITY MENESES CAMPUS 204
BULACAN STATE UNIVERSITY MENESES CAMPUS 205
BULACAN STATE UNIVERSITY MENESES CAMPUS 206
BULACAN STATE UNIVERSITY MENESES CAMPUS 207
BULACAN STATE UNIVERSITY MENESES CAMPUS 208
BULACAN STATE UNIVERSITY MENESES CAMPUS 209
BULACAN STATE UNIVERSITY MENESES CAMPUS 210
BULACAN STATE UNIVERSITY MENESES CAMPUS 211
BULACAN STATE UNIVERSITY MENESES CAMPUS 212
BULACAN STATE UNIVERSITY MENESES CAMPUS 213
BULACAN STATE UNIVERSITY MENESES CAMPUS 214
BULACAN STATE UNIVERSITY MENESES CAMPUS 215
BULACAN STATE UNIVERSITY MENESES CAMPUS 216
BULACAN STATE UNIVERSITY MENESES CAMPUS 217
BULACAN STATE UNIVERSITY MENESES CAMPUS 218
BULACAN STATE UNIVERSITY MENESES CAMPUS 219
BULACAN STATE UNIVERSITY MENESES CAMPUS 220
BULACAN STATE UNIVERSITY MENESES CAMPUS 221
BULACAN STATE UNIVERSITY MENESES CAMPUS 222
BULACAN STATE UNIVERSITY MENESES CAMPUS 223
BULACAN STATE UNIVERSITY MENESES CAMPUS 224
APPENDIX P
CODES OF THE SYSTEM
Splash Sceen [Splash]

public class Splash extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_splash);

Button startButton = findViewById(R.id.getStarted);

startButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(Splash.this, MainActivityRegister.class);

startActivity(intent);

finish();

});

Traveler Login/Signup [MainActivityRegister]

public class MainActivityRegister extends AppCompatActivity {

private TabLayout tabLayout;

private FrameLayout loginsignupContainer;

private LoginFragment loginFragment;

private SignupFragment signupFragment;

BULACAN STATE UNIVERSITY MENESES CAMPUS 225


@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main_register);

tabLayout = findViewById(R.id.tabLayout);

loginsignupContainer = findViewById(R.id.loginsignupContainer);

loginFragment = new LoginFragment();

signupFragment = new SignupFragment();

TabLayout.Tab loginTab = tabLayout.newTab().setText("Login");

TabLayout.Tab signupTab = tabLayout.newTab().setText("Signup");

tabLayout.addTab(loginTab);

tabLayout.addTab(signupTab);

loadFragment(loginFragment);

tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener()

@Override

public void onTabSelected(TabLayout.Tab tab) {

if (tab.getText() != null) {

if (tab.getText().equals("Login")) {

loadFragment(loginFragment);

} else if (tab.getText().equals("Signup")) {

loadFragment(signupFragment);

BULACAN STATE UNIVERSITY MENESES CAMPUS 226


}

@Override

public void onTabUnselected(TabLayout.Tab tab) {

@Override

public void onTabReselected(TabLayout.Tab tab) {

});

private void loadFragment(Fragment fragment) {

getSupportFragmentManager().beginTransaction()

.replace(R.id.loginsignupContainer, fragment)

.commit();

Host login/Signup [MainActivityRegister2]

public class MainActivityRegister2 extends AppCompatActivity {

private TabLayout tabLayout;

private FrameLayout hotelSignupContainer;

private HotelSignupFragment hotelSignupFragment;

private RestoSignupFragment restoSignupFragment;

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 227


protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main_register2);

tabLayout = findViewById(R.id.tabLayout);

hotelSignupContainer = findViewById(R.id.hotelSignupContainer);

hotelSignupFragment = new HotelSignupFragment();

restoSignupFragment = new RestoSignupFragment();

TabLayout.Tab hotelTab = tabLayout.newTab().setText("Hotel");

TabLayout.Tab restoTab = tabLayout.newTab().setText("Restaurant");

tabLayout.addTab(hotelTab);

tabLayout.addTab(restoTab);

loadFragment(hotelSignupFragment);

tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener()

@Override

public void onTabSelected(TabLayout.Tab tab) {

if (tab.getText() != null) {

if (tab.getText().equals("Hotel")) {

loadFragment(hotelSignupFragment);

BULACAN STATE UNIVERSITY MENESES CAMPUS 228


} else if (tab.getText().equals("Restaurant")) {

loadFragment(restoSignupFragment);

@Override

public void onTabUnselected(TabLayout.Tab tab) {

@Override

public void onTabReselected(TabLayout.Tab tab) {

});

private void loadFragment(Fragment fragment) {

getSupportFragmentManager().beginTransaction()

.replace(R.id.hotelSignupContainer, fragment)

.commit();

LoginFragment

public class LoginFragment extends Fragment {

BULACAN STATE UNIVERSITY MENESES CAMPUS 229


private static final String SHARED_PREFS = "com.example.gypsy.PREFS";

private FirebaseAuth auth;

private TextInputEditText lEmail, lPass;

private TextView signupRedirect, forgotPassword;

private Button loginBtn;

private ProgressDialog progressDialog;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_login, container, false);

auth = FirebaseAuth.getInstance();

lEmail = view.findViewById(R.id.login_email);

lPass = view.findViewById(R.id.login_password);

loginBtn = view.findViewById(R.id.login_button);

signupRedirect = view.findViewById(R.id.signupRedirect);

forgotPassword = view.findViewById(R.id.forgotPass);

login();

signRedirect();

progressDialog = new ProgressDialog(requireContext());

progressDialog.setMessage("Logging in...");

progressDialog.setCancelable(false);

BULACAN STATE UNIVERSITY MENESES CAMPUS 230


forgotPassword.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());

View dialogView = getLayoutInflater().inflate(R.layout.dialog_forgot,

null);

EditText emailBox = dialogView.findViewById(R.id.emailBox);

builder.setView(dialogView);

AlertDialog dialog = builder.create();

dialogView.findViewById(R.id.btnReset).setOnClickListener(new

View.OnClickListener() {

@Override

public void onClick(View v) {

String userEmail = emailBox.getText().toString();

if (TextUtils.isEmpty(userEmail) ||

!Patterns.EMAIL_ADDRESS.matcher(userEmail).matches()) {

Toast.makeText(getActivity(), "Enter a valid email address",

Toast.LENGTH_SHORT).show();

return;

auth.sendPasswordResetEmail(userEmail).addOnCompleteListener(new

OnCompleteListener<Void>() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 231


public void onComplete(@NonNull Task<Void> task) {

if (task.isSuccessful()) {

Toast.makeText(getActivity(), "Check your email",

Toast.LENGTH_SHORT).show();

dialog.dismiss();

} else {

Toast.makeText(getActivity(), "Unable to send email",

Toast.LENGTH_SHORT).show();

});

});

dialogView.findViewById(R.id.btnCancel).setOnClickListener(new

View.OnClickListener() {

@Override

public void onClick(View v) {

dialog.dismiss();

});

if (dialog.getWindow() != null) {

dialog.getWindow().setBackgroundDrawable(new ColorDrawable(0));

dialog.show();

BULACAN STATE UNIVERSITY MENESES CAMPUS 232


}

});

return view;

private void login() {

loginBtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

String email = lEmail.getText().toString();

String pass = lPass.getText().toString();

if (!email.isEmpty() &&

Patterns.EMAIL_ADDRESS.matcher(email).matches()) {

if (!pass.isEmpty()) {

progressDialog.show();

auth.signInWithEmailAndPassword(email, pass)

.addOnSuccessListener(new OnSuccessListener<AuthResult>() {

@Override

public void onSuccess(AuthResult authResult) {

progressDialog.dismiss();

FirebaseUser user = auth.getCurrentUser();

if (user != null && user.isEmailVerified()) {

DatabaseReference userRef =

FirebaseDatabase.getInstance().getReference("users");

String userId = user.getUid();

BULACAN STATE UNIVERSITY MENESES CAMPUS 233


userRef.child("Hotel").child(userId).addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot

snapshot) {

if (snapshot.exists()) {

boolean isValidated =

snapshot.child("isValidated").getValue(Boolean.class);

if (isValidated) {

SharedPreferences sharedPreferences =

requireContext().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);

SharedPreferences.Editor editor =

sharedPreferences.edit();

editor.putString("email", "true");

editor.apply();

Intent intent = new Intent(getActivity(),

MainActivity2.class);

startActivity(intent);

requireActivity().finish();

} else {

showSignupReminderDialog();

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 234


userRef.child("Restaurant").child(userId).addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull

DataSnapshot snapshot) {

if (snapshot.exists()) {

boolean isValidated =

snapshot.child("isValidated").getValue(Boolean.class);

if (isValidated) {

SharedPreferences sharedPreferences =

requireContext().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);

SharedPreferences.Editor editor =

sharedPreferences.edit();

editor.putString("email", "true");

editor.apply();

Intent intent = new

Intent(requireActivity(), MainActivity3.class);

startActivity(intent);

requireActivity().finish();

} else {

showSignupReminderDialog();

BULACAN STATE UNIVERSITY MENESES CAMPUS 235


} else {

if (isAdded()) {

SharedPreferences sharedPreferences =

requireContext().getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);

SharedPreferences.Editor editor =

sharedPreferences.edit();

editor.putString("email", "true");

editor.apply();

Intent intent = new Intent(requireActivity(),

MainActivity.class);

startActivity(intent);

requireActivity().finish();

@Override

public void onCancelled(@NonNull

DatabaseError error) {

});

@Override

public void onCancelled(@NonNull DatabaseError

error) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 236


}

});

} else {

Toast.makeText(requireContext(), "Please verify your

email first", Toast.LENGTH_SHORT).show();

})

.addOnFailureListener(new OnFailureListener() {

@Override

public void onFailure(@NonNull Exception e) {

progressDialog.dismiss();

Toast.makeText(requireContext(), "Login Failed",

Toast.LENGTH_SHORT).show();

});

} else {

lPass.setError("Password required!");

} else if (email.isEmpty()) {

lEmail.setError("Please enter a valid email");

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 237


}

private void signRedirect() {

signupRedirect.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

SignupFragment signupFragment = new SignupFragment();

FragmentTransaction transaction =

getParentFragmentManager().beginTransaction();

transaction.replace(R.id.loginsignupContainer, signupFragment);

transaction.addToBackStack(null);

transaction.commit();

});

private void showSignupReminderDialog() {

SignupReminder dialogFragment = SignupReminder.newInstance();

dialogFragment.show(getParentFragmentManager(), "SignupReminder");

Hotel Signup [HotelSignupFragment]

public class HotelSignupFragment extends Fragment {

private FirebaseAuth auth;

private FirebaseDatabase database;

private EditText sName, sEmail, sPass, sConfirmPass;

private Button signupBtn;

BULACAN STATE UNIVERSITY MENESES CAMPUS 238


private TextView loginRedirect, Tourist;

private static final int PICK_BIR_IMAGE_REQUEST = 1;

private static final int PICK_TIN_IMAGE_REQUEST = 2;

private static final int PICK_DTI_IMAGE_REQUEST = 3;

private ImageButton birUploadButton, tinUploadButton, dtiUploadButton;

private TextView birFileNameTextView, tinFileNameTextView,

dtiFileNameTextView;

private String birFileName = "No BIR file selected";

private String tinFileName = "No TIN file selected";

private String dtiFileName = "No DTI file selected";

private Uri birImageUri, tinImageUri, dtiImageUri;

private CheckBox termsCheckbox;

private ImageButton googleBtn;

private GoogleSignInClient mGoogleSignInClient;

private ProgressDialog progressDialog;

private static final int RC_SIGN_IN = 20;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_hotel_signup, container, false);

database = FirebaseDatabase.getInstance();

auth = FirebaseAuth.getInstance();

sName = view.findViewById(R.id.signup_name);

sEmail = view.findViewById(R.id.signup_email);

BULACAN STATE UNIVERSITY MENESES CAMPUS 239


sPass = view.findViewById(R.id.signup_password);

sConfirmPass = view.findViewById(R.id.confirm);

signupBtn = view.findViewById(R.id.signup_button);

loginRedirect = view.findViewById(R.id.loginRedirect);

Tourist = view.findViewById(R.id.touristSignup);

termsCheckbox = view.findViewById(R.id.termsCheckbox);

googleBtn = view.findViewById(R.id.googleBtn);

progressDialog = new ProgressDialog(getActivity());

progressDialog.setMessage("Creating your account.");

birUploadButton = view.findViewById(R.id.birUpload);

birFileNameTextView = view.findViewById(R.id.birFile);

birUploadButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

openGallery(PICK_BIR_IMAGE_REQUEST);

});

tinUploadButton = view.findViewById(R.id.tinUpload);

tinFileNameTextView = view.findViewById(R.id.tinFile);

tinUploadButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

openGallery(PICK_TIN_IMAGE_REQUEST);

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 240


dtiUploadButton = view.findViewById(R.id.dtiUpload);

dtiFileNameTextView = view.findViewById(R.id.dtiFile);

dtiUploadButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

openGallery(PICK_DTI_IMAGE_REQUEST);

});

GoogleSignInOptions gso = new

GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)

.requestIdToken(getString(R.string.default_web_client_id))

.requestEmail().build();

mGoogleSignInClient = GoogleSignIn.getClient(requireActivity(), gso);

googleBtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

googleSignIn();

});

signp();

logRedirect();

touristSign();

return view;

private void openGallery(int requestCode) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 241


Intent galleryIntent = new Intent(Intent.ACTION_PICK,

MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

startActivityForResult(galleryIntent, requestCode);

@Override

public void onActivityResult(int requestCode, int resultCode, @Nullable Intent

data) {

super.onActivityResult(requestCode, resultCode, data);

switch (requestCode) {

case RC_SIGN_IN:

if (resultCode == RESULT_OK) {

Task<GoogleSignInAccount> task =

GoogleSignIn.getSignedInAccountFromIntent(data);

try {

GoogleSignInAccount account = task.getResult(ApiException.class);

firebaseAuth(account.getIdToken());

} catch (ApiException e) {

Toast.makeText(requireContext(), "Google Sign-In failed: " +

e.getStatusCode(), Toast.LENGTH_SHORT).show();

break;

case PICK_BIR_IMAGE_REQUEST:

if (resultCode == RESULT_OK && data != null) {

Uri imageUri = data.getData();

BULACAN STATE UNIVERSITY MENESES CAMPUS 242


String selectedFileName = getFileNameFromUri(imageUri);

birImageUri = imageUri;

birFileName = selectedFileName;

birFileNameTextView.setText(birFileName);

break;

case PICK_TIN_IMAGE_REQUEST:

if (resultCode == RESULT_OK && data != null) {

Uri imageUri = data.getData();

String selectedFileName = getFileNameFromUri(imageUri);

tinImageUri = imageUri;

tinFileName = selectedFileName;

tinFileNameTextView.setText(tinFileName);

break;

case PICK_DTI_IMAGE_REQUEST:

if (resultCode == RESULT_OK && data != null) {

Uri imageUri = data.getData();

String selectedFileName = getFileNameFromUri(imageUri);

dtiImageUri = imageUri;

dtiFileName = selectedFileName;

dtiFileNameTextView.setText(dtiFileName);

break;

BULACAN STATE UNIVERSITY MENESES CAMPUS 243


}

private String getFileNameFromUri(Uri uri) {

String[] filePathColumn = {MediaStore.Images.Media.DISPLAY_NAME};

Cursor cursor = requireActivity().getContentResolver().query(uri,

filePathColumn, null, null, null);

String fileName = "";

if (cursor != null && cursor.moveToFirst()) {

int columnIndex = cursor.getColumnIndex(filePathColumn[0]);

fileName = cursor.getString(columnIndex);

cursor.close();

return fileName;

private void signp() {

signupBtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

String name = sName.getText().toString().trim();

String user = sEmail.getText().toString().trim();

String pass = sPass.getText().toString().trim();

String confirmPass = sConfirmPass.getText().toString().trim();

if (user.isEmpty()) {

sEmail.setError("Email is required!");

BULACAN STATE UNIVERSITY MENESES CAMPUS 244


sEmail.requestFocus();

} else if (pass.isEmpty()) {

sPass.setError("Password is required!");

sPass.requestFocus();

} else if (pass.length() < 8) {

sPass.setError("Password must be at least 8 characters!");

} else if (confirmPass.isEmpty()) {

sConfirmPass.setError("Please confirm your password!");

sConfirmPass.requestFocus();

} else if (!pass.equals(confirmPass)) {

sConfirmPass.setError("Passwords do not match!");

sConfirmPass.requestFocus();

} else if (birImageUri == null || tinImageUri == null || dtiImageUri == null)

Toast.makeText(getActivity(), "Please select both BIR and TIN images",

Toast.LENGTH_SHORT).show();

} else {

if (!termsCheckbox.isChecked()) {

showTermsAndConditionsDialog();

} else {

progressDialog.show();

signUpWithEmailAndPassword(user, pass, name);

BULACAN STATE UNIVERSITY MENESES CAMPUS 245


});

termsCheckbox.setOnCheckedChangeListener(new

CompoundButton.OnCheckedChangeListener() {

@Override

public void onCheckedChanged(CompoundButton buttonView, boolean

isChecked) {

if (isChecked) {

signupBtn.setEnabled(true);

showTermsAndConditionsDialog();

} else {

signupBtn.setEnabled(false);

});

private void signUpWithEmailAndPassword(String userEmail, String password,

String userName) {

auth.createUserWithEmailAndPassword(userEmail, password)

.addOnCompleteListener(new OnCompleteListener<AuthResult>() {

@Override

public void onComplete(@NonNull Task<AuthResult> task) {

if (task.isSuccessful()) {

progressDialog.dismiss();

FirebaseUser firebaseUser = auth.getCurrentUser();

if (firebaseUser != null) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 246


String userId = firebaseUser.getUid();

sendVerificationEmail();

uploadImagesAndStoreUserData(userId, userEmail,

userName);

Toast.makeText(getActivity(), "Form Application

Submitted. Please wait for your form to be processed.",

Toast.LENGTH_SHORT).show();

})

.addOnFailureListener(new OnFailureListener() {

@Override

public void onFailure(@NonNull Exception e) {

if (e instanceof FirebaseAuthUserCollisionException) {

progressDialog.dismiss();

sEmail.setError("This Email is already registered");

sEmail.requestFocus();

} else {

Toast.makeText(getActivity(), "Something went wrong",

Toast.LENGTH_SHORT).show();

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 247


private void uploadImagesAndStoreUserData(final String userId, final String

userEmail, final String userName) {

StorageReference storageRef =

FirebaseStorage.getInstance().getReference().child("validFormsIds").child(userId);

StorageReference birImageRef = storageRef.child("bir");

birImageRef.putFile(birImageUri)

.addOnSuccessListener(birTaskSnapshot -> {

birImageRef.getDownloadUrl().addOnSuccessListener(birDownloadUrl -

>{

String birImageUrl = birDownloadUrl.toString();

StorageReference tinImageRef = storageRef.child("tin");

tinImageRef.putFile(tinImageUri)

.addOnSuccessListener(tinTaskSnapshot -> {

tinImageRef.getDownloadUrl().addOnSuccessListener(tinDownloadUrl -> {

String tinImageUrl = tinDownloadUrl.toString();

StorageReference dtiImageRef = storageRef.child("dti");

dtiImageRef.putFile(dtiImageUri)

.addOnSuccessListener(dtiTaskSnapshot -> {

dtiImageRef.getDownloadUrl().addOnSuccessListener(dtiDownloadUrl -> {

String dtiImageUrl =

dtiDownloadUrl.toString();

BULACAN STATE UNIVERSITY MENESES CAMPUS 248


storeUserDataInDatabase(userId, userEmail,

userName, birImageUrl, tinImageUrl, dtiImageUrl);

})

.addOnFailureListener(e -> {

Toast.makeText(getActivity(), "DTI image

upload failed: " + e.getMessage(), Toast.LENGTH_SHORT).show();

});

})

.addOnFailureListener(e -> {

Toast.makeText(getActivity(), "TIN image upload

failed: " + e.getMessage(), Toast.LENGTH_SHORT).show();

});

});

})

.addOnFailureListener(e -> {

Toast.makeText(getActivity(), "BIR image upload failed: " +

e.getMessage(), Toast.LENGTH_SHORT).show();

});

});

});

private void storeUserDataInDatabase(String userId, String userEmail, String

userName, String birImageUrl, String tinImageUrl, String dtiImageUrl) {

FirebaseDatabase database = FirebaseDatabase.getInstance();

BULACAN STATE UNIVERSITY MENESES CAMPUS 249


DatabaseReference userRef =

database.getReference("users").child("Hotel").child(userId);

Map<String, Object> userData = new HashMap<>();

userData.put("name", userName);

userData.put("email", userEmail);

userData.put("bir", birImageUrl);

userData.put("tin", tinImageUrl);

userData.put("dti", dtiImageUrl);

userData.put("isValidated", false);

userRef.setValue(userData)

.addOnSuccessListener(new OnSuccessListener<Void>() {

@Override

public void onSuccess(Void aVoid) {

Intent intent = new Intent(getActivity(),

MainActivityRegister.class);

startActivity(intent);

})

.addOnFailureListener(new OnFailureListener() {

@Override

public void onFailure(@NonNull Exception e) {

Toast.makeText(getActivity(), "User data storage failed",

Toast.LENGTH_SHORT).show();

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 250


}

private void sendVerificationEmail() {

FirebaseUser firebaseUser = auth.getCurrentUser();

if (firebaseUser != null) {

firebaseUser.sendEmailVerification().addOnCompleteListener(new

OnCompleteListener<Void>() {

@Override

public void onComplete(@NonNull Task<Void> task) {

if (task.isSuccessful()) {

Toast.makeText(getActivity(), "Email has been sent to your Email

address", Toast.LENGTH_SHORT).show();

} else {

Toast.makeText(getActivity(), "Sending verification email

failed", Toast.LENGTH_SHORT).show();

});

private void logRedirect() {

loginRedirect.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), MainActivityRegister.class));

BULACAN STATE UNIVERSITY MENESES CAMPUS 251


});

private void touristSign() {

Tourist.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), MainActivityRegister.class);

startActivity(intent);

});

private void googleSignIn() {

Intent intent = mGoogleSignInClient.getSignInIntent();

startActivityForResult(intent, RC_SIGN_IN);

private void firebaseAuth(String idToken) {

AuthCredential credential = GoogleAuthProvider.getCredential(idToken,null);

auth.signInWithCredential(credential)

.addOnCompleteListener(new OnCompleteListener<AuthResult>() {

@Override

public void onComplete(@NonNull Task<AuthResult> task) {

if (task.isSuccessful()) {

FirebaseUser user = auth.getCurrentUser();

BULACAN STATE UNIVERSITY MENESES CAMPUS 252


HashMap<String, Object> map = new HashMap<>();

map.put("id", user.getUid());

map.put("name", user.getDisplayName());

map.put("email", user.getEmail());

String uid = user.getUid();

DatabaseReference touristRef =

database.getReference("users").child("Hotel").child(uid);

touristRef.setValue(map);

Intent intent = new Intent(getActivity(),

MainActivityRegister.class);

startActivity(intent);

else {

Toast.makeText(getActivity(), "Something went wrong",

Toast.LENGTH_SHORT).show();

});

private void showTermsAndConditionsDialog() {

TermsAndConditionsDialog2 dialogFragment = new

TermsAndConditionsDialog2();

dialogFragment.show(getParentFragmentManager(), "TermsDialog");

BULACAN STATE UNIVERSITY MENESES CAMPUS 253


}

public void setSignupButtonEnabled(boolean isEnabled) {

signupBtn.setEnabled(isEnabled);

Traveler Interface [MainActivity]

public class MainActivity extends AppCompatActivity {

BottomNavigationView BNV;

TravelFragment TF = new TravelFragment();

HotelFragment HF = new HotelFragment();

RestoFragment RF = new RestoFragment();

MsgFragment MF = new MsgFragment();

ProfileFragment PF = new ProfileFragment();

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

BNV = findViewById(R.id.bottom_navigation);

getSupportFragmentManager().beginTransaction().replace(R.id.container,

TF).commit();

BULACAN STATE UNIVERSITY MENESES CAMPUS 254


BNV.setOnItemSelectedListener(new

NavigationBarView.OnItemSelectedListener() {

@Override

public boolean onNavigationItemSelected(MenuItem item) {

switch (item.getItemId()){

case R.id.travel_loc:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

TF).commit();

return true;

case R.id.hotel_list:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HF).commit();

return true;

case R.id.resto_list:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

RF).commit();

return true;

case R.id.msg_list:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

MF).commit();

return true;

BULACAN STATE UNIVERSITY MENESES CAMPUS 255


case R.id.profile_but:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

PF).commit();

return true;

return false;

});

Hotel interface [MainActivity2]

public class MainActivity2 extends AppCompatActivity {

BottomNavigationView BNV;

HotelEditFragment HEF = new HotelEditFragment();

HotelNotifFragment HNF = new HotelNotifFragment();

HotelMsgFragment HMF = new HotelMsgFragment();

HotelProfileFragment HPF = new HotelProfileFragment();

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main2);

BULACAN STATE UNIVERSITY MENESES CAMPUS 256


BNV = findViewById(R.id.bottom_navigation);

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HEF).commit();

BNV.setOnItemSelectedListener(new

NavigationBarView.OnItemSelectedListener() {

@Override

public boolean onNavigationItemSelected(MenuItem item) {

switch (item.getItemId()){

case R.id.hotel_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HEF).commit();

return true;

case R.id.notif_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HNF).commit();

return true;

case R.id.message_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HMF).commit();

BULACAN STATE UNIVERSITY MENESES CAMPUS 257


return true;

case R.id.profile_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

HPF).commit();

return true;

return false;

});

Restaurant Interface [MainActivity3]

public class MainActivity3 extends AppCompatActivity {

BottomNavigationView BNV;

RestoEditFragment REF = new RestoEditFragment();

RestoNotifFragment RNF = new RestoNotifFragment();

RestoMsgFragment RMF = new RestoMsgFragment();

RestoProfileFragment RPF = new RestoProfileFragment();

private Button logout;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

BULACAN STATE UNIVERSITY MENESES CAMPUS 258


setContentView(R.layout.activity_main3);

BNV = findViewById(R.id.bottom_navigation);

getSupportFragmentManager().beginTransaction().replace(R.id.container,

REF).commit();

BNV.setOnItemSelectedListener(new

NavigationBarView.OnItemSelectedListener() {

@Override

public boolean onNavigationItemSelected(MenuItem item) {

switch (item.getItemId()){

case R.id.resto_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

REF).commit();

return true;

case R.id.notif_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

RNF).commit();

return true;

case R.id.message_btn:

BULACAN STATE UNIVERSITY MENESES CAMPUS 259


getSupportFragmentManager().beginTransaction().replace(R.id.container,

RMF).commit();

return true;

case R.id.profile_btn:

getSupportFragmentManager().beginTransaction().replace(R.id.container,

RPF).commit();

return true;

return false;

});

Destinations [TravelFragment]

public class TravelFragment extends Fragment {

RecyclerView recyclerView;

ArrayList<ParentModelClass> parentModelClassArrayList;

ArrayList<ChildModelClass> childModelClassArrayList, religiousSpot,

natureSpot, parkSpot;

ParentAdapter parentAdapter;

private LinearLayout ciudadLayout, kaypianLayout, ricardoLayout, biakLayout,

manalmonLayout, puningLayout, grottoLayout, barasoainLayout, standrewLayout;

BULACAN STATE UNIVERSITY MENESES CAMPUS 260


private Button tabReligious, tabNature,tabPark;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_travel, container, false);

// para sa title

Typeface customFont = ResourcesCompat.getFont(getContext(), R.font.mont);

CollapsingToolbarLayout collapsingToolbar =

view.findViewById(R.id.Collapsing_toolbar);

collapsingToolbar.setCollapsedTitleTypeface(customFont);

collapsingToolbar.setExpandedTitleTypeface(customFont);

collapsingToolbar.setCollapsedTitleTextColor(Color.WHITE);

collapsingToolbar.setExpandedTitleColor(Color.WHITE);

recyclerView = view.findViewById(R.id.rv_parent);

AppCompatActivity activity = (AppCompatActivity) requireActivity();

if (activity.getSupportActionBar() != null) {

activity.getSupportActionBar().hide();

childModelClassArrayList = new ArrayList<>();

religiousSpot = new ArrayList<>();

BULACAN STATE UNIVERSITY MENESES CAMPUS 261


natureSpot = new ArrayList<>();

parkSpot = new ArrayList<>();

parentModelClassArrayList = new ArrayList<>();

// SET NG CATEGORIES

// RELIGIOUS SPOT

religiousSpot.add(new ChildModelClass(R.drawable.grotto, "Popular

Destinations", "Grotto of Our lady of Lourdes Shrine", "Santa Maria, Bulacan"));

religiousSpot.add(new ChildModelClass(R.drawable.barasoain, "Popular

Destinations", "Our Lady of Mount Carmel Parish", "Malolos, Bulacan"));

natureSpot.add(new ChildModelClass(R.drawable.biak, "Popular Destinations",

"Biak na Bato", "San Miguel, Bulacan"));

// the parent

parentModelClassArrayList.add(new ParentModelClass("Popular Destinations",

religiousSpot));

parentAdapter = new ParentAdapter(parentModelClassArrayList,

requireContext());

recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

recyclerView.setAdapter(parentAdapter);

parentAdapter.setOnChildItemClickListener(new

ParentAdapter.OnChildItemClickListener() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 262


public void onChildItemClick(ChildModelClass childModelClass) {

int imageResourceId = childModelClass.getImage();

String category = childModelClass.getCategory();

if (category.equals("Popular Destinations")) {

if (imageResourceId == R.drawable.grotto) {

Intent intent = new Intent(getActivity(), Grotto.class);

startActivity(intent);

} else if (imageResourceId == R.drawable.barasoain) {

Intent intent = new Intent(getActivity(), Barasoain.class);

startActivity(intent);

} else if (imageResourceId == R.drawable.biak) {

Intent intent = new Intent(getActivity(), Biak.class);

startActivity(intent);

});

FirebaseAuth mAuth = FirebaseAuth.getInstance();

String currentUserId = mAuth.getCurrentUser().getUid();

DatabaseReference userRef = FirebaseDatabase.getInstance().getReference()

.child("users")

BULACAN STATE UNIVERSITY MENESES CAMPUS 263


.child("Tourist")

.child(currentUserId)

.child("name");

userRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

String userName = dataSnapshot.getValue(String.class);

TextView userNameTextView =

view.findViewById(R.id.userNameTextView);

userNameTextView.setText("Hello, " + userName + "!");

@Override

public void onCancelled(DatabaseError databaseError) {

});

grottoLayout = view.findViewById(R.id.grotto);

barasoainLayout = view.findViewById(R.id.barasoain);

standrewLayout = view.findViewById(R.id.standrew);

grottoLayout.setOnClickListener(new View.OnClickListener() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 264


@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Grotto.class));

});

barasoainLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Barasoain.class));

});

standrewLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Standrew.class));

});

biakLayout = view.findViewById(R.id.biak);

manalmonLayout = view.findViewById(R.id.manalmon);

puningLayout = view.findViewById(R.id.puning);

biakLayout.setOnClickListener(new View.OnClickListener() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 265


@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Biak.class));

});

manalmonLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Manalmon.class));

});

puningLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Puning.class));

});

ciudadLayout = view.findViewById(R.id.ciudad);

kaypianLayout = view.findViewById(R.id.dam);

ricardoLayout = view.findViewById(R.id.heritage);

ciudadLayout.setOnClickListener(new View.OnClickListener() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 266


@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Ciudad.class));

});

kaypianLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Dam.class));

});

ricardoLayout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

startActivity(new Intent(getActivity(), Heritage.class));

});

return view;

Destination-Detailed [Barasoain]

public class Barasoain extends AppCompatActivity {

FloatingActionButton showMap;

ImageView backButton;

BULACAN STATE UNIVERSITY MENESES CAMPUS 267


@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_barasoain);

showMap = findViewById(R.id.baras_map);

backButton = findViewById(R.id.back_btn);

showMap.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(Barasoain.this, BarasoainMap.class);

startActivity(intent);

});

public void goBack(View view) {

onBackPressed();

Destination-Map [BarasoainMap]

public class BarasoainMap extends FragmentActivity implements

OnMapReadyCallback {

GoogleMap gMap;

FrameLayout map;

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 268


protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_barasoain_map);

map = findViewById(R.id.map_baras);

SupportMapFragment mapFragment = (SupportMapFragment)

getSupportFragmentManager().findFragmentById(R.id.map_baras);

mapFragment.getMapAsync(this);

@Override

public void onMapReady(@NonNull GoogleMap googleMap) {

this.gMap = googleMap;

LatLng mapBaras = new LatLng(14.8463, 120.8126);

this.gMap.addMarker(new MarkerOptions().position(mapBaras).title("Marker in

Barasoain"));

this.gMap.moveCamera(CameraUpdateFactory.newLatLng(mapBaras));

Hotel List [HotelFragment]

public class HotelFragment extends Fragment {

private RecyclerView recyclerView;

private List<HotelModel> hotelList;

private HotelAdapter adapter;

private DatabaseReference databaseRef;

private FirebaseStorage storage;

BULACAN STATE UNIVERSITY MENESES CAMPUS 269


private StorageReference storageRef;

@Nullable

@Override

public View onCreateView(@NonNull LayoutInflater inflater, @Nullable

ViewGroup container, @Nullable Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_hotel, container, false);

Typeface customFont = ResourcesCompat.getFont(getContext(), R.font.mont);

CollapsingToolbarLayout collapsingToolbar =

view.findViewById(R.id.Collapsing_toolbar);

collapsingToolbar.setCollapsedTitleTypeface(customFont);

collapsingToolbar.setExpandedTitleTypeface(customFont);

collapsingToolbar.setCollapsedTitleTextColor(Color.WHITE);

collapsingToolbar.setExpandedTitleColor(Color.WHITE);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

hotelList = new ArrayList<>();

adapter = new HotelAdapter(hotelList, this::redirect);

recyclerView.setAdapter(adapter);

databaseRef = FirebaseDatabase.getInstance().getReference("hotels");

storage = FirebaseStorage.getInstance();

storageRef = storage.getReference("hotel_images");

retrieve();

return view;

BULACAN STATE UNIVERSITY MENESES CAMPUS 270


}

private void redirect(HotelModel hotel) {

Intent intent = new Intent(requireContext(), DynamicHotel.class);

intent.putExtra("hotelKey", hotel.getHotelId());

startActivity(intent);

private void retrieve() {

databaseRef.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

hotelList.clear();

for (DataSnapshot hotelSnapshot : dataSnapshot.getChildren()) {

String hotelId = hotelSnapshot.getKey();

String hotelName = hotelSnapshot.child("name").getValue(String.class);

String hotelDescription =

hotelSnapshot.child("description").getValue(String.class);

String hotelAddress =

hotelSnapshot.child("address").getValue(String.class);

String HotelAddress =

hotelSnapshot.child("hotelAddress").getValue(String.class);

String HotelContact =

hotelSnapshot.child("hotelContact").getValue(String.class);

String HotelEmail =

hotelSnapshot.child("hotelEmail").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 271


String CancellationPolicy =

hotelSnapshot.child("cancellationPolicy").getValue(String.class);

List<String> imageUrls = new ArrayList<>();

DataSnapshot imagesSnapshot = hotelSnapshot.child("images");

for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {

String imageUrl = imageSnapshot.getValue(String.class);

imageUrls.add(imageUrl);

HotelModel hotelModel = new HotelModel(imageUrls, hotelName,

hotelDescription, hotelAddress, hotelId);

hotelList.add(hotelModel);

Log.d("HotelFragment", "Data retrieved: " + hotelName + ", " +

hotelDescription + ", " + imageUrls);

adapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("HotelFragment", "Failed to retrieve hotel data: " +

databaseError.getMessage());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 272


}

Restaurant List [RestoFragment]

public class RestoFragment extends Fragment {

private RecyclerView recyclerView;

private List<RestoModel> restoList;

private RestoAdapter adapter;

private DatabaseReference databaseRef;

private FirebaseStorage storage;

private StorageReference storageRef;

@Nullable

@Override

public View onCreateView(@NonNull LayoutInflater inflater, @Nullable

ViewGroup container, @Nullable Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_resto, container, false);

Typeface customFont = ResourcesCompat.getFont(getContext(), R.font.mont);

CollapsingToolbarLayout collapsingToolbar =

view.findViewById(R.id.Collapsing_toolbar);

collapsingToolbar.setCollapsedTitleTypeface(customFont);

collapsingToolbar.setExpandedTitleTypeface(customFont);

collapsingToolbar.setCollapsedTitleTextColor(Color.WHITE);

collapsingToolbar.setExpandedTitleColor(Color.WHITE);

recyclerView = view.findViewById(R.id.recyclerView);

BULACAN STATE UNIVERSITY MENESES CAMPUS 273


recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

restoList = new ArrayList<>();

adapter = new RestoAdapter(restoList, this::redirect);

recyclerView.setAdapter(adapter);

databaseRef = FirebaseDatabase.getInstance().getReference("restaurants");

storage = FirebaseStorage.getInstance();

storageRef = storage.getReference("restaurant_images");

retrieve();

return view;

private void redirect(RestoModel resto) {

Intent intent = new Intent(requireContext(), DynamicResto.class);

intent.putExtra("restoKey", resto.getRestoId());

startActivity(intent);

private void retrieve() {

databaseRef.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

restoList.clear();

for (DataSnapshot restoSnapshot : dataSnapshot.getChildren()) {

String restoId = restoSnapshot.getKey();

String restoName = restoSnapshot.child("name").getValue(String.class);

String restoDescription =

restoSnapshot.child("description").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 274


String restoAddress =

restoSnapshot.child("address").getValue(String.class);

String restoContact =

restoSnapshot.child("contact").getValue(String.class);

String restoEmail = restoSnapshot.child("email").getValue(String.class);

String CancellationPolicy =

restoSnapshot.child("cancellationPolicy").getValue(String.class);

List<String> imageUrls = new ArrayList<>();

DataSnapshot imagesSnapshot = restoSnapshot.child("images");

for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {

String imageUrl = imageSnapshot.getValue(String.class);

imageUrls.add(imageUrl);

RestoModel restoModel = new RestoModel(imageUrls, restoName,

restoDescription, restoAddress, restoId);

restoList.add(restoModel);

Log.d("RestoFragment", "Data retrieved: " + restoName + ", " +

restoDescription + ", " + imageUrls);

adapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 275


Log.e("HotelFragment", "Failed to retrieve hotel data: " +

databaseError.getMessage());

});

Detailed-Hotel [DynamicHotel]

public class DynamicHotel extends AppCompatActivity {

private ViewPager2 imageSliderViewPager;

private HotelImageSliderAdapter imageSliderAdapter;

private ArrayList<Uri> imageUris = new ArrayList<>();

private LinearLayout sliderDotsPanel;

private Button bookButton;

private FloatingActionButton messageButton;

private String hotelUserId, currentUserName, currentUserId, recepientName;

private FirebaseAuth mAuth;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_dynamic_hotel);

// retrieve intent galing sa hotel fragment

Intent intent = getIntent();

String hotelId = intent.getStringExtra("hotelKey");

BULACAN STATE UNIVERSITY MENESES CAMPUS 276


Log.d("DynamicHotel", "hotelId: " + hotelId);

mAuth = FirebaseAuth.getInstance();

FirebaseUser currentUser = mAuth.getCurrentUser();

if (currentUser != null) {

currentUserId = currentUser.getUid();

Log.d("DynamicHotel", "currentUserId: " + currentUserId);

bookButton = findViewById(R.id.book_button);

messageButton = findViewById(R.id.messageButton);

imageSliderViewPager = findViewById(R.id.imageSliderViewPager);

sliderDotsPanel = findViewById(R.id.dotsLayout2);

imageSliderAdapter = new HotelImageSliderAdapter(this, imageUris,

imageSliderViewPager, sliderDotsPanel);

imageSliderViewPager.setAdapter(imageSliderAdapter);

imageSliderAdapter.updateDotsIndicator(0);

imageSliderViewPager.registerOnPageChangeCallback(new

ViewPager2.OnPageChangeCallback() {

@Override

public void onPageSelected(int position) {

super.onPageSelected(position);

imageSliderAdapter.updateDotsIndicator(position);

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 277


bookButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(DynamicHotel.this, BookForm.class);

intent.putExtra("hotelKey", hotelId);

Log.d("bookButton", "hotelId: " + hotelId);

startActivity(intent);

});

Button mapButton = findViewById(R.id.map);

mapButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

navigateToMap(hotelId);

});

queryHotelUserId(hotelId);

retrieveHotelUserName(hotelId);

retrieveCurrentUserName(currentUserId);

messageButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 278


Intent intent = new Intent(DynamicHotel.this, TouristHotelChat.class);

intent.putExtra("recipientUserId", hotelUserId);

intent.putExtra("recipientUserName", recepientName);

intent.putExtra("currentUserName", currentUserName);

Log.d("DynamicHotel messageButton", "recipientUserId : " + hotelUserId);

Log.d("DynamicHotel messageButton", "recipientName : " +

recepientName);

Log.d("DynamicHotel messageButton", "currentUserName: " +

currentUserName);

startActivity(intent);

});

retrieve(hotelId);

private void navigateToMap(String hotelId) {

Intent intent = new Intent(DynamicHotel.this, DynamicHotelMap.class);

intent.putExtra("hotelId", hotelId);

startActivity(intent);

public void retrieve(String hotelId){

TextView hotelNameTV = findViewById(R.id.nameTextView);

TextView hotelDescriptionTV = findViewById(R.id.descriptionTextView);

TextView amenitiesTV = findViewById(R.id.amenitiesTextView);

TextView hotelAddressTV = findViewById(R.id.addressTextView);

TextView hotelContactTV = findViewById(R.id.contactTextView);

BULACAN STATE UNIVERSITY MENESES CAMPUS 279


TextView hotelEmailTV = findViewById(R.id.emailTextView);

TextView cancellationPolicyTV =

findViewById(R.id.cancellationPolicyTextView);

DatabaseReference databaseReference =

FirebaseDatabase.getInstance().getReference();

DatabaseReference hotelRef = databaseReference.child("hotels").child(hotelId);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

Log.d("DynamicHotel", "onDataChange called");

if (dataSnapshot.exists()) {

String title = dataSnapshot.child("name").getValue(String.class);

String hotelAddress =

dataSnapshot.child("address").getValue(String.class);

String amenities =

dataSnapshot.child("amenities").getValue(String.class);

String description =

dataSnapshot.child("description").getValue(String.class);

String hotelContact =

dataSnapshot.child("contact").getValue(String.class);

String hotelEmail = dataSnapshot.child("email").getValue(String.class);

String cancellationPolicy =

dataSnapshot.child("cancellationPolicy").getValue(String.class);

hotelNameTV.setText(title);

BULACAN STATE UNIVERSITY MENESES CAMPUS 280


hotelDescriptionTV.setText(description);

amenitiesTV.setText(amenities);

hotelAddressTV.setText(hotelAddress);

hotelContactTV.setText(hotelContact);

hotelEmailTV.setText(hotelEmail);

cancellationPolicyTV.setText(cancellationPolicy);

imageUris.clear();

DataSnapshot imagesSnapshot = dataSnapshot.child("images");

for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {

String imageUrl = imageSnapshot.getValue(String.class);

Uri uri = Uri.parse(imageUrl);

imageUris.add(uri);

imageSliderAdapter.setImageUris(imageUris);

imageSliderAdapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("DynamicHotel", "Failed to retrieve hotel data: " +

databaseError.getMessage());

});

private void queryHotelUserId(String hotelId) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 281


DatabaseReference hotelRef =

FirebaseDatabase.getInstance().getReference().child("hotels").child(hotelId);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

hotelUserId = dataSnapshot.child("user_id").getValue(String.class);

Log.d("DynamicHotel", "hotelUserId / recipientId: " + hotelUserId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("DynamicHotel", "Database error: " + databaseError.getMessage());

});

private void retrieveHotelUserName(String hotelId) {

DatabaseReference hotelRef =

FirebaseDatabase.getInstance().getReference().child("hotels").child(hotelId);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

hotelUserId = dataSnapshot.child("user_id").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 282


Log.d("RetrieveHotelUserName", "hotelUserId: " + hotelUserId);

retrieveHotelName(hotelUserId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("DynamicHotel", "Hotel user id retrieval cancelled: " +

databaseError.getMessage());

});

private void retrieveHotelName(String hotelUserId) {

DatabaseReference usersRef =

FirebaseDatabase.getInstance().getReference().child("users").child("Hotel").child(hot

elUserId);

usersRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

recepientName = dataSnapshot.child("name").getValue(String.class);

Log.d("retrieveHotelName", "recepientName: " + recepientName);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 283


Log.e("DynamicHotel", "Hotel user name retrieval cancelled: " +

databaseError.getMessage());

});

private void retrieveCurrentUserName(String currentUserId) {

DatabaseReference usersRef =

FirebaseDatabase.getInstance().getReference().child("users").child("Tourist").child(c

urrentUserId);

Log.d("DynamicHotel", " User ref: " + usersRef);

usersRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

currentUserName = dataSnapshot.child("name").getValue(String.class);

Log.d("DynamicHotel", "Current User Name: " + currentUserName);

@Override

public void onCancelled(DatabaseError databaseError) {

Log.e("BookingDetail", "Current user name retrieval cancelled: " +

databaseError.getMessage());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 284


public void goBack(View view) {

onBackPressed();

Booking Form [BookForm]

public class BookForm extends AppCompatActivity {

private Spinner roomPreferenceSpinner;

private List<String> roomTypeList = new ArrayList<>();

private EditText fullNameET, contactNumberET, emailET, checkInDateET,

checkOutDateET, yourGcashNameET, yourGcashNumberET, referenceNumberET;

private TextView childrenNumberPicker, reservefeeET, gcashDepositNameET,

gcashDepositNumberET, adultsNumberPicker;

private Button submitButton;

private ImageView attachedImageView;

private static final int PICK_IMAGE_REQUEST = 1;

private Uri selectedImageUri;

private Calendar selectedCheckInDate = Calendar.getInstance();

private Calendar selectedCheckOutDate = Calendar.getInstance();

private int adultCount = 0;

private int childrenCount = 0;

Object timestamp;

ImageView imageView;

TextView textView;

@Override

protected void onCreate(Bundle savedInstanceState) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 285


super.onCreate(savedInstanceState);

setContentView(R.layout.activity_book_form);

Intent intent = getIntent(); // kunin yung hotelId sa DynamicHotel para sa

String hotelId = intent.getStringExtra("hotelKey"); // personalized fields nila

Log.d("BookFormActivity", "hotelId: " + hotelId); // sa book info like roomtypes

etc

DatabaseReference databaseReference =

FirebaseDatabase.getInstance().getReference();

DatabaseReference roomPreferencesRef =

databaseReference.child("hotels").child(hotelId).child("roomTypes");

fullNameET = findViewById(R.id.fullNameET);

contactNumberET = findViewById(R.id.contactNumberET);

emailET = findViewById(R.id.emailET);

submitButton = findViewById(R.id.submitButton);

roomPreferenceSpinner = findViewById(R.id.roomPreferenceSpinner);

checkInDateET = findViewById(R.id.checkInDateET);

checkOutDateET = findViewById(R.id.checkOutDateET);

yourGcashNameET = findViewById(R.id.yourGcashNameET);

yourGcashNumberET = findViewById(R.id.yourGcashNumberET);

referenceNumberET = findViewById(R.id.referenceNumberET);

attachedImageView = findViewById(R.id.attachedImageView);

reservefeeET = findViewById(R.id.reservefeeET);

imageView = findViewById(R.id.copyImageView);

textView = findViewById(R.id.gcashDepositNumberET);

BULACAN STATE UNIVERSITY MENESES CAMPUS 286


AlertDialog alertDialog = showTermsDialog();

if (alertDialog != null && alertDialog.isShowing()) {

alertDialog.dismiss();

imageView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

ClipboardManager clipboardManager = (ClipboardManager)

getSystemService(Context.CLIPBOARD_SERVICE);

ClipData clipData =

ClipData.newPlainText("Copy",textView.getText().toString());

clipboardManager.setPrimaryClip(clipData);

Toast.makeText(BookForm.this, "Copied",

Toast.LENGTH_SHORT).show();

});

ArrayAdapter<String> roomTypeAdapter = new ArrayAdapter<>(this,

android.R.layout.simple_spinner_item, roomTypeList);

roomTypeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dro

pdown_item);

roomPreferenceSpinner.setAdapter(roomTypeAdapter);

adultsNumberPicker = findViewById(R.id.adultsNumberPicker);

childrenNumberPicker = findViewById(R.id.childrenNumberPicker);

BULACAN STATE UNIVERSITY MENESES CAMPUS 287


checkInDateET.setOnClickListener(v -> {

selectedCheckInDate = Calendar.getInstance();

showDatePickerDialog(selectedCheckInDate, Calendar.getInstance());

});

checkOutDateET.setOnClickListener(v -> {

selectedCheckOutDate = Calendar.getInstance();

showDatePickerDialog(selectedCheckOutDate, selectedCheckInDate);

});

roomPreferencesRef.addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

roomTypeList.clear();

for (DataSnapshot preferenceSnapshot : dataSnapshot.getChildren()) {

String roomPreference = preferenceSnapshot.getValue(String.class);

roomTypeList.add(roomPreference);

roomTypeAdapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("BookForm", "Error: " + databaseError.getMessage());

BULACAN STATE UNIVERSITY MENESES CAMPUS 288


});

gcashDepositNameET = findViewById(R.id.gcashDepositNameET);

gcashDepositNumberET = findViewById(R.id.gcashDepositNumberET);

reservefeeET = findViewById(R.id.reservefeeET);

DatabaseReference hotelRef = databaseReference.child("hotels").child(hotelId);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot hotelSnapshot) {

if (hotelSnapshot.exists()) {

String gcashNumber =

hotelSnapshot.child("gcashNumber").getValue(String.class);

String gcashName =

hotelSnapshot.child("gcashName").getValue(String.class);

String resrevefee =

hotelSnapshot.child("reservationFee").getValue(String.class);

if (gcashDepositNameET != null && gcashDepositNumberET != null) {

gcashDepositNumberET.setText(gcashNumber);

gcashDepositNameET.setText(gcashName);

reservefeeET.setText(resrevefee);

} else {

Log.e("BookForm", "gcashDepositNameET or

gcashDepositNumberET is null");

} else {

Log.e("BookForm", "Hotel not found with ID: " + hotelId);

BULACAN STATE UNIVERSITY MENESES CAMPUS 289


}

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("BookeForm", "Hotel database error: " +

databaseError.getMessage());

});

submitButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

if (allFields()) {

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String enteredEmail = emailET.getText().toString();

String registeredEmail = currentUser.getEmail();

if (enteredEmail.equals(registeredEmail)) {

ProgressBar loadingProgressBar =

findViewById(R.id.loadingProgressBar);

submitButton.setVisibility(View.GONE);

loadingProgressBar.setVisibility(View.VISIBLE);

new AsyncTask<Void, Void, Void>() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 290


protected Void doInBackground(Void... params) {

try {

Thread.sleep(2000);

} catch (InterruptedException e) {

e.printStackTrace();

return null;

@Override

protected void onPostExecute(Void result) {

loadingProgressBar.setVisibility(View.GONE);

submitButton.setVisibility(View.VISIBLE);

String userId = currentUser.getUid();

String fullName = fullNameET.getText().toString();

String checkInDate = checkInDateET.getText().toString();

String checkOutDate = checkOutDateET.getText().toString();

int adults =

Integer.parseInt(adultsNumberPicker.getText().toString());

int children =

Integer.parseInt(childrenNumberPicker.getText().toString());

String contactNumber =

contactNumberET.getText().toString();

String email = emailET.getText().toString();

String roomPreference =

roomPreferenceSpinner.getSelectedItem().toString();

BULACAN STATE UNIVERSITY MENESES CAMPUS 291


String yourGcashName =

yourGcashNameET.getText().toString();

String yourGcashNumber =

yourGcashNumberET.getText().toString();

String referenceNumber =

referenceNumberET.getText().toString();

canSubmitBooking(userId, hotelId, fullName, checkInDate,

checkOutDate, adults,

children, contactNumber, email, roomPreference,

yourGcashName, yourGcashNumber, referenceNumber);

finish();

}.execute();

} else {

Toast.makeText(BookForm.this, "Please enter the email associated

with your account.", Toast.LENGTH_SHORT).show();

} else {

Log.e("BookForm", "User is not authenticated");

} else {

Toast.makeText(BookForm.this, "Please fill in all required fields.",

Toast.LENGTH_SHORT).show();

BULACAN STATE UNIVERSITY MENESES CAMPUS 292


}

});

Button attachPhotoButton = findViewById(R.id.attachPhotoButton);

attachPhotoButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

openFileChooser();

});

TextView termsPaymentTextView = findViewById(R.id.termsPayment);

termsPaymentTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

showTermsDialog();

});

public void incrementValue(View view) {

if (adultCount < 9) {

adultCount++;

updateAdultsCount();

public void decrementValue(View view) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 293


if (adultCount > 0) {

adultCount--;

updateAdultsCount();

private void updateAdultsCount() {

adultsNumberPicker.setText(String.valueOf(adultCount));

public void incrementValue2(View view) {

if (childrenCount < 9) {

childrenCount++;

updateChildrenCount();

public void decrementValue2(View view) {

if (childrenCount > 0) {

childrenCount--;

updateChildrenCount();

private void updateChildrenCount() {

childrenNumberPicker.setText(String.valueOf(childrenCount));

private void openFileChooser() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 294


Intent intent = new Intent();

intent.setType("image/*");

intent.setAction(Intent.ACTION_GET_CONTENT);

startActivityForResult(intent, PICK_IMAGE_REQUEST);

@Override

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

super.onActivityResult(requestCode, resultCode, data);

if (requestCode == PICK_IMAGE_REQUEST && resultCode ==

RESULT_OK && data != null && data.getData() != null) {

selectedImageUri = data.getData();

attachedImageView.setImageURI(selectedImageUri);

attachedImageView.setVisibility(View.VISIBLE);

private void showDatePickerDialog(final Calendar selectedDate, final Calendar

minDate) {

DatePickerDialog datePickerDialog = new DatePickerDialog(

BookForm.this,

(view, year, monthOfYear, dayOfMonth) -> {

selectedDate.set(year, monthOfYear, dayOfMonth);

Calendar currentDate = Calendar.getInstance();

currentDate.set(Calendar.HOUR_OF_DAY, 0);

currentDate.set(Calendar.MINUTE, 0);

BULACAN STATE UNIVERSITY MENESES CAMPUS 295


currentDate.set(Calendar.SECOND, 0);

currentDate.set(Calendar.MILLISECOND, 0);

if (!selectedDate.before(currentDate)) {

updateDateField(selectedDate);

} else {

Toast.makeText(getApplicationContext(), "Please select a valid date",

Toast.LENGTH_SHORT).show();

},

selectedDate.get(Calendar.YEAR),

selectedDate.get(Calendar.MONTH),

selectedDate.get(Calendar.DAY_OF_MONTH)

);

datePickerDialog.getDatePicker().setMinDate(minDate.getTimeInMillis());

datePickerDialog.show();

private void updateDateField(Calendar selectedDate) {

SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy",

Locale.getDefault());

if (selectedDate.equals(selectedCheckInDate)) {

checkInDateET.setText(dateFormat.format(selectedDate.getTime()));

} else if (selectedDate.equals(selectedCheckOutDate)) {

checkOutDateET.setText(dateFormat.format(selectedDate.getTime()));

BULACAN STATE UNIVERSITY MENESES CAMPUS 296


}

private boolean allFields() {

return !fullNameET.getText().toString().isEmpty() &&

!contactNumberET.getText().toString().isEmpty() &&

!emailET.getText().toString().isEmpty() &&

!checkInDateET.getText().toString().isEmpty() &&

!checkOutDateET.getText().toString().isEmpty() &&

!roomPreferenceSpinner.getSelectedItem().toString().isEmpty() &&

!yourGcashNameET.getText().toString().isEmpty() &&

!yourGcashNumberET.getText().toString().isEmpty() &&

!referenceNumberET.getText().toString().isEmpty() &&

selectedImageUri != null;

private void canSubmitBooking(String userId, String hotelId, String fullName,

String checkInDate, String checkOutDate,

int adults, int children, String contactNumber, String email,

String roomPreference,

String yourGcashName, String yourGcashNumber, String

referenceNumber) {

DatabaseReference databaseReference =

FirebaseDatabase.getInstance().getReference();

DatabaseReference userBookingsRef =

databaseReference.child("booking_info");

BULACAN STATE UNIVERSITY MENESES CAMPUS 297


userBookingsRef.orderByChild("userId").equalTo(userId).addListenerForSingleValu

eEvent(new ValueEventListener() {

@Override

public void onDataChange(DataSnapshot dataSnapshot) {

boolean canSubmit = true;

for (DataSnapshot bookingSnapshot : dataSnapshot.getChildren()) {

String existingCheckInDate =

bookingSnapshot.child("checkInDate").getValue(String.class);

String existingCheckOutDate =

bookingSnapshot.child("checkOutDate").getValue(String.class);

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");

Date currentDate = new Date();

Date existingCheckIn = null;

Date existingCheckOut = null;

try {

existingCheckIn = sdf.parse(existingCheckInDate);

existingCheckOut = sdf.parse(existingCheckOutDate);

} catch (ParseException e) {

e.printStackTrace();

if (existingCheckIn != null && existingCheckOut != null) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 298


if (!(existingCheckOut.before(existingCheckIn) &&

existingCheckIn.before(existingCheckOut) ||

existingCheckIn.after(existingCheckOut) &&

existingCheckIn.after(existingCheckIn))) {

canSubmit = false;

break;

if (existingCheckOut != null && currentDate.before(existingCheckOut))

canSubmit = false;

break;

if (canSubmit) {

saveBooking(userId, hotelId, fullName, checkInDate, checkOutDate,

adults, children, contactNumber, email, roomPreference, yourGcashName,

yourGcashNumber, referenceNumber, timestamp);

} else {

Toast.makeText(BookForm.this, "You cannot submit a new booking until

your current booking has ended.", Toast.LENGTH_SHORT).show();

@Override

public void onCancelled(DatabaseError databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 299


Log.e("BookForm", "Database error: " + databaseError.getMessage());

});

private boolean isDateRangeOverlap(String start1, String end1, String start2, String

end2) {

try {

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");

Date startDate1 = sdf.parse(start1);

Date endDate1 = sdf.parse(end1);

Date startDate2 = sdf.parse(start2);

Date endDate2 = sdf.parse(end2);

return !(endDate1.before(startDate2) || endDate2.before(startDate1));

} catch (ParseException e) {

e.printStackTrace();

return false;

private void saveBooking(String userId, String hotelId, String fullName, String

checkInDate, String checkOutDate,

int adults, int children, String contactNumber, String email, String

roomPreference,

String yourGcashName, String yourGcashNumber, String

referenceNumber, Object timestamp) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 300


DatabaseReference databaseReference =

FirebaseDatabase.getInstance().getReference();

DatabaseReference hotelRef =

databaseReference.child("hotels").child(hotelId).child("user_id");

Log.d("BookForm", "hotelref: " + hotelRef);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot hotelDataSnapshot) {

if (hotelDataSnapshot.exists()) {

String hotelUserId = hotelDataSnapshot.getValue(String.class);

Log.d("BookForm", "HotelUserId: " + hotelUserId);

DatabaseReference bookingsRef =

databaseReference.child("booking_info").push();

String bookingId = bookingsRef.getKey();

bookingsRef.child("isConfirmed").setValue(false);

bookingsRef.child("isPending").setValue(true);

bookingsRef.child("isDeclined").setValue(false);

bookingsRef.child("userId").setValue(userId);

bookingsRef.child("fullName").setValue(fullName);

bookingsRef.child("checkInDate").setValue(checkInDate);

bookingsRef.child("checkOutDate").setValue(checkOutDate);

bookingsRef.child("adults").setValue(adults);

bookingsRef.child("children").setValue(children);

bookingsRef.child("contactNumber").setValue(contactNumber);

BULACAN STATE UNIVERSITY MENESES CAMPUS 301


bookingsRef.child("email").setValue(email);

bookingsRef.child("roomPreference").setValue(roomPreference);

bookingsRef.child("GcashName").setValue(yourGcashName);

bookingsRef.child("yGcashNumber").setValue(yourGcashNumber);

bookingsRef.child("referenceNumber").setValue(referenceNumber);

bookingsRef.child("hotelUserId").setValue(hotelUserId);

bookingsRef.child("timestamp").setValue(ServerValue.TIMESTAMP);

if (selectedImageUri != null) {

saveBookingWithImage(bookingsRef, userId, hotelId);

} else {

Log.d("BookForm", "Booking data saved successfully.");

Toast.makeText(BookForm.this, "Booking submitted successfully.",

Toast.LENGTH_SHORT).show();

@Override

public void onCancelled(@NonNull DatabaseError hotelDatabaseError) {

Log.e("BookForm", "Hotel database error: " +

hotelDatabaseError.getMessage());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 302


private void saveBookingWithImage(DatabaseReference bookingsRef, String

userId, String hotelId) {

StorageReference storageReference =

FirebaseStorage.getInstance().getReference();

StorageReference imageRef = storageReference.child("payment_receipts/" +

userId + "/" + hotelId + "/image.jpg");

imageRef.putFile(selectedImageUri)

.addOnSuccessListener(taskSnapshot -> {

imageRef.getDownloadUrl().addOnSuccessListener(downloadUri -> {

String imageUrl = downloadUri.toString();

bookingsRef.child("imageUrl").setValue(imageUrl);

Log.d("BookForm", "Booking data with image URL saved

successfully.");

Toast.makeText(this, "Booking submitted successfully.",

Toast.LENGTH_SHORT).show();

});

})

.addOnFailureListener(e -> {

Log.e("BookForm", "Image upload failed: " + e.getMessage());

Toast.makeText(this, "Failed to upload image.",

Toast.LENGTH_SHORT).show();

});

private AlertDialog showTermsDialog() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 303


AlertDialog.Builder builder = new AlertDialog.Builder(this);

View customView = getLayoutInflater().inflate(R.layout.dialog_payment, null);

builder.setView(customView);

AlertDialog alertDialog = builder.create();

AppCompatButton understandButton =

customView.findViewById(R.id.understandButton);

understandButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

alertDialog.dismiss();

});

alertDialog.show();

return alertDialog;

public void goBack(View view) {

onBackPressed();

Traveler Profile Page [ProfileFragment]

public class ProfileFragment extends Fragment {

private TextView name, email, pendingbtn, currentbtn, expiredbtn, declinedbtn;

private CircleImageView profilepic;

BULACAN STATE UNIVERSITY MENESES CAMPUS 304


private TextView logout;

private FloatingActionButton picButton;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_profile, container, false);

name = view.findViewById(R.id.tv_name);

email = view.findViewById(R.id.tv_email);

profilepic = view.findViewById(R.id.iv_profilepic);

logout = view.findViewById(R.id.logout_button);

pendingbtn = view.findViewById(R.id.pendingbtn);

currentbtn = view.findViewById(R.id.currentbtn);

expiredbtn = view.findViewById(R.id.expiredbtn);

declinedbtn = view.findViewById(R.id.declinedbtn);

retrieveAndDisplayUserInfo();

picButton = view.findViewById(R.id.pic_Button);

picButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

onSelectProfilePictureClick(v);

});

logout.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 305


logoutUser();

});

expiredbtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

Intent intent = new Intent(getActivity(), ExpiredBooking.class);

startActivity(intent);

});

currentbtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

Intent intent = new Intent(getActivity(), ConfirmedBooking.class);

startActivity(intent);

});

pendingbtn.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

Intent intent = new Intent(getActivity(), PendingBooking.class);

startActivity(intent);

});

declinedbtn.setOnClickListener(new View.OnClickListener() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 306


@Override

public void onClick(View view) {

Intent intent = new Intent(getActivity(), DeclinedBooking.class);

startActivity(intent);

});

TextView tutorialsbtnView = view.findViewById(R.id.tutorialsbtn);

tutorialsbtnView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), Tutorials.class);

startActivity(intent);

});

TextView termsTextView = view.findViewById(R.id.termsbtn);

termsTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), TermsOfUse.class);

startActivity(intent);

});

TextView privacyTextView = view.findViewById(R.id.privacybtn);

privacyTextView.setOnClickListener(new View.OnClickListener() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 307


public void onClick(View v) {

Intent intent = new Intent(getActivity(), PrivacyPolicy.class);

startActivity(intent);

});

TextView contactTextView = view.findViewById(R.id.contactbtn);

contactTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), ContactUs.class);

startActivity(intent);

});

return view;

public void onSelectProfilePictureClick(View view) {

Intent intent = new Intent(Intent.ACTION_PICK);

intent.setType("image/*");

startActivityForResult(intent, 1);

@Override

public void onActivityResult(int requestCode, int resultCode, @Nullable Intent

data) {

super.onActivityResult(requestCode, resultCode, data);

BULACAN STATE UNIVERSITY MENESES CAMPUS 308


if (requestCode == 1 && resultCode == RESULT_OK && data != null) {

Uri imageUri = data.getData();

uploadProfilePictureToStorage(imageUri);

private void uploadProfilePictureToStorage(Uri imageUri) {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

StorageReference storageRef = FirebaseStorage.getInstance().getReference();

StorageReference profilePicsRef =

storageRef.child("profile_pictures").child(userId);

UploadTask uploadTask = profilePicsRef.putFile(imageUri);

uploadTask.addOnSuccessListener(taskSnapshot -> {

profilePicsRef.getDownloadUrl().addOnSuccessListener(uri -> {

String profilePictureUrl = uri.toString();

saveProfilePictureUrlToFirebase(profilePictureUrl);

});

});

private void saveProfilePictureUrlToFirebase(String profilePictureUrl) {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

DatabaseReference userRef =

FirebaseDatabase.getInstance().getReference("users").child("Tourist").child(userId);

HashMap<String, Object> userData = new HashMap<>();

userData.put("profilePictureUrl", profilePictureUrl);

userRef.updateChildren(userData).addOnSuccessListener(aVoid -> {

BULACAN STATE UNIVERSITY MENESES CAMPUS 309


Picasso.get().load(profilePictureUrl).into(profilepic);

}).addOnFailureListener(e -> {

});

private void retrieveAndDisplayUserInfo() {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

DatabaseReference userRef =

FirebaseDatabase.getInstance().getReference("users");

userRef.child("Tourist").child(userId).addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot snapshot) {

if (snapshot.exists()) {

String nameValue = snapshot.child("name").getValue(String.class);

String emailValue = snapshot.child("email").getValue(String.class);

String profilePictureUrl =

snapshot.child("profilePictureUrl").getValue(String.class);

Log.d("ProfileFragment", "Name: " + nameValue);

Log.d("ProfileFragment", "Email: " + emailValue);

if (getActivity() != null) {

getActivity().runOnUiThread(new Runnable() {

@Override

public void run() {

name.setText(nameValue);

BULACAN STATE UNIVERSITY MENESES CAMPUS 310


email.setText(emailValue);

Picasso.get().load(profilePictureUrl).into(profilepic);

});

@Override

public void onCancelled(@NonNull DatabaseError error) {

Log.e("ProfileError", "Database error: " + error.getMessage());

});

private void logoutUser() {

AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());

builder.setMessage("Are you sure you want to log out?")

.setPositiveButton("Yes", (dialogInterface, i) -> {

FirebaseAuth.getInstance().signOut();

Intent intent = new Intent(getActivity(), MainActivityRegister.class);

startActivity(intent);

getActivity().finish();

})

.setNegativeButton("No", (dialogInterface, i) -> dialogInterface.dismiss())

.show();

BULACAN STATE UNIVERSITY MENESES CAMPUS 311


}

Hotel Pending Reservations [PendingHotel]

public class PendingHotelFragment extends Fragment {

private RecyclerView recyclerView;

private PendingInfoAdapter adapter;

private List<BookingInfoModel> pendingBookingsList;

private RelativeLayout emptyStateLayout;

public PendingHotelFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_pending_hotel, container, false);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

pendingBookingsList = new ArrayList<>();

adapter = new PendingInfoAdapter(pendingBookingsList, requireActivity());

recyclerView.setAdapter(adapter);

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

BULACAN STATE UNIVERSITY MENESES CAMPUS 312


if (currentUser != null) {

String currentUserId = currentUser.getUid();

retrievePendingBookings(currentUserId);

} else {

Log.e("ConfirmedBooking", "User not authenticated");

return view;

private void retrievePendingBookings(String currentUserId) {

DatabaseReference bookingInfoRef =

FirebaseDatabase.getInstance().getReference().child("booking_info");

bookingInfoRef.orderByChild("userId").equalTo(currentUserId)

.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

pendingBookingsList.clear();

Log.d("PendingBooking", "OnDataChange triggered");

for (DataSnapshot bookingSnapshot : dataSnapshot.getChildren()) {

String bookingKey = bookingSnapshot.getKey();

BULACAN STATE UNIVERSITY MENESES CAMPUS 313


String userId =

bookingSnapshot.child("userId").getValue(String.class);

String fullName =

bookingSnapshot.child("fullName").getValue(String.class);

String checkInDate =

bookingSnapshot.child("checkInDate").getValue(String.class);

String checkOutDate =

bookingSnapshot.child("checkOutDate").getValue(String.class);

Log.d("PendingBooking", "Data retrieved - FullName: " + fullName

+ ", CheckInDate: " + checkInDate + ", CheckOutDate: " + checkOutDate);

boolean isPending =

bookingSnapshot.child("isPending").getValue(Boolean.class);

Log.d("PendingBooking", "Boolean : " + isPending);

if (isPending) {

BookingInfoModel bookingInfo = new BookingInfoModel();

bookingInfo.setBookingId(bookingKey);

bookingInfo.setFullName(fullName);

bookingInfo.setCheckInDate(checkInDate);

bookingInfo.setCheckOutDate(checkOutDate);

pendingBookingsList.add(bookingInfo);

Log.d("PendingBooking", "Data retrieved and added to the list: "

+ bookingInfo);

Log.d("PendingBooking", "Boolean : " + isPending);

BULACAN STATE UNIVERSITY MENESES CAMPUS 314


}

if (!pendingBookingsList.isEmpty()) {

updateEmptyStateVisibility();

adapter.notifyDataSetChanged();

Log.d("PendingBooking", "Data retrieved successfully. Number of

pending bookings: " + pendingBookingsList.size());

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("PendingBooking", "Error retrieving pending bookings: " +

databaseError.getMessage());

});

private void updateEmptyStateVisibility() {

if (pendingBookingsList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 315


recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

Hotel Confirmed Reservations [ConfirmedHotel]

public class ConfirmedHotelFragment extends Fragment {

private RecyclerView recyclerView;

private ConfirmedInfoAdapter adapter;

private List<BookingInfoModel> confirmedBookingsList;

private RelativeLayout emptyStateLayout;

public ConfirmedHotelFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_confirmed_hotel, container,

false);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

confirmedBookingsList = new ArrayList<>();

BULACAN STATE UNIVERSITY MENESES CAMPUS 316


adapter = new ConfirmedInfoAdapter(confirmedBookingsList,

requireActivity());

recyclerView.setAdapter(adapter);

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

retrieveConfirmedBookings(currentUserId);

} else {

Log.e("ConfirmedBooking", "User not authenticated");

return view;

private void retrieveConfirmedBookings(String currentUserId) {

DatabaseReference bookingInfoRef =

FirebaseDatabase.getInstance().getReference().child("booking_info");

bookingInfoRef.orderByChild("userId").equalTo(currentUserId)

.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

confirmedBookingsList.clear();

Log.d("ConfirmedHotelFragment", "OnDataChange triggered");

for (DataSnapshot bookingSnapshot : dataSnapshot.getChildren()) {

String bookingKey = bookingSnapshot.getKey();

BULACAN STATE UNIVERSITY MENESES CAMPUS 317


String userId =

bookingSnapshot.child("userId").getValue(String.class);

String fullName =

bookingSnapshot.child("fullName").getValue(String.class);

String checkInDate =

bookingSnapshot.child("checkInDate").getValue(String.class);

String checkOutDate =

bookingSnapshot.child("checkOutDate").getValue(String.class);

Log.d("ConfirmedHotelFragment", "Data retrieved - FullName: " +

fullName + ", CheckInDate: " + checkInDate + ", CheckOutDate: " + checkOutDate);

boolean isConfirmed =

bookingSnapshot.child("isConfirmed").getValue(Boolean.class);

if (isConfirmed) {

BookingInfoModel bookingInfo = new BookingInfoModel();

bookingInfo.setBookingId(bookingKey);

bookingInfo.setFullName(fullName);

bookingInfo.setCheckInDate(checkInDate);

bookingInfo.setCheckOutDate(checkOutDate);

confirmedBookingsList.add(bookingInfo);

Log.d("ConfirmedHotelFragment", "Data retrieved and added to

the list: " + bookingInfo);

updateEmptyStateVisibility();

BULACAN STATE UNIVERSITY MENESES CAMPUS 318


adapter.notifyDataSetChanged();

Log.d("ConfirmedHotelFragment", "Data retrieved successfully.

Number of pending bookings: " + confirmedBookingsList.size());

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("ConfirmedHotelFragment", "Error retrieving pending

bookings: " + databaseError.getMessage());

});

private void updateEmptyStateVisibility() {

if (confirmedBookingsList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

Hotel Expired Reservations [ExpiredHotel]

public class ConfirmedHotelFragment extends Fragment {

private RecyclerView recyclerView;

private ConfirmedInfoAdapter adapter;

BULACAN STATE UNIVERSITY MENESES CAMPUS 319


private List<BookingInfoModel> confirmedBookingsList;

private RelativeLayout emptyStateLayout;

public ConfirmedHotelFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_confirmed_hotel, container,

false);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

confirmedBookingsList = new ArrayList<>();

adapter = new ConfirmedInfoAdapter(confirmedBookingsList,

requireActivity());

recyclerView.setAdapter(adapter);

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

retrieveConfirmedBookings(currentUserId);

} else {

Log.e("ConfirmedBooking", "User not authenticated");

BULACAN STATE UNIVERSITY MENESES CAMPUS 320


return view;

private void retrieveConfirmedBookings(String currentUserId) {

DatabaseReference bookingInfoRef =

FirebaseDatabase.getInstance().getReference().child("booking_info");

bookingInfoRef.orderByChild("userId").equalTo(currentUserId)

.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

confirmedBookingsList.clear();

Log.d("ConfirmedHotelFragment", "OnDataChange triggered");

for (DataSnapshot bookingSnapshot : dataSnapshot.getChildren()) {

String bookingKey = bookingSnapshot.getKey();

String userId =

bookingSnapshot.child("userId").getValue(String.class);

String fullName =

bookingSnapshot.child("fullName").getValue(String.class);

String checkInDate =

bookingSnapshot.child("checkInDate").getValue(String.class);

String checkOutDate =

bookingSnapshot.child("checkOutDate").getValue(String.class);

Log.d("ConfirmedHotelFragment", "Data retrieved - FullName: " +

fullName + ", CheckInDate: " + checkInDate + ", CheckOutDate: " + checkOutDate);

BULACAN STATE UNIVERSITY MENESES CAMPUS 321


boolean isConfirmed =

bookingSnapshot.child("isConfirmed").getValue(Boolean.class);

if (isConfirmed) {

BookingInfoModel bookingInfo = new BookingInfoModel();

bookingInfo.setBookingId(bookingKey);

bookingInfo.setFullName(fullName);

bookingInfo.setCheckInDate(checkInDate);

bookingInfo.setCheckOutDate(checkOutDate);

confirmedBookingsList.add(bookingInfo);

Log.d("ConfirmedHotelFragment", "Data retrieved and added to

the list: " + bookingInfo);

updateEmptyStateVisibility();

adapter.notifyDataSetChanged();

Log.d("ConfirmedHotelFragment", "Data retrieved successfully.

Number of pending bookings: " + confirmedBookingsList.size());

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("ConfirmedHotelFragment", "Error retrieving pending

bookings: " + databaseError.getMessage());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 322


}

private void updateEmptyStateVisibility() {

if (confirmedBookingsList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

Hotel Declined Reservations [DeclinedHotel]

public class DeclinedHotelFragment extends Fragment {

private RecyclerView recyclerView;

private DeclinedInfoAdapter adapter;

private List<BookingInfoModel> declinedBookingsList;

private RelativeLayout emptyStateLayout;

public DeclinedHotelFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 323


View view = inflater.inflate(R.layout.fragment_declined_hotel, container, false);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

declinedBookingsList = new ArrayList<>();

adapter = new DeclinedInfoAdapter(declinedBookingsList, requireActivity());

recyclerView.setAdapter(adapter);

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

retrieveConfirmedBookings(currentUserId);

} else {

Log.e("ConfirmedBooking", "User not authenticated");

return view;

private void retrieveConfirmedBookings(String currentUserId) {

DatabaseReference bookingInfoRef =

FirebaseDatabase.getInstance().getReference().child("booking_info");

bookingInfoRef.orderByChild("userId").equalTo(currentUserId)

.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

declinedBookingsList.clear();

BULACAN STATE UNIVERSITY MENESES CAMPUS 324


Log.d("ConfirmedHotelFragment", "OnDataChange triggered");

for (DataSnapshot bookingSnapshot : dataSnapshot.getChildren()) {

String bookingKey = bookingSnapshot.getKey();

String userId =

bookingSnapshot.child("userId").getValue(String.class);

String fullName =

bookingSnapshot.child("fullName").getValue(String.class);

String checkInDate =

bookingSnapshot.child("checkInDate").getValue(String.class);

String checkOutDate =

bookingSnapshot.child("checkOutDate").getValue(String.class);

Log.d("ConfirmedHotelFragment", "Data retrieved - FullName: " +

fullName + ", CheckInDate: " + checkInDate + ", CheckOutDate: " + checkOutDate);

boolean isDeclined =

bookingSnapshot.child("isDeclined").getValue(Boolean.class);

if (isDeclined) {

BookingInfoModel bookingInfo = new BookingInfoModel();

bookingInfo.setBookingId(bookingKey);

bookingInfo.setFullName(fullName);

bookingInfo.setCheckInDate(checkInDate);

bookingInfo.setCheckOutDate(checkOutDate);

declinedBookingsList.add(bookingInfo);

BULACAN STATE UNIVERSITY MENESES CAMPUS 325


Log.d("ConfirmedHotelFragment", "Data retrieved and added to

the list: " + bookingInfo);

updateEmptyStateVisibility();

adapter.notifyDataSetChanged();

Log.d("ConfirmedHotelFragment", "Data retrieved successfully.

Number of pending bookings: " + declinedBookingsList.size());

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("ConfirmedHotelFragment", "Error retrieving pending

bookings: " + databaseError.getMessage());

});

private void updateEmptyStateVisibility() {

if (declinedBookingsList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

recyclerView.setVisibility(View.VISIBLE);

BULACAN STATE UNIVERSITY MENESES CAMPUS 326


emptyStateLayout.setVisibility(View.GONE);

Application Tutorials [Tutorials]

public class Tutorials extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_tutorials);

WebView webView1 = findViewById(R.id.webView1);

loadYouTubeVideo(webView1,

"https://www.youtube.com/embed/M4TCYzsu2vU?si=uTX5DB9DYWY2C9fl");

WebView webView2 = findViewById(R.id.webView2);

loadYouTubeVideo(webView2,

"https://www.youtube.com/embed/RsQCArTlcJU?si=ovL-LLeL_gY7hXmi");

WebView webView3 = findViewById(R.id.webView3);

loadYouTubeVideo(webView3,

"https://www.youtube.com/embed/yp0_bIJChsQ?si=NjEQCRG-R036DNsU");

WebView webView4 = findViewById(R.id.webView4);

BULACAN STATE UNIVERSITY MENESES CAMPUS 327


loadYouTubeVideo(webView4, "https://www.youtube.com/embed/N3-

gvvJLUPY?si=T-BrsZsGSEiXliJq");

WebView webView5 = findViewById(R.id.webView5);

loadYouTubeVideo(webView5, "https://www.youtube.com/embed/3Yd-

pI9jR7c?si=P4Li0yDrxZAKGXUE");

WebView webView6 = findViewById(R.id.webView6);

loadYouTubeVideo(webView5,

"https://www.youtube.com/embed/_ElZZHFxo0E?si=kuLu8TK75L0wz27n");

private void loadYouTubeVideo(WebView webView, String videoUrl) {

String iframe = "<iframe width=\"100%\" height=\"100%\" src=\"" +

videoUrl +

"\" title=\"YouTube video player\" frameborder=\"0\"

allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope;

picture-in-picture; web-share\" allowfullscreen></iframe>";

webView.loadData(iframe, "text/html", "utf-8");

webView.getSettings().setJavaScriptEnabled(true);

webView.setWebChromeClient(new WebChromeClient());

public void goBack(View view) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 328


onBackPressed();

Hotel’s Information Management [EditHotelActivity]

public class EditHotelActivity extends AppCompatActivity {

private List<Uri> imageUris = new ArrayList<>();

private ActivityResultLauncher<Intent> galleryLauncher;

private FloatingActionButton uploadButton;

private List<String> roomTypes = new ArrayList<>();

private RoomTypeAdapter roomTypeAdapter;

private RecyclerView roomTypeRecyclerView;

private TextInputEditText hotelNameET, hotelAddET, hotelDescET,

hotelContactET, hotelEmailET, roomTypeET, gcashNameET, reservationFeeET,

gcashNumberET, amenityET, cancellationPolicyET;

private Button postButton, cancelButton;

private Uri imageUri;

private StorageReference storageReference;

private DatabaseReference databaseReference;

private String userId;

private HotelImageSliderAdapter adapter;

private ViewPager2 viewPager;

private LinearLayout dotsLayout;

private ImageView[] dots;

TextView tvClickableLink;

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 329


protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_edit_hotel);

viewPager = findViewById(R.id.viewPager);

dotsLayout = findViewById(R.id.dotsLayout);

uploadButton = findViewById(R.id.uploadButton);

hotelNameET = findViewById(R.id.hotelNameET);

hotelAddET = findViewById(R.id.hotelAddET);

hotelDescET = findViewById(R.id.hotelDescET);

hotelContactET = findViewById(R.id.hotelContactET);

hotelEmailET = findViewById(R.id.hotelEmailET);

roomTypeET = findViewById(R.id.roomtypeET);

amenityET = findViewById(R.id.amenityET);

cancellationPolicyET = findViewById(R.id.cancellationPolicyET);

gcashNumberET = findViewById(R.id.gcashNumber);

gcashNameET = findViewById(R.id.gcashName);

reservationFeeET = findViewById(R.id.reservationFeeET);

postButton = findViewById(R.id.postButton);

cancelButton = findViewById(R.id.cancelButton);

TextInputEditText latitudeET = findViewById(R.id.latitudeET);

TextInputEditText longitudeET = findViewById(R.id.longitudeET);

tvClickableLink = findViewById(R.id.tvClickableLink);

tvClickableLink.setMovementMethod(LinkMovementMethod.getInstance());

roomTypeRecyclerView = findViewById(R.id.roomTypesRecyclerView);

BULACAN STATE UNIVERSITY MENESES CAMPUS 330


roomTypeAdapter = new RoomTypeAdapter(roomTypes, new

RoomTypeAdapter.OnRoomTypeDeleteListener() {

@Override

public void deleteRoomType(String roomType) {

getHotelId(new HotelIdCallback() {

@Override

public void onHotelIdReceived(String hotelId) {

if (hotelId != null) {

DatabaseReference hotelRef =

databaseReference.child("hotels").child(hotelId);

hotelRef.child("roomTypes").addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot

dataSnapshot) {

if (dataSnapshot.exists()) {

List<String> currentRoomTypes = new ArrayList<>();

for (DataSnapshot roomTypeSnapshot :

dataSnapshot.getChildren()) {

String existingRoomType =

roomTypeSnapshot.getValue(String.class);

if (!roomType.equals(existingRoomType)) {

currentRoomTypes.add(existingRoomType);

BULACAN STATE UNIVERSITY MENESES CAMPUS 331


updateRoomTypesInDatabase(hotelRef,

currentRoomTypes);

@Override

public void onCancelled(@NonNull DatabaseError

databaseError) {

Log.e("deleteRoomType", "Error: " +

databaseError.getMessage());

});

} else {

Log.e("deleteRoomType", "Hotel ID is null");

});

});

roomTypeRecyclerView.setLayoutManager(new LinearLayoutManager(this));

roomTypeRecyclerView.setAdapter(roomTypeAdapter);

roomTypeET = findViewById(R.id.roomtypeET);

Button addRoomTypeBtn = findViewById(R.id.addRoomTypeBtn);

addRoomTypeBtn.setOnClickListener(v -> {

String roomType = roomTypeET.getText().toString().trim();

BULACAN STATE UNIVERSITY MENESES CAMPUS 332


if (!roomType.isEmpty()) {

roomTypes.add(roomType);

roomTypeAdapter.notifyDataSetChanged();

roomTypeET.setText("");

});

FirebaseAuth auth = FirebaseAuth.getInstance();

FirebaseUser currentUser = auth.getCurrentUser();

userId = currentUser.getUid();

FirebaseStorage storage = FirebaseStorage.getInstance();

storageReference = storage.getReference();

FirebaseDatabase database = FirebaseDatabase.getInstance();

databaseReference = database.getReference();

adapter = new HotelImageSliderAdapter(this, imageUris, viewPager,

dotsLayout);

viewPager.setAdapter(adapter);

dotsLayout = findViewById(R.id.dotsLayout);

HotelImageSliderAdapter adapter = new HotelImageSliderAdapter(this,

imageUris, viewPager, dotsLayout);

viewPager.setAdapter(adapter);

viewPager.registerOnPageChangeCallback(new

ViewPager2.OnPageChangeCallback() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 333


@Override

public void onPageSelected(int position) {

super.onPageSelected(position);

adapter.updateDotsIndicator(position);

});

adapter.updateDotsIndicator(0);

galleryLauncher = registerForActivityResult(

new ActivityResultContracts.StartActivityForResult(),

result -> {

if (result.getResultCode() == Activity.RESULT_OK) {

Intent data = result.getData();

if (data != null && data.getData() != null) {

imageUri = data.getData();

imageUris.add(imageUri);

adapter.notifyDataSetChanged();

);

uploadButton.setOnClickListener(v -> openGallery());

postButton.setOnClickListener(v -> {

String hotelName = hotelNameET.getText().toString();

String hotelAddress = hotelAddET.getText().toString();

BULACAN STATE UNIVERSITY MENESES CAMPUS 334


String hotelDescription = hotelDescET.getText().toString();

String hotelContact = hotelContactET.getText().toString();

String hotelEmail = hotelEmailET.getText().toString();

String roomType = roomTypeET.getText().toString();

String cancellationPolicy = cancellationPolicyET.getText().toString();

String amenitiesHotel = amenityET.getText().toString();

String gcashNumber = gcashNumberET.getText().toString();

String gcashName = gcashNameET.getText().toString();

String reservationFee = reservationFeeET.getText().toString();

String latitude = latitudeET.getText().toString();

String longitude = longitudeET.getText().toString();

checkIfExists(userId, hotelName, hotelAddress, hotelDescription,

hotelContact, hotelEmail, roomTypes,

cancellationPolicy, imageUri, amenitiesHotel, gcashNumber,

gcashName, reservationFee, Double.parseDouble(latitude),

Double.parseDouble(longitude));

Intent intent = new Intent(this, MainActivity2.class);

intent.putExtra("fragmentToLoad", "HotelEditFragment");

startActivity(intent);

});

retrieve(userId);

addDotsIndicator(0);

BULACAN STATE UNIVERSITY MENESES CAMPUS 335


viewPager.registerOnPageChangeCallback(new

ViewPager2.OnPageChangeCallback() {

@Override

public void onPageSelected(int position) {

super.onPageSelected(position);

addDotsIndicator(position);

});

Log.d(TAG, "image upload triggeredd");

private void checkIfExists(String userId, String hotelName, String hotelAddress,

String hotelDescription,

String hotelContact, String hotelEmail, List<String> roomTypes,

String cancellationPolicy, Uri imageUri, String amenitiesHotel,

String gcashNumber, String gcashName, String reservationFee,

double latitude, double longitude) {

DatabaseReference hotelsRef = databaseReference.child("hotels");

Query query = hotelsRef.orderByChild("user_id").equalTo(userId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

// pag nag-eexist na, mag uupdate nalang yung existing data instead na

gumawa ng new

BULACAN STATE UNIVERSITY MENESES CAMPUS 336


public void onDataChange(@NonNull

com.google.firebase.database.DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

String existingHotelId =

dataSnapshot.getChildren().iterator().next().getKey();

update(hotelName, hotelAddress, hotelDescription, imageUris,

hotelContact, hotelEmail, roomTypes,

cancellationPolicy, existingHotelId, amenitiesHotel, gcashNumber,

gcashName, reservationFee, latitude, longitude);

adapter.setUris(imageUris);

adapter.notifyDataSetChanged();

Log.d(TAG, "hotel exists, id: " + userId);

} else {

// if hindi pa nag-eeexist, gagawa ng new data under "hotels"

create(userId, hotelName, hotelAddress, hotelDescription, hotelContact,

hotelEmail, roomTypes,

cancellationPolicy, imageUris, amenitiesHotel, gcashNumber,

gcashName, reservationFee, latitude, longitude);

adapter.setUris(imageUris);

adapter.notifyDataSetChanged();

Log.d(TAG, "hotel dont exist: .getText().getText() " + userId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 337


Log.e("check", "error" + databaseError.getMessage());

});

private void create(String userId, String hotelName, String hotelAddress, String

hotelDescription, String hotelContact, String hotelEmail,

List<String> roomTypes, String cancellationPolicy, List<Uri>

imageUris, String amenitiesHotel, String gcashNumber,

String gcashName, String reservationFee, double latitude, double

longitude) {

DatabaseReference hotelsRef = databaseReference.child("hotels");

DatabaseReference hotelRef = hotelsRef.push();

String hotelId = hotelRef.getKey();

List<String> imageUrls = new ArrayList<>();

AtomicInteger uploadCount = new AtomicInteger(0);

for (int i = 0; i < imageUris.size(); i++) {

final int finalIndex = i;

Uri imageUri = imageUris.get(i);

StorageReference imageRef = storageReference.child("hotel_images/" +

hotelId + "/image" + (i + 1));

Log.d(TAG, "Image Storage Reference: " + imageRef.toString());

UploadTask uploadTask = imageRef.putFile(imageUri);

uploadTask.addOnFailureListener(new MyFailureListener());

uploadTask.addOnSuccessListener(taskSnapshot -> {

BULACAN STATE UNIVERSITY MENESES CAMPUS 338


imageRef.getDownloadUrl().addOnCompleteListener(new

OnCompleteListener<Uri>() {

@Override

public void onComplete(@NonNull Task<Uri> task) {

String url = "https://" + task.getResult().getEncodedAuthority() +

task.getResult().getEncodedPath() + "?alt=media&token=" +

task.getResult().getQueryParameters("token").get(0);

imageUrls.add(url);

if (uploadCount.incrementAndGet() == imageUris.size()) {

save(hotelId, imageUrls, hotelName, hotelAddress,

hotelDescription, hotelContact,

hotelEmail, roomTypes, cancellationPolicy, amenitiesHotel,

gcashNumber, gcashName, reservationFee, latitude,longitude);

adapter.setUris(imageUris);

adapter.notifyDataSetChanged();

});

}).addOnFailureListener(e -> {

Log.e(TAG, "failed image uploadnumber: " + (finalIndex + 1) + ": " +

e.getMessage());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 339


}

private void update(String hotelName, String hotelAddress, String

hotelDescription, List<Uri> imageUris, String hotelContact,

String hotelEmail, List<String> roomTypes, String cancellationPolicy,

String hotelId, String amenitiesHotel,

String gcashNumber, String gcashName, String reservationFee, double

latitude, double longitude) {

DatabaseReference hotelsRef = databaseReference.child("hotels");

Query query = hotelsRef.orderByChild("user_id").equalTo(userId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull

com.google.firebase.database.DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

for (com.google.firebase.database.DataSnapshot childSnapshot :

dataSnapshot.getChildren()) {

String hotelId = childSnapshot.getKey();

DatabaseReference hotelRef = hotelsRef.child(hotelId);

hotelRef.child("name").setValue(hotelName);

hotelRef.child("address").setValue(hotelAddress);

hotelRef.child("description").setValue(hotelDescription);

hotelRef.child("contact").setValue(hotelContact);

hotelRef.child("email").setValue(hotelEmail);

BULACAN STATE UNIVERSITY MENESES CAMPUS 340


hotelRef.child("cancellationPolicy").setValue(cancellationPolicy);

hotelRef.child("amenities").setValue(amenitiesHotel);

hotelRef.child("gcashNumber").setValue(gcashNumber);

hotelRef.child("gcashName").setValue(gcashName);

hotelRef.child("reservationFee").setValue(reservationFee);

hotelRef.child("latitude").setValue(latitude);

hotelRef.child("longitude").setValue(longitude);

saveRoomTypes(hotelId, roomTypes);

if (!imageUris.isEmpty()) {

List<String> imageUrls = new ArrayList<>();

AtomicInteger uploadCount = new AtomicInteger(0);

CountDownLatch latch = new CountDownLatch(imageUris.size());

for (int i = 0; i < imageUris.size(); i++) {

Uri imageUri = imageUris.get(i);

if (imageUri != null) {

if (fileExists(imageUri)) {

StorageReference imageRef =

storageReference.child("hotel_images/" + hotelId + "/image" + (i + 1));

UploadTask uploadTask = imageRef.putFile(imageUri);

uploadTask.addOnSuccessListener(taskSnapshot -> {

BULACAN STATE UNIVERSITY MENESES CAMPUS 341


imageRef.getDownloadUrl().addOnSuccessListener(downloadUri -> {

String imageUrl = downloadUri.toString();

imageUrls.add(imageUrl);

if (uploadCount.incrementAndGet() ==

imageUris.size()) {

save(hotelId, imageUrls, hotelName, hotelAddress,

hotelDescription, hotelContact,

hotelEmail, roomTypes, cancellationPolicy,

amenitiesHotel, gcashNumber, gcashName, reservationFee, latitude, longitude);

latch.countDown();

}).addOnFailureListener(e -> {

Log.e("image upload", "Firebase Storage Error: " +

e.getMessage());

latch.countDown();

});

}).addOnFailureListener(e -> {

Log.e("image upload", "Error during upload: " +

e.getMessage());

latch.countDown();

});

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 342


Log.e(TAG, "Image file does not exist at Uri: " +

imageUri.toString());

latch.countDown();

} else {

Log.e(TAG, "ImageUri is null. Handle this case accordingly.");

latch.countDown();

try {

latch.await();

} catch (InterruptedException e) {

e.printStackTrace();

} else {

save(hotelId, null, hotelName, hotelAddress, hotelDescription,

hotelContact,

hotelEmail, roomTypes, cancellationPolicy, amenitiesHotel,

gcashNumber, gcashName, reservationFee, latitude, longitude);

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 343


public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("update", "error" + databaseError.getMessage());

});

private boolean fileExists(Uri uri) {

if (uri != null) {

File file = new File(uri.getPath());

return file.exists();

return false;

private void openGallery() {

// lalagyan natin to ng permission first

Intent galleryIntent = new Intent(Intent.ACTION_PICK,

MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

galleryLauncher.launch(galleryIntent);

private void save(String hotelId, List<String> imageUrls, String hotelName, String

hotelAddress, String hotelDescription,

String hotelContact, String hotelEmail, List<String> roomTypes, String

cancellationPolicy,

String amenitiesHotel, String gcashNumber, String gcashName, String

reservationFee, double latitude, double longitude) {

DatabaseReference hotelsRef = databaseReference.child("hotels");

BULACAN STATE UNIVERSITY MENESES CAMPUS 344


DatabaseReference hotelRef = hotelsRef.child(hotelId);

hotelRef.child("name").setValue(hotelName);

hotelRef.child("address").setValue(hotelAddress);

hotelRef.child("description").setValue(hotelDescription);

hotelRef.child("contact").setValue(hotelContact);

hotelRef.child("email").setValue(hotelEmail);

hotelRef.child("cancellationPolicy").setValue(cancellationPolicy);

hotelRef.child("user_id").setValue(userId);

hotelRef.child("amenities").setValue(amenitiesHotel);

hotelRef.child("gcashNumber").setValue(gcashNumber);

hotelRef.child("gcashName").setValue(gcashName);

hotelRef.child("reservationFee").setValue(reservationFee);

hotelRef.child("latitude").setValue(latitude);

hotelRef.child("longitude").setValue(longitude);

Map<String, Object> imagesMap = new HashMap<>();

for (int i = 0; i < imageUrls.size(); i++) {

imagesMap.put("image" + (i + 1), imageUrls.get(i));

hotelRef.child("images").setValue(imagesMap);

Map<String, Object> roomTypesMap = new HashMap<>();

for (int i = 0; i < roomTypes.size(); i++) {

roomTypesMap.put("roomType" + (i + 1), roomTypes.get(i));

BULACAN STATE UNIVERSITY MENESES CAMPUS 345


hotelRef.child("roomTypes").setValue(roomTypesMap);

private void retrieve(String userId) {

DatabaseReference hotelsRef = databaseReference.child("hotels");

Query query = hotelsRef.orderByChild("user_id").equalTo(userId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

DataSnapshot hotelSnapshot =

dataSnapshot.getChildren().iterator().next();

String title = hotelSnapshot.child("name").getValue(String.class);

String hotelAddress =

hotelSnapshot.child("address").getValue(String.class);

String description =

hotelSnapshot.child("description").getValue(String.class);

String hotelContact =

hotelSnapshot.child("contact").getValue(String.class);

String hotelEmail = hotelSnapshot.child("email").getValue(String.class);

String cancellationPolicy =

hotelSnapshot.child("cancellationPolicy").getValue(String.class);

String amenitiesHotel =

hotelSnapshot.child("amenities").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 346


String gcashNumber =

hotelSnapshot.child("gcashNumber").getValue(String.class);

String gcashName =

hotelSnapshot.child("gcashName").getValue(String.class);

String reservationfee =

hotelSnapshot.child("reservationFee").getValue(String.class);

Double latitudeDouble =

hotelSnapshot.child("latitude").getValue(Double.class);

Double longitudeDouble =

hotelSnapshot.child("longitude").getValue(Double.class);

String latitude = (latitudeDouble != null) ? latitudeDouble.toString() :

"defaultLatitude";

String longitude = (longitudeDouble != null) ?

longitudeDouble.toString() : "defaultLongitude";

Log.d(TAG, "Retrieved Latitude: " + latitude);

Log.d(TAG, "Retrieved Longitude: " + longitude);

DataSnapshot roomTypesSnapshot = hotelSnapshot.child("roomTypes");

List<String> roomTypes = new ArrayList<>();

for (DataSnapshot roomTypeSnapshot :

roomTypesSnapshot.getChildren()) {

String roomType = roomTypeSnapshot.getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 347


roomTypes.add(roomType);

List<String> imageUrls = new ArrayList<>();

DataSnapshot imagesSnapshot = hotelSnapshot.child("images");

for (DataSnapshot imageSnapshot : imagesSnapshot.getChildren()) {

String imageUrl = imageSnapshot.getValue(String.class);

imageUrls.add(imageUrl);

hotelNameET.setText(title);

hotelDescET.setText(description);

hotelAddET.setText(hotelAddress);

hotelContactET.setText(hotelContact);

hotelEmailET.setText(hotelEmail);

cancellationPolicyET.setText(cancellationPolicy);

amenityET.setText(amenitiesHotel);

gcashNumberET.setText(gcashNumber);

gcashNameET.setText(gcashName);

reservationFeeET.setText(reservationfee);

TextInputEditText latitudeET = findViewById(R.id.latitudeET);

TextInputEditText longitudeET = findViewById(R.id.longitudeET);

latitudeET.setText(String.valueOf(latitude));

longitudeET.setText(String.valueOf(longitude));

for (String imageUrl : imageUrls) {

imageUris.add(Uri.parse(imageUrl));

BULACAN STATE UNIVERSITY MENESES CAMPUS 348


adapter.setUris(imageUris);

adapter.notifyDataSetChanged();

roomTypeAdapter.setRoomTypes(roomTypes);

roomTypeAdapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("retrieve", "error" + databaseError.getMessage());

});

private void addDotsIndicator(int position) {

dots = new ImageView[imageUris.size()];

dotsLayout.removeAllViews();

for (int i = 0; i < dots.length; i++) {

dots[i] = new ImageView(this);

dots[i].setImageDrawable(ContextCompat.getDrawable(this,

R.drawable.dots_unselected));

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(

LinearLayout.LayoutParams.WRAP_CONTENT,

LinearLayout.LayoutParams.WRAP_CONTENT

);

params.setMargins(8, 0, 8, 0);

BULACAN STATE UNIVERSITY MENESES CAMPUS 349


dotsLayout.addView(dots[i], params);

if (dots.length > 0) {

dots[position].setImageDrawable(ContextCompat.getDrawable(this,

R.drawable.dots_selected));

private void saveRoomTypes(String hotelId, List<String> roomTypes) {

DatabaseReference roomTypesRef =

databaseReference.child("hotels").child(hotelId).child("roomTypes");

if (roomTypes != null) {

for (int i = 0; i < roomTypes.size(); i++) {

String roomType = roomTypes.get(i);

if (roomType != null) {

roomTypesRef.child("roomType" + (i + 1)).setValue(roomType);

private void deleteRoomType(String roomType) {

getHotelId(new HotelIdCallback() {

@Override

public void onHotelIdReceived(String hotelId) {

if (hotelId != null) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 350


DatabaseReference hotelRef =

databaseReference.child("hotels").child(hotelId);

hotelRef.child("roomTypes").addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

List<String> currentRoomTypes = new ArrayList<>();

for (DataSnapshot roomTypeSnapshot :

dataSnapshot.getChildren()) {

String existingRoomType =

roomTypeSnapshot.getValue(String.class);

if (!roomType.equals(existingRoomType)) {

currentRoomTypes.add(existingRoomType);

updateRoomTypesInDatabase(hotelRef, currentRoomTypes);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("deleteRoomType", "Error: " + databaseError.getMessage());

});

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 351


Log.e("deleteRoomType", "Hotel ID is null");

});

private void updateRoomTypesInDatabase(DatabaseReference hotelRef,

List<String> roomTypes) {

hotelRef.child("roomTypes").removeValue();

Map<String, Object> roomTypesMap = new HashMap<>();

for (int i = 0; i < roomTypes.size(); i++) {

roomTypesMap.put("roomType" + (i + 1), roomTypes.get(i));

hotelRef.child("roomTypes").updateChildren(roomTypesMap);

private void getHotelId(HotelIdCallback callback) {

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

DatabaseReference hotelRef =

FirebaseDatabase.getInstance().getReference("hotels");

Query query = hotelRef.orderByChild("user_id").equalTo(currentUserId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 352


public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

String hotelId = dataSnapshot.getChildren().iterator().next().getKey();

callback.onHotelIdReceived(hotelId);

} else {

callback.onHotelIdReceived(null);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

});

} else {

callback.onHotelIdReceived(null);

private interface HotelIdCallback {

void onHotelIdReceived(String hotelId);

public void goBack(View view) {

onBackPressed();

Restaurant Notifications [RestoNotifFragment]

public class RestoNotifFragment extends Fragment {

BULACAN STATE UNIVERSITY MENESES CAMPUS 353


public RestoNotifFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_resto_notif, container, false);

TabLayout tabLayout = view.findViewById(R.id.tabLayout);

tabLayout.addTab(tabLayout.newTab().setText("New"));

tabLayout.addTab(tabLayout.newTab().setText("Confirmed"));

tabLayout.addTab(tabLayout.newTab().setText("Declined"));

replaceFragment(new NewRestoNotifFragment());

tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener()

@Override

public void onTabSelected(TabLayout.Tab tab) {

switch (tab.getPosition()) {

case 0:

replaceFragment(new NewRestoNotifFragment());

break;

case 1:

replaceFragment(new ConfirmedRestoNotifFragment());

break;

case 2:

replaceFragment(new DeclinedRestoNotifFragment());

BULACAN STATE UNIVERSITY MENESES CAMPUS 354


break;

@Override

public void onTabUnselected(TabLayout.Tab tab) {

@Override

public void onTabReselected(TabLayout.Tab tab) {

});

return view;

private void replaceFragment(Fragment fragment) {

FragmentTransaction transaction =

getChildFragmentManager().beginTransaction();

transaction.replace(R.id.fragmentContainer, fragment);

transaction.addToBackStack(null);

transaction.commit();

Restaurant’s New Notifications [NewRestoNotif]

public class NewRestoNotifFragment extends Fragment {

private RecyclerView recyclerView;

private NewNotifAdapter2 adapter;

BULACAN STATE UNIVERSITY MENESES CAMPUS 355


private List<ReservationInfoModel> newRestoNotifList;

private String currentRestoUserId;

private DatabaseReference restaurantsRef;

private DatabaseReference reservationRef;

private ProgressBar loadingProgressBar;

private RelativeLayout emptyStateLayout;

public NewRestoNotifFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_new_resto_notif, container,

false);

loadingProgressBar = view.findViewById(R.id.loadingProgressBar);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setHasFixedSize(true);

recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

newRestoNotifList = new ArrayList<>();

adapter = new NewNotifAdapter2(newRestoNotifList, requireActivity());

recyclerView.setAdapter(adapter);

BULACAN STATE UNIVERSITY MENESES CAMPUS 356


restaurantsRef =

FirebaseDatabase.getInstance().getReference().child("restaurants");

reservationRef =

FirebaseDatabase.getInstance().getReference().child("reservation_info");

loadingProgressBar.setVisibility(View.VISIBLE);

recyclerView.setVisibility(View.GONE);

retrieveCurrentRestoUserId();

return view;

private void retrieveCurrentRestoUserId() {

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

Log.d("RestoNotifFragment", "currentUserId: " + currentUserId);

Query query =

restaurantsRef.orderByChild("user_id").equalTo(currentUserId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 357


public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

DataSnapshot restaurantSnapshot =

dataSnapshot.getChildren().iterator().next();

currentRestoUserId =

restaurantSnapshot.child("user_id").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " +

currentRestoUserId);

if (currentRestoUserId != null) {

retrieveReservationInformation(currentRestoUserId);

} else {

Log.e("RestoNotifFragment", "User is not associated with any hotel");

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

});

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 358


Log.e("RestoNotifFragment", "User is not logged in");

private void retrieveReservationInformation(String currentRestoUserId) {

Log.d("RestoNotifFragment", "Starting retrieve() with currentHotelUserId: " +

currentRestoUserId);

Query query =

reservationRef.orderByChild("restoUserId").equalTo(currentRestoUserId);

Log.d("RestoNotifFragment", "Query: " + query);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

newRestoNotifList.clear();

Log.d("RestoNotifFragment", "Data retrieved: " + currentRestoUserId);

for (DataSnapshot reservationSnapshot : dataSnapshot.getChildren()) {

// Check if "isPending" is true

boolean isPending =

reservationSnapshot.child("isPending").getValue(Boolean.class);

if (isPending) {

String reservationId = reservationSnapshot.getKey();

String userName =

reservationSnapshot.child("userName").getValue(String.class);

String fullName =

reservationSnapshot.child("fullName").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 359


String contactNumber =

reservationSnapshot.child("contactNumber").getValue(String.class);

String email =

reservationSnapshot.child("email").getValue(String.class);

Integer customers =

reservationSnapshot.child("customers").getValue(Integer.class);

String userId =

reservationSnapshot.child("userId").getValue(String.class);

String yGcashNumber =

reservationSnapshot.child("yGcashNumber").getValue(String.class);

String GcashName =

reservationSnapshot.child("GcashName").getValue(String.class);

String imageUrl =

reservationSnapshot.child("imageUrl").getValue(String.class);

String reservationDate =

reservationSnapshot.child("reservationDate").getValue(String.class);

String referenceNumber =

reservationSnapshot.child("referenceNumber").getValue(String.class);

String restoUserId =

reservationSnapshot.child("restoUserId").getValue(String.class);

String declineReason =

reservationSnapshot.child("declineReason").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

BULACAN STATE UNIVERSITY MENESES CAMPUS 360


ReservationInfoModel model = new

ReservationInfoModel(reservationId, false, true, false, userId, fullName,

reservationDate, customers, contactNumber, email,

GcashName, yGcashNumber, referenceNumber, restoUserId,

imageUrl, declineReason);

newRestoNotifList.add(model);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

loadingProgressBar.setVisibility(View.GONE);

updateEmptyStateVisibility();

} else {

loadingProgressBar.setVisibility(View.GONE);

adapter.notifyDataSetChanged();

Log.d("RestoNotifFragment", "retrieve() completed with

currentHotelUserId: " + currentRestoUserId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

BULACAN STATE UNIVERSITY MENESES CAMPUS 361


}

});

public void updateData(List<ReservationInfoModel> updatedData) {

newRestoNotifList.clear();

newRestoNotifList.addAll(updatedData);

adapter.notifyDataSetChanged();

public List<ReservationInfoModel> getRestoNotifList() {

return newRestoNotifList;

private void updateEmptyStateVisibility() {

if (newRestoNotifList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

Restaurant’s Confirmed Notifications [ConfirmedRestoNotif]

BULACAN STATE UNIVERSITY MENESES CAMPUS 362


public class ConfirmedRestoNotifFragment extends Fragment {

private RecyclerView recyclerView;

private ConfirmedNotifAdapter2 adapter;

private List<ReservationInfoModel> confirmedRestoNotifList;

private String currentRestoUserId;

private DatabaseReference restaurantsRef;

private DatabaseReference reservationRef;

private ProgressBar loadingProgressBar;

private RelativeLayout emptyStateLayout;

public ConfirmedRestoNotifFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_confirmed_resto_notif,

container, false);

loadingProgressBar = view.findViewById(R.id.loadingProgressBar);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setHasFixedSize(true);

recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

BULACAN STATE UNIVERSITY MENESES CAMPUS 363


confirmedRestoNotifList = new ArrayList<>();

adapter = new ConfirmedNotifAdapter2(confirmedRestoNotifList);

recyclerView.setAdapter(adapter);

restaurantsRef =

FirebaseDatabase.getInstance().getReference().child("restaurants");

reservationRef =

FirebaseDatabase.getInstance().getReference().child("reservation_info");

loadingProgressBar.setVisibility(View.VISIBLE);

recyclerView.setVisibility(View.GONE);

retrieveCurrentRestoUserId();

return view;

private void retrieveCurrentRestoUserId() {

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

Log.d("RestoNotifFragment", "currentUserId: " + currentUserId);

BULACAN STATE UNIVERSITY MENESES CAMPUS 364


Query query =

restaurantsRef.orderByChild("user_id").equalTo(currentUserId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

DataSnapshot restaurantSnapshot =

dataSnapshot.getChildren().iterator().next();

currentRestoUserId =

restaurantSnapshot.child("user_id").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " +

currentRestoUserId);

if (currentRestoUserId != null) {

retrieveReservationInformation(currentRestoUserId);

} else {

Log.e("RestoNotifFragment", "User is not associated with any hotel");

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 365


Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

});

} else {

Log.e("RestoNotifFragment", "User is not logged in");

private void retrieveReservationInformation(String currentRestoUserId) {

Log.d("RestoNotifFragment", "Starting retrieve() with currentHotelUserId: " +

currentRestoUserId);

Query query =

reservationRef.orderByChild("restoUserId").equalTo(currentRestoUserId);

Log.d("RestoNotifFragment", "Query: " + query);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

confirmedRestoNotifList.clear();

Log.d("RestoNotifFragment", "Data retrieved: " + currentRestoUserId);

for (DataSnapshot reservationSnapshot : dataSnapshot.getChildren()) {

// Check if "isPending" is true

boolean isConfirmed =

reservationSnapshot.child("isConfirmed").getValue(Boolean.class);

if (isConfirmed) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 366


String reservationId = reservationSnapshot.getKey();

String userName =

reservationSnapshot.child("userName").getValue(String.class);

String fullName =

reservationSnapshot.child("fullName").getValue(String.class);

String contactNumber =

reservationSnapshot.child("contactNumber").getValue(String.class);

String email =

reservationSnapshot.child("email").getValue(String.class);

Integer customers =

reservationSnapshot.child("customers").getValue(Integer.class);

String userId =

reservationSnapshot.child("userId").getValue(String.class);

String yGcashNumber =

reservationSnapshot.child("yGcashNumber").getValue(String.class);

String GcashName =

reservationSnapshot.child("GcashName").getValue(String.class);

String imageUrl =

reservationSnapshot.child("imageUrl").getValue(String.class);

String reservationDate =

reservationSnapshot.child("reservationDate").getValue(String.class);

String referenceNumber =

reservationSnapshot.child("referenceNumber").getValue(String.class);

String restoUserId =

reservationSnapshot.child("restoUserId").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 367


String declineReason =

reservationSnapshot.child("declineReason").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

ReservationInfoModel model = new

ReservationInfoModel(reservationId, false, true, false, userId, fullName,

reservationDate, customers, contactNumber, email,

GcashName, yGcashNumber, referenceNumber, restoUserId,

imageUrl, declineReason);

confirmedRestoNotifList.add(model);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

loadingProgressBar.setVisibility(View.GONE);

updateEmptyStateVisibility();

} else {

loadingProgressBar.setVisibility(View.GONE);

adapter.notifyDataSetChanged();

Log.d("RestoNotifFragment", "retrieve() completed with

currentHotelUserId: " + currentRestoUserId);

BULACAN STATE UNIVERSITY MENESES CAMPUS 368


}

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

});

public void updateData(List<ReservationInfoModel> updatedData) {

confirmedRestoNotifList.clear();

confirmedRestoNotifList.addAll(updatedData);

adapter.notifyDataSetChanged();

public List<ReservationInfoModel> getRestoNotifList() {

return confirmedRestoNotifList;

private void updateEmptyStateVisibility() {

if (confirmedRestoNotifList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 369


recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

Restaurant’s Declinied Notifications [DeclinedRestoNotif]

public class DeclinedRestoNotifFragment extends Fragment {

private RecyclerView recyclerView;

private DeclinedNotifAdapter2 adapter;

private List<ReservationInfoModel> declinedRestoNotifList;

private String currentRestoUserId;

private DatabaseReference restaurantsRef;

private DatabaseReference reservationRef;

private ProgressBar loadingProgressBar;

private RelativeLayout emptyStateLayout;

public DeclinedRestoNotifFragment() {

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_declined_resto_notif, container,

false);

BULACAN STATE UNIVERSITY MENESES CAMPUS 370


loadingProgressBar = view.findViewById(R.id.loadingProgressBar);

emptyStateLayout = view.findViewById(R.id.emptyStateLayout);

recyclerView = view.findViewById(R.id.recyclerView);

recyclerView.setHasFixedSize(true);

recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));

declinedRestoNotifList = new ArrayList<>();

adapter = new DeclinedNotifAdapter2(declinedRestoNotifList);

recyclerView.setAdapter(adapter);

restaurantsRef =

FirebaseDatabase.getInstance().getReference().child("restaurants");

reservationRef =

FirebaseDatabase.getInstance().getReference().child("reservation_info");

loadingProgressBar.setVisibility(View.VISIBLE);

recyclerView.setVisibility(View.GONE);

retrieveCurrentRestoUserId();

return view;

BULACAN STATE UNIVERSITY MENESES CAMPUS 371


}

private void retrieveCurrentRestoUserId() {

FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {

String currentUserId = currentUser.getUid();

Log.d("RestoNotifFragment", "currentUserId: " + currentUserId);

Query query =

restaurantsRef.orderByChild("user_id").equalTo(currentUserId);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

DataSnapshot restaurantSnapshot =

dataSnapshot.getChildren().iterator().next();

currentRestoUserId =

restaurantSnapshot.child("user_id").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " +

currentRestoUserId);

if (currentRestoUserId != null) {

retrieveReservationInformation(currentRestoUserId);

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 372


Log.e("RestoNotifFragment", "User is not associated with any hotel");

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

});

} else {

Log.e("RestoNotifFragment", "User is not logged in");

private void retrieveReservationInformation(String currentRestoUserId) {

Log.d("RestoNotifFragment", "Starting retrieve() with currentHotelUserId: " +

currentRestoUserId);

Query query =

reservationRef.orderByChild("restoUserId").equalTo(currentRestoUserId);

Log.d("RestoNotifFragment", "Query: " + query);

query.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

declinedRestoNotifList.clear();

BULACAN STATE UNIVERSITY MENESES CAMPUS 373


Log.d("RestoNotifFragment", "Data retrieved: " + currentRestoUserId);

for (DataSnapshot reservationSnapshot : dataSnapshot.getChildren()) {

// Check if "isPending" is true

Boolean isDeclinedObject =

reservationSnapshot.child("isDeclined").getValue(Boolean.class);

// Check if the booking is declined (taking care of null values)

boolean isDeclined = Boolean.TRUE.equals(isDeclinedObject);

if (isDeclined) {

String reservationId = reservationSnapshot.getKey();

String userName =

reservationSnapshot.child("userName").getValue(String.class);

String fullName =

reservationSnapshot.child("fullName").getValue(String.class);

String contactNumber =

reservationSnapshot.child("contactNumber").getValue(String.class);

String email =

reservationSnapshot.child("email").getValue(String.class);

Integer customers =

reservationSnapshot.child("customers").getValue(Integer.class);

String userId =

reservationSnapshot.child("userId").getValue(String.class);

String yGcashNumber =

reservationSnapshot.child("yGcashNumber").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 374


String GcashName =

reservationSnapshot.child("GcashName").getValue(String.class);

String imageUrl =

reservationSnapshot.child("imageUrl").getValue(String.class);

String reservationDate =

reservationSnapshot.child("reservationDate").getValue(String.class);

String referenceNumber =

reservationSnapshot.child("referenceNumber").getValue(String.class);

String restoUserId =

reservationSnapshot.child("restoUserId").getValue(String.class);

String declineReason =

reservationSnapshot.child("declineReason").getValue(String.class);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

ReservationInfoModel model = new

ReservationInfoModel(reservationId, false, true, false, userId, fullName,

reservationDate, customers, contactNumber, email, GcashName,

yGcashNumber, referenceNumber, restoUserId,imageUrl, declineReason);

declinedRestoNotifList.add(model);

Log.d("RestoNotifFragment", "Data retrieved: " + userName + ", " +

contactNumber + ", " + email);

loadingProgressBar.setVisibility(View.GONE);

BULACAN STATE UNIVERSITY MENESES CAMPUS 375


updateEmptyStateVisibility();

} else {

loadingProgressBar.setVisibility(View.GONE);

adapter.notifyDataSetChanged();

Log.d("RestoNotifFragment", "retrieve() completed with

currentHotelUserId: " + currentRestoUserId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("RestoNotifFragment", "Database error: " +

databaseError.getMessage());

});

public void updateData(List<ReservationInfoModel> updatedData) {

declinedRestoNotifList.clear();

declinedRestoNotifList.addAll(updatedData);

adapter.notifyDataSetChanged();

BULACAN STATE UNIVERSITY MENESES CAMPUS 376


private void updateEmptyStateVisibility() {

if (declinedRestoNotifList.isEmpty()) {

recyclerView.setVisibility(View.GONE);

emptyStateLayout.setVisibility(View.VISIBLE);

} else {

recyclerView.setVisibility(View.VISIBLE);

emptyStateLayout.setVisibility(View.GONE);

public List<ReservationInfoModel> getRestoNotifList() {

return declinedRestoNotifList;

Hotel Chat System List [MsgFragment]

public class HotelMsgFragment extends Fragment {

private static final String TAG= "HotelMsgFragment";

private RecyclerView chatHistoryRV;

private ChatAdapter chatAdapter;

private String chatRoomId;

private List<ChatModel> chatHistoryList;

private FirebaseUser currentUser;

private DatabaseReference chatRoomsRef;

private DatabaseReference usersRef;

BULACAN STATE UNIVERSITY MENESES CAMPUS 377


private Map<String, String> lastMsgMap;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_hotel_msg, container, false);

currentUser = FirebaseAuth.getInstance().getCurrentUser();

chatHistoryRV = view.findViewById(R.id.chatRV);

chatHistoryList = new ArrayList<>();

lastMsgMap = new HashMap<>();

chatAdapter = new ChatAdapter(chatHistoryList);

chatHistoryRV.setAdapter(chatAdapter);

chatHistoryRV.setLayoutManager(new LinearLayoutManager(getContext()));

chatRoomsRef = FirebaseDatabase.getInstance().getReference("chat_rooms");

usersRef = FirebaseDatabase.getInstance().getReference("users");

retrieveChatRooms();

return view;

BULACAN STATE UNIVERSITY MENESES CAMPUS 378


private void retrieveChatRooms() {

chatRoomsRef.addValueEventListener(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

chatHistoryList.clear();

for (DataSnapshot chatSnapshot : dataSnapshot.getChildren()) {

String chatRoomId = chatSnapshot.getKey();

if (chatRoomId != null) {

isCurrentUserParticipant(chatSnapshot, chatRoomId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e(TAG, "Database Error: " + databaseError.getMessage());

});

private void isCurrentUserParticipant(DataSnapshot chatSnapshot, String

chatRoomId) {

DataSnapshot participantsSnapshot = chatSnapshot.child("participants");

if (participantsSnapshot.hasChild(currentUser.getUid())) {

Log.d(TAG, "Retrieved Chat Room ID: " + chatRoomId);

BULACAN STATE UNIVERSITY MENESES CAMPUS 379


retrieveLatestMessage(chatRoomId);

private void retrieveLatestMessage(String chatRoomId) {

Log.d(TAG, "Retrieving latest message for chatRoomId: " + chatRoomId);

DatabaseReference messagesRef =

chatRoomsRef.child(chatRoomId).child("messages");

messagesRef.orderByChild("timestamp").limitToLast(1).addChildEventListener(new

ChildEventListener() {

@Override

public void onChildAdded(DataSnapshot dataSnapshot, String s) {

ChatModel chatModel = dataSnapshot.getValue(ChatModel.class);

if (chatModel != null) {

chatModel.setChatRoomId(chatRoomId);

String receiverId = chatModel.getReceiverId();

lastMsgMap.put(receiverId, chatModel.getLastMessage());

chatModel.setReceiverId(receiverId);

chatModel.setSenderId(currentUser.getUid());

retrieveReceiverName(receiverId, chatModel);

BULACAN STATE UNIVERSITY MENESES CAMPUS 380


chatHistoryList.add(chatModel);

chatAdapter.notifyDataSetChanged();

@Override

public void onChildChanged(DataSnapshot dataSnapshot, String s) {

@Override

public void onChildRemoved(DataSnapshot dataSnapshot) {

@Override

public void onChildMoved(DataSnapshot dataSnapshot, String s) {

@Override

public void onCancelled(DatabaseError databaseError) {

});

private void retrieveReceiverName(String receiverId, ChatModel chatModel) {

if (receiverId != null) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 381


usersRef.child(receiverId).addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

String receiverName =

dataSnapshot.child("recipientUserName").getValue(String.class);

if (receiverName != null) {

chatModel.setRecipientUserName(receiverName);

Log.d(TAG, "receiverId: " + chatModel.getReceiverId());

Log.d(TAG, "receiverName: " + receiverName);

chatAdapter.notifyDataSetChanged();

@Override

public void onCancelled(DatabaseError databaseError) {

});

} else {

Log.e(TAG, "ReceiverId is null");

BULACAN STATE UNIVERSITY MENESES CAMPUS 382


}

Chat Room [TouristHotelChat]

public class TouristHotelChat extends AppCompatActivity {

private RecyclerView messageRecyclerView;

private MessageAdapter messageAdapter;

private List<MessageModel> messageList;

private EditText messageEditText;

private ImageButton sendButton;

private DatabaseReference databaseReference;

private FirebaseUser currentUser;

private String recipientUserId, chatRoomId, currentUserName, senderId,

recipientUserName, senderProfilePic, recipientProfilePic;

private TextView recipientNameTextView;

private static final String TAG= "TouristHotelChat";

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_tourist_hotel_chat);

databaseReference = FirebaseDatabase.getInstance().getReference();

currentUser = FirebaseAuth.getInstance().getCurrentUser();

BULACAN STATE UNIVERSITY MENESES CAMPUS 383


recipientUserId = getIntent().getStringExtra("recipientUserId"); // nanggaling sa

DynamicHotel at BookingDetail

recipientUserName = getIntent().getStringExtra("recipientUserName"); //

nanggaling sa DynamicHotel at BookingDetail

currentUserName = getIntent().getStringExtra("currentUserName");

Log.d(TAG, "Recipient recipient user ID: " + recipientUserId);

Log.d(TAG, "Recipient Current user name: " + currentUserName);

Log.d(TAG, "Recipient recipient user name: " + recipientUserName);

chatRoomId = generateUniqueChatRoomId(currentUser.getUid(),

recipientUserId);

Log.d(TAG, "Generated Chat Room ID: " + chatRoomId);

createChatRoom(chatRoomId);

messageRecyclerView = findViewById(R.id.messageRecyclerView);

LinearLayoutManager layoutManager = new LinearLayoutManager(this);

layoutManager.setStackFromEnd(true);

messageRecyclerView.setLayoutManager(layoutManager);

messageList = new ArrayList<>();

messageAdapter = new MessageAdapter(messageList, currentUser.getUid());

messageRecyclerView.setAdapter(messageAdapter);

messageEditText = findViewById(R.id.messageEditText);

sendButton = findViewById(R.id.sendButton);

sendButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 384


sendMessage();

});

listenForMessages(chatRoomId);

DatabaseReference categoryRef = databaseReference.child("users");

categoryRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (dataSnapshot.child("Hotel").hasChild(recipientUserId)) {

retrieveRecipientName("Hotel", recipientUserId);

} else if (dataSnapshot.child("Tourist").hasChild(recipientUserId)) {

retrieveRecipientName("Tourist", recipientUserId);

} else if (dataSnapshot.child("Restaurant").hasChild(recipientUserId)) {

retrieveRecipientName("Restaurant", recipientUserId);

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

});

private void sendMessage() {

String messageText = messageEditText.getText().toString().trim();

if (!messageText.isEmpty()) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 385


String messageId = generateId();

long timestamp = System.currentTimeMillis();

MessageModel message = new MessageModel(messageText,

currentUser.getUid(), recipientUserId, currentUserName, recipientUserName,

messageId, timestamp, senderProfilePic, recipientProfilePic);

String chatRoomPath = "chat_rooms/" + chatRoomId + "/messages";

DatabaseReference chatRoomRef = databaseReference.child(chatRoomPath);

chatRoomRef.child(messageId).setValue(message);

messageEditText.setText("");

Log.d(TAG, "Sent Message:");

Log.d(TAG, "Message Text: " + messageText);

Log.d(TAG, "Message ID: " + messageId);

Log.d(TAG, "Sender ID: " + currentUser);

private void listenForMessages(String chatRoomId) {

String chatRoomPath = "chat_rooms/" + chatRoomId + "/messages";

DatabaseReference chatRoomRef = databaseReference.child(chatRoomPath);

chatRoomRef.addChildEventListener(new ChildEventListener() {

@Override

public void onChildAdded(@NonNull DataSnapshot dataSnapshot, String s) {

MessageModel message = dataSnapshot.getValue(MessageModel.class);

if (message != null) {

messageList.add(message);

BULACAN STATE UNIVERSITY MENESES CAMPUS 386


messageAdapter.notifyDataSetChanged();

messageRecyclerView.scrollToPosition(messageList.size() - 1);

@Override

public void onChildChanged(@NonNull DataSnapshot dataSnapshot, String

s) {

@Override

public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {

@Override

public void onChildMoved(@NonNull DataSnapshot dataSnapshot, String s)

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

});

private String generateUniqueChatRoomId(String senderId, String receiverId) {

String sortedUserIds = Stream.of(senderId, receiverId)

.filter(Objects::nonNull)

.sorted()

.collect(Collectors.joining("_"));

BULACAN STATE UNIVERSITY MENESES CAMPUS 387


return "chat_" + sortedUserIds;

private void createChatRoom(String chatRoomId) {

String chatRoomPath = "chat_rooms/" + chatRoomId;

DatabaseReference chatRoomRef = databaseReference.child(chatRoomPath);

chatRoomRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

if (!dataSnapshot.exists()) {

Map<String, Object> participants = new HashMap<>();

participants.put(currentUser.getUid(), true);

participants.put(recipientUserId, true);

Map<String, Object> chatRoom = new HashMap<>();

chatRoom.put("participants", participants);

if (chatRoom != null) {

chatRoomRef.setValue(chatRoom);

} else {

Log.e(TAG, "chatRoom is null");

@Override

BULACAN STATE UNIVERSITY MENESES CAMPUS 388


public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e(TAG, "onCancelled: " + databaseError.getMessage());

});

private String generateId() {

SimpleDateFormat dateFormat = new

SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.getDefault());

Date currentDate = new Date();

return "message_" + dateFormat.format(currentDate);

private void retrieveRecipientName(String category, String userId) {

String recipientNamePath = "users/" + category + "/" + userId + "/name";

DatabaseReference recipientNameRef =

databaseReference.child(recipientNamePath);

recipientNameRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

Log.d("TouristHotelChat", "onDatachange called ");

if (dataSnapshot.exists()) {

String recipientName = dataSnapshot.getValue(String.class);

TextView recipientNameTextView =

findViewById(R.id.recipientNameTextView);

recipientNameTextView.setText(recipientName);

Log.d("TouristHotelChat", "recipientName: " + recipientName);

BULACAN STATE UNIVERSITY MENESES CAMPUS 389


}

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

});

public void goBack(View view) {

onBackPressed();

Dynamic Hotel Map [DynamicHotelMap]

public class DynamicHotelMap extends AppCompatActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_dynamic_hotel_map);

Intent intent = getIntent();

if (intent != null) {

String hotelId = intent.getStringExtra("hotelId");

if (hotelId != null) {

queryHotelDetails(hotelId);

} else {

BULACAN STATE UNIVERSITY MENESES CAMPUS 390


Toast.makeText(DynamicHotelMap.this, "Hotel ID is null",

Toast.LENGTH_SHORT).show();

private void queryHotelDetails(String hotelId) {

DatabaseReference hotelRef =

FirebaseDatabase.getInstance().getReference().child("hotels").child(hotelId);

hotelRef.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(DataSnapshot dataSnapshot) {

if (dataSnapshot.exists()) {

String hotelName = dataSnapshot.child("name").getValue(String.class);

double latitude = dataSnapshot.child("latitude").getValue(Double.class);

double longitude =

dataSnapshot.child("longitude").getValue(Double.class);

showAlertDialog(hotelName, latitude, longitude);

@Override

public void onCancelled(DatabaseError databaseError) {

Toast.makeText(DynamicHotelMap.this, "Database error: " +

databaseError.getMessage(), Toast.LENGTH_SHORT).show();

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 391


}

private void showAlertDialog(String hotelName, double latitude, double longitude)

AlertDialog.Builder builder = new AlertDialog.Builder(this);

builder.setTitle("PLEASE TAKE NOTE");

builder.setMessage("The map coordinates for " + hotelName + " may not be

accurate. Please consider manually searching for the location if it's incorrect.");

builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

directionFromCurrentMap(latitude, longitude);

});

builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

dialog.dismiss();

finish();

});

builder.show();

private void directionFromCurrentMap(double destinationLatitude, double

destinationLongitude) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 392


Uri mapUri = Uri.parse("https://maps.google.com/maps?daddr=" +

destinationLatitude + "," + destinationLongitude);

Intent intent = new Intent(Intent.ACTION_VIEW, mapUri);

startActivity(intent);

finish();

Hotel’s Profile Page [HotelProfileFragment]

public class HotelProfileFragment extends Fragment {

private TextView name;

private TextView email;

private TextView logout;

private CircleImageView profilepic;

@Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_hotel_profile, container, false);

name = view.findViewById(R.id.tv_name);

email = view.findViewById(R.id.tv_email);

logout = view.findViewById(R.id.logout_button);

profilepic = view.findViewById(R.id.iv_profilepic);

retrieveAndDisplayUserInfo();

logout.setOnClickListener(new View.OnClickListener() {

BULACAN STATE UNIVERSITY MENESES CAMPUS 393


@Override

public void onClick(View v) {

logoutUser();

});

FloatingActionButton picButton = view.findViewById(R.id.pic_Button);

picButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

onSelectProfilePictureClick(v);

});

TextView termsTextView = view.findViewById(R.id.termsbtn);

termsTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), TermsOfUse.class);

startActivity(intent);

});

TextView privacyTextView = view.findViewById(R.id.privacybtn);

BULACAN STATE UNIVERSITY MENESES CAMPUS 394


privacyTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), PrivacyPolicy.class);

startActivity(intent);

});

TextView contactTextView = view.findViewById(R.id.contactbtn);

contactTextView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), ContactUs.class);

startActivity(intent);

});

TextView tutorialsbtnView = view.findViewById(R.id.tutorialsbtn);

tutorialsbtnView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

Intent intent = new Intent(getActivity(), Tutorials.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 395


startActivity(intent);

});

return view;

public void onSelectProfilePictureClick(View view) {

Intent intent = new Intent(Intent.ACTION_PICK);

intent.setType("image/*");

startActivityForResult(intent, 1);

@Override

public void onActivityResult(int requestCode, int resultCode, @Nullable Intent

data) {

super.onActivityResult(requestCode, resultCode, data);

if (requestCode == 1 && resultCode == RESULT_OK && data != null) {

Uri imageUri = data.getData();

uploadProfilePictureToStorage(imageUri);

private void uploadProfilePictureToStorage(Uri imageUri) {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

StorageReference storageRef = FirebaseStorage.getInstance().getReference();

BULACAN STATE UNIVERSITY MENESES CAMPUS 396


StorageReference profilePicsRef =

storageRef.child("profile_pictures").child(userId);

UploadTask uploadTask = profilePicsRef.putFile(imageUri);

uploadTask.addOnSuccessListener(taskSnapshot -> {

profilePicsRef.getDownloadUrl().addOnSuccessListener(uri -> {

String profilePictureUrl = uri.toString();

saveProfilePictureUrlToFirebase(profilePictureUrl);

});

});

private void saveProfilePictureUrlToFirebase(String profilePictureUrl) {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

DatabaseReference userRef =

FirebaseDatabase.getInstance().getReference("users").child("Hotel").child(userId);

HashMap<String, Object> userData = new HashMap<>();

userData.put("profilePictureUrl", profilePictureUrl);

userRef.updateChildren(userData).addOnSuccessListener(aVoid -> {

Picasso.get().load(profilePictureUrl).into(profilepic);

}).addOnFailureListener(e -> {

});

private void retrieveAndDisplayUserInfo() {

String userId = FirebaseAuth.getInstance().getCurrentUser().getUid();

BULACAN STATE UNIVERSITY MENESES CAMPUS 397


DatabaseReference userRef =

FirebaseDatabase.getInstance().getReference("users");

userRef.child("Hotel").child(userId).addListenerForSingleValueEvent(new

ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot snapshot) {

if (snapshot.exists()) {

String nameValue = snapshot.child("name").getValue(String.class);

String emailValue = snapshot.child("email").getValue(String.class);

String profilePictureUrl =

snapshot.child("profilePictureUrl").getValue(String.class);

if (getActivity() != null) {

getActivity().runOnUiThread(new Runnable() {

@Override

public void run() {

name.setText(nameValue);

email.setText(emailValue);

Picasso.get().load(profilePictureUrl).into(profilepic);

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 398


@Override

public void onCancelled(@NonNull DatabaseError error) {

Log.e("ProfileError", "Database error: " + error.getMessage());

});

private void logoutUser() {

AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());

builder.setMessage("Are you sure you want to log out?")

.setPositiveButton("Yes", (dialogInterface, i) -> {

FirebaseAuth.getInstance().signOut();

Intent intent = new Intent(getActivity(), MainActivityRegister.class);

startActivity(intent);

getActivity().finish();

})

.setNegativeButton("No", (dialogInterface, i) -> dialogInterface.dismiss())

.show();

Admin Login [Admin]

public class Login extends AppCompatActivity {

private TextInputEditText emailEditText, passwordEditText;

private Button loginButton;

private ProgressBar progressBar;

private FirebaseAuth mAuth;

private static final String ADMIN_EMAIL = "///@gmail.com";

BULACAN STATE UNIVERSITY MENESES CAMPUS 399


private static final String ADMIN_PASSWORD = "";

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_login);

mAuth = FirebaseAuth.getInstance();

emailEditText = findViewById(R.id.login_email);

passwordEditText = findViewById(R.id.login_password);

loginButton = findViewById(R.id.login_button);

progressBar = findViewById(R.id.progressBar);

loginButton.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View v) {

loginUser();

});

private void loginUser() {

String email = emailEditText.getText().toString().trim();

String password = passwordEditText.getText().toString().trim();

if (email.isEmpty() || password.isEmpty()) {

Toast.makeText(this, "Please fill in all fields", Toast.LENGTH_SHORT).show();

return;

progressBar.setVisibility(View.VISIBLE);

BULACAN STATE UNIVERSITY MENESES CAMPUS 400


if (email.equals(ADMIN_EMAIL)) {

mAuth.signInWithEmailAndPassword(email, password)

.addOnCompleteListener(new OnCompleteListener<AuthResult>() {

@Override

public void onComplete(@NonNull Task<AuthResult> task) {

progressBar.setVisibility(View.GONE);

if (task.isSuccessful()) {

Intent intent = new Intent(Login.this, MainActivity.class);

startActivity(intent);

finish();

} else {

Toast.makeText(Login.this, "Authentication failed.",


Toast.LENGTH_SHORT).show();

});

} else {

progressBar.setVisibility(View.GONE);

Toast.makeText(Login.this, "Authentication failed.", Toast.LENGTH_SHORT).show();

Admin Forms List [MainActivity]

public class MainActivity extends AppCompatActivity {

private FirebaseAuth mAuth;

private DatabaseReference mDatabaseReference;

private RecyclerView recyclerView;

private FormAdapter formAdapter;

private List<FormModel> formList;

BULACAN STATE UNIVERSITY MENESES CAMPUS 401


@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

mAuth = FirebaseAuth.getInstance();

FirebaseUser currentUser = mAuth.getCurrentUser();

formList = new ArrayList<>();

recyclerView = findViewById(R.id.recyclerView);

if (currentUser != null) {

String uid = currentUser.getUid();

mDatabaseReference = FirebaseDatabase.getInstance().getReference("users");

Query hotelQuery = mDatabaseReference.child("Hotel");

Query restaurantQuery = mDatabaseReference.child("Restaurant");

Log.d("FirebaseDebug", "User UID: " + uid);

hotelQuery.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

Log.d("FirebaseDebug", "Hotel Query: DataSnapshot count = " +


dataSnapshot.getChildrenCount());

for (DataSnapshot snapshot : dataSnapshot.getChildren()) {

String uid = snapshot.getKey();

String email = snapshot.child("email").getValue(String.class);

String name = snapshot.child("name").getValue(String.class);

String birUrl = snapshot.child("bir").getValue(String.class);

String tinUrl = snapshot.child("tin").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 402


String dtiUrl = snapshot.child("dti").getValue(String.class);

Boolean isValidated = snapshot.child("isValidated").getValue(Boolean.class);

if (isValidated != null && isValidated.booleanValue()) {

Log.d("MainActivity", "isValidated: true");

} else {

Log.d("MainActivity", "isValidated: false");

isValidated = false;

Log.d("MainActivity", "uid: " + uid);

Log.d("MainActivity", "email: " + email);

Log.d("MainActivity", "name: " + name);

Log.d("MainActivity", "bir: " + birUrl);

Log.d("MainActivity", "tin: " + tinUrl);

Log.d("MainActivity", "dti: " + dtiUrl);

FormModel formModel = new FormModel(name, email, birUrl, tinUrl, dtiUrl,


isValidated, uid);

formList.add(formModel);

formAdapter.notifyDataSetChanged();

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("FirebaseDebug", "Hotel Query: onCancelled",


databaseError.toException());

});

BULACAN STATE UNIVERSITY MENESES CAMPUS 403


restaurantQuery.addListenerForSingleValueEvent(new ValueEventListener() {

@Override

public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

Log.d("FirebaseDebug", "Restaurant Query: DataSnapshot count = " +


dataSnapshot.getChildrenCount());

for (DataSnapshot snapshot : dataSnapshot.getChildren()) {

String uid = snapshot.getKey();

String email = snapshot.child("email").getValue(String.class);

String name = snapshot.child("name").getValue(String.class);

String birUrl = snapshot.child("bir").getValue(String.class);

String tinUrl = snapshot.child("tin").getValue(String.class);

String dtiUrl = snapshot.child("dti").getValue(String.class);

Boolean isValidated = snapshot.child("isValidated").getValue(Boolean.class);

if (isValidated != null) {

boolean isValid = isValidated;

Log.d("MainActivity", "isValidated: " + isValid);

} else {

Log.e("MainActivity", "isValidated is null or has no value.");

Log.d("MainActivity", "email: " + email);

Log.d("MainActivity", "name: " + name);

Log.d("MainActivity", "bir: " + birUrl);

Log.d("MainActivity", "tin: " + tinUrl);

Log.d("MainActivity", "tdtiin: " + dtiUrl);

FormModel formModel = new FormModel(name, email, birUrl, tinUrl, tinUrl,


isValidated, uid);

formList.add(formModel);

formAdapter.notifyDataSetChanged();

BULACAN STATE UNIVERSITY MENESES CAMPUS 404


}

@Override

public void onCancelled(@NonNull DatabaseError databaseError) {

Log.e("FirebaseDebug", "Restaurant Query: onCancelled",


databaseError.toException());

});

formAdapter = new FormAdapter(formList);

recyclerView.setLayoutManager(new LinearLayoutManager(this));

recyclerView.setAdapter(formAdapter);

ImageView archiveImageView = findViewById(R.id.archiveImageView);

archiveImageView.setOnClickListener(new View.OnClickListener() {

@Override

public void onClick(View view) {

Intent intent = new Intent(MainActivity.this, Archive.class);

startActivity(intent);

});

Detailed Signup Forms Submissions [DetailedForm]


public class DetailedForm extends AppCompatActivity {
private DatabaseReference mDatabaseReference;
private FirebaseAuth mAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detailed_form);

BULACAN STATE UNIVERSITY MENESES CAMPUS 405


String uid = getIntent().getStringExtra("uid");
String name = getIntent().getStringExtra("name");
String email = getIntent().getStringExtra("email");
String birUrl = getIntent().getStringExtra("birUrl");
String tinUrl = getIntent().getStringExtra("tinUrl");
String dtiUrl = getIntent().getStringExtra("dtiUrl");
boolean isValidated = getIntent().getBooleanExtra("isValidated", false);

Log.d("DetailedForm", "uid: " + uid);


Log.d("DetailedForm", "name: " + name);
Log.d("DetailedForm", "email: " + email);
Log.d("DetailedForm", "birUrl: " + birUrl);
Log.d("DetailedForm", "tinUrl: " + tinUrl);
Log.d("DetailedForm", "dtiUrl: " + dtiUrl);
Log.d("DetailedForm", "isValidated: " + isValidated);

mAuth = FirebaseAuth.getInstance();
mDatabaseReference = FirebaseDatabase.getInstance().getReference("users");

TextView nameTextView = findViewById(R.id.detailed_name);


TextView emailTextView = findViewById(R.id.detailed_email);
ImageView birImageView = findViewById(R.id.detailed_bir_image);
ImageView tinImageView = findViewById(R.id.detailed_tin_image);
ImageView dtiImageView = findViewById(R.id.detailed_dti_image);

nameTextView.setText(name);
emailTextView.setText(email);
Picasso.get().load(birUrl).into(birImageView);
Picasso.get().load(tinUrl).into(tinImageView);

BULACAN STATE UNIVERSITY MENESES CAMPUS 406


Picasso.get().load(dtiUrl).into(dtiImageView);

Button validateButton = findViewById(R.id.validateButton);


validateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d("DetailedForm", "Validate button clicked.");
FirebaseUser currentUser = mAuth.getCurrentUser();

if (currentUser != null) {
new AlertDialog.Builder(DetailedForm.this)
.setTitle("Confirm Verification")
.setMessage("Are you sure you want to verify this user?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
DatabaseReference hotelReference =
mDatabaseReference.child("Hotel").child(uid);
DatabaseReference restaurantReference =
mDatabaseReference.child("Restaurant").child(uid);

hotelReference.addListenerForSingleValueEvent(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot
dataSnapshot) {
if (dataSnapshot.exists()) {
hotelReference.child("isValidated").setValue(true);
showToast("User successfully verified!");
Log.d("DetailedForm", "isValidated: true");
}
}

BULACAN STATE UNIVERSITY MENESES CAMPUS 407


@Override
public void onCancelled(@NonNull DatabaseError
databaseError) {
Log.e("DetailedForm", "Validation failed: " +
databaseError.getMessage());
showToast("Verification failed. Please try again.");
}
});

restaurantReference.addListenerForSingleValueEvent(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot
dataSnapshot) {
if (dataSnapshot.exists()) {
restaurantReference.child("isValidated").setValue(true);
showToast("User successfully verified!");
Log.d("DetailedForm", "isValidated: true");
}
}
@Override
public void onCancelled(@NonNull DatabaseError
databaseError) {
Log.e("DetailedForm", "Validation failed: " +
databaseError.getMessage());
showToast("Verification failed. Please try again.");
}
});
}
})
.setNegativeButton("No", null)

BULACAN STATE UNIVERSITY MENESES CAMPUS 408


.show();
} else {
Log.e("DetailedForm", "User is not authenticated");
showToast("Verification failed. Please try again.");
}
}
});

Button declineButton = findViewById(R.id.declineButton);


declineButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Log.d("DetailedForm", "Decline button clicked.");
FirebaseUser currentUser = mAuth.getCurrentUser();

if (currentUser != null) {
new AlertDialog.Builder(DetailedForm.this)
.setTitle("Confirm Decline")
.setMessage("Are you sure you want to decline this user?")
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
DatabaseReference hotelReference =
mDatabaseReference.child("Hotel").child(uid);
DatabaseReference restaurantReference =
mDatabaseReference.child("Restaurant").child(uid);
hotelReference.addListenerForSingleValueEvent(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot
dataSnapshot) {
if (dataSnapshot.exists()) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 409


hotelReference.removeValue();
showToast("User declined and removed from the
database!");
Log.d("DetailedForm", "User declined and removed
from the database.");
finish();
}
}
@Override
public void onCancelled(@NonNull DatabaseError
databaseError) {
Log.e("DetailedForm", "Decline failed: " +
databaseError.getMessage());
showToast("Decline failed. Please try again.");
}
});
restaurantReference.addListenerForSingleValueEvent(new
ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot
dataSnapshot) {
if (dataSnapshot.exists()) {
restaurantReference.removeValue();
showToast("User declined and removed from the
database!");
Log.d("DetailedForm", "User declined and removed
from the database.");
finish();
}
}
@Override
public void onCancelled(@NonNull DatabaseError
databaseError) {

BULACAN STATE UNIVERSITY MENESES CAMPUS 410


Log.e("DetailedForm", "Decline failed: " +
databaseError.getMessage());
showToast("Decline failed. Please try again.");
}
});
}
})
.setNegativeButton("No", null)
.show();
} else {
Log.e("DetailedForm", "User is not authenticated");
showToast("Decline failed. Please try again.");
}
}
});
}
private void showToast(String message) {
Toast.makeText(DetailedForm.this, message, Toast.LENGTH_SHORT).show();
}
public void goBack(View view) {
onBackPressed();
}
}
Archived Forms after Verifying/Declining [Archive]
public class Archive extends AppCompatActivity {

private DatabaseReference mDatabaseReference;


private RecyclerView recyclerView;
private FormAdapter2 formAdapter;
private List<FormModel> formList2;

BULACAN STATE UNIVERSITY MENESES CAMPUS 411


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_archive);

formList2 = new ArrayList<>();


recyclerView = findViewById(R.id.archiveRecyclerView);

mDatabaseReference = FirebaseDatabase.getInstance().getReference("users");
FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();

if (currentUser != null) {
String uid = currentUser.getUid();

Query hotelQuery =
mDatabaseReference.child("Hotel").orderByChild("isValidated").equalTo(true);
Query restaurantQuery =
mDatabaseReference.child("Restaurant").orderByChild("isValidated").equalTo(true);

Log.d("FirebaseDebug", "User UID: " + uid);

hotelQuery.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
handleDataSnapshot(dataSnapshot);
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Log.e("FirebaseDebug", "Hotel Query: onCancelled",
databaseError.toException());
}

BULACAN STATE UNIVERSITY MENESES CAMPUS 412


});

restaurantQuery.addListenerForSingleValueEvent(new ValueEventListener()
{
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
handleDataSnapshot(dataSnapshot);
}

@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
Log.e("FirebaseDebug", "Restaurant Query: onCancelled",
databaseError.toException());
}
});

formAdapter = new FormAdapter2(formList2);


recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(formAdapter);
}
}

private void handleDataSnapshot(DataSnapshot dataSnapshot) {


Log.d("FirebaseDebug", "DataSnapshot count = " +
dataSnapshot.getChildrenCount());
for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
String uid = snapshot.getKey();
String email = snapshot.child("email").getValue(String.class);
String name = snapshot.child("name").getValue(String.class);
String birUrl = snapshot.child("bir").getValue(String.class);
String tinUrl = snapshot.child("tin").getValue(String.class);

BULACAN STATE UNIVERSITY MENESES CAMPUS 413


String dtiUrl = snapshot.child("dti").getValue(String.class);
Boolean isValidated = snapshot.child("isValidated").getValue(Boolean.class);

Log.d("ArchiveActivity", "uid: " + uid);


Log.d("ArchiveActivity", "email: " + email);
Log.d("ArchiveActivity", "name: " + name);
Log.d("ArchiveActivity", "bir: " + birUrl);
Log.d("ArchiveActivity", "tin: " + tinUrl);
Log.d("ArchiveActivity", "dti: " + dtiUrl);

FormModel formModel = new FormModel(name, email, birUrl, tinUrl, dtiUrl,


isValidated, uid);
formList2.add(formModel);
}
formAdapter.notifyDataSetChanged();
}
}

BULACAN STATE UNIVERSITY MENESES CAMPUS 414

You might also like