0% found this document useful (0 votes)
62 views

Final Year Assignment Hotel Management System

Final year project

Uploaded by

rafayrafay336
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Final Year Assignment Hotel Management System

Final year project

Uploaded by

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

lOMoARcPSD|45440669

Final year assignment - hotel management system

Product Design BSc Final Project Work (Coventry University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Rafay Qadeer ([email protected])
lOMoARcPSD|45440669

Final Year Project

Hotel Management System

Final Report
75% Individual Coursework

Word Count (Where required):7723 words

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Acknowledgement
My final year project had a huge impact on my experience and also sharpened my skills. It would
had been impossible to finish my project if my supervisor Mr. Bipin Bhattarai and Mr. Bikash
Bhattarai were not there to support me and help me. Islington College was the reason I got to
work on the final year project (FYP). I am grateful to my client Kathmandu Prince Hotel for
accepting my proposal to develop the web application and co-operating with me when I needed
help and assistance.

In the end would like to show my gratitude to my peers and family who helped me during the
moments while I was completing my final year project (FYP).

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Abstract
The main artefact of this project is to make a web based application which will make the
management system run smoothly with proper database system. The project allows the hotel
employee to have interactive GUI and can even manage room’s services and booking in a
systematic manner. As the hotel employees are a very busy people and does not have time to plan
and manage everything on paper. Now he/she has the power to do it easily with flexible time
from this project. The project will allow the hotel management to go on smoothly as it will have
features such as Check-in, Check-out, restaurant bills and reservations. As all the important part
is stored on the application it is easy to make the bill of a guest and check the availability of the
rooms beforehand. The data will be safe with only authorized people having access to the data.
The data will also be safe and can be recovered if any natural disaster takes place the data can be
restored easily. Restaurant services are also provided here which make it easier when the guest
checks out of the hotel. This system is useful both for the customer and the hotel employee
which will have a good effect on both side of.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Contents
CHAPTER 1: INTRODUCTION....................................................................................................7
1.1 Introduction to the topic........................................................................................ 7
1.1.1 Current Scenario............................................................................................7
1.2 Problem Statement...............................................................................................8
1.3 Project as a solution............................................................................................. 9
1.3.1 Aims:.............................................................................................................. 9
1.3.2 Objectives:..................................................................................................... 9
Chapter 2: Background....................................................................................................11
2.1 About the client/ end user...................................................................................... 11
2.2 Understanding the solution.................................................................................... 11
2.3 Similar Projects...................................................................................................... 12
2.4 Comparisons..........................................................................................................14
2.5 Review of technical aspects:..................................................................................15
Chapter 3: Development..................................................................................................17
3.1 Considered Methodologies:................................................................................... 17
3.2 Selected methodology:.......................................................................................... 20
3.2.1 Agile Methodology:..........................................................................................20
3.3 Phases of methodology:........................................................................................ 20
3.4 Survey results:....................................................................................................... 21
3.4.1 Pre-Survey results:..........................................................................................21
3.4.2 Post-Survey results:........................................................................................ 21
3.5 Requirement Analysis:........................................................................................... 22
3.6 Design.................................................................................................................... 23
Chapter 4: Testing and analysis...................................................................................... 25
4.1 Test Plan.................................................................................................................25
4.1.1 Unit Testing, Test Plan.....................................................................................25
4.1.2 System Testing, Test Plan............................................................................... 25
4.2 Unit Testing............................................................................................................ 26
4.3 System Testing.......................................................................................................34
4.4 Critical Analysis:.....................................................................................................41
Chapter 5: Conclusion..................................................................................................... 42

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

5.1 Legal, Social and Ethical Issues............................................................................42


5.1.1 Legal Issues:................................................................................................... 42
5.1.2 Social Issues:.................................................................................................. 43
5.1.3 Ethical Issues.................................................................................................. 43
5.2 Advantages:........................................................................................................... 44
5.3 Limitations:............................................................................................................. 45
5.4 Future Work:...........................................................................................................46
Chapter 6......................................................................................................................... 47
References.......................................................................................................................47
Chapter 7: Bibliography................................................................................................... 49
Bibliography..................................................................................................................... 49
Chapter 8: Appendix........................................................................................................ 51
8.1 Appendix A: Survey................................................................................................51
8.1.1 Pre Survey.......................................................................................................... 51
8.1.2 Post Survey (My project is client based so the acceptance letter is provided):
............................................................................................................................... 58
8.2 Appendix B: Source Codes....................................................................................59
8.2.1 Code of Controllers......................................................................................... 59
8.2.2 Kernel Code...................................................................................................135
8.2.3 Models codes................................................................................................ 138
8.3 Appendix C: Designs............................................................................................159
8.3.1 Gantt Chart....................................................................................................159
8.3.2 General working of the system......................................................................159
8.4.2 Screenshot of the application........................................................................160
8.5 Appendix E: Future Work.....................................................................................162

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Table of figures

Figure 1 Design............................................................................................................... 23
Figure 2............................................................................................................................24
Figure 3 Logging in..........................................................................................................27
Figure 4 Successfully logged in.......................................................................................27
Figure 5: Filling information of a user.............................................................................. 28
Figure 6: Successfully added a user............................................................................... 29
Figure 7 Trying to login with fake credentials.................................................................. 30
Figure 8: error shown.......................................................................................................30
Figure 9: a normal users view......................................................................................... 31
Figure 10 : A admin level users view............................................................................... 32
Figure 11: logging out of the system................................................................................33
Figure 12: Successfully logged out..................................................................................33
Figure 13: Check-in of a guest........................................................................................ 34
Figure 14: Guest check-in created.................................................................................. 35
Figure 15: Gathering information of the guest.................................................................36
Figure 16 Data of the guest stored..................................................................................36
Figure 17 Food order of a guest......................................................................................37
Figure 18: Guest food added on their room.................................................................... 38
Figure 19: Laundry added............................................................................................... 39
Figure 20: Successfully added the data.......................................................................... 39
Figure 21 Checking out of a guest...................................................................................40
Figure 22 Completion of the checkout.............................................................................41
Figure 23 Gantt chart.....................................................................................................159
Figure 24: flowchart....................................................................................................... 159
Figure 25 Homepage of the website..............................................................................160
Figure 26 Customers List...............................................................................................160
Figure 27Restaurant order list....................................................................................... 161
Figure 28 payments list that is completed..................................................................... 161

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

CHAPTER 1: INTRODUCTION
1.1 Introduction to the topic

Almost all people travel around the world and not all have home around the world so they will
prefer to live in hotels. The first thing that come upon peoples mind is if they can secure a room
when they reach to their destination. This is a huge task for the staffs in hotel as lot of data of the
customers need to be stored properly and efficiently.

Implementing a system which can handle all the information about the hotel guest along with the
needed facilities all under one system would help the staffs of the hotel. The system will be
optimized to add modify the details about customer with what facilities they want to add as food
laundry and more. All will be handled by the hotel staff and will be managed well.

Humans tend to make simple error and small errors like calculating the total bill of a hotel guest
can have a huge impact on small hotels so with the help of my project Kathmandu Prince Hotel
will not have such problems and the database will be safe as well.

1.1.1 Current Scenario

The utilization of data innovation in the hospitality industry has become enormously in the
course of recent years. This voyage has not generally been smooth, yet it has become certain that
information technology is presently a basic aggressive weapon in the business. On the chief
online portals, OpenTable.com, flaunted that in 2016 dining seats filled in cafés using their
online reservation framework surpassed one million. This was a 65% expansion from the earlier
year. (Montgomery, 2006)

The tourism industry business and voyaging is one of the key parts of economy in Nepal. Every
year a huge number of traveller from each side of the globe visits to encounter Nepal. In recent
years the innovative headway has soared in Nepal. However not many inns utilize a customized
computerized framework to help with a portion of the remaining task at hand. Just bunch of Star
lodging has database the board framework for recording data pertinent for the time being and for
later in regard to organization and consumer loyalty

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

1.2 Problem Statement


To regulate a hotel is constantly a repetitive errand. The hospitality business, which runs on
the sole motor of services, will undoubtedly conform to the nature of services to the visitors
to leave a long lasting impression. The manual treatment of inn the executive’s framework
has consistently been a troublesome undertaking. Directing the littlest of the prerequisites of
the visitors to the essential needs the inn friendliness the hotel hospitality management need
to place a great deal of vitality in controlling and executing the day-today work alongside
the different things. Nonetheless, the presentation of the hotel management system has
reduced the conceivable outcomes of blunder and constraint of the staff to give a particular
services on some random time.

Today, every single hotel or chain of inns, need a management system, the need is a direct
result of changing visitor observations and change in innovation, today everything is very
available to a visitor due to Internet and cloud based advancements, which offer Anytime
and Anywhere access to visitors, So lodgings need to make their essence felt on each
channel and system with most recent costs, inventories and obviously also a rundown of
administrations that they offer. (Hychinthia, 2018)

The major Drawback of Manual hotel management system over computerised are:

 Time consuming.
 Data are lost and employees are not aware.
 Manual labour for record keeping.
 Data is not always reliable as it is hand written and some human errors might have
occurred example wrong telephone number among other.
 Hard time retrieving records.
 Reservation process is slow.
 Security is low.
 Files are prone to theft unauthorized modification due to low data security levels and
standards.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

 Guest records can’t be retrieved easily.

1.3 Project as a solution


The problems faced by the client along with the user this project proved to be the solution by
providing the essential features in the web application which solved the problem along with
saving time and errors.

1.3.1 Aims:
The point of this project is to fabricate a web application for lodgings around the world
however concentrating more on Nepal as this is the new innovation here. The system will
deal with all the fundamental services done by the hotel however the online framework
like room booking, consumer loyalty subtleties, getting ready report and some more. The
system won't be huge however if necessary in future more exertion and work should be
possible to cause it to develop regarding usefulness and usability.

1.3.2 Objectives:
To overcome the aims to complete the project I used the following steps:

 Learn to design and develop HTML business applications using PHP programs
that meet commercial programming standards by the end of final academic year.
 Analyse different applications similar to the proposed project to compare the
technology and ideas and benefit from them.
 Gather all the requirements required for the project from different hotel managers
through face to face interview and/or questionnaire.
 Identify the relevant risks for the project regarding different factors like social,
economic and environmental etc. and contingency plan for the project.
 Follow the methodology, the tools and techniques that come with it to design the
software first and actually develop the software second.
 Develop a database for storing the guest details and property, employee and
other details.
 Develop a friendly web application which can be used for retrieving, insertion,
modification and deletion of records stored on database. The website should be

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

able to books the rooms, produce reports using various queries from the database
software.
 Infuse the application with high security features like log in, and other relevant
technologies.
 Test for any errors be it functional or logical and repair them until the system is
error proof.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 2: Background
2.1 About the client/ end user

Name of the client: Mr. Aryan Shakya

Hotel name: Kathmandu Price Hotel

Description: Kathmandu Prince hotel is located at Chettrapati, Kathmandu which is very close to
the main attraction for many tourists Thamel. The hotel is beautiful with a small garden
restaurant and even free pickup service from the airport. Mr Aryan Shakya agreed to be my client
after hearing what I had to offer to him and was happy to take the initiative forward. Then soon
with our understanding the Client Acceptance letter was signed by the owner Mr Aryan Shakya.

2.2 Understanding the solution

The system I provided them with has an interface which is easy to use with basic knowledge and
can easily use it. There will not be any more calculation errors and the customer’s data will be
stored safely and can be accessed at the time of need without much time being wasted. Bookings
and laundry will be managed without any problem. Humans make errors in their life we are not
programmed robots which is always perfect so with the help of the system I have completed its
going to be a huge help for the people and my client. Small errors on the bill of a customer
during checkout process can make a huge difference. If the customer finds out they have been
charged more than they are supposed to pay then they will defame the hotel and many customers
will be lost which is a very bad part for the business. The other major factor if the billing is
decreased than it is supposed to then it is going to effect the owner of the hotel as his main source
of income will be mismatched and problems might occur and even some misunderstanding can
occur between the people which will cause problem on the working environment. Here the
system I provided will keep a good track of the money along with a safety with no calculation
error and managed system which is the best.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

2.3 Similar Projects

Hotelogix

Hotelogix by HMS InfoTech is a versatile, spectacular hotel management that incorporates each
application a little or medium-sized accommodation business should be effective in present
focused market. This powerful, cloud-based arrangement is obviously appropriate for developing
autonomous lodgings, hotels, cabins, resorts, and other property types that are looking for a
moderate model that can be set up rapidly and effectively, with no enormous forthright
speculation.

Basic applications incorporate hearty front desk operations, Point of Sale, housekeeping, and
that's only the tip of the iceberg. Structured utilizing the most recent online advances, the
framework's neighbourly and graphical UI disentangles and streamlines basic regular
assignments. It's additionally very easy to understand, so lodging staff can be fully operational
rapidly with next to zero vacation.

At the centre of the framework is a thorough Property Management System (PMS) that supports
numerous properties as well as different monetary standards, making this an incredible fit for
organizations with a shifted geological impression. From this brought together centre point
clients can then effectively get to different modules: reservations, MIS or eating administrations,
and even the hotel site, all from a solitary bound together stage.

The system can be incorporated with all significant charge card instalment entryways, just as
other outsider mixes for outer CRS's, EPBAX, bookkeeping, and then some. The device used to
build up this application is PHP.

Features

 Experience the power and simplicity of Centralized Dashboard for your inventory sales
through all available mediums of sale and distribution.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

 Sell across all sources of distribution without blocking your Room-nights. Get Real Time
updates across all channels, at the front desk.
 Create rates centrally through a Powerful Rate Manager and sell across distribution
networks with rate parity.
 Manage all hotel operations e.g. Check-ins, Checkouts, Revenue Reports, etc. seamlessly
through a comprehensive PMS at the core.

HoteloPro

HotelPro group accompanies an extreme development in Hotel Management. The likelihood to


oversee more than one structure from a similar application with Multi-Property the executives.
This online electronic arrangement isn't just a device for better online reservations; it is an
application which gives a few highlights, including solicitations, available reports of the
convenience's unit and the plausibility of publicizing inn benefits through various channels like
SMS, email, Facebook and Twitter.

Consolidating openness with adaptability, HoteloPro offers the chance to create advancements
from a similar application, utilizing either the advertising instrument or the POS module where
hoteliers can characterize new administrations and items.

Features

 instant access to all reservations through a robust reservations dashboard


 online widget that allows your clients to make reservations through your website
 detailed reports that provide a clear picture of what’s going on with your property and
help you make the appropriate decisions and adjustments
 generate invoices and receipts for your clients
 Define and manage services and products like restaurant, mini bar, spa, travel, city tours,
etc. o marketing tools allow you to easily distribute promotions and marketing messages,
so you can get new clients and make the existing ones return

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

 flexible pricing management - you can setup room prices in advance or you can modify
them on the fly

2.4 Comparisons

Key Features of Hotelogix Key Features of HoteloPro


Seamless integration

Unlimited Points of Sale pos (spa, restaurant, bar and more)


Web reservation engine online reservation widget on your
website
Multi-Property system multi-property management
Front Desk management invoicing
Distribution channels support
Online payments & credit card payments
Credit Card processing

Travel agent and Corporate consoles


Marketing console marketing tools
Group reservations reservations management
Accounting, third party integrations
flexible rates setup

Both application is electronic expecting to pick up business from accommodation segment be it


hotel, restaurants and else. The fundamental preferred position of making the application
electronic is by all accounts equipment autonomous that pulls in the business due to the
negligible prerequisite required to utilize the application. Simultaneously all the private and
significant are extremely secure in the distributed storage.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

HoteloPro is a recently framed web framework that gives the comparable highlights that is
probably going to be in the framework for the last year venture. In spite of the fact that very few
highlights analyses to Hotelogix the framework is a picking up notoriety in its classification.

At the other hand Hotelogix is an entrenched web application that lifts in excess of million
income from the undertaking. The future here is by all accounts well for both the old heroes and
newcomers.

2.5 Review of technical aspects:

1. Database:

At the point when I chose to utilize PHP as my essential IDE, I considered whereupon database
can be utilized with PHP to give it all the more simple and productive touch. From my Research
and point by point investigation of the themes I currently realize that Database MYSQL is an
imaginative, incredible and instinctive numerous database the executive’s apparatus Browse
objects, Design tables, Edit columns, Export information and Run questions with a reliable
interface. PHP and MYSQL are especially utilized for overseeing database and web applications.

2. MY SQL:
MySQL is described as a free, quick, solid open source social database. It lacks some refinement
and offices, however it has a functioning advancement group and, as it goes from discharge to
discharge, more abilities are included. At specific occasions there will be an exchange off among
speed and capacities, and the MySQL group expect to keep their database motor quick and solid
MySQL Advantage is a suite of four open-source programming bundles demonstrated,
mainstream, and well-upheld ones–that work together to run intelligent, unique Internet locales.

Free-programming ventures that require a full-highlighted database the board framework


frequently use MySQL and the arrangement for FYP is to make it as costless as could reasonably
be expected. MySQL is additionally utilized in some prominent, huge scale World Wide Web
items including, Google and Facebook, Wikipedia its prominence for use with web applications
is intently attached to the notoriety of PHP, which is regularly joined with MySQL. A few high
traffic

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

sites (counting Flickr, Facebook, Wikipedia, Google (however not for look), Nokia and YouTube)
use MySQL for information stockpiling and logging of client information. (Fitzpatrick, 2020)

Features:

 Because of its unique storage engine architecture MySQL performance is very high.
 Supports large number of embedded applications which makes MySQL very flexible.
 Use of Triggers, Stored procedures and views which allows the developer to give a
higher productivity.
 Allows transactions to be rolled back, commit and crash recovery.
 Triggers & cursor.

3. PHP:

PHP is an open source server-side scripting language that is fundamentally the same as in
sentence structure to C language. From this it tends to be inferred three of the essential
favourable circumstances of PHP. Right off the bat, it is a cross stage innovation and
subsequently PHP applications can be entirely versatile – depending, obviously, upon any extra
segments they are worked to join, for example, seller explicit databases and so on. This convey-
ability causes an extra advantage by righteousness of the way that most Web facilitating suppliers
support PHP, making it genuinely simple to change has if essential.

Furthermore, in light of the fact that PHP looks to some extent like C programming languages, it
is effectively gotten by designers acquainted with this sentence structure – one that is shared by
Java, JavaScript and Perl, among others. Thirdly, being open source, PHP is always advancing
and, all the more significantly, bug fixes are in effect normally actualized deeply libraries, which
are uninhibitedly accessible. (Refense, 2018)

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 3: Development

3.1 Considered Methodologies:


Choosing a methodology is a very important part to manage the project properly and
efficiently. There were many choice from which I could choose the type of methodology which
will be beneficial for me going through with my project. Some of the methodologies I considered
while choosing the one for me were Scrum methodology, waterfall methodology, Kanban
methodology, lean methodology, Scrum ban methodology, XP methodology, Prince methodology
and Agile methodology. All the mentioned methodology above have their own advantages and
disadvantages while working on a project. I had researched properly about each of the
methodology and found out keen difference between them such as with Scrum methodology and
Agile methodology Agile had a priority to satisfy customers by providing continuous delivery of
the needed software whereas Scrum delivered products to construct to clients and get there
feedback. Among all the methodology I found keen potential on agile amongst all the other
methodologies.

1. Scrum Methodology:
Scrum is a lightweight and nimble way to deal with venture the executives that separates
an item into littler assignments, and spots them on a rundown called an overabundance.
Undertakings are taken from the build-up, in the request they should be finished, and
given to groups who work to take care of business inside a set time period called a run.
Runs endures a normal of about fourteen days, contingent upon the venture's time period
and multifaceted nature of the undertaking.

The historical backdrop of Scrum returns to 1986 when Hirakata Takeuchi and Ikujiro
Nunica first utilized the term to depict a progressively proficient approach to move
toward item improvement. The word Scrum originates from the sport of Rugby, and
alludes to when a group clusters near one another and charges trying to get the show on
the road from the rival group.

In the 1990's Ken Schamber and Jeff Sutherland utilized and refined this strategy
explicitly for programming improvement, since the prescient and cascade strategies
weren't generally

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

a solid match. They joined their practices, thoughts, and perceptions and made what is
authoritatively known as Scrum. (Epiicace, 2015)
2. Waterfall methodology:
The Waterfall Model was the main Process Model to be presented. It is exceptionally
easy to comprehend and utilize. In a Waterfall model, each stage must be finished before
the following stage can start and there is no covering in the stages. The cascade model is
the most punctual SDLC approach that was utilized for programming advancement.
In "The Waterfall" approach, the entire procedure of programming advancement is
isolated into independent stages. The result of one stage goes about as the contribution for
the following stage consecutively. This implies any stage in the advancement procedure
starts just if the past stage is finished. The cascade model is a consecutive plan process in
which progress is viewed as streaming consistently downwards through the periods of
Conception, Initiation, Analysis, Design, Construction, Testing,
Production/Implementation, and Maintenance. As the Waterfall Model outlines the
product improvement process in a straight successive stream; subsequently it is
additionally alluded to as a Linear-Sequential Life Cycle Model. (Oscar, 2018)

3. Kanban Methodology:
Toward the start of the 21st Century, key players inside the product business immediately
acknowledged how Kanban could be utilized to decidedly change the manners by which
items and administrations were conveyed.
With an expanded spotlight on effectiveness, and by bridling progresses in figuring
innovation, Kanban left the domain of the car business and was effectively applied to
other complex business areas, for example, IT, programming advancement, advertising,
etc.
For sure, what we currently perceive as the Kanban Method with all centre components
developed toward the start of 2007.
The least complex Kanban board may begin with three sections – "Mentioned", "In
Progress" and "Done". When developed, oversaw and working appropriately, it fills in as
an ongoing data archive, featuring bottlenecks inside the framework and whatever else
which may impede smooth working practices. (Rober, 2018)

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

4. XP Methodology:
Thinking back to the 1990s, the ascent of the Internet required an adjustment in
programming advancement. On the off chance that an organization's prosperity relied
upon the speed at which the organization could develop and put up items for sale to the
public, organizations expected to significantly lessen the product improvement life cycle.

It was in this condition Kent Beck made extreme programming, a coordinated


undertaking the board strategy that supports visit discharges in short advancement cycles
to improve programming quality and permit engineers to react to changing client
prerequisites. (Josh, 2019)

5. Prince Methodology:
PRINCE is a procedure put together methodology that concentrations with respect to
association and power over the whole task, through and through. That implies ventures
are altogether arranged before the opening shot, each phase of the procedure is
unmistakably organized, and any remaining details are perfectly tied up after the task
closes. (Wrike, 2015)

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

3.2 Selected methodology:

3.2.1 Agile Methodology:

All the methodologies have their own advantages. But for the FYP hotel management system I
have chosen agile method because here the requirements are known up-front but are expected to
evolve over time.

Another advantage of using Agile Method is so that the functionality can be added one after
another and testing them at the same time. By this method functionalities can be added until the
near last moment of the project completion. This methodology is a very iterative and incremental
process which has direct mixture with the client. One part can last from one to three weeks which
will be efficient to complete the project on time even with changes in circumstances. Most
importantly the main focus of the agile methodology is to satisfy the client through early and
continuous delivery for the software. The keen difference with agile methodology and other
methodology was it could let me change some requirements even during the final stage of
development which played a vital role for me choosing the methodology.

3.3 Phases of methodology:

Hotel management system is a web based application which helps in making the hotel
management systematic and well planned which will have a direct impact on a hotel using a
normal way of storing and carrying out the basic. It will be focused on the end user first which
will be simple and gets the work done efficiently.

Agile is a procedure by which a group can deal with an undertaking by separating it into a few
stages and including steady coordinated effort with partners and nonstop improvement and cycle
at each stage. The Agile methodology starts with customers depicting how the final result will be
utilized and what issue it will fathom. This explains the client's desires to the undertaking group.
When the work starts, groups cycle through a procedure of arranging, executing, and assessing

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

which may very well change the last deliverable to meet the client's requirements better.
Continuous effort is critical, both among colleagues and with partners, to settle on completely
informed choices. (Sadh, 2017)

In the wake of dissecting the subtleties and learning about it the following stage will be to make a
real time scenario as in which we will have the option to utilize it as a model from which we can
decide the deficiencies and the additional subtleties to through various test might be
comprehended. Testing is a critical and significant part as this will choose the advantages the
deficiencies the misfortune the benefits of the task which I will do and furthermore will help me
on improving the framework by utilizing an appropriate testing methodology. Every single vital
direct related toward the venture will be assessed on what has been realized during the course or
procedure for making this task. (William, 2018)

3.4 Survey results:

3.4.1 Pre-Survey results:

The results of survey indicated that the hotel management system would be popular among
the customers. It pointed out to have good features implemented on it. The survey also pointed
out to the obvious fact the people in Nepal lacked attention towards technological change.
However the survey indicated that due to small projects like this things will change.

Detail survey of each result can be gathered from the Appendix.

3.4.2 Post-Survey results:

The result of the survey shows the hotel management system has a huge impact with the
people and the staff using the services. It also confirmed the pre survey was correct and the
features implemented in the project has a huge impact on them with good response.

Details about the survey can be seen on the Appendix.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

3.5 Requirement Analysis:

These are the list of requirements:

Type of computer:
It's exceptionally exhorted that the most advantageous PCs to be utilized ought to be
minicomputers from approved sellers most consciously DELL. This will guarantee most extreme
similarity, ease of use, and unwavering quality

Operating System:

The framework investigator exhortation's that the inn ought to introduce WINDOWS 7 with an
OFFICE 2007 bundle to understand the greatest capability of the framework. The working
framework's high usefulness esteem and the serious deal of valuable devices incited the
framework examiner to suggest it as the most invaluable working framework.

Data processing modes:

Online information preparing mode will be pertinent with the room booking, corridor reservation
and guest orders replies. Batch handling will be applied at accounts office to create day by day
reports for the hotel transactions.

Networking requirements:

Since guaranteeing effective and solid correspondence at the lodging is one of the goals of the
system, the framework will depend on a system. It's suggested that fiber-optic link be utilized to
interface the PCs. This is on the grounds that; the link is invulnerable to tapping, quick
information rates and high data transfer capacity.

Software Requirements:

 Operating System : Windows 7 or more, Linux.


 Presentation layer : PHP, CSS, HTML
 Database : MySQL
 Presentation : Power Point 2003
 Documentation Tool : MS Office

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Hardware Requirements:
 Processor : Standard processor with a speed of 1.6 GHz
 RAM : 256 MB RAM or more
 Hard Disk : 20 GB or more
 Monitor : Standard colour monitor
 Keyboard : Standard keyboard
 Mouse : Standard mouse

3.6 Design

Figure 1 Design

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 2

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 4: Testing and analysis

4.1 Test Plan


4.1.1 Unit Testing, Test Plan
S.no Test Case Outcome
1 Logging user to the system Successful
2 Registering user to the system Successful
3 Unauthorized access should be denied Successful
4 Difference in admin and staff Successful
5 Logging out of the system Successful

4.1.2 System Testing, Test Plan


S.no Test Case Outcome
1 Check-in of a guest Successful
2 Adding information of a guest Successful
3 Adding food bills to the guest Successful
4 Adding Laundry bills to the guest Successful
5 Check-out of the guest Successful

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

4.2 Unit Testing

UNIT TESTING is a degree of programming testing where singular units/segments of a product


are tried. The object is to approve that every unit of the product proceeds as planned. A unit is the
littlest testable piece of any product. It typically has one or a couple of information sources and
generally a solitary yield. In procedural programming, a unit might be an individual program,
work, strategy, and so forth. In object-situated programming, the littlest unit is a technique, which
may have a place with a base/super class, unique class or determined/kid class.

1. Test Case 1: Logging the user to the system:

Test Type Unit Testing

Performed Action Logged the user to the Web-app.

Expected Outcome The user will be logged in the site.

Obtained Outcome The user was logged in to the application

Test Result Successful

Conclusion This is an essential part to test as without a user


logging in all the other functions will not be
accessible so it is of no use if this is not a
success.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Proof for test case 1:

Figure 3 Logging in

Figure 4 Successfully logged in

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Test Case 2: Registering user to the system


Test Type Unit Testing
Performed Action Filled the information of a new user
Expected Outcome The user profile will be registered and can
login
Obtained Outcome The user was able to login
Test Result The outcome was a success
Conclusion The action performed is essential to verify
if the staff can registered properly.

Proof of test case 2:

Figure 5: Filling information of a user

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 6: Successfully added a user

Test Case 3: Registering user to the system


Test Type Unit Testing
Performed Action Tried to login with fake credentials
Expected Outcome The fake user was not allowed to enter
Obtained Outcome These credentials do not match
Test Result The outcome was a success
Conclusion The unauthorized user was not allowed to
enter as the credentials did not match
which is a good way of securing.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Proof of test case 3:

Figure 7 Trying to login with fake credentials

Figure 8: error shown

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Test 4: Difference in admin and staff

Test Type Unit Testing


Performed Action Normal user tries to change certain things
Expected Outcome The normal user does not have such
privilege to change certain things.
Obtained Outcome Only user with admin power has certain
power.
Test Result The test was as expected which is
success
Conclusion Some small staffs can misuse the power
to gain extra money or certain things so it
this must be kept in mind before letting
certain people with power.

Proof of test case 4:

Figure 9: a normal users view

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 10 : A admin level users view

Test Case 5: Logging out of the system


Test Type Unit Testing
Performed Action A user tried to logout of the system
Expected Outcome The login page will appear after logging
out
Obtained Outcome The Login page was present with
successfully logging out a user
Test Result The test was a success with no errors.
Conclusion Logging out of a system is important as
an unauthorized person can just hop on
the system and create a chaos if the staff
does not logout.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Proof of Test case 5:

Figure 11: logging out of the system

Figure 12: Successfully logged out

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

4.3 System Testing:


System Testing is a degree of testing that approves the total and completely coordinated
programming item. The reason for a framework test is to assess the start to finish framework
particulars. As a rule, the product is just a single component of a bigger PC based framework. At
last, the product is interfaced with other programming/equipment frameworks. System Testing is
really a progression of various tests whose sole reason for existing is to practice the full PC
based framework.

Test Case 6: Check-in of a guest


Test Type System Testing
Performed Action Check-in of a guest
Expected Outcome The check-in of the guest is a success
Obtained Outcome Checked-in guest is listed
Test Result The test is a success with listed
Conclusion The correct data of a guest with proper
check in is essential for a system to work.

Proof of test case 6:

Figure 13: Check-in of a guest

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 14: Guest check-in created

Test Case 7: Adding information of a guest

Test Type System Testing


Performed Action Added the information of a guest
Expected Outcome The user will be listed on the list of
customers
Obtained Outcome The user is successfully listed
Test Result The result was a success with all the
expected outcome to work
Conclusion The information of a person is essential
to the company if anything happens to the
person then the obtained information can
be of a great help

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Proof of test case 7:

Figure 15: Gathering information of the guest

Figure 16 Data of the guest stored

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Test Case 8: Adding food bills to the guest

Test Type System Testing


Performed Action The food ordered by the guest is added to
their bill
Expected Outcome The bill will contain the proper information
of the food.
Obtained Outcome Total item of food ordered listed.
Test Result The test was a complete success.
Conclusion Now this is essential as the restaurant
need to keep track of the bills and money
must be expected to be paid.

Proof of test case 8:

Figure 17 Food order of a guest

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 18: Guest food added on their room

Test Case 9: Adding Laundry bills to the guest


Test Type System Testing
Performed Action The laundry guest needs to be cleaned
are added
Expected Outcome The data of the laundry of the guest
should be stored
Obtained Outcome The laundry data of the guest is stored
Test Result The test case was a success
Conclusion Guests have some dirty clothes which
needs to be cleaned and this helps the
hotel manage it properly.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Proof of test case 9:

Figure 19: Laundry added

Figure 20: Successfully added the data

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Test Case 10: Check-out of the guest


Test Type System Testing
Performed Action The guest proceeds to check-out of the
hotel
Expected Outcome Total bill is created of the guest
Obtained Outcome The complete list of the guest is listed
Test Result The process is a success
Conclusion This is one of the important part of the
system as the bill must be managed well
and can cause a catastrophe I not
managed well.

Proof of test case 10:

Figure 21 Checking out of a guest

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 22 Completion of the checkout

4.4 Critical Analysis:

All of the tests conducted by myself has been successful and effective all the time which is a
very good thing as errors could cause a lot of problems. The system had worked efficiently
without any problems what so ever. The complete system was given a chance to let some users
use it and they provided with the feedback needed for me which was actually good. (Jazbel,
2019)

The people who gave the survey provided some good points about the system. The features that
are implemented on the system is extremely good and even accepted by the public which is a
very good response as it not only me who is willing to see it as a productive and a good system.
No matter how much effort I put into the system the end user is what matters as they can make
some error and the system can-not do anything. As a matter of fact if the end user does not make

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

some simple errors then it’s a very good system which will help the business of my client grow
properly.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 5: Conclusion

At this moment on the world everything is going computerized from small things to huge things
which has brought a huge change on our lives. A few years ago computer was not even
considered as an essential but just a rich person’s toy but the time has changed and as we all
know it has a huge impact on our lives. Huge companies likes Apple, Microsoft and many others
companies all are investing to make a better future with efficiency. (Wanghi, 2018)Tourism has
boosted all around the world and hotels need to manage their data properly and taxes well. Major
parts of the world need to manage their customers as anything can happen and even data which
were over a decade ago can have a huge impact on some cases. People often makes some
mistakes and with a proper management system those error will be deleted. Data will be stored
properly and bills with some features with of the hotel can be added easily without any errors.
Sometime people forget the things needed by the customer but with proper management then it
can’t be forgotten and easy management.

5.1 Legal, Social and Ethical Issues

5.1.1 Legal Issues:

As of now the legal problem is of some issues on the context of our country Nepal as the
government which is hotel association Nepal issued a white paper asking the owner to take some
power over the rising sector related with the hotel. As our project is implemented to the hotel
with proper permit of running their industry it will not be a problem for us who are developing a
proper management system for them. There can occur some issues if I use the code of other
programmer’s which will cause a huge problem if caught but as I haven’t used the code of any
other people it will not be a problem to me or my client. The hotel industry is booming in our
country and will need a proper management system. With the help of my project the hotel will
have an automated way of making bills and tracking them properly so there will be less chances
for the hotel owner to hide the taxes which is a huge win for the government as they will have a
secure feeling when these type of projects are implemented on most of the hotels business. Some
customers may be on the blacklist and the proper management of the data of the customer will
help secure some proper

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

proof if any cases arise in the future and the hotel can play a vital role helping the proper people
involved on the case. (Jyasth, 2019)

5.1.2 Social Issues:

The people of my client’s area have a high demand of proper hotel rooms its near Thamel area
which is in the heart of the city and the place where tourists prefer to live in. The area is full of
hotels and many customers are mostly there on the hotel so it’s a huge win if the customer’s
needs are fulfilled properly and their information is placed secure. Not all people are perfect and
often make mistakes here and there which will cause a huge impact on the face of a hotel if the
customer is not satisfied with their needs and most of the issues caused by this is less people
around the hotel which will be very bad for the people related to the hotel business. Hospitality
and trust of the customers is important for business like these as each time they suggest some
other people about the hotel should have better experience with the people. Small things like this
can affect the overall growth of the business and with the help of my project they will not have
some problems like there bills getting mixed up with some other people or miscalculation can
effect a lot on the customer as no people in the world would want to pay more than they had
done. So proper management can solve problems similar to them and will run properly.
(Rameshwaram, 2018)

5.1.3 Ethical Issues:

The projects main function is to manage the database of the customers and keep track of them
properly. Details about the customers such as their name passport, photo, address, phone number
is stored on the database which is very sensitive data on the wrong hands. Identity theft is a major
problem at the moment this is a complex process where a person gets all the needed information
of a certain people and change their old identity and become a whole new person. The people can
commit many crimes and do some fraud work under the name of the other person this is a serious
issue and people need to be careful from such people as this can be a huge setback to any
business if their data is leaked into the wrong hands it is unethical to do so. Some companies and
hotels have ties with some criminal organizations and sell the data of the customer which is
worthless for them but to the criminal world it is a jackpot and the people will suffer a lot from
such cases of their identity being stolen. Now imagine you getting caught by the police for some
action you

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

never did or some bills coming to your home due to the expenses due kept under their name with
the identity which have been stolen. (KIm, 2017)

5.2 Advantages:

The project I created for the client is going to be a huge change for them and will have a lot of
advantages over the old manual process which can be listed down below:

1. Speed of the procedure: Inn frameworks are intended to effectively spare, recover, send,
compute and match up information into the database in this way making the procedures
quick. Having quick exchanges gets more cash-flow, great client experience and
advantageous for lodging clients.

2. Less Errors: Accommodation programming are modified to forestall copy passages,


wrong information type inputs. Additionally gives content safeguarding when
inadvertently eradicated.

3. Ongoing outcomes: PCs with high details in addition to an elite inn framework would
give ongoing outcomes from any exchanges like sparing information sources of info,
refreshing and erasing of information passages.

4. Exact Daily Revenue Reports: Because of the constant and mistake free highlights, inn
directors approach an exact day by day income reports that can be either appeared or
printed.

5. Forestall Double Booking. In manual tasks, twofold reserving is a typical situation yet
neighbourliness programming can stay away from this event because of framework
trappings and checks.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

6. Market division: With a lodging framework, administrators and proprietors can all the
more likely track the sorts of guests that typically have and from that information they
can check whether their business is focusing on the correct market.

7. Coordinated effort of different offices. There are numerous sorts of inn clients that has a
place with a particular office or division, with a lodging framework it can advance great
coordinated effort different offices because of constant announcing and show status.

5.3 Limitations:

Even with all the advantage the management system has provided there are still some limitations:

Visitor/Guest:

1. In the event that there is a force disappointment while reserving a spot, all the data must be
given once more.

2. In the event that there is a force cut while there is a registration or registration, the visitor need
to sit tight for full server fire up, which make him/her furious.

Staff:

1. In the event that one staff mistypes the data than the visitor may blow up.

2. On the off chance that there is a force disappointment, while reserving a spot than the staff
must re-try the entire reservation.

3. At the point when late evening reviewing is being done all other client's must be logged off

4. In the event that there is an infection assault the put away data can be degenerate and an
inappropriate data might be given to the visitor which may drive him mad.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Hotel:

1. All the staff should be prepared on the product.

2. The product should be recharged every year.

3. High danger of infection assault as the frameworks are associated with the web more often
than not.

4. On the off chance that there is an infection assault the put away data may get degenerate.

5. In the event that there is a force disappointment, the inn runs a high danger of losing all the put
away data.

6. In the event that late evening reviewing is missed one day there may be an annihilation the
following day.

7. Most urban areas/nations don't have nearby help. Bolster is conceivable through online just
and some of the time it requires some investment.

5.4 Future Work:

The project might have some bugs on it but as of now I haven’t found one yet. My system is
managed for the present scenario of the hotel the functions and every other features added on the
system is for the present. Everything evolves with time same as the hotel using the system I
provided from the old manual database system which could have many errors in the past and
even misplaced many of the data hard copy. Similarly the hotel can add some features to make it
more comforting and welcome to the guest visiting the hotel. The methodology I chose was for
this case to as we can change the program even after the final stage easily and the program can
be used to add new functions according to their need. This project is open to change and many
things are possible and important. Everything with time evolves and changes accordingly so with
time the changes in the project is possible and open to it.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 6:

References
Epiicace. (2015) azengdo [Online]. Available from: https://blog.azendoo.com/scrum-
project-management-methodology- explained/#:~:text=Scrum%20is%20a
%20lightweight%20and,set%20timeframe%20call ed%20a%20sprint. [Accessed 25
April 2020].
Fitzpatrick, J. (2020) Oracle [Online]. Available from:
https://searchoracle.techtarget.com/definition/MySQ.
Hychinthia. (2018) HN [Online]. Available from:
https://www.hospitalitynet.org/opinion/4087001.html [Accessed 01 January 2020].
Jazbel. (2019) analu [Online]. Available from:
https://www.ukessays.com/essays/computer-science/analysis-of-a-hotel-database-
management-system-computer-science- essay.php#:~:text=This%20is%20software
%20which%20has,and%20room%20in%20th e%20hotel. [Accessed 15 may 2020].
Josh, C. (2019) Lucid chart [Online]. Available from:
https://www.lucidchart.com/blog/what-is-extreme-programming [Accessed 8 may 2020].
Jyasth. (2019) HM [Online]. Available from:
https://www.hotelmanagement.net/legal/hotel-association-nepal-issues-white-paper-to-
curb-booming-hotel-industry [Accessed 20 May 2020].
KIm. (2017) HR [Online]. Available from: https://digitalcommons.fiu.edu/cgi/viewcontent.cgi?
article=1491&context=hospitalityrevi ew&httpsredir=1&referer= [Accessed 5 May 2020].
Montgomery. (2006) Open table [Online]. Available from: https://www.opentable.com/
[Accessed 04 January 2020].
Oscar. (2018) toolsqa [Online]. Available from: https://www.toolsqa.com/software-
testing/waterfall- model/#:~:text=The%20waterfall%20model%20is%20a,Production
%2FImplementation
%2C%20and%20Maintenance. [Accessed 5 May 2020].
Rameshwaram. (2018) mocit [Online]. Available from:
https://mocit.gov.np/application/resources/admin/uploads/source/EConsultation/Final%2
0Book.pdf [Accessed 25 May 2020].
Refense. (2018) W3Schools [Online]. Available from:
https://www.w3schools.com/php/php_intro.asp [Accessed 5 January 2020].

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Rober. (2018) kanbanize [Online]. Available from: https://kanbanize.com/kanban-


resources/getting-started/what-is-kanban [Accessed 6 May 2020].
Sadh. (2017) Guru99 [Online]. Available from: https://www.guru99.com/agile-scrum-
extreme-testing.html [Accessed 11 November 2019].
Wanghi. (2018) investo [Online]. Available from:
https://www.investopedia.com/articles/investing/061015/top-5-most-profitable-hotel-
companies.asp [Accessed 20 May 2020].
William. (2018) Wrike [Online]. Available from: https://www.wrike.com/project-
management-guide/faq/what-is-agile-methodology-in-project-management/ [Accessed
11 Novemeber 2019].
Wrike. (2015) Wrikeblog [Online]. Available from: https://www.wrike.com/blog/project-
management-basics-prince2- explained/#:~:text=PRINCE2%20is%20a%20process
%2Dbased,up%20after%20the%2 0project%20concludes. [Accessed 3 May 2020].

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 7: Bibliography

Bibliography
Epiicace. (2015) azengdo [Online]. Available from: https://blog.azendoo.com/scrum-
project-management-methodology- explained/#:~:text=Scrum%20is%20a
%20lightweight%20and,set%20timeframe%20call ed%20a%20sprint. [Accessed 25
April 2020].
Fitzpatrick, J. (2020) Oracle [Online]. Available from:
https://searchoracle.techtarget.com/definition/MySQ.
Hychinthia. (2018) HN [Online]. Available from:
https://www.hospitalitynet.org/opinion/4087001.html [Accessed 01 January 2020].
Jazbel. (2019) analu [Online]. Available from:
https://www.ukessays.com/essays/computer-science/analysis-of-a-hotel-database-
management-system-computer-science- essay.php#:~:text=This%20is%20software
%20which%20has,and%20room%20in%20th e%20hotel. [Accessed 15 may 2020].
Josh, C. (2019) Lucid chart [Online]. Available from:
https://www.lucidchart.com/blog/what-is-extreme-programming [Accessed 8 may 2020].
Jyasth. (2019) HM [Online]. Available from:
https://www.hotelmanagement.net/legal/hotel-association-nepal-issues-white-paper-to-
curb-booming-hotel-industry [Accessed 20 May 2020].
KIm. (2017) HR [Online]. Available from: https://digitalcommons.fiu.edu/cgi/viewcontent.cgi?
article=1491&context=hospitalityrevi ew&httpsredir=1&referer= [Accessed 5 May 2020].
Montgomery. (2006) Open table [Online]. Available from: https://www.opentable.com/
[Accessed 04 January 2020].
Oscar. (2018) toolsqa [Online]. Available from: https://www.toolsqa.com/software-
testing/waterfall- model/#:~:text=The%20waterfall%20model%20is%20a,Production
%2FImplementation
%2C%20and%20Maintenance. [Accessed 5 May 2020].
Rameshwaram. (2018) mocit [Online]. Available from:
https://mocit.gov.np/application/resources/admin/uploads/source/EConsultation/Final%2
0Book.pdf [Accessed 25 May 2020].
Refense. (2018) W3Schools [Online]. Available from:
https://www.w3schools.com/php/php_intro.asp [Accessed 5 January 2020].

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Rober. (2018) kanbanize [Online]. Available from: https://kanbanize.com/kanban-


resources/getting-started/what-is-kanban [Accessed 6 May 2020].
Sadh. (2017) Guru99 [Online]. Available from: https://www.guru99.com/agile-scrum-
extreme-testing.html [Accessed 11 November 2019].
Wanghi. (2018) investo [Online]. Available from:
https://www.investopedia.com/articles/investing/061015/top-5-most-profitable-hotel-
companies.asp [Accessed 20 May 2020].
William. (2018) Wrike [Online]. Available from: https://www.wrike.com/project-
management-guide/faq/what-is-agile-methodology-in-project-management/ [Accessed
11 Novemeber 2019].
Wrike. (2015) Wrikeblog [Online]. Available from: https://www.wrike.com/blog/project-
management-basics-prince2- explained/#:~:text=PRINCE2%20is%20a%20process
%2Dbased,up%20after%20the%2 0project%20concludes. [Accessed 3 May 2020].

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Chapter 8: Appendix
8.1 Appendix A: Survey
8.1.1 Pre Survey

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

8.1.2 Post Survey (My project is client based so the acceptance letter
is provided):

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

8.2 Appendix B: Source Codes

8.2.1 Code of Controllers

Agent controller
<?php

namespace App\Http\Controllers;

use App\Forms\Agent\Store;
use App\Forms\Agent\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreAgent;
use App\Http\Requests\UpdateAgent;
use App\Repositories\Agent\AgentRepositoryInterface;
use App\Services\Agent\AgentServiceInterface;
use App\Models\Agent;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Agent as AgentResource;
use App\Http\Resources\AgentCollection;

class AgentController extends Controller

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

{
protected $agentRepository;
protected $agentService;

/**
* AgentController constructor.
*
* @param AgentRepositoryInterface $agentRepository
* @param AgentServiceInterface $agentService
*/
public function construct(AgentRepositoryInterface $agentRepository,
AgentServiceInterface $agentService)
{
$this->agentRepository = $agentRepository;
$this->agentService = $agentService;
}

/**
* Display a listing of the agent.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.napep',
[ 'records' => $this->agentRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Agents',

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

'routePrefix' => 'agents',


]);
'label' => 'agent'
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created agent in storage.
*
* @param StoreAgent $request
* @return RedirectResponse|Redirector
*/
public function store(StoreAgent $request)
{
return $this->agentService->create($request)
? redirect(route('agents.index'))->with('success', 'New agent created
successfully.')
: back()->with('error', 'New agent could not be created.');

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Display the specified agent.
*
* @param Agent $agent
* @return void
*/
public function show(Agent $agent)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Agent $agent
* @return Factory|View
*/
public function edit(Agent $agent)
{
return view('components.form.index',
[ 'setup' => (new Update($agent))-
>setup()
]);
}

/**
* Update the specified agent in storage.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param UpdateAgent $request
* @param Agent $agent
* @return RedirectResponse|Redirector
*/
public function update(UpdateAgent $request, Agent $agent)
{
return $this->agentService->update($request, $agent->id)
? redirect(route('agents.index'))->with('success', 'Agent updated successfully.')
: back()->with('error', 'The agent could not be updated.');
}

/**
* Remove the specified agent from storage.
*
* @param Agent $agent
* @return RedirectResponse|Redirector
*/
public function destroy(Agent $agent)
{
return $this->agentService->delete($agent->id)
? redirect(route('agents.index'))->with('success', 'Agent deleted successfully.')
: back()->with('error', 'The agent could not be deleted.');
}
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Check-in
<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\Requests\StoreCheckIn;
use App\Http\Requests\UpdateCheckIn;
use App\Models\Room;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Models\CheckIn;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

class CheckInController extends Controller


{
protected $checkinRepository;
protected $checkinService;
protected $roomRepository;

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* CheckInController constructor.
*
* @param CheckInRepositoryInterface $checkinRepository
* @param CheckInServiceInterface $checkinService
*/
public function construct(CheckInRepositoryInterface $checkinRepository,
CheckInServiceInterface $checkinService, RoomRepositoryInterface
$roomRepository)
{
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
$this->roomRepository = $roomRepository;
}

/**
* Display a listing of the checkin.
*
* @return Factory|View
*/
public function index(Request $request)
{
if($request->has('archived') && $request->archived = "true"){
$data = $this->checkinRepository->where([
['check_out', '!=' ,null]
]);
$color = 'warning';
}else {
$data = $this->checkinRepository->where([
['check_out', null]
]);

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

$color = 'primary';
}
return view('checkins.index', [
'checkins' => $data,
'color' => $color
]);
}

/**
* Create new check ins.
*
* @return Factory|View
*/
public function create()
{
return view('checkins.create', [
'rooms' => $this->roomRepository->getFreeRooms(),
]);
}

/**
* Store a newly created checkin in storage.
*
* @param StoreCheckIn $request
* @return RedirectResponse|Redirector
*/
public function store(StoreCheckIn $request)
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return $this->checkinService->create($request)
? redirect(route('checkins.index'))->with('success', 'New checkin created
successfully.')
: back()->with('error', 'New checkin could not be created.');
}

/**
* Display the specified checkin.
*
* @param CheckIn $checkin
* @return Factory|View
*/
public function show(Request $request, CheckIn $checkin)
{
if($request->has('tab')
&& !empty($request->tab)
&& in_array($request->tab, ['meals', 'restaurant', 'laundry']))
{ return view('checkins.tabs.' . $request->tab,
compact('checkin'));
}else{
return view('checkins.tabs.index', compact('checkin'));
}
}

/**
* Edit the checkin.
*
* @param Request $request
* @param CheckIn $checkin
* @return Factory|View

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function edit(Request $request, CheckIn $checkin)
{
$rooms = $this->roomRepository->getFreeRooms();
$merged = $rooms->merge($checkin->rooms);
$rooms = $merged->all();
return view('checkins.edit', compact(['checkin', 'rooms']));
}

/**
* Update the specified checkin in storage.
*
* @param UpdateCheckIn $request
* @param CheckIn $checkin
* @return RedirectResponse|Redirector
*/
public function update(UpdateCheckIn $request, CheckIn $checkin)
{
return $this->checkinService->update($request, $checkin->id)
? back()->with('success', 'CheckIn updated successfully.')
: back()->with('error', 'The checkin could not be updated.');
}

/**
* Remove the specified checkin from storage.
*
* @param CheckIn $checkin
* @return RedirectResponse|Redirector

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function destroy(CheckIn $checkin)
{
return $this->checkinService->delete($checkin->id)
? redirect(route('checkins.index'))->with('success', 'CheckIn deleted
successfully.')
: back()->with('error', 'The checkin could not be deleted.');
}
}

Check-out
<?php

namespace App\Http\Controllers;

use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class CheckOutController extends Controller


{
protected $checkinRepository;
protected $checkinService;

/**
* CheckInController constructor.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param CheckInRepositoryInterface $checkinRepository
* @param CheckInServiceInterface $checkinService
*/
public function construct(CheckInRepositoryInterface $checkinRepository,
CheckInServiceInterface $checkinService)
{
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
}

/**
* Checkout the guest.
*
* @param Request $request
* @param CheckIn $checkin
*/
public function checkout(Request $request, CheckIn $checkin)
{
if($request->has('skipPayment') && $request->skipPayment === "true"){
return $this->checkinService->checkout($checkin);
}else {
return $this->checkinService->checkoutWithPayment($request, $checkin);
}
}
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Customer
<?php

namespace App\Http\Controllers;

use App\Http\Requests\StoreCustomer;
use App\Http\Requests\UpdateCustomer;
use App\Repositories\Customer\CustomerRepositoryInterface;
use App\Services\Customer\CustomerServiceInterface;
use App\Models\Customer;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;

class CustomerController extends Controller


{
protected $customerRepository;
protected $customerService;

/**
* CustomerController constructor.
*
* @param CustomerRepositoryInterface $customerRepository

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @param CustomerServiceInterface $customerService


*/
public function construct(CustomerRepositoryInterface $customerRepository,
CustomerServiceInterface $customerService)
{
$this->customerRepository = $customerRepository;
$this->customerService = $customerService;
}

/**
* Display a listing of the customer.
*
* @return Factory|View
*/
public function index()
{
return view('customers.index', [
'customers' => $this->customerRepository->all()
]);
}

/**
* Form to create a new customer.
* Form to create a new customer.
*
* @return Factory|View
*/
public function create()
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return view('customers.form');
}

/**
* Store a newly created customer in storage.
*
* @param StoreCustomer $request
* @return RedirectResponse|Redirector
*/
public function store(StoreCustomer $request)
{
return $this->customerService->create($request)
? redirect(route('customers.index'))->with('success', 'New customer created
successfully.')
: back()->with('error', 'New customer could not be created.');
}

/**
* Display the specified customer.
*
* @param Customer $customer
* @return void
*/
public function show(Customer $customer)
{
abort(404);
}

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Form to update a new customer.


*
* @param Customer $customer
* @return Factory|View
*/
public function edit(Customer $customer)
{
return view('customers.form', compact('customer'));
}

/**
* Update the specified customer in storage.
*
* @param Request $request
* @param UpdateCustomer $customer
* @return RedirectResponse|Redirector
*/
public function update(UpdateCustomer $request, Customer $customer)
{
return $this->customerService->update($request, $customer->id)
? redirect(route('customers.index'))->with('success', 'Customer updated
successfully.')
: back()->with('error', 'The customer could not be updated.');
}

/**
* Remove the specified customer from storage.
*
* @param Customer $customer

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @return RedirectResponse|Redirector
*/
public function destroy(Customer $customer)
{
return $this->customerService->delete($customer->id)
? redirect(route('customers.index'))->with('success', 'Customer deleted
successfully.')
: back()->with('error', 'The customer could not be deleted.');
}
}
Food
<?php

namespace App\Http\Controllers;

use App\Forms\Food\Store;
use App\Forms\Food\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreFood;
use App\Http\Requests\UpdateFood;
use App\Repositories\Food\FoodRepositoryInterface;
use App\Services\Food\FoodServiceInterface;
use App\Models\Food;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use Illuminate\View\View;
use App\Http\Resources\Food as FoodResource;
use App\Http\Resources\FoodCollection;

class FoodController extends Controller


{
protected $foodRepository;
protected $foodService;

/**
* FoodController constructor.
*
* @param FoodRepositoryInterface $foodRepository
* @param FoodServiceInterface $foodService
*/
public function construct(FoodRepositoryInterface $foodRepository,
FoodServiceInterface $foodService)
{
$this->foodRepository = $foodRepository;
$this->foodService = $foodService;
}

/**
* Display a listing of the food.
*
* @return Factory|View
* @throws \Exception
*/
public function index()

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

{
return view('components.table.ndp',
[ 'records' => $this->foodRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Menu Items',
'routePrefix' => 'foods',
'label' => 'menu item'
]);
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created food in storage.
*
* @param StoreFood $request
* @return RedirectResponse|Redirector
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function store(StoreFood $request)


{
return $this->foodService->create($request)
? redirect(route('foods.index'))->with('success', 'New food created successfully.')
: back()->with('error', 'New food could not be created.');
}

/**
* Display the specified food.
*
* @param Food $food
* @return void
*/
public function show(Food $food)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Food $food
* @return Factory|View
*/
public function edit(Food $food)
{
return view('components.form.index',
[ 'setup' => (new Update($food))-
>setup()

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

]);
}

/**
* Update the specified food in storage.
*
* @param UpdateFood $request
* @param Food $food
* @return RedirectResponse|Redirector
*/
public function update(UpdateFood $request, Food $food)
{
return $this->foodService->update($request, $food->id)
? redirect(route('foods.index'))->with('success', 'Food updated successfully.')
: back()->with('error', 'The food could not be updated.');
}

/**
* Remove the specified food from storage.
*
* @param Food $food
* @return RedirectResponse|Redirector
*/
public function destroy(Food $food)
{
return $this->foodService->delete($food->id)
? redirect(route('foods.index'))->with('success', 'Food deleted successfully.')
: back()->with('error', 'The food could not be deleted.');

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

}
}
Home
<?php

namespace App\Http\Controllers;

use App\Models\CheckIn;
use App\Models\LaundryOrder;
use App\Models\Payment;
use App\Models\RestaurantOrder;
use Carbon\Carbon;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\View\View;

class HomeController extends Controller


{
/**
* Displays the home page of the application.
*
* @return Factory|View
*/
public function index(Request $request)
{
$data = [];
if ($request->has('stats'))
{ switch ($request->stats)
{
case 'week':

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

$data = $this->getWeekStats();
break;

case 'month':
$data = $this->getMonthStats();
break;

default:
$data = $this->getTodayStats();
}
}else {
$data = $this->getTodayStats();
}
return view('home', compact('data'));
}

public function getTodayStats()


{
$checkin = CheckIn::whereDate('created_at', Carbon::today())->count();
$payments = 0;
foreach(Payment::whereDate('created_at', Carbon::today())->get() as $payment){
$payments = $payments + ($payment->total + ((13/100) * $payment->total) -
$payment->discount);
}
$payments = number_format($payments, 2, '.', ',');
$restaurant = RestaurantOrder::whereDate('created_at', Carbon::today())->count();
$laundry = LaundryOrder::whereDate('created_at', Carbon::today())->count();

return compact(['checkin', 'payments', 'restaurant', 'laundry']);

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function getWeekStats()


{
$checkin = CheckIn::whereBetween('created_at', [
Carbon::now()->startOfWeek(Carbon::SUNDAY), Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->count();

$payments = 0;
foreach(Payment::whereBetween('created_at', [
Carbon::now()->startOfWeek(Carbon::SUNDAY), Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->get() as $payment){
$payments = $payments + ($payment->total + ((13/100) * $payment->total) -
$payment->discount);
}
$payments = number_format($payments, 2, '.', ',');
$restaurant = RestaurantOrder::whereBetween('created_at',
[ Carbon::now()->startOfWeek(Carbon::SUNDAY),
Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])
->count();
$laundry = LaundryOrder::whereBetween('created_at',
[ Carbon::now()->startOfWeek(Carbon::SUNDAY),
Carbon::now()-
>endOfWeek(Carbon::SATURDAY)
])

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

->count();

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return compact(['checkin', 'payments', 'restaurant', 'laundry']);


}

public function getMonthStats()


{
$checkin = CheckIn::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->count();

$payments = 0;
foreach(Payment::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->get() as $payment){
$payments = $payments + ($payment->total + ((13/100) * $payment->total) -
$payment->discount);
}
$payments = number_format($payments, 2, '.', ',');
$restaurant = RestaurantOrder::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->count();
$laundry = LaundryOrder::whereMonth('created_at', date('m'))
->whereYear('created_at', date('Y'))
->count();
return compact(['checkin', 'payments', 'restaurant', 'laundry']);
}
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Laundry
<?php

namespace App\Http\Controllers;

use App\Forms\Laundry\Store;
use App\Forms\Laundry\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreLaundry;
use App\Http\Requests\UpdateLaundry;
use App\Repositories\Laundry\LaundryRepositoryInterface;
use App\Services\Laundry\LaundryServiceInterface;
use App\Models\Laundry;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Laundry as LaundryResource;
use App\Http\Resources\LaundryCollection;

class LaundryController extends Controller


{
protected $laundryRepository;
protected $laundryService;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* LaundryController constructor.
*
* @param LaundryRepositoryInterface $laundryRepository
* @param LaundryServiceInterface $laundryService
*/
public function construct(LaundryRepositoryInterface $laundryRepository,
LaundryServiceInterface $laundryService)
{
$this->laundryRepository = $laundryRepository;
$this->laundryService = $laundryService;
}

/**
* Display a listing of the laundry.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->laundryRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Laundry Items',
'routePrefix' => 'laundries',
'label' => 'laundry item'
]);
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created laundry in storage.
*
* @param StoreLaundry $request
* @return RedirectResponse|Redirector
*/
public function store(StoreLaundry $request)
{
return $this->laundryService->create($request)
? redirect(route('laundries.index'))->with('success', 'New laundry created
successfully.')
: back()->with('error', 'New laundry could not be created.');
}

/**
* Display the specified laundry.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param Laundry $laundry
* @return void
*/
public function show(Laundry $laundry)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Laundry $laundry
* @return Factory|View
*/
public function edit(Laundry $laundry)
{
return view('components.form.index', [
'setup' => (new Update($laundry))->setup()
]);
}

/**
* Update the specified laundry in storage.
*
* @param UpdateLaundry $request
* @param Laundry $laundry
* @return RedirectResponse|Redirector

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function update(UpdateLaundry $request, Laundry $laundry)
{
return $this->laundryService->update($request, $laundry->id)
? redirect(route('laundries.index'))->with('success', 'Laundry updated
successfully.')
: back()->with('error', 'The laundry could not be updated.');
}

/**
* Remove the specified laundry from storage.
*
* @param Laundry $laundry
* @return RedirectResponse|Redirector
*/
public function destroy(Laundry $laundry)
{
return $this->laundryService->delete($laundry->id)
? redirect(route('laundries.index'))->with('success', 'Laundry deleted
successfully.')
: back()->with('error', 'The laundry could not be deleted.');
}
}
Laundry Control
<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use App\Http\Requests\StoreLaundryOrder;
use App\Http\Requests\UpdateLaundryOrder;
use App\Models\Food;
use App\Models\Laundry;
use App\Repositories\LaundryOrder\LaundryOrderRepositoryInterface;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\LaundryOrder\LaundryOrderServiceInterface;
use App\Models\LaundryOrder;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

class LaundryOrderController extends Controller


{
protected $laundryorderRepository;
protected $laundryorderService;
protected $roomRepository;

/**
* LaundryOrderController constructor.
*
* @param LaundryOrderRepositoryInterface $laundryorderRepository
* @param LaundryOrderServiceInterface $laundryorderService
* @param RoomRepositoryInterface $roomRepository
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function construct(LaundryOrderRepositoryInterface


$laundryorderRepository, LaundryOrderServiceInterface $laundryorderService,
RoomRepositoryInterface $roomRepository)
{
$this->laundryorderRepository = $laundryorderRepository;
$this->laundryorderService = $laundryorderService;
$this->roomRepository = $roomRepository;
}

/**
* Display a listing of the laundryorder.
*
* @return Factory|View
*/
public function index()
{
return view('orders.index', [
'records' => $this->laundryorderRepository->all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}

/**
* Display the form to create laundry order.
*
* @return Factory|View

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function create()
{
return view('orders.form', [
'rooms' => $this->roomRepository->getCheckedInRooms(),
'items' => Laundry::all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}

/**
* Store a newly created laundryorder in storage.
*
* @param StoreLaundryOrder $request
* @return RedirectResponse|Redirector
*/
public function store(StoreLaundryOrder $request)
{
return $this->laundryorderService->create($request)
? redirect(route('laundryorders.index'))->with('success', 'New order created
successfully.')
: back()->with('error', 'New order could not be created.');
}

/**
* Display the specified laundryorder.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @param LaundryOrder $laundryorder


* @return void
*/
public function show(LaundryOrder $laundryorder)
{
abort(404);
}

/**
* Displays the form to edit laundry order.
*
* @param LaundryOrder $laundryorder
* @return Factory|View
*/
public function edit(LaundryOrder $laundryorder)
{
return view('orders.form', [
'rooms' => $this->roomRepository->getCheckedInRooms(),
'record' => $laundryorder,
'items' => Laundry::all(),
'pageTitle' => 'Laundry',
'routePrefix' => 'laundryorders',
'itemName' => 'laundry'
]);
}

/**
* Update the specified laundryorder in storage.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param UpdateLaundryOrder $request
* @param LaundryOrder $laundryorder
* @return RedirectResponse|Redirector
*/
public function update(UpdateLaundryOrder $request, LaundryOrder $laundryorder)
{
return $this->laundryorderService->update($request, $laundryorder->id)
? redirect(route('laundryorders.index'))->with('success', 'Order updated
successfully.')
: back()->with('error', 'The order could not be updated.');
}

/**
* Remove the specified laundryorder from storage.
*
* @param LaundryOrder $laundryorder
* @return RedirectResponse|Redirector
*/
public function destroy(LaundryOrder $laundryorder)
{
return $this->laundryorderService->delete($laundryorder->id)
? redirect(route('laundryorders.index'))->with('success', 'Order deleted
successfully.')
: back()->with('error', 'The order could not be deleted.');
}
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Meal
<?php

namespace App\Http\Controllers;

use App\Forms\Meal\Store;
use App\Forms\Meal\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreMeal;
use App\Http\Requests\UpdateMeal;
use App\Repositories\Meal\MealRepositoryInterface;
use App\Services\Meal\MealServiceInterface;
use App\Models\Meal;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Meal as MealResource;
use App\Http\Resources\MealCollection;

class MealController extends Controller


{
protected $mealRepository;
protected $mealService;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* MealController constructor.
*
* @param MealRepositoryInterface $mealRepository
* @param MealServiceInterface $mealService
*/
public function construct(MealRepositoryInterface $mealRepository,
MealServiceInterface $mealService)
{
$this->mealRepository = $mealRepository;
$this->mealService = $mealService;
}

/**
* Display a listing of the meal.
*
* @param Request $request
* @return Factory|View
* @throws \Exception
*/
public function index(Request $request)
{
return view('components.table.ndp',
[ 'records' => $this->mealRepository-
>all(), 'pageTitle' => 'Configuration',
'tableTitle' => 'Meal Plans',
'routePrefix' => 'meals',
'label' => 'meal plan'
]);

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created meal in storage.
*
* @param StoreMeal $request
* @return RedirectResponse|Redirector
*/
public function store(StoreMeal $request)
{
return $this->mealService->create($request)
? redirect(route('meals.index'))->with('success', 'New meal created
successfully.')
: back()->with('error', 'New meal could not be created.');
}

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Display the specified meal.


*
* @param Meal $meal
* @return void
*/
public function show(Meal $meal)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Meal $meal
* @return Factory|View
*/
public function edit(Meal $meal)
{
return view('components.form.index',
[ 'setup' => (new Update($meal))-
>setup()
]);
}

/**
* Update the specified meal in storage.
*
* @param UpdateMeal $request
* @param Meal $meal

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @return RedirectResponse|Redirector
*/
public function update(UpdateMeal $request, Meal $meal)
{
return $this->mealService->update($request, $meal->id)
? redirect(route('meals.index'))->with('success', 'Meal updated successfully.')
: back()->with('error', 'The meal could not be updated.');
}

/**
* Remove the specified meal from storage.
*
* @param Meal $meal
* @return RedirectResponse|Redirector
*/
public function destroy(Meal $meal)
{
return $this->mealService->delete($meal->id)
? redirect(route('meals.index'))->with('success', 'Meal deleted successfully.')
: back()->with('error', 'The meal could not be deleted.');
}
}
Payment
<?php

namespace App\Http\Controllers;

use App\Http\Requests\StorePayment;
use App\Http\Requests\UpdatePayment;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Payment\PaymentRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Services\Payment\PaymentServiceInterface;
use App\Models\Payment;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

class PaymentController extends Controller


{
protected $paymentRepository;
protected $paymentService;
protected $checkinRepository;
protected $checkinService;

/**
* PaymentController constructor.
*
* @param PaymentRepositoryInterface $paymentRepository
* @param PaymentServiceInterface $paymentService
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function construct(PaymentRepositoryInterface $paymentRepository,


PaymentServiceInterface $paymentService, CheckInRepositoryInterface
$checkinRepository, CheckInServiceInterface $checkinService)
{
$this->paymentRepository = $paymentRepository;
$this->paymentService = $paymentService;
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
}

/**
* Display the list of payments.
*
*/
public function index()
{
return view('payments.index', [
'payments' => $this->paymentRepository->all(),
]);
}

/**
* Show the form to add new payment.
*
* @return Application|Factory|View
*/
public function create()
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return view('payments.create', [
'checkins' => $this->checkinRepository->query()
->doesntHave('payments')->get(),
]);
}

/**
* Displays the payment addition form with the billing information.
*
* @param CheckIn $checkin
* @return Application|Factory|View
*/
public function createWithBilling(CheckIn $checkin)
{

return view('payments.create', [
'checkins' => $this->checkinRepository->all(),
'selectedCheckin' => $checkin,
'data' => $this->checkinService->getBillAmount($checkin)
]);
}

/**
* Add a new payment.
*
* @param Request $request
* @param CheckIn $checkin
* @return Application|RedirectResponse|Redirector

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function store(Request $request, CheckIn $checkin)
{
$request->validate([
'discount' => 'nullable|numeric|min:0|max:1000000000',
'payer' => 'required|in:agent,customer'
]);
return $this->paymentService->create($request)
? redirect(route('payments.index'))->with('success', 'New payment added
successfully.')
: back()->with('error', 'New payment could not be added.');
}

public function edit(Request $request, Payment $payment)


{
return view('payments.edit',
[ 'selectedCheckin' => $payment-
>checkin,
'data' => $this->checkinService->getBillAmount($payment->checkin),
'payment' => $payment
]);
}

/**
* Update a specific payment.
*
* @param Request $request
* @param Payment $payment
* @return Payment|RedirectResponse
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function update(Request $request, Payment $payment)


{
return $this->paymentService->update($request, $payment->id)
? back()->with('success', 'Payment information updated successfully.')
: back()->with('error', 'Failed to update payment information');
}

/**
* Delete a specific payment.
*
* @param Payment $payment
* @return Application|RedirectResponse|Redirector
*/
public function destroy(Payment $payment)
{
return $this->paymentService->delete($payment->id)
? redirect(route('payments.index'))->with('success', 'Payment deleted
successfuly.')
: redirect(route('payments.index'))->with('error', 'Failed to delete payment.');
}
}

Restaurant

<?php

namespace App\Http\Controllers;

use App\Http\Requests\StorePayment;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use App\Http\Requests\UpdatePayment;
use App\Models\CheckIn;
use App\Repositories\CheckIn\CheckInRepositoryInterface;
use App\Repositories\Payment\PaymentRepositoryInterface;
use App\Services\CheckIn\CheckInServiceInterface;
use App\Services\Payment\PaymentServiceInterface;
use App\Models\Payment;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;

class PaymentController extends Controller


{
protected $paymentRepository;
protected $paymentService;
protected $checkinRepository;
protected $checkinService;

/**
* PaymentController constructor.
*
* @param PaymentRepositoryInterface $paymentRepository
* @param PaymentServiceInterface $paymentService
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function construct(PaymentRepositoryInterface $paymentRepository,


PaymentServiceInterface $paymentService, CheckInRepositoryInterface
$checkinRepository, CheckInServiceInterface $checkinService)
{
$this->paymentRepository = $paymentRepository;
$this->paymentService = $paymentService;
$this->checkinRepository = $checkinRepository;
$this->checkinService = $checkinService;
}

/**
* Display the list of payments.
*
*/
public function index()
{
return view('payments.index', [
'payments' => $this->paymentRepository->all(),
]);
}

/**
* Show the form to add new payment.
*
* @return Application|Factory|View
*/
public function create()
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return view('payments.create', [
'checkins' => $this->checkinRepository->query()
->doesntHave('payments')->get(),
]);
}

/**
* Displays the payment addition form with the billing information.
*
* @param CheckIn $checkin
* @return Application|Factory|View
*/
public function createWithBilling(CheckIn $checkin)
{

return view('payments.create', [
'checkins' => $this->checkinRepository->all(),
'selectedCheckin' => $checkin,
'data' => $this->checkinService->getBillAmount($checkin)
]);
}

/**
* Add a new payment.
*
* @param Request $request
* @param CheckIn $checkin
* @return Application|RedirectResponse|Redirector

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function store(Request $request, CheckIn $checkin)
{
$request->validate([
'discount' => 'nullable|numeric|min:0|max:1000000000',
'payer' => 'required|in:agent,customer'
]);
return $this->paymentService->create($request)
? redirect(route('payments.index'))->with('success', 'New payment added
successfully.')
: back()->with('error', 'New payment could not be added.');
}

public function edit(Request $request, Payment $payment)


{
return view('payments.edit',
[ 'selectedCheckin' => $payment-
>checkin,
'data' => $this->checkinService->getBillAmount($payment->checkin),
'payment' => $payment
]);
}

/**
* Update a specific payment.
*
* @param Request $request
* @param Payment $payment
* @return Payment|RedirectResponse
*/

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

public function update(Request $request, Payment $payment)


{
return $this->paymentService->update($request, $payment->id)
? back()->with('success', 'Payment information updated successfully.')
: back()->with('error', 'Failed to update payment information');
}

/**
* Delete a specific payment.
*
* @param Payment $payment
* @return Application|RedirectResponse|Redirector
*/
public function destroy(Payment $payment)
{
return $this->paymentService->delete($payment->id)
? redirect(route('payments.index'))->with('success', 'Payment deleted
successfuly.')
: redirect(route('payments.index'))->with('error', 'Failed to delete payment.');
}
}
Role
<?php

namespace App\Http\Controllers;

use App\Forms\Role\Store;
use App\Forms\Role\Update;
use App\Http\Controllers\Controller;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use App\Http\Requests\StoreRole;
use App\Http\Requests\UpdateRole;
use App\Repositories\Role\RoleRepositoryInterface;
use App\Services\Role\RoleServiceInterface;
use App\Models\Role;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Role as RoleResource;
use App\Http\Resources\RoleCollection;

class RoleController extends Controller


{
protected $roleRepository;
protected $roleService;

/**
* RoleController constructor.
*
* @param RoleRepositoryInterface $roleRepository
* @param RoleServiceInterface $roleService
*/
public function construct(RoleRepositoryInterface $roleRepository,
RoleServiceInterface $roleService)
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

$this->roleRepository = $roleRepository;
$this->roleService = $roleService;
}

/**
* Display a listing of the role.
*
* @param Request $request
* @return Factory|View
* @throws \Exception
*/
public function index(Request $request)
{
$search = $request->search ?? '';
return view('uac.roles.index', [
'roles' => $this->roleRepository->all()
]);
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

]);
}

/**
* Store a newly created role in storage.
*
* @param StoreRole $request
* @return RedirectResponse|Redirector
*/
public function store(StoreRole $request)
{
return $this->roleService->create($request)
? redirect(route('roles.index'))->with('success', 'New role created successfully.')
: back()->with('error', 'New role could not be created.');
}

/**
* Display the specified role.
*
* @param Role $role
* @return void
*/
public function show(Role $role)
{
abort(404);
}

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Display the form to update user.


*
* @param Role $role
* @return Factory|View
*/
public function edit(Role $role)
{
return view('components.form.index',
[ 'setup' => (new Update($role))-
>setup()
]);
}

/**
* Update the specified role in storage.
*
* @param UpdateRole $request
* @param Role $role
* @return RedirectResponse|Redirector
*/
public function update(UpdateRole $request, Role $role)
{
return $this->roleService->update($request, $role->id)
? redirect(route('roles.index'))->with('success', 'Role updated successfully.')
: back()->with('error', 'The role could not be updated.');
}

/**
* Remove the specified role from storage.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param Role $role
* @return RedirectResponse|Redirector
*/
public function destroy(Role $role)
{
return $this->roleService->delete($role->id)
? redirect(route('roles.index'))->with('success', 'Role deleted successfully.')
: back()->with('error', 'The role could not be deleted.');
}
}
Room
<?php

namespace App\Http\Controllers;

use App\Forms\Room\Store;
use App\Forms\Room\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreRoom;
use App\Http\Requests\UpdateRoom;
use App\Repositories\Room\RoomRepositoryInterface;
use App\Services\Room\RoomServiceInterface;
use App\Models\Room;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Room as RoomResource;
use App\Http\Resources\RoomCollection;

class RoomController extends Controller


{
protected $roomRepository;
protected $roomService;

/**
* RoomController constructor.
*
* @param RoomRepositoryInterface $roomRepository
* @param RoomServiceInterface $roomService
*/
public function construct(RoomRepositoryInterface $roomRepository,
RoomServiceInterface $roomService)
{
$this->roomRepository = $roomRepository;
$this->roomService = $roomService;
}

/**
* Display a listing of the room.
*
* @return Factory|View
* @throws \Exception

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function index()
{
return view('components.table.rn', [
'records' => $this->roomRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Rooms',
'routePrefix' => 'rooms',
'label' => 'room'
]);
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created room in storage.
*
* @param StoreRoom $request

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @return RedirectResponse|Redirector
*/
public function store(StoreRoom $request)
{
return $this->roomService->create($request)
? redirect(route('rooms.index'))->with('success', 'New room created
successfully.')
: back()->with('error', 'New room could not be created.');
}

/**
* Display the specified room.
*
* @param Room $room
* @return void
*/
public function show(Room $room)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Room $room
* @return Factory|View
*/
public function edit(Room $room)
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return view('components.form.index',
[ 'setup' => (new Update($room))-
>setup()
]);
}

/**
* Update the specified room in storage.
*
* @param UpdateRoom $request
* @param Room $room
* @return RedirectResponse|Redirector
*/
public function update(UpdateRoom $request, Room $room)
{
return $this->roomService->update($request, $room->id)
? redirect(route('rooms.index'))->with('success', 'Room updated successfully.')
: back()->with('error', 'The room could not be updated.');
}

/**
* Remove the specified room from storage.
*
* @param Room $room
* @return RedirectResponse|Redirector
*/
public function destroy(Room $room)
{
return $this->roomService->delete($room->id)

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

? redirect(route('rooms.index'))->with('success', 'Room deleted successfully.')


: back()->with('error', 'The room could not be deleted.');
}
}
Room type
<?php

namespace App\Http\Controllers;

use App\Forms\RoomType\Store;
use App\Forms\RoomType\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreRoomType;
use App\Http\Requests\UpdateRoomType;
use App\Repositories\RoomType\RoomTypeRepositoryInterface;
use App\Services\RoomType\RoomTypeServiceInterface;
use App\Models\RoomType;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\RoomType as RoomTypeResource;
use App\Http\Resources\RoomTypeCollection;

class RoomTypeController extends Controller


{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

protected $roomtypeRepository;
protected $roomtypeService;

/**
* RoomTypeController constructor.
*
* @param RoomTypeRepositoryInterface $roomtypeRepository
* @param RoomTypeServiceInterface $roomtypeService
*/
public function construct(RoomTypeRepositoryInterface $roomtypeRepository,
RoomTypeServiceInterface $roomtypeService)
{
$this->roomtypeRepository = $roomtypeRepository;
$this->roomtypeService = $roomtypeService;
}

/**
* Display a listing of the roomtype.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->roomtypeRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Room Types',
'routePrefix' => 'roomtypes',

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

'label' => 'room type'


]);
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created roomtype in storage.
*
* @param StoreRoomType $request
* @return RedirectResponse|Redirector
*/
public function store(StoreRoomType $request)
{
return $this->roomtypeService->create($request)
? redirect(route('roomtypes.index'))->with('success', 'New roomtype created
successfully.')
: back()->with('error', 'New roomtype could not be created.');
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Display the specified roomtype.
*
* @param RoomType $roomtype
* @return void
*/
public function show(RoomType $roomtype)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param RoomType $roomtype
* @return Factory|View
*/
public function edit(RoomType $roomtype)
{
return view('components.form.index', [
'setup' => (new Update($roomtype))->setup()
]);
}

/**
* Update the specified roomtype in storage.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @param UpdateRoomType $request


* @param RoomType $roomtype
* @return RedirectResponse|Redirector
*/
public function update(UpdateRoomType $request, RoomType $roomtype)
{
return $this->roomtypeService->update($request, $roomtype->id)
? redirect(route('roomtypes.index'))->with('success', 'RoomType updated
successfully.')
: back()->with('error', 'The roomtype could not be updated.');
}

/**
* Remove the specified roomtype from storage.
*
* @param RoomType $roomtype
* @return RedirectResponse|Redirector
*/
public function destroy(RoomType $roomtype)
{
return $this->roomtypeService->delete($roomtype->id)
? redirect(route('roomtypes.index'))->with('success', 'RoomType deleted
successfully.')
: back()->with('error', 'The roomtype could not be deleted.');
}
}
Service type
<?php

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

namespace App\Http\Controllers;

use App\Forms\Service\Store;
use App\Forms\Service\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreService;
use App\Http\Requests\UpdateService;
use App\Repositories\Service\ServiceRepositoryInterface;
use App\Services\Service\ServiceServiceInterface;
use App\Models\Service;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Service as ServiceResource;
use App\Http\Resources\ServiceCollection;

class ServiceController extends Controller


{
protected $serviceRepository;
protected $serviceService;

/**
* ServiceController constructor.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @param ServiceRepositoryInterface $serviceRepository


* @param ServiceServiceInterface $serviceService
*/
public function construct(ServiceRepositoryInterface $serviceRepository,
ServiceServiceInterface $serviceService)
{
$this->serviceRepository = $serviceRepository;
$this->serviceService = $serviceService;
}

/**
* Display a listing of the service.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->serviceRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Services',
'routePrefix' => 'services',
'label' => 'service'
]);
}

/**
* Display the form to create new user.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()
]);
}

/**
* Store a newly created service in storage.
*
* @param StoreService $request
* @return RedirectResponse|Redirector
*/
public function store(StoreService $request)
{
return $this->serviceService->create($request)
? redirect(route('services.index'))->with('success', 'New service created
successfully.')
: back()->with('error', 'New service could not be created.');
}

/**
* Display the specified service.
*
* @param Service $service
* @return void

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function show(Service $service)
{
abort(404);
}

/**
* Display the form to update user.
*
* @param Service $service
* @return Factory|View
*/
public function edit(Service $service)
{
return view('components.form.index', [
'setup' => (new Update($service))->setup()
]);
}

/**
* Update the specified service in storage.
*
* @param UpdateService $request
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function update(UpdateService $request, Service $service)
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return $this->serviceService->update($request, $service->id)


? redirect(route('services.index'))->with('success', 'Service updated
successfully.')
: back()->with('error', 'The service could not be updated.');
}

/**
* Remove the specified service from storage.
*
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function destroy(Service $service)
{
return $this->serviceService->delete($service->id)
? redirect(route('services.index'))->with('success', 'Service deleted successfully.')
: back()->with('error', 'The service could not be deleted.');
}
}
User
<?php

namespace App\Http\Controllers;

use App\Forms\Service\Store;
use App\Forms\Service\Update;
use App\Http\Controllers\Controller;
use App\Http\Requests\StoreService;
use App\Http\Requests\UpdateService;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

use App\Repositories\Service\ServiceRepositoryInterface;
use App\Services\Service\ServiceServiceInterface;
use App\Models\Service;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use App\Http\Resources\Service as ServiceResource;
use App\Http\Resources\ServiceCollection;

class ServiceController extends Controller


{
protected $serviceRepository;
protected $serviceService;

/**
* ServiceController constructor.
*
* @param ServiceRepositoryInterface $serviceRepository
* @param ServiceServiceInterface $serviceService
*/
public function construct(ServiceRepositoryInterface $serviceRepository,
ServiceServiceInterface $serviceService)
{
$this->serviceRepository = $serviceRepository;
$this->serviceService = $serviceService;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Display a listing of the service.
*
* @return Factory|View
* @throws \Exception
*/
public function index()
{
return view('components.table.ndp', [
'records' => $this->serviceRepository->all(),
'pageTitle' => 'Configuration',
'tableTitle' => 'Services',
'routePrefix' => 'services',
'label' => 'service'
]);
}

/**
* Display the form to create new user.
*
* @return Factory|View
*/
public function create()
{
return view('components.form.index',
[ 'setup' => (new Store())->setup()

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

]);
}

/**
* Store a newly created service in storage.
*
* @param StoreService $request
* @return RedirectResponse|Redirector
*/
public function store(StoreService $request)
{
return $this->serviceService->create($request)
? redirect(route('services.index'))->with('success', 'New service created
successfully.')
: back()->with('error', 'New service could not be created.');
}

/**
* Display the specified service.
*
* @param Service $service
* @return void
*/
public function show(Service $service)
{
abort(404);
}

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Display the form to update user.


*
* @param Service $service
* @return Factory|View
*/
public function edit(Service $service)
{
return view('components.form.index', [
'setup' => (new Update($service))->setup()
]);
}

/**
* Update the specified service in storage.
*
* @param UpdateService $request
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function update(UpdateService $request, Service $service)
{
return $this->serviceService->update($request, $service->id)
? redirect(route('services.index'))->with('success', 'Service updated
successfully.')
: back()->with('error', 'The service could not be updated.');
}

/**
* Remove the specified service from storage.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @param Service $service
* @return RedirectResponse|Redirector
*/
public function destroy(Service $service)
{
return $this->serviceService->delete($service->id)
? redirect(route('services.index'))->with('success', 'Service deleted successfully.')
: back()->with('error', 'The service could not be deleted.');
}
}
Password
<?php

namespace App\Http\Controllers;

use App\Forms\User\ChangePassword;
use App\Http\Controllers\Controller;
use App\Http\Requests\PasswordChangeRequest;
use App\Models\User;
use App\Repositories\User\UserRepositoryInterface;
use App\Services\User\UserServiceInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;

class UserPasswordController extends Controller

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

{
protected $userRepository;
protected $userService;

/**
* UserController constructor.
*
* @param UserRepositoryInterface $userRepository
* @param UserServiceInterface $userService
*/
public function construct(UserRepositoryInterface $userRepository,
UserServiceInterface $userService)
{
$this->userRepository = $userRepository;
$this->userService = $userService;
}

/**
* Shows the password change form.
*
* @param User $user
* @return Factory|View
*/
public function edit(User $user)
{
return view('components.form.index', [
'setup' => (new ChangePassword($user))->setup(),
]);
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Updates the password of a user.
*
* @param PasswordChangeRequest $request
* @param User $user
* @return \Illuminate\Http\RedirectResponse
*/
public function update(PasswordChangeRequest $request, User $user)
{
return $this->userService->changePassword($request->password, $user->id)
? back()->with('success', 'Password changed successfully.')
: back()->with('error', 'Could not change password.');
}

/**
* Shows the password change form.
*
* @param User $user
* @return Factory|View
*/
public function editByUser()
{
return view('components.form.index', [
'setup' => (new ChangePassword(Auth::user()))->setup(),
]);
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Updates the password of a user.
*
* @param PasswordChangeRequest $request
* @param User $user
* @return \Illuminate\Http\RedirectResponse
*/
public function updateByUser(PasswordChangeRequest $request)
{
return $this->userService->changePassword($request->password, Auth::id())
? back()->with('success', 'Password changed successfully.')
: back()->with('error', 'Could not change password.');
}
}
8.2.2 Kernel Code
<?php

namespace App\Http;

use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel


{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @var array
*/
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];

/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

'api' =>
[ 'throttle:60,
1',

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' =>
\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings'
=> \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers'
=> \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' =>
\Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' =>
\Illuminate\Auth\Middleware\RequirePassword::class, 'signed' =>
\Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' =>
\Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' =>
\Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];

/**
* The priority-sorted list of middleware.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* This forces non-global middleware to always be in the given order.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}
8.2.3 Models codes:

Check-in
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class CheckIn extends Model


{
/**
* Attributes that are mass assignable.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @var array
*/
protected $fillable = [
'customer_id', 'agent_id', 'check_in_date', 'people_count', 'days', 'check_out'
];

/**
* Get the customer of the check in.
*
* @return BelongsTo
*/
public function customer()
{
return $this->belongsTo(Customer::class);
}

/**
* Get the rooms used for the check in.
*
* @return BelongsToMany
*/
public function rooms()
{
return $this->belongsToMany(Room::class, 'checkin_room', 'checkin_id', 'room_id')
->withPivot('released_on')
->withTimestamps();

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Get the meal plans used for the check in.
*
* @return BelongsToMany
*/
public function meals()
{
return $this->belongsToMany(Meal::class, 'checkin_meal', 'checkin_id', 'meal_id')
->withPivot('quantity')
->withTimestamps();
}

/**
* Get the restaurant orders of the check in.
*
* @return BelongsToMany
*/
public function restaurantOrders()
{
return $this->belongsToMany(Food::class, 'restaurant_orders', 'checkin_id',
'food_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}

/**
* Get the laundry orders of the check in.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @return BelongsToMany
*/
public function laundryOrders()
{
return $this->belongsToMany(Laundry::class, 'laundry_orders', 'checkin_id',
'laundry_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}

/**
* Get the payment for the checkin.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function payments()
{
return $this->hasMany(Payment::class, 'checkin_id');
}

/**
* Get the agent of the checkin.
*
* @return BelongsTo
*/
public function agent()
{
return $this->belongsTo(Agent::class);

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

}
}

Customer
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Customer extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'phone', 'gender', 'nationality',
'permanent_address', 'current_address', 'occupation',
'passport_no', 'passport_expiry_date', 'visa_no',
'visa_expiry_date', 'purpose_of_visit', 'arrival',
'arrival_country', 'departure', 'departure_country',
'identity_verification_type', 'identity_verification_document'
];

/**
* Get the checkins of the customer.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @return HasMany
*/
public function checkins()
{
return $this->hasMany(CheckIn::class);
}
}
Food

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Food extends Model


{

public $table = "foods";

/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

'name', 'description', 'price'


];

/**
* Get the orders for the check in.
*
* @return BelongsToMany
*/
public function restaurantOrders()
{
return $this->belongsToMany(CheckIn::class, 'restaurant_orders', 'food_id',
'checkin_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Laundry extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
protected $fillable = [
'name', 'description', 'price'
];

/**
* Get the orders for the check in.
*
* @return BelongsToMany
*/
public function laundryOrders()
{
return $this->belongsToMany(CheckIn::class, 'laundry_orders', 'laundry_id',
'checkin_id')
->withPivot('quantity', 'room_id')
->withTimestamps();
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\Pivot;

class LaundryOrder extends Pivot


{
/**
* The table model is related to.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @var string
*/
protected $table = 'laundry_orders';

/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = true;

/**
* Appends with the json representation of model.
*
* @var array
*/
protected $appends = [ 'laundry', 'room'];

/**
* Return the instance of the laundry model.
*
* @return mixed
*/
public function getLaundryAttribute()
{
return Laundry::find($this->laundry_id);
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

/**
* Return the instance of the room model.
*
* @return mixed
*/
public function getRoomAttribute()
{
return Room::find($this->room_id);
}
}<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Meal extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'description', 'price'
];

/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Get the check in records for the room.


*
* @return BelongsToMany
*/
public function checkins()
{
return $this->belongsToMany(CheckIn::class, 'checkin_room', 'meal_id',
'checkin_id')
->withPivot('quantity')
->withTimestamps();
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Nationality extends Model


{
//
}
Payments
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

class Payment extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'checkin_id', 'total', 'discount', 'payer'
];

/**
* Checkin of the payment.
*
* @return BelongsTo
*/
public function checkin()
{
return $this->belongsTo(CheckIn::class);
}
}
Permission
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

class Permission extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable =
[ 'name', 'description',
'tag'
];

/**
* Get all the roles related to the permission.
*
* @return BelongsToMany
*/
public function roles()
{
return $this->belongsToMany(Role::class);
}
}
Restaurant order
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\Pivot;

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

class RestaurantOrder extends Pivot


{

/**
* The table model is related to.
*
* @var string
*/
protected $table = 'restaurant_orders';

/**
* Indicates if the IDs are auto-incrementing.
*
* @var bool
*/
public $incrementing = true;

/**
* Appends with the json representation of model.
*
* @var array
*/
protected $appends = [ 'food', 'room'];

/**
* Return the instance of the food model.
*

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* @return mixed
*/
public function getFoodAttribute()
{
return Food::find($this->food_id);
}

/**
* Return the instance of the room model.
*
* @return mixed
*/
public function getRoomAttribute()
{
return Room::find($this->room_id);
}
}
Role
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Role extends Model


{
/**

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

* Attributes that are mass assignable.


*
* @var array
*/
protected $fillable =
[ 'name', 'description'
];

/**
* Get all the permissions related to the role.
*
* @return BelongsToMany
*/
public function permissions()
{
return $this->belongsToMany(Permission::class);
}

/**
* Get the users of the role.
*
* @return BelongsToMany
*/
public function users()
{
return $this->belongsToMany(User::class);
}
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Room
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Room extends Model


{
/**
* Attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'room_type_id', 'locked'
];

/**
* Get the type of the room.
*
* @return BelongsTo
*/
public function roomType()
{

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

return $this->belongsTo(RoomType::class);
}

/**
* Get the check in records for the room.
*
* @return BelongsToMany
*/
public function checkins()
{
return $this->belongsToMany(CheckIn::class, 'checkin_room', 'room_id',
'checkin_id')
->withPivot('released_on')
->withTimestamps();
}
}
Room type
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class RoomType extends Model


{
/**
* Attributes that are mass assignable.

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*
* @var array
*/
protected $fillable = [
'name', 'description', 'price'
];

/**
* Rooms belonging to the type.
*
* @return HasMany
*/
public function rooms()
{
return $this->hasMany(Room::class);
}
}
User
<?php

namespace App\Models;

use App\Traits\HasPermissions;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class User extends Authenticatable

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

{
use Notifiable, HasPermissions;

/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email','username', 'password', 'avatar', 'superadmin'
];

/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden =
[ 'password',
'remember_token',
];

protected $appends = ['role'];

/**
* Find the user instance for the given username.
*
* @param string $username
* @return User

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

*/
public function findForPassport($username)
{
return $this->where('username', $username)->first();
}

/**
* Get the roles of the user.
*
* @return BelongsToMany
*/
public function roles()
{
return $this->belongsToMany(Role::class);
}

/**
* Gets the first role.
*
* @return mixed
*/
public function getRoleAttribute()
{
return $this->roles()->first();
}

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

8.3 Appendix C: Designs


8.3.1 Gantt Chart

Figure 23 Gantt chart

8.3.2 General working of the system

Figure 24: flowchart

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

8.4.2 Screenshot of the application

Figure 25 Homepage of the website

Figure 26 Customers List

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

Figure 27Restaurant order list

Figure 28 payments list that is completed

Downloaded by Rafay Qadeer ([email protected])


lOMoARcPSD|45440669

8.5 Appendix E: Future Work

The provided system is updated according to the present time but with time everything evolves
and maybe new features will be added in the hotel which is not implemented now but it is open
and change can be made easily even after many time.

Downloaded by Rafay Qadeer ([email protected])

You might also like