Réservation System For Hotel
Réservation System For Hotel
Réservation System For Hotel
Fevriere
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.
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
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.
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
Phase 1-Inception .................................................................................................................. 27 Phase 2-Elaboration .............................................................................................................. 30 Phase 3-Construction ............................................................................................................ 30 System Coding ................................................................................................................... 34 References ........................................................................................................................ 61
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.
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.
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.
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/)
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.
7 1 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.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).
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
consumers today, this form of commerce will help Paradise hotel remain up-to-date with its global market.
3.2
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
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.
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
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.
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
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.
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
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.
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 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.
5.3.4
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.
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
<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>
<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 & 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>
<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>
<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>
<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>
</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">
<?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>
<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>
<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() {
$('#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>
if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); session flashdata variable if available } else { $data['alert'] = ''; } // retrieve
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'); } }
$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');
$this->session->set_userdata($session_data);
redirect('select_rooms');
} else {
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;
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; } }
$json = array();
$room_id = (int)$this->input->post('room_id');
$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'],
$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));
$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');
$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');
/*$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');
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 {
} else { redirect('pages'); }
$data['hotels'] = $this->Main_model->get_hotels();
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; }
$data['cart_items'] = array();
if ($this->cart->contents()) {
$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()); }
$json = array();
$room_id = (int)$this->input->post('room_id');
$room_data = $this->Main_model->get_room($room_id);
$cart_data = array(
$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)); } }
if ($this->session->flashdata('alert')) { $data['alert'] = $this->session->flashdata('alert'); session flashdata variable if available } else { $data['alert'] = ''; } // retrieve
$results = $this->Admin_model->getReservations();
$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'] .' '.
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
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.
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
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