Anda di halaman 1dari 63

Iana N.K.

Fevriere

Cardiff Metropolitan University,2013

The development of An Online Hotel Reservation System


(Using a Php framework)
A report in partial fulfilment of a BSc in Computing

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Acknowledgement
To God above, I give my sincere gratitude, for without him all things are not possible. I thank him for his abundant mercies and blessings he has bestowed upon me. I thank my parents for guiding me and giving me the financial assistance to undertake these studies, and for their continued mentoring and guidance throughout this time I thank my module supervisor, Mr Nigel Kermode for his continued guidance and supervision throughout the course of this module. All my family members, I give heartfelt gratitude for their support of my academic endeavours and for always being there.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Abstract

This project aimed to create an Online Reservation System for a small Hotel. The hotel is a
Small to Medium Enterprise (SME) in Saint Lucia, West Indies named Paradise Hotel. This new system enables guests to make reservations from anywhere around the world and is accessible via the Internet. This system fulfils some basic functionality including; gathering customers details, example; number of people in party, contact number, address, duration of stay, date of arrival and departure, email address, room booked and number of children in party, if any. The system is implemented to replace the current, error-prone manual filing system used by Paradise Hotel. With the introduction of the World Wide Web, online transactions are now very popular and prove to be more reliable than the traditional manual file systems in that it speeds up the booking process and reduces the problems of duplicate bookings. An online reservation system is an example of an Internet Booking Engine (IBE), which assists travel and tourism industry support reservations through the internet. Due to the ubiquity of web servers, web applications are very popular and using a web browser as a client is very convenient to businesses and attracts the attention of many commercial entities. The travel and tourism industry in particular is very popular with regard to making online reservations for hotel rooms, airline seats, etc. The systems interface is the point of contact between the hotel and the customer. Developing software systems is becoming more common today and developers are always searching for ways to develop systems faster and to eliminate the problem of repetitive code in the development process.(Terrance,2010) This can be achieved by using application frameworks. Application frameworks are collections of abstract classes that are adapted and extended to create application systems. These help by reducing the amount of code to be written when developing an application system. Frameworks take all the complexities of interacting with the operating system and simplify them for the user. The PHP framework, CodeIgniter, was used to develop this Online Reservation System. CodeIgniter provides the basic structure for which this system was built. The architecture of this system is similar to that of most application systems today. The final product is a web based application developed using Wamp (Windows, Apache, MySql and

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php) program package. The basic structure of the system illustrates the flow of information throughout the system components. Architecture of Paradise Online Reservation System

The purpose of this report is to explain, justify and evaluate all the necessary information regarding the development of this Online Hotel Reservation System using a PHP framework. This report focuses on learning the various steps, processes and methodologies to build this software system.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Contents
Chapter 1 1.1 1.2 1.3 1.4 1.5 1.6 Chapter 2 2.1 2.2 2.3 Introduction ........................................................................................................................ 7 Introduction to Paradise hotel ................................................................................................. 7 About SMEs ............................................................................................................................ 8 Problem Statement ................................................................................................................. 9 Aim ........................................................................................................................................ 10 Objectives ............................................................................................................................. 10 Significance ........................................................................................................................... 10 Background ....................................................................................................................... 13 Introduction .......................................................................................................................... 13 Real Time Booking ............................................................................................................... 14 Incorporating the calendar component into real time systems ........................................... 15 Why was Wamp Chosen?.............................................................................................. 28 Apache Version 2.2.22 .................................................................................................. 28 MySQL- Version 5.4.3 .................................................................................................... 28 Php Version 5.5.24 ........................................................................................................ 29 Netbeans IDE ................................................................................................................. 29 Why was Netbeans chosen for this system? ................................................................ 29 Literature Review .............................................................................................................. 19 The Internet and Information Systems .................................................................................. 19 Tools and Technologies ........................................................................................................ 20 Web Applications.................................................................................................................. 21 Web Architecture .................................................................................................................. 21 Php Frameworks ................................................................................................................... 21 Related Project Works .......................................................................................................... 22 System Design ................................................................................................................... 23 System Requirements ........................................................................................................... 23 Functional Requirements .............................................................................................. 23 Non Functional Requirements ...................................................................................... 23

2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 Chapter 3 3.1 3.2 3.3 3.4 3.5 3.6 Chapter 4 4.1 4.1.1 4.1.2 4.2 4.3 4.4 Chapter 5 5.1

The use of Php Frameworks on my system .......................................................................... 16 CodeIgniter ........................................................................................................................... 16 Why was CodeIgniter Chosen for this system? .................................................................... 18 Methodology ..................................................................................................................... 27 Unified Process Model- ........................................................................................................ 27

Iana N.K. Fevriere 5.2 5.3 5.4 Chapter 6 Chapter 7

Cardiff Metropolitan University,2013

Phase 1-Inception .................................................................................................................. 27 Phase 2-Elaboration .............................................................................................................. 30 Phase 3-Construction ............................................................................................................ 30 System Coding ................................................................................................................... 34 References ........................................................................................................................ 61

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 1 Introduction
1.1 Introduction to Paradise hotel
Paradise Hotel is a small hotel in Saint Lucia with a total number of fifteen rooms available to guests for temporary accommodation. Saint Lucia is a small Caribbean island which is a popular vacation spot for many tourists all over the globe. Tourism is the main income generator for this island. The biggest tourist markets to Saint Lucia are the United States and the United Kingdom. Paradise Hotel has two sister hotels in different locations on the island that are operated by the same management team. The rooms at Paradise Hotel are divided into three main categories which are; Marina View, Sea View and poolside rooms. The pricing of these rooms vary according to the category. Children under twelve years of age are not allowed to stay in poolside rooms. The hotels reception staff assists in check-in and check-out of arrivals and need daily summaries of all guests checking in and out of the Category Marina View Sea View Poolside Rooms Price 220 per night 250 per night 300 per night No. of Rooms Available 5 5 5 hotel. Hotel staff also cancel reservations for guests who request to do so.

When guests arrive at the hotel, they are greeted by hotel staff and ushered to their rooms. In the drive to cut costs and eliminate human errors in the reservation process, this new online reservation system (Paradise Hotel Reservation System) is being implemented.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

1.2 About SMEs


The definition of Small and Medium Enterprises (SMEs) vary according to country or region. In the United Kingdom, a small enterprise is a business with a headcount of less than fifty employees and a medium enterprise is a business with a headcount of fewer than two hundred and fifty employees. A business with a headcount of fewer than ten is called microbusiness. In Saint Lucia, however, a small to medium enterprise is any privately owned business or company with less than 75 employees (Peter, 2010). There are a number of small businesses in Saint Lucia, most of which offer various products and services to the large number of tourists who visit the island. These small and medium businesses are collectively large income generators for the island and provide employment throughout the country. The incorporation of online systems into SMEs around the world has become very popular. Small and medium businesses have recognized the value and the income that this venture generates. Online systems enable SMEs to reach a wider geographical market at little cost to the company. This also helps the company to cut costs generated by human errors in manual systems. This is especially important for the hospitality businesses, especially hotels in that large amount of funds are wasted when human errors are made in reservations.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

1.3 Problem Statement


Currently, Paradise Hotel uses a manual filing system to manage guest reservations. Guests who want to reserve rooms can either book through a travel agent or call the hotel to check availability and book the room/ rooms of their choice. This form of conducting reservations is time consuming and there are many inconsistencies in the final reservation made. Paradise Hotel Manual Reservation Process

The implementation of an Online reservation system is designed to eliminate the problems faced by the current manual system. This system will enable guests to reserve the room of their choice via the internet. Errors of inconsistencies with reservations will no longer be made since In building online reservation systems however, the developer faces a number of problems. Suitable tools and technologies must be researched and chosen in order to create a functioning system. The main documented error in developing an online reservation system is the calendar. The calendar needs to enable guests to accurately book a room so that the room is reserved in the hotels database and cant be double booked. For this system a considerable amount of time was spent of developing codes for the calendar component.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

1.4 Aim
To design and implement an online reservation system to replace the current error-prone manual filing system at Paradise Hotel.

1.5 Objectives
1) To design and develop a reservation system for Paradise Hotel by using appropriate available software 2) To create a standard real time booking calendar which is the main component of this system(This component eliminates the error of duplicate bookings) 3) To analyse existing reservation systems and establish main areas of difficulty in the creation of such systems 4) To review appropriate literature about online reservation systems and compare the software packages and languages that are available for developing these systems

1.6 Significance A business website serves as a 24/7 office.(Zhou,2004). In the fierce competition for dominance over the web, the site that can not only attract visitors but can make them loyal customers will have a competitive advantage. This web application not only markets Paradise Hotel worldwide, but also allows a guest to book/reserve a room from anywhere at any time. The incorporation of this system into the business of Paradise Hotel will introduce ecommerce activities into the overall business processes of the hotel. This will cut costs for the business and also bring in more revenue for the company thus increasing tourism in Saint Lucia.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

1.7 The Internet and Online Systems


The role of the internet as an emerging force in hospitality and tourism, information technology and commerce industries is quite profound. The internet has revolutionized the way we communicate, expanded the horizon of our thinking and presented countless opportunities for various human activities that include e-commerce.(Zhou, 2004) With the introduction of the World Wide Web, online web applications allow people to navigate web pages and carry out transactions from remote locations. E-marketing and online information distribution and online transaction processing are keys to future industry success in any business today. Online systems are any form of electronic systems which provide information to users via computers or telecommunication devices. The very first documented online system was SAGE (Semi-Automatic Ground Environment). This system was an air defence project which was developed by the United States Air Military and became available for commercial use in 1960.(Goff,1999) An online reservation system however, can be defined as a computerized system used to store and retrieve information and conduct transactions related to the system. (Goff,1999). Reservation systems specifically refer to online systems that allow users to make transactions. An online reservation system is an example of an Internet Booking Engine (IBE), which came into existence after legacy systems were not able to accommodate the large number of shopping transactions and the speed of development required to satisfy customers. IBEs were initially used by airline companies to reserve seats. The very first documented online reservation system was SABRE, which stands for Semi Automated Business Research Environment. This system was developed by American Airlines and was created to automate the reservation process of booking airline seats. This reservation system contained basic features that are still present in reservation systems today. SABRE system has now been customized and is being sold to many businesses around the globe. It connects more than 30,000 travel agents and 3 million registered online consumers with more than 400 airlines.(Goff,1999)

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

The components of an online reservation system include, the database used to store information about the resources available for use, the web pages used to present this information, and the software that connects the web pages to the database. In order to successfully build this reservation system, a combination of database, web development and middleware software has been selected. WAMP, which stands for Windows, Apache, MySql and Php is very well suited to develop this system. The main features common to most online reservation systems are; 1) Enables efficient management of guest bookings 2) Minimize the time involved in the whole booking process 3) Has the ability to store and manipulate data 4) Has a comprehensive database 5) Supports a large amount of data 6) Real Time Booking 7) Visual Calendar 8) Book Now button All these above features are features of the new Paradise Hotel reservation system. Developing online reservations systems for the hospitality industry is quite a common venture and final year project topic for students. The difficulty in creation of this system however is underestimated in that the sheer importance of the calendar is not taken into consideration. Developing code for the reservation of a room per night can be a tedious task, and must enable accurate real time booking. A few online reservation systems are;
SABRE(Semi-Automated Business Related Environment) Reservation system- This was the very first documented reservation system built in 1960. This reservation system had the basic features of all reservation systems today and is still in existence and used widely by many travel and tourism business around the world. Sabre today is roughly the same system the team built between 1960 and 1962(Goff, 1999).

Sirvoy Hotel Reservation System- This is a booking system software that can be used for hotels, lodges, and guesthouses. This system has been in existence for a number of years and is widely used by many hotels around the world.( http://www.sirvoy.co.uk/)

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 2 Background
2.1 Introduction
This Chapter focuses on the necessary background information regarding this project, which will enable readers to fully understand and appreciate the rest of this project. Section 2.1 assesses Real Time Systems and their significance to making reservations. Section 2.2 analyses similar project works of reservation systems from the first documented system to reservation systems developed today. The main areas of noted difficulty in developing reservation systems are also analysed.

2.2 Similar Reservation System Projects


When the very first reservation system was developed by American Airlines in 1960 (Goff, 1999), the main idea of the development was to automate the reservation process, therefore making the process faster and error free. It is becoming more popular however for businesses to incorporate their reservation systems into their websites. Such web applications are very convenient in that they market the business and enable transactions to be carried out. Web pages which allow transactions to be carried out are called dynamic web pages. A number of popular hotels, today have incorporated their reservation systems into their websites which enable guests to reserve rooms and check availability from remote locations. Such hotels are; Hilton Resorts (www.hilton.com/resorts ) Premier Inn (www.premierinn.com/ ) Holiday Inn (www.ihg.com/holidayinn/ ) Radisson Blu (www.radissonblu.co.uk)

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

2.3 Real Time Booking


Booking systems are complex and must cope with booking requests from different sources at the same time. A good booking system therefore should manage all these bookings without making any duplicate bookings. In order to do this, booking systems must incorporate the concept of real time systems. In a real time booking system, user input is processed instantaneously, so that the resulting output is ready before the new input is processed. (Copley 1999) In real time booking, when a booking/reservation request arrives, the previous booking has already been processed. This process is what prevents double booking. Example; If two people are using Paradise Hotel reservation system at the same time, and both try to book the same rooms at the same time, one request will be received before the other since requests come through the system in a queue. This is a fundamental concept in developing reservation systems, since real time booking is what accurately states the room availability and prevents double booking. Diagram showing how real time systems work

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

2.4 Incorporating the calendar component into real time systems


In the real time system of Paradise Hotel, the calendar plays a major role. Since guests are required to book rooms per night, for a period of time (one night or more), the system needs the precise year, month, day and duration for the process of room reservation to function correctly. Diagram showing Paradise Hotel Reservation Calendar
Rooms 1 2 Double Room SV2 Double Room SV3 Single Room MV 1 Single Room MV 2 Week 1 3 4 5 Week 2 7 1 2 3 4 5 6 Week 3 3 4 5

7 1 2

Double Room PS 1 Double Room PS 2

The above diagram illustrates how the calendar component will be designed. Weeks begin from one to 52 and days begin from 1 to 365. In this way an SQL command can enable a room to be booked accurately. The green shaded regions represent the reserved days.

2.5 UNIX Timestamp


In order to accurately calculate the number of nights from the arrival and departure dates, the Unix Timestamp was used. UNIX time is used to represent instants in time. It is defined by the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time, January 1970. How Unix Timestamp Works Returns the current time as a Unix timestamp, referenced either to your server's local time or GMT, based on the "time reference" setting in your config file (CodeIgniter Tutorial Guide)

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

2.6 PHP Frameworks


What is a PHP framework? PHP frameworks are a relatively new phenomenon which can be used to develop projects written in PHP. A php framework was chosen to develop this this system to remove the problem of writing repetitive. Also, this relatively new process of building application systems using a php framework is quite appealing. PHP frameworks streamline the development of web applications written in PHP by providing a basic structure for which to build the web applications. In other words, PHP frameworks help to promote rapid application development (RAD), which saves time, helps build more stable applications, and reduces the amount of repetitive coding for developers. Frameworks can also help beginners to build more stable apps by ensuring proper database interaction and coding on the presentation layer. This allows the developer to spend more time creating the actual web application, instead of spending time writing repetitive code. Questions to ask when choosing a Framework 1) What is needed from the framework? 2) Is there a level of consistency? 3) Is there documentation available? Is the documentation clear and easy to understand? Source: Boronczyk 2013

2.7 The use of Php Frameworks on this system

2.8 CodeIgniter
CodeIgniter is the Php framework which was used in the development of this system. CodeIgniter was compared to a number of other available PHP frameworks before it was finally chosen. Since CodeIgniter is backed by a company, EllisLab, it is highly documented and offers a comprehensive tutorial guide. CI is also easy to write new libraries, change the behaviour of existing libraries and just change the overall behaviour of the framework with little effort. (Monnat, 2008).

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Features of CodeIgniter 1) Easy to understand and extend 2) All the tools you need in one package 3) Built-in security tools 4) Database abstraction 5) Large and active user community The general idea behind the workings of CodeIgnter PHP framework is referred to as Model View Controller (MVC). MVC is an architectural pattern in programming that isolates business logic from the UI (User Interface), allowing one to be modified separately from the other. With MVC, Model refers to data, View refers to the presentation layer, and Controller to the application or business logic. Basically, MVC breaks up the development process of an application, so the developer can work on individual elements while others are unaffected. Essentially, this makes coding in PHP faster and less complicated. Diagram showing how MVC works

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

A diagram showing how CodeIgniter works.

Other Frameworks Available; Yii Framework Cake Php Symphony Php

2.9 Why was CodeIgniter Chosen for this system?


As mentioned earlier, CodeIgniter is a php framework used for developing software systems written in PHP. For this project a number of frameworks were compared and contrasted before one was finally chosen.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 3 Literature Review


The scope of this review is largely focused on similar project works in developing reservation systems using similar software. Section 3.1 reviews literature on the use and importance of the internet, information and online systems and the impact of the incorporation of e-commerce in the tourism and hospitality industry. Section 3.2 examines the features, pros and cons of the tools and technologies used in developing this reservation system. Section 3.3 focuses on features and a characteristic of web applications. An assessment of the suitability of those software tools from different viewpoints is carried out. A literature review on the different works carried out using Php frameworks and CodeIgniter is done.

3.1 The Internet and Information Systems


The internet has revolutionized the way we communicate, expanded the horizon of our thinking and presented countless opportunities for various human activities that include ecommerce. E-commerce is not an option that we can safely predict but a necessity of life for every business in the coming years. Integrating e-commerce technologies into the daily operations of hospitality and tourism businesses is a fundamental step in migrating from a manual file based system to a computer based reservation system. (Zhou Z, 2004) Information systems are necessary for a business' survival and an effective computerized information system has been known as a vital business advantage. OBrien and Marakas, 2010 state that information systems can be any organized combination of people, hardware, software, communications networks, data resources, and policies and procedures that stores, retrieves, transforms and disseminates information in an organization. Geraldene et al, 1999 state that online systems differ in two fundamental ways. One way is that it provides remote access to consumers, meaning that the file and the searcher do not have to be in the same geographical location. Another way is that, when the search is conducted online, it progresses in an interactive fashion while producing clear, fast results. This proves that the concept of online systems as being 24/7 offices is quite advantageous to a medium sized company like Paradise Hotel. This will help the company maximize profits by hiring less staff to assign and book reservations for guests. The incorporation of an internet based system into the business of Paradise Hotel will undoubtedly help to broaden the hotels market. This online system is a form of e-commerce, since it involves buying and selling online. In keeping with the changes in time and practices of

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

consumers today, this form of commerce will help Paradise hotel remain up-to-date with its global market.

3.2

Tools and Technologies

Laurie et al, 2003, state that Apache web server is a versatile package and becoming more versatile every day. After developing similar projects using Apache web server, Laurie et al, 2003 stated that the hardest stage of learning how to use Apache in a real life context is right at the beginning, where the novice webmaster often has to get Apache, a scripting language and a database manager to collaborate. Bulger 2004, state that almost all of the work of web applications take place on the server. In this project, a combination package of Windows, Apache, MySql and PHP (Wamp) was installed. This was free software which was installed in minutes. The problem faced by Laurie et al, of obtaining Apache and a database manager to collaborate was not faced in the development of this project due to the availability of this Wamp package. Apache proved to be a reliable server in the development of this system and no problems were faced throughout. Now more than ever the web is a major vehicle for corporate and personal communications. The core PHP language features powerful string and array handling facilities as well as support for object oriented programming. With the use of standard and optional extension modules, a PHP application can interact with a database such as MySql, draw graphs and parse Xml files. Php was designed to create dynamic web content and is still best suited for that task. Php can be used in three primary ways, server-side scripting, command line scripting and client-side GUI applications. (Lerdorf and Tatroe ,2002). Features of Php; it is fast and easy, its cross platform, its constantly being improved, its free. (Bulger ,2002) In the development of this system, Php was challenging to learn, but the basic concepts of this scripting language became familiar after about three months. Php was used as the serverside scripting language which transports information from the database to the web pages. Php was chosen in the development of this system over other scripting languages because of its core features, like, its fast and easy, its constantly being improved and its free. MySql is quick and powerful, cost effective, improving all the time

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

3.3 Web Applications According to Nations 2012, a web application is any application that uses a web browser as a client. Web applications commonly use a combination of server-side script e.g PHP and client-side script e.g HTML to develop the application. 3.4 Web Architecture The development of web applications relies on a three tier web architecture design. In designing reservation systems, it is concluded that a three-tier architecture is best suited for this application. Gavrilova and Gervasi, 2007 state that a three tier client system is the best option for such systems, as customers will use a web 3.5 PHP Frameworks Terrance 2010, state that when using PHP frameworks, the developer should look for features and characteristics such as community and database support and easily comprehensible documentation. When developing projects using PHP frameworks, Monnat, 2010 state that PHP frameworks reduce the time spent on coding and promote Rapid Application Development. (RAD) CodeIgniter uses the Model View Controller (MVC). Monnat, 2010 state that the MVC way of doing things offers nice code separation and keep things clean. While some frameworks force you to do things by the books, CodeIgniter lets you use MVC in a way that is suitable to you. In developing applications with CodeIgniter, Monnat, 2010 state that CodeIgniter is the most effective PHP framework and is more reliable than Cake PHP and Zend Framework which are two other PHP frameworks. Monnat states that CodeIgniter was relatively easy to start up and was up and in running in minutes. CodeIgniter was the chosen PHP framework used to develop this reservation system. This particular framework was chosen mainly because of its excellent documentation. CodeIgiters tutorial guide is a standard guide book to using this framework.(See Appendix, Figure 5 for CodeIgniter Tutorial Guide) Comprehensive information regarding libraries and plug-ins is readily available. Another reason why CodeIgniter was chosen for this development was because of the ease of use with the Interactive Development Environment (IDE) used. CodeIgniter was easily used with Netbeans IDE (See Chapter 2.1) for this development. The other significant features of CodeIgniter which made CodeIgniter efficient for the development of this system was the easy installation and database abstraction tools.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

CodeIgniter was installed quickly with no noted problems. CodeIgniter also worked quite well with the Wamp package. 3.6 Related Project Works Related project works have been carried out and are continually being carried out over the years which have tried to establish better ways and more efficient software to

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 4 System Design


4.1 System Requirements
This system must fulfil some basic functionality including; gathering customers details, example, number of people in party, contact number, address, duration of stay, date of arrival and departure, email address, room booked and number of children in party, if any. The resulting product has a web -based client server/architecture and the main goal of the system is to efficiently book hotel rooms quickly and easily without the hassle of visiting travel agencies.
4.1.1 Functional Requirements

Functional requirements are statements of services that the system should provide. This may also state what the system should do. Functional requirements of System 1) The system should accept guest bookings and make the necessary adjustments in the database (in real time) 2) A user should be able to browse rooms and check availability of rooms 3) The system should allow quick retrieval of information 4) The system should enable updates of reservations
4.1.2 Non Functional Requirements

Non- functional requirements are very critical to the system in that if they dont work then the whole system may be useless. Non-functional requirements affect the entire system as opposed to single components. Non- functional requirements of System 1) Reliability- The system must be reliable in that it should perform tasks in good time 2) Scalability- The system should be able to handle increased workload increasing the processing time significantly 3) Compatibility- This web application should be compatible with most standard web browsers e.g Google Chrome, Internet Explorer 4) Availability- The system should be available online 24/7 to be accessible to guests and hotel staff.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Activity diagrams are graphical representations of step-by-step activities and actions. These help to clearly establish what happens in the system and when. The order of activities is clearly defined in an activity diagram. Activity Diagram showing Guest interaction with the system

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Use Case Diagram

The system use case diagram shows the different types of users for Paradise Online Reservation system and how they interact with the system. This Online reservation system allows a guest to browse rooms, select rooms, make reservations and cancel bookings at a later date if they wish to do so. In order to select rooms, the guest has to login on the system. A potential guest can only check availability, browse rooms and register for an account. Potential guests are not permitted to select rooms or make a reservation. Hotel staff is able to manage reservations, which includes cancelling and updating bookings. In order to manage reservations, hotel staff have to login to the system.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Class Diagram

Class Diagram Explained: 1) 2) 3) 4) 5) Each guest can make none or more than one reservation Each reservation can only be made by one guest Each room can only be allocated to one reservation Each reservation can be for one or more rooms

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 5 Methodology
Undertaking the development of a software project requires the developer to follow a particular process model. Process models help developers to follow a number of steps which help in the successful completion of their project. Process models are chosen with regard to the nature of the project being developed, for example, the waterfall model is ideally suited for manufacturing and construction projects because of its sequential design. Some software models are: Waterfall Model Spiral Model The Unified software process model was chosen for the development of this system because it uses an iterative and incremental approach. This approach facilitates learning and is highly documented.

5.1 Unified Process ModelThe reason for implementing Iterative and Incremental strategies in creating this system was to allow for the writers inevitable mistakes to be discovered relatively early and repaired in a timely manner. This eliminated the occurrence of major software development errors in earlier stages of the development process. The general concept of this model is to build a software system through repeated cycles (iterative), and in small portions at a time (incremental). This software process model has 4 phases which are; Inception, Elaboration, Construction and Transition. In the development of this software system, each of the phases was divided into one or more iterations. Each phase is divided into Requirements, Analysis and Design, Implementation, Testing and Deployment.

5.2 Phase 1-Inception


In this phase. .

5.3 Technologies and Tools Used


This section focuses on the different resources which were used in the successful completion of this project. Some of the areas discussed here are; WAMP, Apache, MySQL, Php, Netbeans IDE, and HTML. WampServer 2.2 WAMPs are packages of independently created programs installed on computers that use a Microsoft Windows operating system.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

WAMP is an acronym formed from the initials of the operating system Microsoft Windows and the principal components of the package: Apache, MySQL and one of PHP. Apache is a web server. MySQL is an open-source database. PHP is a scripting language that can manipulate information held in a database and generate web pages dynamically each time content is requested by a browser. Other programs may also be included in a package, such as phpMyAdmin which provides a graphical user interface for the MySQL database manager. The advantage of Wamp is that it is easily configurable with the built-in tools. In this project Apache- represents the front end of the website, whereas MySQL is the database used to store the information, and Php is the middleware server side scripting language that moves data between the database and the web pages.
5.3.1 Why was Wamp Chosen?

Wamp was chosen for the development of this system because it is free, open source software and is available to anyone who wishes to use it. Wamp is also ideally suited for the development of this system because of the efficiency of the entire package of Apache, MySQL and Php. Another reason why Wamp was chosen, was because of the ease of use of transferring documents between platforms.
5.3.2 Apache Version 2.2.22

Apache is a web server application which is used for both static and dynamic web content running on a large number of servers around the world. Apache is used where content needs to be available in a reliable and a secure way. An arbitrary file in Apache document root can be shared if Apache is installed in the computer. Programmers use a locally installed version of Apache to preview and test the codes before publishing the web content.

5.3.3

MySQL- Version 5.4.3

MySQL database server allows to process, access and add date which is stored in the computer database. It is RDMS (Relational Database Management System) which stores data in different tables instead of storing all data in a massive storage. The data stores in a different table in order to increase speed and flexibility. To use relational database, it is not necessary to understand relation theory but it is necessary to learn some basic concept of database. SQL (Structured Query Language) is a well-known standardized language to access database.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

5.3.4

Php Version 5.5.24

PHP is a server side scripting language and is designed particularly for the web. PHP code can be embedded in an HTML page which will execute every time the page is accessed. PHP code translates to the web server and it generates the HTML or other outputs which the visitor will see. PHP is simple to learn because the syntax is based on other programming languages such as C++ and Java. Additionally, it connects to several database systems. With a few lines of code, PHP can generate Portable Document Format (PDF) document, connects to network services and web services, and also send emails. PHP is available for Windows, Apple Mac, Linux and other Operating Systems (OS). PHP uses open source servers and MySQL database and the service is effective.
5.3.5 Netbeans IDE

NetBeans is an integrated development environment (IDE) for developing with programming languages such as Java PHP, C/C++, and HTML5. It is also an application platform framework for Java desktop applications and others. The NetBeans IDE is written in Java and can run on Windows, OS X, Linux, Solaris and other platforms. The NetBeans Platform allows applications to be developed from a set of modular software components called modules. Applications based on the NetBeans Platform (including the NetBeans IDE itself) can be extended by third party developers. Netbeans can be compared with similar platforms such as Eclipse which performs the same basic functionality.
5.3.6 Why was Netbeans chosen for this system?

Netbeans was chosen against any other IDE because after research, its believed that Netbeans is a very efficient Integrated Development Environment (IDE) for novices. Netbeans is also free to download off the internet and accessible by anyone with internet access. Netbeans is compatible with both Wamp and CodeIgniter software. Netbeans is also a powerful Graphical User Interface (GUI) builder. Html (Hypertext Mark-up Language) The coding for the web pages of this online system was written in Html. Html is a is the set of mark-up symbols or codes inserted in a file intended for display on browser page via the World Wide Web. Css (Cascading Style Sheets)- This is used to style and present html. Css was used in the presentation layout of this system.

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Activity Log
Date Start Time 17/07/2013 19/07/2013 22/07/2013 25/07/2013 27/07/2013 28/07/2013 30/07/2013 31/07/2013 01/08/2013 02/08/2013 05/08/2013 10/08/2013 13/08/2013 14/08/2013 15/08/2013 18/08/2013 19/08/2013 20/08/2013 22/08/2013 End Time 16:00 18:00 13:00 18:00 15:00 19:00 17:00 15:00 08:00 08:00 10:00 11:00 16:00 14:00 20:00 16:00 21:00 14:00 20:00 18:00 22:00 14:00 21:00 18:00 20:00 21:00 18:00 12:00 10:00 12:00 13:00 20:00 17:15 22:00 20:00 22:00 17:00 22:00 Duration 2 hours 4 hours 1 hour 3 hours 3 hours 1 hour 4 hours 2 hours 4 hours 2 hours 2 hours 2 hours 4 hours 3 hours 2 hours 4 hours 1 hour 3 hours 2 hours Activities Worked on coding for calendar Worked on coding for calendar Worked on project documentation Worked on coding for system Worked on project documentation Did system testing Worked on system coding Did system testing Worked on system coding Worked on project documentation Did system testing Worked on project documentation Worked on project diagrams Attended project supervision classes Worked on system coding Worked on system coding and documentation Did system testing Attended project supervision classes Did system testing

5.4 Phase 2-Elaboration 5.5 Phase 3-Construction


This is the first page of the booking process

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Calendar enabling guests to choose dates

Prompting guest that checkin date should be later than today

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Message saying room has been successfully selected

The number of nights is calculated using unix time stamp

Total price of all the rooms selected is calculated

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Guest then clicks reserve

Guest information is entered

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 6 System Coding


HTML System Coding
<article id="content"> <div class="box1"> <div class="wrapper"> <div id="form1"> <form method="post" accept-charset="utf-8" action="<?php echo $action; ?>" id="form1"> <div id="notification"><?php echo validation_errors(); ?></div> <h2>Book a Room</h2> <table> <tr> <td><label for="select_hotel">Select your hotel:</label></td> <td><select name="select_hotel"> <option value="1">Paradise</option> <option value="2">Heaven</option> </select></td> </tr> <tr> <td><label for="check_in">Check-in Date (from):</label></td> <td><input type="text" name="check_in" value="<?php echo set_value('check_in'); ?>" id="check-in" /></td> </tr> <tr> <td><label for="check_out">Check-out Date (to):</label></td> <td><input type="text" name="check_out" value="<?php echo set_value('check_out'); ?>" id="check-out" /></td> </tr> <tr> <td><label for="adults">Adults:</label></td> <td><select name="adults"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option>

Iana N.K. Fevriere


<option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select></td> </tr> <tr> <td><label for="children">Children:</label></td> <td><select name="children"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select></td> </tr> <tr> </tr> <tr class="buttons"> <td></td>

Cardiff Metropolitan University,2013

<td class="right"><input type="submit" name="submit" value="SEARCH" class="" /></td> </tr> </table> </form> </div> <div class="kwicks-wrapper marg_bot1"> <ul class="kwicks horizontal"> <li><img src="<?php echo base_url("assets/images/img1.jpg"); ?>" alt=""></li> <li><img src="<?php echo base_url("assets/images/img2.jpg"); ?>" alt=""></li> <li><img src="<?php echo base_url("assets/images/img3.jpg"); ?>" alt=""></li> <li><img src="<?php echo base_url("assets/images/img4.jpg"); ?>" alt=""></li> </ul> </div>

Iana N.K. Fevriere


</div> <div class="pad"> <div class="line1"> <div class="wrapper line2"> <div class="col1">

Cardiff Metropolitan University,2013

<h2><img src="<?php echo base_url("assets/images/title_marker1.jpg"); ?>" alt="">Best Rates</h2> <p class="pad_bot1">Lounge Hotel is one of free website templates created by TemplateMonster.com team. This website template is optimized for 1280X1024 screen resolution. It is also XHTML &amp; CSS valid.</p> <a href="#" class="color1">Read More</a> </div> <div class="col1 pad_left1"> <h2><img src="<?php echo base_url("assets/images/title_marker2.jpg"); ?>" alt="">Hotel Guide</h2> <p class="pad_bot1">Lounge Hotel Template goes with 2 packages. PSD source files are available for free for the registered members of Templates.com. Basic package is available for anyone without registration.</p> <a href="#" class="color1">Read More</a> </div> <div class="col1 pad_left1"> <h2><img src="<?php echo base_url("assets/images/title_marker3.jpg"); ?>" alt="">Packages</h2> <p class="pad_bot1">T: <a href="index.html">About Us</a>, <a href="services.html">Services</a>, <a href="booking.html">Booking</a>, <a href="rooms.html">Our Rooms</a>, <a href="locations.html">Contact Us</a> ..</p> <a href="#" class="color1">Read More</a> </div> </div> </div> </div> </div> <div class="pad"> <div class="wrapper line3"> <div class="col2"> <h2>Welcome to Our Hotel!</h2> <p class="pad_bot1"><strong class="color2">paradise hotels </strong><br> . </p> <p class="pad_bot2"> Paradise hotelswelcome message</p> <a href="#" class="button1">Read More</a> </div>

Iana N.K. Fevriere


<div class="col1 pad_left1"> <h2>About Us</h2> <div class="wrapper">

Cardiff Metropolitan University,2013

<figure class="left marg_right1"><img src="<?php echo base_url("assets/images/page1_img1.jpg"); ?>" alt=""></figure> <p class="pad_bot1"><strong class="color2">10.10.2011</strong></p> <p class="pad_bot2">.</p> </div> <a href="#" class="button1">Read More</a> </div> </div> </div> </article> <script type="text/javascript" src="<?php echo base_url("assets/javascripts/jquery-uitimepicker-addon.js"); ?>"></script> <script type="text/javascript"><!-$(document).ready(function() { $('#check-in, #check-out').datepicker({ dateFormat: 'yy-mm-dd', showButtonPanel: false }); }); //--></script> . <!--<?php echo print_r($rooms); ?>--> <div class="right-section"> <div class="search-data"> <ul> <li><b>Selected Hotel:</b> <?php foreach($hotels as $hotel) { ?> <?php if($hotel['hotel_id'] === $select_hotel) { ?> <?php echo $hotel['hotel_name']; ?> <?php } ?> <?php } ?> </li> <li><b>Check-in:</b> <?php echo $check_in; ?><li> <li><b>Check-out:</b> <?php echo $check_out; ?><li> <li><b>Adults:</b> <?php echo $adults; ?><li> <li><b>Children:</b> <?php echo $children; ?><li>

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

<li><b>Number of Nights:</b> <?php echo $nights; ?><li> </ul> </div>

<div id="cart-box"></div> </div> <article id="content"> <div class="form-container"> <?php echo form_open(current_url()); ?> <h2>Enter Guest Information</h2> <table cellspacing="0" cellpadding="0"> <tbody> <tr> <td></td> <td class="label">Title (Mr., Mrs., Miss):</td> <td class="field"><select name="title"> <option value="Mr">Mr</option> <option value="Mrs">Mrs</option> <option value="Miss">Miss</option> </select></td> </tr> <tr> <td class="required">*</td> <td class="label">First Name:</td> <td class="field"><input type="text" value="" size="40" name="first_name"></td> </tr> <tr> <td class="required">*</td> <td class="label">Last Name:</td> <td class="field"><input type="text" value="" size="40" name="last_name"></td> </tr> <tr> <td class="required">*</td> <td class="label">Address Line 1:</td> <td class="field"><input type="text" value="" size="40" name="address[address_1]"></td> </tr>

Iana N.K. Fevriere


<tr> <td></td> <td class="label">Address Line 2:</td>

Cardiff Metropolitan University,2013

<td class="field"><input type="text" value="" size="40" name="address[address_2]"></td> </tr> <tr> <td></td> <td class="label">Address Line 3:</td> <td class="field"><input type="text" value="" size="40" name="address[address_3]"></td> </tr> <tr> <td class="required">*</td> <td class="label">City:</td> <td class="field"><input type="text" value="" size="40" name="address[city]"></td> </tr> <tr> <td></td> <td class="label">State/Province:</td> <td class="field"><select style="width:235px;" name="address[states]"> <option selected="selected" value="">Choose...</option> <option value="US AA">AA Armed Forces</option> <option value="US AE">AE Armed Forces</option> //other states listed </select></td> </tr> <tr> <td class="required">*</td> <td class="label">Zip/Postal Code:</td> <td class="field"><input type="text" value="" size="40" name="address[postal_code]"></td> </tr> <tr> <td class="required">*</td> <td class="label">Country:</td> <td class="field"><select style="width:235px;"name="address[country]"> <option value="">Select a Country</option>

Iana N.K. Fevriere

Cardiff Metropolitan University,2013


<option value="US">United States</opt

</select></td> </tr> <tr> <td class="required">*</td> <td class="label">Phone:</td> <td align="field"><input type="text" value="" name="telephone" ></td> </tr> <tr> <td class="required">*</td> <td class="label">Your Email Address:</td> <td class="field"><input type="text" value="" size="40" name="email_address"></td> </tr> <tr> <td class="required">*</td> <td class="label">Verify Email Address:</td> <td class="field"><input type="text" value="" size="40" name="itineraryForm.activeGuestInfoForm.confirmEmailAddress"></td> </tr> <tr> <td></td> <td></td> <td><input type="submit" name="submit" value="Complete Reservation"></td> </tr> </tbody> </table> </form> </div> </article> <script type="text/javascript"><!-$(document).ready(function() { $('#cart-box').load('<?php echo site_url("select_rooms/cart"); ?> #cart > *'); }); //--></script> .. <!--<?php echo print_r($rooms); ?>--> <div class="right-section">

Iana N.K. Fevriere


<div class="search-data"> <ul> <li><b>Selected Hotel:</b>

Cardiff Metropolitan University,2013

<?php foreach($hotels as $hotel) { ?> <?php if($hotel['hotel_id'] === $select_hotel) { ?> <?php echo $hotel['hotel_name']; ?> <?php } ?> <?php } ?> </li> <li><b>Check-in:</b> <?php echo $check_in; ?><li> <li><b>Check-out:</b> <?php echo $check_out; ?><li> <li><b>Adults:</b> <?php echo $adults; ?><li> <li><b>Children:</b> <?php echo $children; ?><li> <li><b>Number of Nights:</b> <?php echo $nights; ?><li> </ul> </div>

<div id="cart-box"></div> <div class="buttons"> <div class="left"><a href="<?php echo $back; ?>">Check Again</a></div> <div class="right"><a href="<?php echo $continue; ?>">Reserve</a></div> </div> </div>

<article id="content"> <div id="notification"></div>

<div class="form-container"> <table class="room-lists" width="100%"> <?php if ($rooms) { ?> <tr> <th>Room Image</th> <th>Room Name</th> <th>Room Price</th> <th>Room Type</th> <th>Room Qty</th> <th>Select</th>

Iana N.K. Fevriere


</tr> <?php foreach($rooms as $room) { ?>

Cardiff Metropolitan University,2013

<tr id="<?php echo $room['room_id']; ?>" align="center"> <td><img src="../assets/images/<?php echo $room['room_image']; ?>" width="100" height="100"></td> <td><?php echo $room['room_name']; ?></td> <td><?php echo $room['room_price']; ?></td> <td><?php echo $room['room_type_name']; ?></td> <td><select name="room_qty[<?php echo $room['room_id']; ?>]"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select></td> <td align="center"><button class="cart" onclick="selectRoom('<?php echo $room['room_id']; ?>');">Select</button></td> </tr> <?php } ?> <!--<tr> <td colspan="6" align="right"><input type="submit" value="Submit" /></td> </tr>--> <?php } else { ?> <tr> <td>There are no rooms available.</td> </tr> <?php } ?> </table> </div> </article> <script type="text/javascript"><!-$(document).ready(function() {

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

$('#cart-box').load('<?php echo site_url("select_rooms/cart"); ?> #cart > *'); }); //--></script> .. <div id="cart"> <h3>Selected Rooms</h3> <?php if ($cart_items) {?> <div class="cart-info"> <?php foreach ($cart_items as $cart_item) { ?> <table id="<?php echo $cart_item['key']; ?>" width="100%" height="auto" class="list"> <tr> <td><b>Room Name:</b></td> <td><?php echo $cart_item['room_name']; ?></td> </tr> <tr id="<?php echo $cart_item['key']; ?>"> <td><b>Room Type:</b></td> <td><?php echo $cart_item['room_name']; ?></td> </tr> <tr> <td><b>Room Price</b></td> <td><?php echo $cart_item['room_price']; ?></td> </tr> <tr> <td><b>Room Qty</b></td> <td><?php echo $cart_item['quantity_value']; ?></td> </tr> <td><b>Subtotal</b></td> <td><?php echo $cart_item['sub_total']; ?></td> </tr> </table> <hr> <?php } ?> </div> <div class="cart-total"> <table width="100%" height="auto" class="list"> <tr> <td class="right"><b>Order Total:</b> <?php echo $total; ?></td>

Iana N.K. Fevriere


</tr> </table> </div> <?php } else { ?> <p><?php echo $text_no_cart_items; ?></p> <?php } ?> </div>

Cardiff Metropolitan University,2013

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Coding for Administration Login


<?php class Admin_login extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('Admin_model'); }

public function index() { $this->output->enable_profiler(TRUE); //remove later

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); session flashdata variable if available } else { $data['alert'] = ''; } // retrieve

$data['heading'] = 'Staff Login';

if (($this->input->post('user')) || ($this->input->post('password'))) { $username = $this->input->post('user'); $password = $this->input->post('password');

if (!$this->Admin_model->login($username, $password)) { $this->session->set_flashdata('alert', '<p class="error">Invalid Username and Password!</p>'); redirect('admin_login'); } else { redirect('admin_home'); } } $this->load->view('admin_header', $data); $this->load->view('admin_login', $data); $this->load->view('admin_footer'); } }

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php Coding for Home Page


<?php class Pages extends CI_Controller {

public function __construct() { parent::__construct(); }

public function index() { $this->output->enable_profiler(TRUE); //remove later

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); } else { $data['alert'] = ''; }

$data['action'] = $this->config->site_url('pages');

$this->form_validation->set_rules('select_hotel', 'Select your hotel', 'trim|required|integer'); $this->form_validation->set_rules('check_in', 'Check-in', 'trim|required|callback_validate_check_in'); $this->form_validation->set_rules('check_out', 'Check-out', 'trim|required|callback_validate_check_in'); $this->form_validation->set_rules('adults', 'Adults', 'trim|required|integer'); $this->form_validation->set_rules('children', 'Children', 'trim|required|integer');

if ($this->form_validation->run() == TRUE) { $select_hotel $check_in $check_out $adults $children = $this->input->post('select_hotel'); = $this->input->post('check_in'); = $this->input->post('check_out'); = $this->input->post('adults'); = $this->input->post('children');

$session_data['search_data'] = array( 'select_hotel' 'check_in' => $select_hotel, => $check_in,

Iana N.K. Fevriere


'check_out' 'adults' 'children' ); => $check_out, => $adults, => $children

Cardiff Metropolitan University,2013

$this->session->set_userdata($session_data);

redirect('select_rooms');

} else {

$this->session->unset_userdata('search_data'); /*$this->session->unset_userdata('0'); $this->session->unset_userdata('submit'); $this->session->unset_userdata('children'); $this->session->unset_userdata('adults'); $this->session->unset_userdata('check_in'); $this->session->unset_userdata('check_out'); $this->session->unset_userdata('select_hotel');*/

$this->load->view('header', $data); $this->load->view('home', $data); $this->load->view('footer'); }

public function validate_check_in($str) { $datestring = "%Y-%m-%d"; $time = time(); $current_date = mdate($datestring, $time);

if (strtotime($str) <= strtotime($current_date)) { $this->form_validation->set_message('validate_check_in', 'Checkin date must be later than today!'); return FALSE;

Iana N.K. Fevriere


} else { return TRUE; } }

Cardiff Metropolitan University,2013

public function validate_check_out($str) { $check_in = $this->input->post('check_in');

if (strtotime($str) <= strtotime($check_in)) { $this->form_validation->set_message('validate_check_out', 'Checkout date must be greater than checkin date!'); return FALSE; } else { return TRUE; } }

public function select() { $this->load->model('Main_model');

$json = array();

$room_id = (int)$this->input->post('room_id');

if ( ! $json && $this->input->is_ajax_request()) {

if ($this->input->post('quantity') > 0) { $quantity = (int)$this->input->post('quantity');

$room_data = $this->Main_model->get_room($room_id);

$cart_data = array( 'id' 'name' 'qty' 'price' 'type' => $room_id, => $room_data['room_name'], => $quantity, => $room_data['room_price'], => $room_data['room_type_name'],

Iana N.K. Fevriere


);

Cardiff Metropolitan University,2013

$added_data = $this->cart->insert($cart_data); }

if (isset($added_data)) { $json['success'] = 'Success: Room has been selected.'; } else { $json['error'] = 'Error: Please select your room quantity'; } }

$this->output->set_output(json_encode($json));

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php Coding for to Book Reservation


<?php class Reservation extends CI_Controller {

public function __construct() { parent::__construct(); $this->output->enable_profiler(TRUE); //remove later $this->load->model('Main_model'); }

public function index() {

if ( ! $this->cart->contents()) { $this->session->set_flashdata('alert', 'Please, select room(s) before you reserve!'); redirect('select_rooms'); }

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); } else { $data['alert'] = ''; }

if ($this->session->flashdata('success')) { $this->session->keep_flashdata('success'); $data['success'] = $this->session->flashdata('success'); } else { $data['success'] = ''; }

$data['back'] = $this->config->site_url('pages'); $data['continue'] = $this->config->site_url('reservation');

if ($this->session->userdata('search_data')) { $search_data = $this->session->userdata('search_data');

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

$data['select_hotel'] = $search_data['select_hotel']; $data['check_in'] $data['check_out'] $data['adults'] = $search_data['check_in']; = $search_data['check_out']; = $search_data['adults'];

$check_in = strtotime($data['check_in']); $check_out = strtotime($data['check_out']);

$data['nights'] = ceil(abs($check_in - $check_out) / 86400);

$data['hotels'] = $this->Main_model->get_hotels(); $data['rooms'] = $this->Main_model->get_rooms();

if ($this->input->post() && $this->_addReservation() === TRUE) { redirect('reservation'); }

$this->load->view('header', $data); $this->load->view('reservation', $data); $this->load->view('footer'); }

public function _addReservation() {

$this->form_validation->set_rules('guest[first_name]', 'First Name', 'trim|required|min_length[2]|max_length[32]'); $this->form_validation->set_rules('guest[last_name]', 'Last Name', 'trim|required|min_length[2]|max_length[32]'); $this->form_validation->set_rules('guest[email]', 'Email Address', 'trim|required|valid_email|max_length[96]'); //is_unique[guests.email] $this->form_validation->set_rules('guest[telephone]', 'Telephone', 'trim|required|alpha_dash'); $this->form_validation->set_rules('guest[address_1]', 'Address 1', 'trim|required'); $this->form_validation->set_rules('guest[address_2]', 'Address 2', 'trim'); $this->form_validation->set_rules('guest[address_3]', 'Address 3', 'trim'); $this->form_validation->set_rules('guest[city]', 'City', 'trim|required');

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

$this->form_validation->set_rules('guest[state]', 'State', 'trim'); $this->form_validation->set_rules('guest[postcode]', 'Postal Code', 'trim|required'); $this->form_validation->set_rules('guest[country]', 'Country', 'trim|required');

if ($this->session->userdata('search_data') && $this->form_validation->run() === TRUE) { $add = array();

/*$add['first_name'] $add['last_name']

= $this->input->post('first_name'); = $this->input->post('last_name');

$add['email_address'] = $this->input->post('email_address'); $add['telephone'] $add['guest'] $add['room_details'] $add['total'] = $this->input->post('telephone');*/ = $this->input->post('guest'); = serialize($this->cart->contents()); = $this->cart->total();

$search_data = $this->session->userdata('search_data');

$add['hotel_id'] $add['check_in'] $add['check_out'] $add['no_of_adults']

= $search_data['select_hotel']; = $search_data['check_in']; = $search_data['check_out']; = $search_data['adults'];

$data['no_of_nights'] = ceil(abs($search_data['check_in'] $search_data['check_out']) / 86400);

if ($this->Main_model->addReservation($add)) {

//$this->cart->destroy();

$this->session->set_flashdata('success', '<p> Reservation Received.. </p><p> You will receive a confirmation email shortly with details of your reservation. </p>'); return TRUE;

} else {

Iana N.K. Fevriere


} } }

Cardiff Metropolitan University,2013

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php Coding to Select Rooms


<?php class Select_rooms extends CI_Controller {

public function __construct() { parent::__construct(); $this->load->model('Main_model'); }

public function index() { $this->output->enable_profiler(TRUE); //remove later

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); } else { $data['alert'] = ''; }

if ($this->session->userdata('search_data')) { $search_data = $this->session->userdata('search_data');

$data['select_hotel'] = $search_data['select_hotel']; $data['check_in'] $data['check_out'] $data['adults'] = $search_data['check_in']; = $search_data['check_out']; = $search_data['adults'];

$check_in = strtotime($data['check_in']); $check_out = strtotime($data['check_out']);

$data['nights'] = ceil(abs($check_in - $check_out) / 86400);

} else { redirect('pages'); }

$data['hotels'] = $this->Main_model->get_hotels();

Iana N.K. Fevriere


$data['rooms'] = $this->Main_model->get_rooms();

Cardiff Metropolitan University,2013

$data['back'] = $this->config->site_url('pages'); $data['continue'] = $this->config->site_url('reservation');

if ($this->input->post('room_qty')) { $room_qty[] = $this->input->post('room_qty'); $room_data = array(); foreach ($room_qty as $key => $value) { if ($value > 0) { $room_qty = $value; }

$room_data[$key] = $room_qty; }

$reserve_data = array_merge($search_data, $room_data); //$this->session->unset_userdata('search_data'); //$this->session->set_userdata($reserve_data);

$this->load->view('header', $data); $this->load->view('select_rooms', $data); $this->load->view('footer'); }

public function cart() { $this->output->enable_profiler(TRUE); //remove later

$data['heading'] = 'Selected Rooms'; $data['text_no_cart_items'] = 'There are no rooms selected.';

$data['cart_items'] = array();

if ($this->cart->contents()) {

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

foreach ($this->cart->contents() as $cart_results) {

$data['cart_items'][] = array( 'key' 'id' 'room_name' 'quantity_value' 'room_price' >format_number($cart_results['price']), 'sub_total' >format_number($cart_results['subtotal']) ); } => $cart_results['rowid'], => $cart_results['id'], => $cart_results['name'], => $cart_results['qty'], => $this->cart=> $this->cart-

$data['total'] = $this->cart->format_number($this->cart->total()); }

$this->load->view('header'); $this->load->view('selected_rooms', $data); $this->load->view('footer'); }

public function select() { $this->load->model('Main_model');

$json = array();

$room_id = (int)$this->input->post('room_id');

if ( ! $json && $this->input->is_ajax_request()) {

if ($this->input->post('quantity') > 0) { $quantity = (int)$this->input->post('quantity');

$room_data = $this->Main_model->get_room($room_id);

$cart_data = array(

Iana N.K. Fevriere


'id' 'name' 'qty' 'price' 'type' );

Cardiff Metropolitan University,2013


=> $room_id, => $room_data['room_name'], => $quantity, => $room_data['room_price'], => $room_data['room_type_name'],

$added_data = $this->cart->insert($cart_data); }

if (isset($added_data)) { $json['success'] = 'Success: Room has been selected.'; } else { $json['error'] = 'Error: Please select your room quantity'; } }

$this->output->set_output(json_encode($json)); } }

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php Coding for Administration To Check Bookings


<?php class Admin_bookings extends CI_Controller {

public function __construct() { parent::__construct(); $this->load->model('Admin_model'); }

public function index() { $this->output->enable_profiler(TRUE); //remove later

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); session flashdata variable if available } else { $data['alert'] = ''; } // retrieve

$data['heading'] = 'View Bookings';

$results = $this->Admin_model->getReservations();

if ($results) { foreach ($results as $result) {

$room_details = unserialize($result['room_details']);

$data['reservations'][] = array( 'reservation_id' 'hotel_name' 'guest_name' $result['last_name'], 'room_type' //'no_of_rooms' 'check_in' 'check_out' => '', => $result['no_of_rooms'], => $result['check_in'], => $result['check_out'], => $result['reservation_id'], => $result['hotel_name'], => $result['first_name'] .' '.

Iana N.K. Fevriere


'no_of_nights' $result['no_of_nights'], 'no_of_adults' $result['no_of_adults'],

Cardiff Metropolitan University,2013


=> => => $this->config-

'edit' >site_url('admin_bookings/edit/' . $result['reservation_id']) ); } }

$this->load->view('admin_header', $data); $this->load->view('admin_bookings', $data); $this->load->view('admin_footer'); } }

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Php Coding for Administration Home Page


<?php class Admin_home extends CI_Controller {

public function __construct() { parent::__construct(); }

public function index() { $this->output->enable_profiler(TRUE); //remove later

if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); } else { $data['alert'] = ''; }

$this->load->view('admin_header', $data); $this->load->view('admin_home', $data); $this->load->view('admin_footer'); } }

Iana N.K. Fevriere

Cardiff Metropolitan University,2013

Chapter 7 References
OBrien and Marakas,2010, Introduction to Information Systems, 15th Edition, McGraw Hill International Edition Laurie B, Laurie P, 2003, Apache The Definitive Guide,Orielly Publishers Lerdorf R and Tatroe K,2002, Programming PHP, Orielly Publishing Bulger B et al, 2004, MySql/PHP Databse Applications, 2nd Edition, Wiley Publication Zhou Z,2004, Ecommerce and Information Technology in Hospitality and Tourism, Thompson Learning OConnor P,2004, Using Computers in Hospitality, Cengage Learning Iterative and Incremental Development [Online] Available at: http://www.techopedia.com/definition/25895/iterative-and-incremental-development Date Accessed: 14th July 2013

Cockburn, A. (2007).Agile Software Development: The Cooperative Game. (2nd edition). Boston: Pearson Education.. Gantt Charts for projects [Online] Available at: http://www.mindtools.com/pages/article/newPPM_03.htm Date Accessed: 12 July, 2013

Craig Larman.1998. Applying UML and Patterns. (1st Edition) Patience- Hall, Inc. Iterative and Incremental Development [Online], Available at: https://www.google.co.uk/#biw=1584&bih=797&sclient=psyab&q=steps%20in%20iterative%20and%20incremental%20development&oq=&gs_l=&pbx=1&bav=on.2,or.r_cp .r_qf.&fp=2f74d568bcfd2c4a&pf=p&pdl=300 Date Accessed: 13 July 2013 Sharp et al,(2004) Management of a Student Research Project Welling, L., and Thomson, L., 2008. PHP and MySQL Web Development 4th ed. Addison-Wesley. Douglas,K,(2003)PostGre SQL 1st Edition. Online Booking Systems[online],Available at: http://www.ehow.com/info_8780323_advantages-disadvantages-online-booking-system.html Date Visited: 12th July,2013 Netbeans IDE,[online] Available at: https://netbeans.org/switch/why.html Date Visited: 12th July,2013 Raymond Mcleod, J.-G. P. (2005). Management information system[Online], Available at: team3.googlecode.com/files/Hilton_Hotel_Reservation_System2.ppt Date Accessed: 02June 2013

Iana N.K. Fevriere


About Coding[Online], Available at;

Cardiff Metropolitan University,2013

http://edu.technion.ac.il/Faculty/OritH/HomePage/HAOSE_OOPSLA_Workshop/Papers/DodigCrnkovic.pdf Date Visited: 31st May,2013

Index [Online], Available at; http://www.internetrights.org.uk/index.shtml?AA_SL_Session=8fa795873994ed10dd54938b98227a99&x= 605 Date Visited: 02 june 2013 Raymond Mcleod, J.-G. P. (2005). Management information system.

Php master[Online], Available at; http://phpmaster.com/using-wampserver-for-local-development/ Date Visited: 02June 2013

Sabre Takes Off, Goff L, 1999 [Online] Available at; http://edition.cnn.com/TECH/computing/9906/29/1960.idg/


Date Visited; 17/11/2013

Calendar Conversion for real time systems[online] Available at: http://www.sciencedirect.com/science/article/pii/S0965997804000638 Date visited: 12th November 2013

Booking Systems Copley,2010 [Online] Available at; http://www.igcseict.info/theory/7_2/book/ Date Visited: 12/11 2013

Orfali et al, 1999, Client/Server Survival Guide, Third Edition, Wiley Publication

PHP frameworks, Boronczyk T,2013,[Online] Available at http://www.sitepoint.com/6-things-to-consider-when-choosing-a-framework/ Date Visited: 12/11/13

10 Reasons Why CodeIgniter Rocks, Monnat C, 2008 [Online], Available at: http://www.christophermonnat.com/2008/06/10-reasons-why-codeigniter-rocks/ Date Visited: 12/11/13

Iana N.K. Fevriere

Cardiff Metropolitan University,2013