Hotel Room Reservation System in PHP and Mysql
Hotel Room Reservation System in PHP and Mysql
Hotel Room Reservation System in PHP and Mysql
INTRODUCTION
Project Description:
The resort management project will automate the manual and legacy
Modules:
Room Description:-
This form consists of the following sub menus
Room Entry
Room Entry Update and Delete
Room Entry :-
1
levied,fine waived. We can select the rooms that are
vacating dates.
2
2. SYSTEM ANALYSIS
results.
2. There are only one room picture for a hotel. Providing different
3
2.2 PROPOSED SYSTEM:
to be verified each time. But with this project these process are
are manually very tedious which are made very easy and
success.
Advantages:
4
1. Less effort
2. Quick reference
3. Future enhancement
Ram Capacity - 1 GB
Hard disk - 80 Gb
PHP started out as a small open source project that evolved as more and more
people found out how useful it was. RasmusLerdorf unleashed the first version of
5
• PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
Apache module on the Unix side. The MySQL server, once started,
executes even very complex queries with huge result sets in record-setting
time.
• PHP supports a large number of major protocols such as POP3, IMAP, and
LDAP. PHP4 added support for Java and distributed object architectures
(COM and CORBA), making n-tier development a possibility for the first
• PHP performs system functions, i.e. from files on a system it can create, open,
6
• PHP can handle forms, i.e. gather data from files, save data to a file, through
• You add, delete, modify elements within your database thru PHP.
• Using PHP, you can restrict users to access some pages of your website.It can
encrypt data.
Characteristics of PHP
• Simplicity
• Efficiency
• Security
• Flexibility
• Familiarity
pages contain HTML with embedded code that does "something" (in this case,
output "Hi, I'm a PHP script!"). The PHP code is enclosed in special start and end
processing instructions <?php and ?> that allow you to jump into and out of "PHP
mode."
that the code is executed on the server, generating HTML which is then sent to the
client. The client would receive the results of running that script, but would not
7
know what the underlying code was. You can even configure your web server to
process all your HTML files with PHP, and then there's really no way that users
The best things in using PHP are that it is extremely simple for a
Don't be afraid reading the long list of PHP's features. You can jump in, in a short
any other CGI program can do, such as collect form data, generate dynamic page
content, or send and receive cookies. But PHP can do much more.
1.Server-side scripting: This is the most traditional and main target field
for PHP. You need three things to make this work. The PHP parser (CGI or server
module), a web server and a web browser. You need to run the web server, with a
connected PHP installation. You can access the PHP program output with a web
browser, viewing the PHP page through the server. All these can run on your
Command line scripting: You can make a PHP script to run it without
any server or browser. You only need the PHP parser to use it this way. This type
of usage is ideal for scripts regularly executed using cron (on *nix or Linux) or
8
Task Scheduler (on Windows). These scripts can also be used for simple text
processing tasks.
language to create a desktop application with a graphical user interface, but if you
know PHP very well, and would like to use some advanced PHP features in your
client-side applications you can also use PHP-GTK to write such programs. You
also have the ability to write cross-platform applications this way. PHP-GTK is an
PHP can be used on all major operating systems, including Linux, many
Mac OS X, RISC OS, and probably others. PHP has also support for most of the
web servers today. This includes Apache, Microsoft Internet Information Server,
Personal Web Server, Netscape and iPlanet servers, Oreilly Website Pro server,
Caudium, Xitami, OmniHTTPd, and many others. For the majority of the servers,
PHP has a module, for the others supporting the CGI standard, PHP can work as a
CGI processor.
One of the strongest and most significant features in PHP is its support
Adabas D
dBase
9
Empress
FilePro (read-only)
Hyperwave
IBM DB2
Informix
Ingres
InterBase
FrontBase
mSQL
Direct MS-SQL
MySQL
ODBC
Ovrimos
PostgreSQL
SQLite
Solid
Sybase
Velocis
Unixdbm
10
• Because managing large sites with only static HTML pages is
• Because through the dynamic pages, users can interact (Forum, chat)
• Because through the dynamic pages we can offer value added services
(By Arus)
MySQL
What is MySQL?
MySQL is a fast, easy-to-use RDBMS used being used for many small
packages.
11
• MySQL uses a standard form of the well-known SQL data language.
• MySQL works very quickly and works well even with large data sets.
• MySQL is very friendly to PHP, the most appreciated language for web
development.
table. The default file size limit for a table is 4GB, but you can increase
this (if your operating system can handle it) to a theoretical limit of 8
environments.
3. SYSTEM DESIGN
12
13
3.2. CONTEST LEVEL DIAGRAM
14
3.3. DATAFLOW DIAGRAM
Data flow diagram (DFD) is a tool developed for he purpose of
graphically representing t he system in order t make the classification of
system requirements easy and identifying the major transformation that will
become modules in system design. So, it is starting point of the design
phase that functionally decomposes specifications down phase to the lowest
level of details. This diagram follows a top down approach. As the
overview mode is exploded, lower level diagrams can be obtained that
shows additional features. Each process in the data flows diagram can be
exploded into yet more detailed data flow diagram.
15
LEVEL 0:
16
LEVEL 1:
17
3.3. ER DIAGRAM
18
Table name: customer_info
19
Description: Stores the room booking details
Table name:food_info
20
Description: Stores the food order details
21
Field Name Datatype Size Constraints Description
Index.php
22
<!--End of Header-->
<div class="container">
<?php include'sidebar.php';?>
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
<legend><h2 class="text-left">About</h2></legend>
</fieldset>
23
</div>
</div>
</div>
</div>
<!-- </div>-->
</div>
<!--/span-->
<!--Sidebar-->
</div>
<!--/row-->
<!--End of Header-->
<div class="container">
<?php include'sidebar.php';?>
24
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
<legend><h2 class="text-left">Contact</h2></legend>
marginheight="0" marginwidth="0"
src="https://www.google.co.in/maps/search/hotel+gowri+shankar+tuticorin+
google+map+link/@13.0475255,80.2090117,11z/data=!3m1!
4b1"></iframe>
msa=0&msid=216284867372251359438.0004f12903dc23b39f7d5&am
p;ie=UTF8&t=h&ll=9.991135,122.813008&spn=0.00317,0.0
03219&z=17&source=embed" style="color:#0000FF;text-
<p>
25
<p>No 54, D Gin Factory Road,<br/>
Thoothukudi - 628002<br/>
</p></p>
</fieldset>
</div>
</div>
</div>
</div>
<!-- </div>-->
</div>
<!--/span-->
<!--Sidebar-->
</div>
<!--/row-->
26
<!--End of Header-->
<div class="container">
<?php include'sidebar.php';?>
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
<?php
$cur = $amen->listOfamenities();
foreach($cur as $amenity){
27
echo '<a href="'.$image.'" rel="prettyPhoto[mwaura]"><img src="'.
<br>'.$amenity->amen_name.'</a>';
echo'</div>';
?>
</fieldset>
</div>
</div>
</div>
</div>
<!-- </div>-->
28
</div>
<!--/span-->
<!--Sidebar-->
</div>
<!--/row-->
<div class="container">
<?php include'sidebar.php';?>
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
29
<legend><h2 class="text-left">Company Mission</h2></legend>
and to offer top quality service to our entire guest and provided comfort
abundance.</p>
</fieldset>
<fieldset>
quality
Hotel and conference facilities, in order to fulfill the best way in the relevant
</fieldset>
<fieldset>
<legend><h2 class="text-left">About</h2></legend>
On the year 2003, Elizabeth Gasataya and Family have started a business. It
30
Negros Occidental Philippines 6111. It was well renovated with 14 air
conditioned rooms, Hot and Cold Shower, Cable Television and WIFI area.
</fieldset>
<br/><br/><br/><br/>
<fieldset>
<?php
$cur = $mydb->loadResultList();
foreach($cur as $room){
$image = 'admin/mod_room/'.$room->roomImage;
<br>'.$room->roomName.'<br>'.$room->typeName.'</a>';
31
echo'</div>';
?>
</fieldset>
</div>
</div>
</div>
</div>
<!-- </div>-->
</div>
<!--/span-->
<!--Sidebar-->
32
</div>
<?php
require_once("includes/initialize.php");
$content='home.php';
switch ($view) {
case '1' :
$title="Home";
$content='home.php';
break;
case '2' :
$title="Gallery";
$content ='gallery.php';
break;
case '3' :
$title="About Us";
$content = 'about.php';
break;
case '4' :
33
$title="Contacts";
$content ='contact.php';
break;
case '5' :
$title="Room Rates";
$content='rates.php';
break;
case '7' :
$title="Location";
$content ='sitemap.php';
break;
default :
$title="Home";
$content ='home.php';
require_once 'theme/template.php';
?>
34
<?php
require_once("includes/initialize.php");
session_start();
unset($_SESSION['guest_id']);
unset($_SESSION['name']);
unset($_SESSION['last']);
unset($_SESSION['country']);
unset($_SESSION['city']);
unset($_SESSION['address']);
unset($_SESSION['zip']);
unset($_SESSION['phone']);
unset($_SESSION['email']);
unset($_SESSION['pass']);
unset($_SESSION['from']);
35
unset($_SESSION['to']);
//session_destroy();
redirect(WEB_ROOT ."index.php?logout=1");
?>
<?php
$arrival= '';
$departure= '';
if (isset($_SESSION['from'])){
$arrival = $_SESSION['from'];
$departure = $_SESSION['to'];
if(isset($_POST['btnbook'])){
if (!isset($_SESSION['from']) || !isset($_SESSION['to'])){
message("Please Choose check in Date and Check out Out date to continue
reservation!", "error");
redirect("index.php?page=5");
36
}
if(isset($_POST['roomid'])){
$_SESSION['roomid']=$_POST['roomid'];
redirect(WEB_ROOT. 'booking/');
/*if(!isset($_POST['adults'])){
redirect(".WEB_ROOT. 'booking/");
//exit;
}*/
/* if(isset($_POST['adults'])&&isset($_POST['child'])){
$_SESSION['roomid']=$_POST['roomid'];
$_SESSION['adults'] = $_POST['adults'];
$_SESSION['child'] = $_POST['child'];
*/
// $_SESSION['roomid']=$_POST['roomid'];
//exit;
37
//}
//}
?>
<!--End of Header-->
<div class="container">
<?php include'sidebar.php';?>
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
<p class="bg-warning">
<?php
$departure.'</strong> </div>';
?></p>
38
<legend><h2 class="text-left">Room and Rates</h2></legend>
<?php
$cur = $mydb->loadResultList();
WHERE ((
OR (
39
OR (
$stats = $mydb->executeQuery();
$rows = mysql_fetch_assoc($stats);
$image = 'admin/mod_room/'.$result->roomImage;
$roomName; ?>"/>';
echo '</div>';
color:#000033;">';
40
echo '<form name="book" method="POST" action="'.'index.php?
page=5">';
>Children.'<br/>
$status=$rows['STATUS'];
if($status=='pending'){
size:16px;"><strong>Reserve!</strong></div><br>';
}elseif($status=='Confirmed'){
size:16px;"><strong>Book!</strong></div><br>';
}else{
echo '
<div class="form-group">
<div class="row">
41
<div class="col-xs-12 col-sm-12">
</div>
</div>
</div>';
echo '</form>';
echo '</div>';
echo '</div>';
?>
42
</fieldset>
</div>
</div>
</div>
<!-- </div>-->
</div>
<!--/span-->
<!--Sidebar-->
</div>
<!--/row-->
<?php
if(isset($_POST['login'])){
$email = $_POST['log_email'];
$pass = $_POST['log_pword'];
43
redirect("index.php");
} else {
if($res == true){
redirect("index.php");
}else{
administrator.","error");
redirect("index.php");
?>
<!--Side bar-->
44
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"
role="navigation">
<div class="sidebar-nav">
<div class="panel-body">
<div class="form-group">
<div class="row">
45
</div>
</div>
</div>
<div class="form-group">
<div class="row">
link-format="yyyy-mm-dd">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
46
<button type="submit" class="btn btn-primary"
align="right"name="avail">Check Availability</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<?php if(!isset($_SESSION['guest_id'])){
<div class="panel-body">
47
<div class="form-group">
<div class="row">
name="log_email">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
name="log_pword">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
48
<button type="submit" class="btn btn-primary" align="right"
name="login">Sign in</button>
</div>
</div>
</div>
</div>
</form>
</div>';
}else{
<div class="panel-body">
<p><b>'.$_SESSION['name'].' '.$_SESSION['last'].'</b><br/>
$_SESSION['email'].'</b><br/>
$_SESSION['phone'].'</b><br/><br/>
49
<a href="logout.php" class="btn btn-default">Logout <span
class="glyphicon glyphicon-log-out"></span></a>
</div>
</div>';
?>
</div>
<form name="clock">
value="">
</form>
<hr>
50
</div>
<!--/.well -->
</div>
<!--/span-->
<!--End of Header-->
<div class="container">
<?php include'sidebar.php';?>
<!--<div class="jumbotron">-->
<div class="">
<div class="panel-body">
<fieldset>
<legend><h2 class="text-left">Location</h2></legend>
51
<iframe width="500" height="350" frameborder="0" scrolling="no"
marginheight="0" marginwidth="0"
src="https://maps.google.com/maps/ms?
msa=0&msid=216284867372251359438.0004f12903dc23b39f7d5&am
p;ie=UTF8&t=h&ll=9.991135,122.813008&spn=0.00317,0.0
03219&z=17&output=embed"></iframe>
msa=0&msid=216284867372251359438.0004f12903dc23b39f7d5&am
p;ie=UTF8&t=h&ll=9.991135,122.813008&spn=0.00317,0.0
03219&z=17&source=embed" style="color:#0000FF;text-
corridor circuit, Hells gate Naivasha, Maasai mara, Lake Nakuru and the
lake Bogoria hot spirngs. In addition we have easy access to the northern
</i></p>
</fieldset>
</div>
52
</div>
</div>
<!-- </div>-->
</div>
<!--/span-->
<!--Sidebar-->
</div>
<!--/row-->
<!DOCTYPE html>
<html>
<head>
<title></title>
media="screen">
</head>
<body>
53
<div class="container">
<fieldset>
<legend>Bootstrap-DateTimePicker</legend>
<div class="form-group">
Time</label>
field="dtp_input1">
remove"></span></span>
th"></span></span>
</div>
</div>
<div class="form-group">
54
<div class="input-group date form_date col-md-5" data-date="" data-date-
format="yyyy-mm-dd">
remove"></span></span>
calendar"></span></span>
</div>
</div>
<div class="form-group">
remove"></span></span>
time"></span></span>
55
</div>
</div>
</fieldset>
</form>
</div><!---End Container-->
charset="UTF-8"></script>
charset="UTF-8"></script>
charset="UTF-8"></script>
<script type="text/javascript">
as an argument to be
$('.form_datetime').datetimepicker({
56
language: 'en',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1
});
$('.form_date').datetimepicker({
language: 'en',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
minView: 2,
forceParse: 0
});
57
//this is for Time Only
$('.form_time').datetimepicker({
language: 'en',
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 1,
minView: 0,
maxView: 1,
forceParse: 0
});</script></body></html>
5. SYSTEM TESTING
ensuring that the system works accurately and efficiently before live
errors that is making the program fail. The tester may analysts, programmer
58
program fail. Analysts know that an effective testing program does not
system.
system. Testing to vital for the success of the project, whichis the last stage
literature. All provide the developer with a template for testing and
Testing begins at the module level and works “outward” toward the integration of
The developer of the software and independent test group conducts testing.
Unit Testing
59
In unit testing we have to test the programs making up the
system. For this reason unit testing is sometimes called as the Program
testing. The software units in a system are modules and routines that are
to locate errors. This enables, to detect errors in coding and logic that are
contained within the module alone. Unit testing can be performed from the
bottom up, starting with the lowest level modules and proceeding one at a
time. Unit testing is done for each module in Online Examination. This
ensures that the value we enter match with the data type and within the
specified limits.
Integration Testing
Data can be lost across any interface, one module can have
testing for conducting tests to uncover errors associated within the interface.
The objective is to take unit tested modules and build a program structure.
All the modules are combined and tested as a whole. Here correction is
difficult because the vast expenses of the entire program complicate the
isolation of causes. Thus in the integration testing step, all the errors are
60
corrected for the next testing steps.
tested. This testing provides the assurance that the application is well
Validation Testing
is that validation succeeds when the software functions in a manner that can
can only enter the numeric value not the text value. For e.g.: in phone
number field user can only enter numeric value to it. The system is user
each level.
Output Testing
61
Output testing is series of different test whole primary purpose is the
fully exercise the company based system.Although each test has a different
purpose all the works should verify that all system elements have been
suitspecification. Then using the test data prepared, the wholesystem was
template for software testing is set of steps into which we can place specific
test case design techniques and testing methods-should be defined for the
and clear form errors. Some useful and practical approach to trace the errors
should be employed. Test cases have been developed for this purpose.
A test case is a set of data that the system will process as normal input.
62
that the system works accurately and efficiently before live operation
63
6. SYSTEM IMPLEMENTATION
implementation. The other aspects are the post implementation review and
software maintenance.
is turned into a working system and is giving confidence on the new system
for the users that it will work efficiently and effectively. It involves careful
preparing the implementation are education and training of users. The more
complex system being implemented, the more involved will be the system
According to this plan, the activities are to be carried out, discussions are
made regarding the equipment and resources and the additional equipment
critical stage in achieving a successful new system and in giving the users
confidence that the new system will work is effective. The system can be
implemented only after thorough testing. This method also offers the
greatest security since the old system can take over if the errors are found or
inability to handle certain type of transactions while using the new system.
6.2.IMPLEMENTATION PLAN:
To install this software in the system the following steps must be
followed:
Install xWampserver 2.0
65
Thus the system is ready to start the operation of the project
7. FUTURE ENHANCEMENTS
66
“Hotel Reservation System “ project is developed considering only material
and money but it can be extended for man and machine machine also. Since
provides efficiency in many ways. All the features that is required for the
application has it s own merits and demerits. The project has covered almost
the existing modules or adding new module can append improvements. This
project provides detailed information about all the Room Booking , Rook
HOME PAGE
67
Users Rooms View
68
69
How to Contact and Where is located.
List of Amenities
70
Booking room
71
User Registration
72
Guest User –After Logged-in
73
Reservation Billing Details
74
User-Reservation Printing Proof
75
Administrator’s Login Page
76
Admin- Users Details
77
Admin –RoomType, Rooms Add/Update
78
79
80
Admin- Amenities List / Update
81
Admin- Viewing Users’ Comments
82
Admin – Reservation Maintenance
83
9. CONCLUSION
tedious process requiring lot of effort more care has been taken for the
minimization of clerical work, easy and efficient data storage and report
generation
84
10. BIBLIOGRAPHY
Websites:
1. http://www.nationalrail.co.uk/
2. http://www.us-football-tickets.com/
3. http://www.hotels.com/
4. http://www.ticketmaster.co.uk/
5. http://www.seetickets.com/
6. Dix et al. (1998) Human-Computer Interaction, Ch3 : The interaction
Books:
edition ,O'Reilly,2004
edition, Apress,2003
85