Complete Project Documentation
Complete Project Documentation
SYNOPSIS
Page |1
Free-Friendly Travel Mood
SYNOPSIS
1. Title of the Project:
Free Friendly Travel Mood
3. Project Category:
RDBMS (Relational Database Management System)
Programming Language:
Front End: PHP:
Page |2
Free-Friendly Travel Mood
5. Project modules:
The project has following modules:
Customer Account module: This module stores customer registration
details. Customer needs login to the website to access all features of the
website. Customer can update his profile or he can change password after
the login.
Tourism places: This module stores tourism information with different
places to visit, facilities, location map, contact details, etc. Even this stores
photos and video gallery of tourism place.
Gallery module: This module is for employees to upload photos and
videos of tourism places.
Comment section: This comment section is for customers to post their
tourism experiences with photo and videos. Other customers can view
published comments and videos.
Room booking module: This module shows list of available rooms and
hotels. Customer can book rooms through online.
Cab booking module: This module allows customer to book cabs through
online.
Online food order: Customer can order food items through online.
Gift Coupon module: Gift coupon will be given to the customer for best
photos and videos. Gift coupons can be redeemed during room booking, cab
booking and food order.
Payment module: This module shows payment report and booking report.
Dashboard module: Administrator can configure complete settings of the
website.
Report module: This module is for employees to generate various kinds of
reports.
- Customer report
- Payment report
- Room booking report
- Cab booking report
- Online food order report
Page |3
Free-Friendly Travel Mood
7. Limitations:
Internet connection required to access this website.
Basic computer knowledge required.
Page |4
Free-Friendly Travel Mood
SOFTWARE
REQUIREMENT
SPECIFICATION
Page |5
Free-Friendly Travel Mood
1.1. Purpose
The main purpose of the project is to provide information about tours and
travels Mainly this website provide complete information about tourism places with
facilities, location map, contact details. Even it allows customer to book lodges, Cabs
and Food order through online. Customer can ask all kinds of query and they can post
travel experiences in the comment box. Administrator is having full authority of the
website and he can monitor the website activities.
This project is to provide user friendly hotel booking and service portal which
helps customers as well as management. In this project customer can search for hotels
or lodges and they can book hotel rooms along with hotel services. Services like cab
services, food order services can be booked through online. The existing system doesn’t
provide online booking features but in our system we implement all these features
which is helps for customers and hotel management.
1.2. Scope
The project has following scopes and features:
Free-Friendly Travel Mood project is to develop a system that automates the processes
and activities of a travel and the purpose is to design a system using which one can
perform all operations related to traveling.
Customers can decide about places they want to visit and make bookings online for
travel and accommodation.
Customer can view complete travel information with Google Maps, Hotel facilities,
Restaurant facilities, vehicle services through online.
Page |6
Free-Friendly Travel Mood
1.3. References
www.w3schools.com
www.php.net
www.mysql.com
www.tutorialspoint.com
www.stackoverflow.com
1.4. Overview
The SRS is organized into two main sections. The first is The Overall
Description, the second is the Specific Requirements. The Overall Description
will describe the requirements of Free-Friendly Travel Mood. The Specific
Requirements section will describe in detail the requirements of the system.
2. Overall Description
2.1. Product perspective
The Free-Friendly Travel Mood is a web based application and it can be
accessed over the internet. The system is developed in PHP which needs apache server
to execute programming. All databases for the Free-Friendly Travel Mood will be
configured using MySQL database. These databases include Travel location, Tourism
places, hotel location, hotel rooms, customers information, billing details and other
service information.
This web application allows visitors to easily get the informations about the hotels.
Users who travel around the country can easily get the information about the
different hotels. This website allows customers to book rooms through online by
entering customers profile information and room details.
During the booking process, customer can see available rooms for the desired
period and will have the opportunity to select one or more rooms as well as the
number of guests in each room.
Page |7
Free-Friendly Travel Mood
The customers information will contain all the information of the customer such
as first name, last name, number of occupants, room details, phone number,
payment details, check in date and time, check out date and time, total amount,
etc.
Allows addition, deletion and modification of information on rooms, tariff rates
and room type for administrator.
It has two types of payment options i.e; cash payment through offline and card
payment through online.
Administrator can do the settings of travels feature, routes feature, reservations
feature and feedbacks feature.
Administrator manages all information and has access rights to add, delete, edit
and view the data related to places, travels, routes, bookings, etc.
The management or customer can generate billing or invoice report.
Administrators:
Administrators are the one who can add or manages travel locations and he inputs
information about tourism places.
Employees:
Employees are the staffs who works for hotel, restaurant, cab services. Limited
authority has given to the employees.
End users:
The end user will be the customers one who visits the website and books the hotel
rooms.
Every user must enter valid login id and password to use this web application.
Page |8
Free-Friendly Travel Mood
The Cash payment and Credit card payment is only for testing purpose and it’s a virtual
payment gateway.
3. Specific Requirements
This section contains all the software requirements at a level of detail which enables
designers to design a system to satisfy those requirements and testers to test that the
system satisfies those requirements.
o Login module
Page |9
Free-Friendly Travel Mood
o Forgot password
o Profile module
o Change password
Tourism places:
This module stores tourism information with different places to visit, facilities, location
map, contact details, etc. Even this stores photos and video gallery of tourism place.
Sub modules of this module are:
o Add Tourism Location
Hotel module:
In this module for administrator can add different hotel details, hotel rooms with
hotel type.
Sub modules of this module are:
o Search hotel
o Add hotel
o View hotel
o Add hotel facilities
o View hotel facility
o Upload hotel images
o View hotel images
Gallery module:
This module is for employees to upload photos and videos of tourism places.
Sub modules of this module are:
o Add Album
o View album
o Upload photos
o View photos
o Upload video
o View video
Comment section:
This comment section is for customers to post their tourism experiences with
photo and videos. Other customers can view published comments and videos.
Sub modules of this module are:
P a g e | 10
Free-Friendly Travel Mood
o Post comment
o View comment
Rooms module:
In this module, administrator can add rooms and it has options to add different
types of rooms.
Sub modules of this module are:
o Add Room type:
o View room type
o Add hotel rooms
o View hotel rooms
P a g e | 11
Free-Friendly Travel Mood
o Vehicle booking
Payment module:
The customer can make payment for the bill.
Sub modules of this module are:
o Make payment
o Cancel booking
Report module:
This module is for employees to generate various kinds of reports.
o Customer report
o Payment report
Dashboard module:
Administrator is the main user of the project. Employees are one who works for the
website. This module is for administrator where administrator can add different
Tourism places, Hotel details, Food item details, Cab details, etc.
P a g e | 12
Free-Friendly Travel Mood
Dashboard module
Settings module
Add location
View location
All inputs should be checked for validation and messages should be given for the
improper data.The invalid data are to be ignored and error message should be given.
Details provided by the user during his sign up should be stored in the database.
While adding the products to the system,mandatory fields must be checked for
validation whether user has filled appropriate data in these mandatory fields.If
not,proper error message should be displayed or else the data is to be stored in the
database for later retrieval.
Code efficiency
Memory efficiency
Response time
Maintainability
P a g e | 13
Free-Friendly Travel Mood
Security
The system is supposed to be having good memory space and RAM should be Above
256 MB preferably.
The sound card and graphics card will have to be of good quality and capacity.
The load time for user interface screens shall take no longer than three seconds.
In case the customer forget their password, they can recover the password in the Forgot
Password panel.
Reliability:
This system is designed to have very simple database just to cater the exact need of
“Free-Friendly Travel Mood”. It is tested for all the constraints at development stage.
Availability:
This system will only available till the system on which it is installed is running.
Security:
This system is provided with authentication without which no user can pass. So
only the legitimate users are allowed to use the application. If the legitimate users share
the authentication information then the system is open to outsiders.
P a g e | 14
Free-Friendly Travel Mood
Maintainability:
There is maintenance required for the website. The database is provided by the
Administrator as well as the end-use.
Portability:
The system works anywhere with the internet connection.
5. Other requirements:
None
P a g e | 15
Free-Friendly Travel Mood
SYSTEM DESIGN
P a g e | 16
Free-Friendly Travel Mood
SYSTEM DESIGN
Introduction:
System Analysis:
The system analysis approach emphasis a closed look on all parts of the system.
The analyst must consider all the system elements, their inputs, outputs, control,
feedback and the environment when the system is being constructed.
This web application allows visitors to easily get the information about the hotels.
Users who travel around the country can easily get the information about the
different hotels. This website allows customers to book rooms through online by
entering customers profile information and room details.
During the booking process, customer can see available rooms for the desired
period and will have the opportunity to select one or more rooms as well as the
number of guests in each room.
The customers information will contain all the information of the customer such
as first name, last name, number of occupants, room details, phone number,
payment details, check in date and time, check out date and time, total amount,
etc.
Allows addition, deletion and modification of information on rooms, tariff rates
and room type for administrator.
It has two types of payment options i.e; cash payment through offline and card
payment through online.
Administrator can do the settings of travels feature, routes feature, reservations
feature and feedbacks feature.
Administrator manages all information and has access rights to add, delete, edit
and view the data related to places, travels, routes, bookings, etc.
The management or customer can generate billing or invoice report.
1. Program Description:
Context Flow Diagram:
Context flow diagram is a top level data flow diagram. It only contains
one process node that generalized the function of the entire system in relationship
P a g e | 17
Free-Friendly Travel Mood
A DFD represents flow of data through a system. Data flow diagrams are
commonly used during problem analysis. It views a system as a function that performs the
input into the desired output. A DFD shows movement of data through the different
transformations or processes in the system.
Data Flow diagrams can be used to provide the end users with the physical idea of
where the data they input ultimately has an effect upon the structure of whole system from
P a g e | 18
Free-Friendly Travel Mood
order to dispatch to restock how any system is developed can be determined through data
flow diagram. The appropriate register saved in database and maintained by appropriate
authorities.
Symbol Description
The circle or bubble represents a process.
A process is named and each process is
represented by a named circle.
P a g e | 19
Free-Friendly Travel Mood
customer_name,emailed,p
customer details (2.2)
assword
Registration
process
Customer
location_id,
Customer check_in,cost
room (2.3) Room
booking booking room_booking
details process
food_order_id,item_id,
item_cost,qty
Food items entry
details food_order
(2.4) Food
order process
vehicle_typeid,booking_d
Cab booking details ate,booking_time,cost
EMPLOYEE
Registration
login
Free Friendly
ADMIN
CUSTOMER Travel
Mood
view
report
Free friendly
travel Mood
location_id,
tourism_place ,
features
Feed back rating tourism_place
Posting Tourism_placeid,
tourism_place
feedback
customer
tourism_placeid
tourism_place
Feedback
Photo and
video gallery
posting
gallery
gallery file,
gallery
note
registration
process Customer_name,
email_id,password
P a g e | 22
Logged_in user
Free-Friendly Travel Mood
address,
Profile detail city,
pincode
update
profile
hotel_image
P a g e | 23
Free-Friendly Travel Mood
Adding
room
type room_type
customer
Room booking detail
Room
booking room_booking _id ,
process hotel_id, check_in
room_booking
Payment detail payment_id,payment_date,
total_amt
Payment
process
Payment
Adding food_category,note
food
category
food_category
Food item Adding food_category_id,
deatil food food_category
item
item_id,
customer Item item_name,item_cost
P a g e | 24
Free-Friendly Travel Mood
item_id,
Food order detail
item_name,item_cost
Food item_id,
order item_date,item_cost
process
food_order
food_order_id,
booked_date
payment_date ,
Payment
total_amt
detail
Payment payment
DFD LEVEL 2.5 process
Adding vehicle_type,
km_cost,
vehicle
vehicle_img
type
vehicle_type
Cab
booking Cab
customer detail booking
process vehicle_typeid
vehicle_type,
bookingdate, km_cost
booking_time,
total_km,cost
cab_booking
P a g e | 25
cab_bookingid,
Free-Friendly Travel Mood
Payment detail
Payment
process
1. Entity-Relationship Diagram:
P a g e | 26
Free-Friendly Travel Mood
ER DIAGRAM
P a g e | 27
Free-Friendly Travel Mood
P a g e | 28
Free-Friendly Travel Mood
DATABASE
DESIGN
P a g e | 29
Free-Friendly Travel Mood
DATABASE DESIGN
Introduction:
Database: A Database is collection of related data, which can be of any size and
complexity. By using the concept of Database, we can easily store and retrieve the data.
The major purpose of a database is to provide the information, which utilizes it with the
information’s that the system needs according to its own requirements.
Database Design: Database design is done before building it to meet needs of end-
users within a given information-system that the database is intended to support. The
database design defines the needed data and data structures that such a database comprises
Customer
cab booking
discount coupon
feedback
food_category
food_order
gallery
hotel
hotel_facility
hotel_image
item
location
payment
room_booking
room_type
staff
vehicle_type
tourism_place
P a g e | 30
Free-Friendly Travel Mood
P a g e | 31
Free-Friendly Travel Mood
d Key
food_category varchar(50) Not null Food category
Note text Not null Note on the Food Category
Status varchar(10) Not null Food Category Status
P a g e | 32
Free-Friendly Travel Mood
P a g e | 33
Free-Friendly Travel Mood
P a g e | 34
Free-Friendly Travel Mood
P a g e | 35
Free-Friendly Travel Mood
P a g e | 36
Free-Friendly Travel Mood
DETAILED
DESIGN
DETAILED DESIGN
Introduction
Detailed design is the second level of design process. During detail design, we
specify how the module in the system interacts with each other and the internal logic of
each of the modules specified during system design is decided, hence it is called as logic
design.
Detailed design essentially expands the system design and database design to
conatin a more detailed description of the processing logic and data structures so that the
design is sufficiently complete for coding.
Applicable documents
P a g e | 37
Free-Friendly Travel Mood
Module of Employee
This module is designed for the employee. They will have their own
account provided by admin and they perform the activities which are allotted to
them.
1.Registration
P a g e | 38
Free-Friendly Travel Mood
Processing:Inserts user details into the database encrypting sensitive information and
validating the users details to prevent misuse of the website.
2.Login
In this module,User/Admin logs into the ‘FREE FRIENDLY TRAVEL MOOD’ Website.
Input: Email ID,Password
Output: Redirect to the admin console/user profile depending on the type of user
Processing:
3.Tourism places
This module stores tourism information with different places to visit, facilities, location
map, contact details, etc. Even this stores photos and video gallery of tourism place.
Input: Add Tourism Location,View Tourism Location,Add travel location,View travel
location
Ouput:Redirects to the page which lets the user to set location name,tourism place name
and then redirects to the page to perform different bookings.
Processing: Inserts locations ,images and tourism place details to the database.
4.Hotel module:
In this module administrator can add different hotel details, hotel rooms with hotel
type.
Input: Search hotel, Add hotel, View hotel, Add hotel facilities, View hotel facility,
Upload hotel images,View hotel images
Output: Redirects to the page which lets the user to set Hotel name,Hotel type and then
redirects to the page to perform different bookings.
Processing: Stores Hotel locations ,Hotel names, Hotel type, Hotel description Address,
Pincode, Map, Hotel policies, Status to the database.
5.Gallery module:
This module is for employees to upload photos and videos of tourism places.
6.Rooms module
In this module, administrator can add rooms and it has options to add different
types of rooms
Input: Add Room type,View room type,Add hotel rooms,View hotel rooms
Output: Redirects to the page which lets the user to set Room type,Adding Hotel
rooms and then redirects to the page to perform booking.
P a g e | 39
Free-Friendly Travel Mood
9.Payment module:
The customer can make payment for the bill.
Input: Make payment, View payment report, Cancel booking,View cancellation
report
Output: Redirects to the page which lets the user to set Payment type, Card type,
Card holder name, Card no, CVV no, Expiry Date.
Processing: Stores Payment type, Card type, Card holder name, Card no,
CVV no, Expiry Date to the database.
10.Dashboard module:
Administrator is the main user of the project. Employees are one who works for the
website. This module is for administrator where administrator can add different
Tourism places, Hotel details, Food item details, Cab details, etc.
Input: Dashboard module, Settings module, Add location, View location
Output: Displays different Tourism places, Hotel details, Food item details, Cab
details, etc to the users and then redirects to the page to perform different bookings.
Processing: Stores different Tourism places, Hotel details, Food item details, Cab
details, etc to the database.
P a g e | 40
Free-Friendly Travel Mood
Gift Coupon Will Be Given To The Customer For Best Photos And Videos. Gift
Coupons Can Be Redeemed During Room Booking, Cab Booking And Food Order
Input: Admin Enter the coupon details namely coupon number.
Output: As soon as admin press submit a pop up will be available in customer
page.
Processing: The admin will select the customer for coupon and enter the coupon
details and press submit as soon as he submit it notification will be pop in the
customer page.
P a g e | 41
Free-Friendly Travel Mood
CODING
Customer
<?php
include("header.php");
if(!isset($_SESSION[staffid]))
{
//echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
$password = md5($_POST[password]);
if(isset($_GET[editid]))
{
$sql = "UPDATE customer SET
customer_name='$_POST[customer_name]',address='$_POST[address]',city='$_P
P a g e | 42
Free-Friendly Travel Mood
OST[city]',pincode='$_POST[pincode]',contact_no='$_POST[contact_no]',email_i
d='$_POST[email_id]',password='$password',status='$_POST[status]' WHERE
customer_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Customer record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO customer
(customer_name,address,city,pincode,contact_no,email_id,password,status)
values('$_POST[customer_name]','$_POST[address]','$_POST[city]','$_POST[pin
code]','$_POST[contact_no]','$_POST[email_id]','$password','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Customer details accepted..');</script>";
echo "<script>window.location='customer.php';</script>";
}
else
{
echo "<script>alert('Customer account already registered
with this Email ID.....');</script>";
//echo mysqli_error($con);
}
}
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM customer where
customer_id='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Customer Details </h2>
</div>
P a g e | 43
Free-Friendly Travel Mood
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" onsubmit="return validateform()">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Name
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter Your Name"
name="customer_name" id="customer_name" class="form-control" value="<?php
echo $rsedit[customer_name];?>"><span id="errcustomer_name" class="errmsg
flash"></span>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Password
</div>
<div class="col-md-10">
<input type="password" placeholder="Enter Password" name="password"
id="password" class="form-control"><span id="errpassword" class="errmsg
flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Confirm Password
</div>
<div class="col-md-10">
<input type="password" placeholder="confirm Password"
name="cpassword" id="cpassword" class="form-control"><span
id="errcpassword" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
P a g e | 44
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
City
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter City" name="city" id="city"
class="form-control" value="<?php echo $rsedit[city];?>"><span id="errcity"
class="errmsg flash"></span>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Pincode
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter Pincode" name="pincode"
id="pincode" class="form-control" value="<?php echo $rsedit[pincode];?>"><span
id="errpincode" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Contact No
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter Contact Number"
name="contact_no" id="contact_no" class="form-control" value="<?php echo
$rsedit[contact_no];?>"><span id="errcontact_no" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Email Id
</div>
<div class="col-md-10">
P a g e | 45
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select><span id="errstatus" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
P a g e | 46
Free-Friendly Travel Mood
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function validateform()
{
var i = 0;
$( ".errmsg" ).empty();
if(!
document.getElementById("customer_name").value.match(alphaspaceExp))
{
document.getElementById("errcustomer_name").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Entered customer name is not
valid";
i=1;
}
if(document.getElementById("customer_name").value== "")
{
document.getElementById("errcustomer_name").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Customer name should not be
empty";
i=1;
}
if(document.getElementById("password").value.length < 8)
{
document.getElementById("errpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Password should contain more
than 8 characters";
i=1;
}
if(document.getElementById("password").value== "")
{
P a g e | 47
Free-Friendly Travel Mood
if(document.getElementById("password").value !=
document.getElementById("cpassword").value)
{
document.getElementById("errcpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Password and confirm password
not matching...";
i=1;
}
if(document.getElementById("cpassword").value== "")
{
document.getElementById("errcpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Confirm Password should not be
empty...";
i=1;
}
if(document.getElementById("address").value== "")
{
document.getElementById("erraddress").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Enter the address";
i=1;
}
if(document.getElementById("city").value== "")
{
document.getElementById("errcity").innerHTML = " <i class='fa
fa-times-circle' aria-hidden='true'></i>Enter the city name";
i=1;
}
if(document.getElementById("pincode").value.match(numericExpression))
{
document.getElementById("errpincode").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Pincode should be entered";
i=1;
}
if(document.getElementById("contact_no").value.match(numericExpression)))
{
document.getElementById("errcontact").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Enter the Contact number";
i=1;
}
if(!document.getElementById("email_id").value.match(emailpattern))
{
document.getElementById("erremail_id").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Entered Email ID is not valid...";
P a g e | 48
Free-Friendly Travel Mood
i=1;
}
if(document.getElementById("email_id").value== "")
{
document.getElementById("erremail_id").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Email ID should not be empty...";
i=1;
}
if(document.getElementById("status").value== "")
{
document.getElementById("errstatus").innerHTML = " <i class='fa
fa-times-circle' aria-hidden='true'></i>Status should not be empty...";
i=1;
}
if(i == 0)
{
return true;
}
else
{
return false;
}
}
</script>
Cab Booking
<?php
include("header.php");
if(isset($_POST[submit]))
{
$sql = "INSERT INTO
cab_booking(vehicle_typeid,customer_id,booking_datetime,flocation,tlocation,tota
l_km,cost,status)
VALUES('$_GET[vehicle_typeid]','$_SESSION[customer_id]','$_POST[booking_
date]
$_POST[booking_time]','$_POST[flocation]','$_POST[tlocation]','$_POST[total_k
m]','$_POST[costperkm]','Pending')";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
if(mysqli_affected_rows($con) ==1 )
{
$insid = mysqli_insert_id($con);
echo "<SCRIPT>alert('Cab Booking record inserted
successfully..');</SCRIPT>";
echo "<SCRIPT>window.location='cabbookingpayment.php?
cab_bookingid=$insid&vehicle_typeid=$_GET[vehicle_typeid]&paymentid=$_G
ET[paymentid]';</SCRIPT>";
}
P a g e | 49
Free-Friendly Travel Mood
}
else
{
$sql = "DELETE FROM cab_booking WHERE status='Pending'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
}
//2. Update - select record starts here
if(isset($_GET[editid]))
{
$sqledit= "SELECT * FROM cab_booking WHERE
cab_bookingid='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
//2. Update - select record ends here
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner" style="background-image:
url(images/rentacarkefalonia_by_safecarrental.png);">
<div class="container">
<center><h2>Rent a Car - Booking Detail</h2></center>
</div>
</div>
<!-- Sub Banner Start -->
P a g e | 50
Free-Friendly Travel Mood
<th>Check-out date</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM room_booking LEFT JOIN hotel ON
room_booking.hotel_id=hotel.hotel_id LEFT JOIN room_type ON
room_booking.room_typeid=room_type.room_typeid LEFT JOIN customer ON
room_booking.customer_id=customer.customer_id LEFT JOIN payment ON
payment.room_booking_id=room_booking.room_booking_id LEFT JOIN
tourism_location ON tourism_location.location_id=hotel.location_id WHERE
room_booking.status='Active' AND payment.payment_id='$_GET[paymentid]'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
while($rs = mysqli_fetch_array($qsql))
{
$room_booking_id = $rs[room_booking_id];
$hotelid= $rs[hotel_id];
$_GET[hotel_id] = $hotelid;
$location_name = $rs[location_name];
$hotel_pincode = $rs[hotel_pincode];
$hotel_address= $rs[hotel_address];
echo "<input type='hidden' name='room_booking_id'
value='$rs[room_booking_id]' >";
$checkin = date("d-M-Y",strtotime($rs[check_in]));
$checkout = date("d-M-Y",strtotime($rs[check_out]));
$checkindt = date("Y-m-d",strtotime($rs[check_in]));
$checkoutdt = date("Y-m-d",strtotime($rs[check_out]));
echo "<tr>
<td>$rs[hotel_name]</td>
<td>$rs[room_type]</td>";
if(!isset($_SESSION[customer_id]))
{
echo "<td>$rs[customer_name]</td>";
}
echo "<td>$rs[no_ofadults]</td>
<td>$rs[no_ofchildren]</td>
<td>$checkin</td>
<td>$checkout</td>
</tr>";
}
?>
</tbody>
</table>
<hr>
<div class="contact_left">
<div class="company_address">
<h3>Vehicle information :</h3>
P a g e | 51
Free-Friendly Travel Mood
<p>
<?php
$i=0;
$sql = "SELECT * FROM vehicle_type WHERE status='Active' AND
vehicle_typeid='$_GET[vehicle_typeid]'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
while($rs = mysqli_fetch_array($qsql))
{
if($rs['vehicle_img'] == "")
{
$imgname= "images/noimage.png";
}
else
{
if(file_exists("imgvehicletype/".$rs['vehicle_img']))
{
$imgname= "imgvehicletype/".$rs['vehicle_img'];
}
else
{
$imgname= "images/noimage.png";
}
}
?>
<div class="row">
<!-- Our Rooms Wrap Start-->
<div class="col-md-12">
<!-- iqoniq Blog Listing Start -->
<div class="mg_blog_listing our-room fancy-overlay">
<div class="thumb">
<a href="cabbooking.php?vehicle_typeid=<?php
echo $rs[0]; ?>"><img src="<?php echo $imgname ; ?>" style="height:
350px;width: 100%;"></a>
<a class="mg_zoom_icon" href="cabbooking.php?
vehicle_typeid=<?php echo $rs[0]; ?>"><i class="fa fa-search"></i></a>
</div>
<div class="text">
<h5 class="blog_title"><a href="cabbooking.php?
vehicle_typeid=<?php echo $rs[0]; ?>"><?php echo $rs['vehicle_type']; ?
></a></h5>
<ul class="blog-meta-list">
<li><span>Cost : Rs. <?php echo $kmcost =
$rs[km_cost]; ?>/KM</span></li>
</ul>
<div class="clear"></div>
</div>
</div>
<!-- iqoniq Blog Listing Start -->
P a g e | 52
Free-Friendly Travel Mood
</div>
<!-- Our Rooms Wrap End-->
</div>
<?php
}
?>
</p>
</div>
</div>
<div class="row">
<!-- Our Rooms Wrap Start-->
<div class="col-md-12">
<!-- iqoniq Blog Listing Start -->
<div class="mg_blog_listing our-room fancy-overlay"
style="padding: 20px;">
P a g e | 53
Free-Friendly Travel Mood
<div class="row">
<br>
<div class="col-md-6">
<span><label>Cost / KM</label></span>
<span><input type="text" class="form-control" name="costperkm"
id="costperkm" placeholder="Enter a location" readonly style="background-
color:grey;color:white;" value="<?php echo $kmcost; ?>" /></span>
</div>
<div class="col-md-6">
<span><label>Total KM</label></span>
<span><input name="total_km" id="total_km" type="text"
class="form-control" readonly style="background-color:grey;color:white;"
></span>
</div>
</div>
<div class="row">
<br>
<div class="col-md-6">
<span><label>Total Cost</label></span>
<span><input name="cost" id="cost" type="text" class="form-
control" value="<?php echo $rsedit[cost]; ?>" readonly style="background-
color:grey;color:white;"></span>
</div>
<div class="col-md-6">
</div>
</div>
<hr>
P a g e | 54
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4"><span><input type="submit" value="Click here to
Book" name="submit" class="mg_login_btn" style="float: left;" ></span>
</div>
<div class="col-md-4"></div>
</div>
</form>
</div>
<!-- iqoniq Blog Listing Start -->
</div>
<!-- Our Rooms Wrap End-->
</div>
<!-- #########################-->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?
sensor=false&libraries=places&key=AIzaSyDDJM57tgwCA5CYeKcfBR6Wcz3B
p_kXa34"></script>
<script type="text/javascript">
google.maps.event.addDomListener(window, 'load', function () {
var places = new
google.maps.places.Autocomplete(document.getElementById('txtPlaces'));
google.maps.event.addListener(places, 'place_changed', function ()
{
var place = places.getPlace();
var address = place.formatted_address;
var latitude = place.geometry.location.lat();
var longitude = place.geometry.location.lng();
var mesg = "Address: " + address;
mesg += "\nLatitude: " + latitude;
mesg += "\nLongitude: " + longitude;
funcalculatekm(latitude,longitude);
});
});
</script>
<script>
function funcalculatekm(latitude,longitude)
{
P a g e | 55
Free-Friendly Travel Mood
P a g e | 56
Free-Friendly Travel Mood
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO food_category
(food_category_id,food_category,note,status)
values('$_POST[food_category_id]','$_POST[food_category]','$_POST[note]','$_P
OST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Food category has been
inserted..');</script>";
echo
"<script>window.location='food_category.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM food_category where
food_category_id='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Food Category </h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="">
<div class="row">
<!-- Hotel Destination Start -->
P a g e | 57
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Food Category
</div>
<div class="col-md-10">
<input type="text" name="food_category" placeholder="Enter Food
Category" id="food_category" class="form-control" value="<?php echo
$rsedit[food_category]; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Note
</div>
<div class="col-md-10">
<textarea placeholder="Write note" name="note" id="note" class="form-
control"><?php echo $rsedit[note];?></textarea>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
P a g e | 58
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
Food_Order
<?php
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
if(isset($_GET[editid]))
{
$sql = "UPDATE food_order SET
room_booking_id='$_POST[room_booking_id]',item_id='$_POST[item_id]',custo
mer_id='$_POST[customer_id]',item_cost='$_POST[item_cost]',qty='$_POST[qty
]',status='$_POST[status]' WHERE food_order_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Food Order record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
P a g e | 59
Free-Friendly Travel Mood
}
}
else
{
$sql ="INSERT INTO
food_order(food_order_id,room_booking_id,item_id,customer_id,item_cost,qty,sta
tus)
values('$_POST[food_order_id]','$_POST[room_booking_id]','$_POST[item_id]','
$_POST[customer_id]','$_POST[item_cost]','$_POST[qty]','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Food will be deliverd to you..');</script>";
echo "<script>window.location='food_order.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Food order details </h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Room Booking
</div>
<div class="col-md-10">
<select name="room_booking_id" id="room_booking_id"
class="form-control">
<option value="">Select the hotel</option>
</select>
P a g e | 60
Free-Friendly Travel Mood
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Food Item
</div>
<div class="col-md-10">
<select name="item_id" id="item_id" class="form-control">
<option value="">Select the Food item</option>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Customer
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name" name="customer_id"
id="customer_id" class="form-control" value="<?php echo $rsedit[customer_id]; ?
>">
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Price of Food
</div>
<div class="col-md-10">
<select name="item_cost" id="item_cost" class="form-control">
<option value="">The price of Food </option>
<select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Quantity
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter quantity" name="qty" id="qty"
class="form-control" value="<?php echo $rsedit[qty]; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
P a g e | 61
Free-Friendly Travel Mood
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
Gallery
<?php
P a g e | 62
Free-Friendly Travel Mood
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
$upload_file = rand() . $_FILES[upload_file][name];
move_uploaded_file($_FILES[upload_file][tmp_name],"imggallery/".
$upload_file);
if(isset($_GET[editid]))
{
$sql = "UPDATE gallery SET
gallerytype='$_POST[gallerytype]',tourism_placeid='$_POST[tourism_placeid]'";
if($_FILES[upload_file][name] != "")
{
$sql = $sql . ",upload_file='$upload_file'";
}
$sql = $sql . ",note='$_POST[note]',status='$_POST[status]'
WHERE galleryid='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Gallery record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
gallery(gallerytype,tourism_placeid,upload_file,note,status)
values('$_POST[gallerytype]','$_POST[tourism_placeid]','$upload_file','$_POST[n
ote]','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
if($_POST[gallerytype] == "Photo Gallery")
{
echo "<script>alert('Photo has been uploaded..');</script>";
}
if($_POST[gallerytype] == "Video Gallery")
{
echo "<script>alert('Video has been uploaded..');</script>";
}
echo "<script>window.location='viewgallery.php?
tourism_placeid=$_GET[tourism_placeid]';</script>";
P a g e | 63
Free-Friendly Travel Mood
}
else
{
echo mysqli_error($con);
}
}
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM gallery WHERE
galleryid='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Gallery</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="tourism_placeid" id="tourism_placeid" value="<?
php echo $_GET[tourism_placeid]; ?>" >
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Gallery Type
</div>
<div class="col-md-10">
<select name="gallerytype" id="gallerytype" class="form-
control">
<option value="">Select the Gallery Type</option>
<?php
$arr = array("Photo Gallery","Video Gallery");
foreach($arr as $val)
{
P a g e | 64
Free-Friendly Travel Mood
if($val == $rsedit[gallerytype])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Upload the File
</div>
<div class="col-md-10">
<input type="file" placeholder="Enter the name" name="upload_file"
id="upload_file" class="form-control">
<?php
if(isset($_GET[editid]))
{
if($rsedit[upload_file] == "")
{
$img = "images/nophoto.jpg";
}
else if(file_exists("imggallery/" . $rsedit[upload_file]))
{
$img = "imggallery/" . $rsedit[upload_file];
}
else
{
$img = "images/nophoto.jpg";
}
echo "<img src='$img' style='width: 125px; height: 100px;' >";
}
?>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Note
</div>
<div class="col-md-10">
<textarea placeholder="Enter your note" name="note" id="note"
class="form-control" ><?php echo $rsedit[note];?></textarea>
P a g e | 65
Free-Friendly Travel Mood
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
P a g e | 66
Free-Friendly Travel Mood
include("footer.php");
?>
Hotel
<?php
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
if(isset($_GET[editid]))
{
$sql = "UPDATE hotel SET
location_id='$_POST[location_id]',hotel_name='$_POST[hotel_name]',hotel_type
='$_POST[hotel_type]',hotel_description='$_POST[hotel_description]',hotel_addre
ss='$_POST[hotel_address]',hotel_map='$_POST[hotel_map]',hotel_pincode='$_P
OST[hotel_pincode]',hotel_policies='$_POST[hotel_policies]',status='$_POST[stat
us]' WHERE hotel_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Hotel record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
hotel(hotel_id,location_id,hotel_name,hotel_type,hotel_description,hotel_address,h
otel_map,hotel_pincode,hotel_policies,status)
values('$_POST[hotel_id]','$_POST[location_id]','$_POST[hotel_name]','$_POST[
hotel_type]','$_POST[hotel_description]','$_POST[hotel_address]','$_POST[hotel_
map]','$_POST[hotel_pincode]','$_POST[hotel_policies]','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Hotel Record inserted..');</script>";
echo "<script>window.location='hotel.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
P a g e | 67
Free-Friendly Travel Mood
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM hotel WHERE hotel_id='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Add Hotel</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Hotel Location
</div>
<div class="col-md-10">
<select name="location_id" id="location_id" class="form-control">
<option value="">Select the place</option>
<?php
$sqltourism_location = "SELECT * FROM tourism_location where
status='Active'";
$qsqltourism_location = mysqli_query($con,$sqltourism_location);
while($rstourism_location = mysqli_fetch_array($qsqltourism_location))
{
if($rstourism_location[location_id] == $rsedit[location_id])
{
echo "<option value='$rstourism_location[location_id]'
selected>$rstourism_location[location_name]</option>";
}
else
{
P a g e | 68
Free-Friendly Travel Mood
echo "<option
value='$rstourism_location[location_id]'>$rstourism_location[location_name]</opt
ion>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel Name
</div>
<div class="col-md-10">
<input type="text" name="hotel_name" id="hotel_name" class="form-
control" value="<?php echo $rsedit[hotel_name]; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel Type
</div>
<div class="col-md-10">
<select name="hotel_type" id="hotel_type" class="form-control">
<option value="">Select the hotel type</option>
<?php
$arr =
array("Resort","Guesthouse","Villa","Cottage","Apartment","Homestays","Hotel")
;
foreach($arr as $val)
{
if($val == $rsedit[hotel_type])
{
echo "<option value='$val' selected >$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel Description
P a g e | 69
Free-Friendly Travel Mood
</div>
<div class="col-md-10">
<textarea type="text" name="hotel_description" id="hotel_description"
class="form-control" ><?php echo $rsedit[hotel_description]; ?></textarea>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Address
</div>
<div class="col-md-10">
<textarea type="text" name="hotel_address" id="hotel_address"
class="form-control"><?php echo $rsedit[hotel_address];?></textarea>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Pincode
</div>
<div class="col-md-10">
<input type="text" name="hotel_pincode" id="hotel_pincode" class="form-
control" value="<?php echo $rsedit[hotel_pincode]; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Map
</div>
<div class="col-md-10">
<textarea type="text" name="hotel_map" id="hotel_map" class="form-
control"><?php echo $rsedit[hotel_map];?></textarea>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel Policies
</div>
<div class="col-md-10">
<textarea name="hotel_policies" id="hotel_policies" class="form-
control"><?php echo $rsedit[hotel_policies];?></textarea>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
P a g e | 70
Free-Friendly Travel Mood
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
Item
<?php
P a g e | 71
Free-Friendly Travel Mood
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
$imgname = rand(). $_FILES["item_img"]["name"];
move_uploaded_file($_FILES["item_img"]["tmp_name"],"imgitem/".
$imgname);
if(isset($_GET[editid]))
{
$sql = "UPDATE item SET
item_name='$_POST[item_name]',hotel_id='$_POST[hotel_id]'";
if($_FILES["item_img"]["name"] != "")
{
$sql = $sql . ",item_img='$imgname'";
}
$sql = $sql .
",food_category_id='$_POST[food_category_id]',item_description='$_POST[item
_description]',item_cost='$_POST[item_cost]',status='$_POST[status]',location_id
='$_POST[location_id]' WHERE item_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Item deatils updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
item(item_name,hotel_id,food_category_id,item_description,item_cost,status,item
_img,location_id)
values('$_POST[item_name]','$_POST[hotel_id]','$_POST[food_category_id]','$_
POST[item_description]','$_POST[item_cost]','$_POST[status]','$imgname','$_PO
ST[location_id]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Items added..');</script>";
echo "<script>window.location='item.php';</script>";
}
else
{
echo mysqli_error($con);
P a g e | 72
Free-Friendly Travel Mood
}
}
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM item where item_id='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Item</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" enctype="multipart/form-data">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Location
</div>
<div class="col-md-10">
<select name="location_id" id="location_id" class="form-control"
onchange="funloadhotel(this.value)">
<option value="">Select Location</option>
<?php
$sqltourism_location = "SELECT * FROM tourism_location where
status='Active'";
$qsqltourism_location = mysqli_query($con,$sqltourism_location);
while($rstourism_location = mysqli_fetch_array($qsqltourism_location))
{
if($rstourism_location['location_id'] == $rsedit['location_id'])
{
echo "<option value='$rstourism_location[location_id]'
selected>$rstourism_location[location_name]</option>";
}
else
P a g e | 73
Free-Friendly Travel Mood
{
echo "<option
value='$rstourism_location[location_id]'>$rstourism_location[location_name]</opt
ion>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel name
</div>
<div class="col-md-10" id="divhotel"><?php include("ajaxhotel.php"); ?
></div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Item Name
</div>
<div class="col-md-10">
<input type="text" name="item_name" id="item_name" class="form-
control" value="<?php echo $rsedit['item_name']; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Item Image
</div>
<div class="col-md-10">
<input type="file" name="item_img" id="item_img" class="form-control">
<?php
if(isset($_GET['editid']))
{
if(file_exists("imgitem/".$rsedit['item_img']))
{
$imgname = "imgitem/".$rsedit['item_img'];
}
else
{
$imgname="images/nophoto.jpg";
}
echo '<img style="width: 200px; height: 250px;" src="<?php echo
$imgname; ?>">';
}
P a g e | 74
Free-Friendly Travel Mood
?>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Food category
</div>
<div class="col-md-10">
<select name="food_category_id" id="food_category_id" class="form-
control">
<option value="">Select the food category</option>
<?php
$sqlfood_category = "SELECT * FROM food_category where
status='Active'";
$qsqlfood_category = mysqli_query($con,$sqlfood_category);
while($rsfood_category = mysqli_fetch_array($qsqlfood_category))
{
if($rsfood_category['food_category_id'] ==
$rsedit['food_category_id'])
{
echo "<option value='$rsfood_category[food_category_id]'
selected>$rsfood_category[food_category]</option>";
}
else
{
echo "<option
value='$rsfood_category[food_category_id]'>$rsfood_category[food_category]</o
ption>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Item description
</div>
<div class="col-md-10">
<textarea name="item_description" id="item_description" class="form-
control"><?php echo $rsedit['item_description']; ?></textarea>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Cost
</div>
P a g e | 75
Free-Friendly Travel Mood
<div class="col-md-10">
<input type="text" name="item_cost" id="item_cost" class="form-control"
value="<?php echo $rsedit['item_cost']; ?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit['status'])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
P a g e | 76
Free-Friendly Travel Mood
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function funloadhotel(location_id)
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("divhotel").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "ajaxhotel.php?location_id=" + location_id, true);
xmlhttp.send();
}
</script>
Location
<?php
include("header.php");
if(!isset($_SESSION['staffid']))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST['submit']))
{
$tourismdescription = mysqli_real_escape_string($con,
$_POST['description']);
$location_img = rand() . $_FILES['location_img']['name'];
move_uploaded_file($_FILES['location_img']['tmp_name'],"imglocation/".
$location_img);
if(isset($_GET['editid']))
{
$sql = "UPDATE tourism_location SET
location_name='$_POST[location_name]'";
if($_FILES['location_img']['name'] != "")
{
$sql = $sql . ",location_img='$location_img'";
}
$sql = $sql .
",description='$tourismdescription',status='$_POST[status]' WHERE
location_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Tourism Location record updated
successfully..');</script>";
}
P a g e | 77
Free-Friendly Travel Mood
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
tourism_location(location_name,location_img,description,status)
values('$_POST[location_name]','$location_img','$tourismdescription','$_POST[st
atus]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Tourism Location record inserted
successfully....');</script>";
echo
"<script>window.location='tourism_location.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
}
if(isset($_GET['editid']))
{
$sqledit = "SELECT * FROM tourism_location WHERE
location_id='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Tourism location</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" enctype="multipart/form-data" onsubmit="return
validatesubmit()" >
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
P a g e | 78
Free-Friendly Travel Mood
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Location Name
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name of Location"
name="location_name" id="location_name" class="form-control" value="<?php
echo $rsedit[location_name];?>">
<span id="errlocation_name" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Images
</div>
<div class="col-md-10">
<input type="file" name="location_img" id="location_img" class="form-
control">
<span id="errlocation_img" class="errmsg flash"></span>
<?php
if(isset($_GET['editid']))
{
if($rsedit['location_img'] == "")
{
$img = "images/nophoto.jpg";
}
else if(file_exists("imglocation/" . $rsedit['location_img']))
{
$img = "imglocation/" . $rsedit['location_img'];
}
else
{
$img = "images/nophoto.jpg";
}
echo "<img src='$img' style='width: 125px; height: 100px;' >";
}
?>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Description
</div>
<div class="col-md-10">
P a g e | 79
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit['status'])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select><span id="errstatus" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
P a g e | 80
Free-Friendly Travel Mood
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function validatesubmit()
{
var alphaExp = /^[a-zA-Z]+$/; //Variable to validate only alphabets
var alphaspaceExp = /^[a-zA-Z\s]+$/;//Variable to validate only alphabets
with space
var alphanumericExp = /^[a-zA-Z0-9]+$/;//Variable to validate only
alphanumerics
var numericExpression = /^[0-9]+$/; //Variable to validate only numbers
var emailpattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/; //For email id
var i = 0;
$( ".errmsg" ).empty();
if(!
document.getElementById("location_name").value.match(alphaspaceExp))
{
document.getElementById("errlocation_name").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Location name is not valid.....";
i=1;
}
if(document.getElementById("location_name").value== "")
{
document.getElementById("errlocation_name").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Location name should not be
empty...";
i=1;
}
//errlocation_name errlocation_img errstatus
if(document.getElementById("location_img").value== "")
{
document.getElementById("errlocation_img").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Kindly upload Image...";
i=1;
}
if(document.getElementById("status").value== "")
{
document.getElementById("errstatus").innerHTML = " <i class='fa
fa-times-circle' aria-hidden='true'></i>Kindly select status...";
i=1;
}
P a g e | 81
Free-Friendly Travel Mood
if(i == 0)
{
return true;
}
else
{
return false;
}
}
</script>
Payment
<?php
session_start();
$dt = date("Y-m-d");
include("databaseconnection.php");
if(isset($_POST['btncancellation']))
{
$sql = "INSERT INTO
payment(customer_id,card_holder,name,payment_date,payment_type,card_no,cvv
_no,total_amt,status,transaction_type)
VALUES('$_SESSION[customer_id]','$_POST[card_holder]','$_POST[room_boo
king_id]','$dt','$_POST[payment_type]','$_POST[card_no]','$_POST[cvv_no]','$_P
OST[totcost]','Cancelled','Cancellation')";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
echo $insid = mysqli_insert_id($con);
}
if(isset($_POST['btncabbooking']))
{
$sql = "INSERT INTO
payment(customer_id,card_holder,room_booking_id,cab_bookingid,payment_date,
payment_type,card_no,cvv_no,exp_date,total_amt,status,transaction_type)
VALUES('$_SESSION[customer_id]','$_POST[card_holder]','$_POST[room_boo
king_id]','$_POST[cal_bookingid]','$dt','$_POST[payment_type]','$_POST[card_n
o]','$_POST[cvv_no]','$_POST[exp_date]-01','$_POST[totcost]','Active','Cab
Booking')";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
echo $insid = mysqli_insert_id($con);
$sql = "UPDATE cab_booking SET status='Active',payment_id='$insid'
WHERE cal_bookingid='$_POST[cal_bookingid]' AND status='Pending'";
$qsql = mysqli_query($con,$sql);
P a g e | 82
Free-Friendly Travel Mood
echo mysqli_error($con);
}
if(isset($_POST['btnfoodorder']))
{
$paymentdetail = serialize(array($_POST['card_holder'],
$_POST['card_no'],$_POST['cvv_no'],$_POST['exp_date']));
$sql = "INSERT INTO
payment(customer_id,card_holder,room_booking_id,food_order_id,payment_date,
payment_type,card_no,cvv_no,exp_date,total_amt,status,name,mobileno,note,trans
action_type)
VALUES('$_SESSION[customer_id]','$_POST[card_holder]','$_POST[room_boo
king_id]','$_POST[room_booking_id]','$dt','$_POST[payment_type]','$_POST[car
d_no]','$_POST[cvv_no]','$_POST[exp_date]-
01','$_POST[totcost]','Active','$_POST[name]','$_POST[contactnumber]','$_POST
[note]','Food Order')";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
echo $insid = mysqli_insert_id($con);
$sql = "UPDATE food_order SET status='Active',payment_id='$insid'
WHERE status='Pending' AND payment_id='0' AND
customer_id='$_SESSION[customer_id]'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
}
if(isset($_POST['btnhotelbooking']))
{
$sql = "INSERT INTO
room_booking(hotel_id,room_typeid,customer_id,no_ofadults,no_ofchildren,check
_in,check_out,cost,status)
VALUES('$_POST[hotelid]','$_POST[room_type]','$_SESSION[customer_id]','$_
POST[adults]','$_POST[children]','$_POST[checkin]','$_POST[checkout]','$_POS
T[cost]','Active')";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
$insid = mysqli_insert_id($con);
$paymentdetail = serialize(array($_POST['card_holder'],
$_POST['card_no'],$_POST['cvv_no'],$_POST['exp_date']));
$discount_detail = serialize(array($_POST['discount_couponcode'],
$_POST['discount_expirydate'],$_POST['discount_percentage'],
$_POST['discount_max_limit'],$_POST['discount_reason'],
$_POST['discount_status']));
$sql = "INSERT INTO
payment(customer_id,room_booking_id,payment_date,payment_type,payment_det
ail,total_amt,status,name,mobileno,note,transaction_type,discount_amount,discoun
t_detail)
VALUES('$_SESSION[customer_id]','$insid','$dt','$_POST[payment_type]','$pay
mentdetail','$_POST[totcost]','Active','$_POST[name]','$_POST[contactnumber]','
$_POST[note]','Hotel Booking','$_POST[discount_amt]','$discount_detail')";
$qsql = mysqli_query($con,$sql);
echo $insid = mysqli_insert_id($con);
P a g e | 83
Free-Friendly Travel Mood
echo mysqli_error($con);
$sqlupd="UPDATE giftcoupon set status='Redeemed' WHERE
couponcode='$_POST[discount_couponcode]'";
mysqli_query($con,$sqlupd);
}
?>
Room_Booking
<?php
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
if(isset($_GET[editid]))
{
$sql = "UPDATE room_booking SET hotel_id='$_POST[hotel_id
]',room_typeid='$_POST[room_typeid]',customer_id='$_POST[customer_i
d]',no_ofadults='$_POST[no_ofadults]',no_ofchildren='$_POST[no_ofchildren]',ch
eck_in='$_POST[check_in]',check_out='$_POST[check_out]',cost='$_POST[cost]'
,status='$_POST[status]' WHERE room_booking_id='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Room Booking record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
staff(staffid,staffname,stafftype,loginid,password,status)
values('$_POST[staffid]','$_POST[staff]','$_POST[room_typeid]','$_POST[custom
er_id]','$_POST[no_ofadults]','$_POST[no_ofchildren]','$_POST[check_in]','$_PO
ST[check_out]','$_POST[cost]','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('room booking details..');</script>";
echo "<script>window.location='room_booking.php';</script>";
}
else
{
echo mysqli_error($con);
P a g e | 84
Free-Friendly Travel Mood
}
}
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Room Booking</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Hotel
</div>
<div class="col-md-10">
<select name="hotel_id" id="hotel_id" class="form-control">
<option value="">Select the hotel name</option>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Room
</div>
<div class="col-md-10">
<select name="room_typeid" id="room_typeid" class="form-control">
<option value="">Select the room</option>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Customer
</div>
<div class="col-md-10">
P a g e | 85
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
No. of Adults
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name" name="no_ofadults"
id="no_ofadults" class="form-control" value="<?php echo $rsedit[no_ofadults];?
>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
No. of Children
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name" name="no_ofchildren"
id="no_ofchildren" class="form-control" value="<?php echo
$rsedit[no_ofchildren];?>">
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Check In
</div>
<div class="col-md-10">
<select name="check_in" id="check_in" class="form-control">
<option value="">Check IN</option>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Check Out
</div>
<div class="col-md-10">
<select name="check_out" id="check_out" class="form-control">
<option value="">Check Out</option>
</select>
</div>
</div><br>
P a g e | 86
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Cost
</div>
<div class="col-md-10">
<select name="cost" id="cost" class="form-control">
<option value="">Cost</option>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
P a g e | 87
Free-Friendly Travel Mood
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
Staff
<?php
include("header.php");
if(!isset($_SESSION[staffid]))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST[submit]))
{
$pwd = md5($_POST[password]);
if(isset($_GET[editid]))
{
$sql = "UPDATE staff SET
staffname='$_POST[staffname]',stafftype='$_POST[stafftype]',loginid='$_POST[l
oginid]'";
if($_POST[password] != "")
{
$sql = $sql . ",password='$pwd'";
}
$sql = $sql . ",status='$_POST[status]' WHERE
staffid='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Staff record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
staff(staffid,staffname,stafftype,loginid,password,status)
P a g e | 88
Free-Friendly Travel Mood
values('$_POST[staffid]','$_POST[staffname]','$_POST[stafftype]','$_POST[logini
d]','$pwd','$_POST[status]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('staff deatils inserted
successfully..');</script>";
echo "<script>window.location='staff.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
}
?>
<?php
if(isset($_GET[editid]))
{
$sqledit = "SELECT * FROM staff where staffid='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit = mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Staff deatils</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" onsubmit="return validateform()">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Name
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name"
name="staffname" id="staffname" class="form-control" value="<?php echo
$rsedit[staffname];?>"><span id="errstaffname" class="errmsg flash"></span>
P a g e | 89
Free-Friendly Travel Mood
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Staff Type
</div>
<div class="col-md-10">
<select name="stafftype" id="stafftype" class="form-control">
<option value="">Select the staff type</option>
<?php
$arr= array("Administrator","Employee");
foreach($arr as $val)
{
if($val == $rsedit[stafftype])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select><span id="errstafftype" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Login ID
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the name" name="loginid"
id="loginid" class="form-control" value="<?php echo $rsedit[loginid];?>"><span
id="errloginid" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Password
</div>
<div class="col-md-10">
<input type="password" placeholder="Enter Password" name="password"
id="password" class="form-control" ><span id="errpassword" class="errmsg
flash"></span>
</div>
</div><br>
P a g e | 90
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Confirm Password
</div>
<div class="col-md-10">
<input type="password" placeholder="Confirm Password"
name="cpassword" id="cpassword" class="form-control" ><span
id="errcpassword" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select><span id="errstatus" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
P a g e | 91
Free-Friendly Travel Mood
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function validateform()
{
var i = 0;
$( ".errmsg" ).empty();
if(!document.getElementById("staffname").value.match(alphaspaceExp))
{
document.getElementById("errstaffname").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Entered staff name is not
valid.....";
i=1;
}
if(document.getElementById("staffname").value== "")
{
document.getElementById("errstaffname").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Staff name should not be
empty...";
i=1;
}
if(document.getElementById("stafftype").value== "")
{
document.getElementById("errstafftype").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Kindly select staff type...";
i=1;
}
if(!document.getElementById("loginid").value.match(emailpattern))
{
P a g e | 92
Free-Friendly Travel Mood
if(document.getElementById("password").value.length < 8)
{
document.getElementById("errpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Password should contain more
than 8 characters...";
i=1;
}
if(document.getElementById("password").value== "")
{
document.getElementById("errpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Password should not be empty...";
i=1;
}
if(document.getElementById("password").value !=
document.getElementById("cpassword").value)
{
document.getElementById("errcpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Password and confirm password
not matching...";
i=1;
}
if(document.getElementById("cpassword").value== "")
{
document.getElementById("errcpassword").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Confirm Password should not be
empty...";
i=1;
}
if(document.getElementById("status").value== "")
{
document.getElementById("errstatus").innerHTML = " <i class='fa
fa-times-circle' aria-hidden='true'></i>Status should not be empty...";
i=1;
}
P a g e | 93
Free-Friendly Travel Mood
if(i == 0)
{
return true;
}
else
{
return false;
}
}
</script>
Vehicle_Type
<?php
include("header.php");
if(!isset($_SESSION['staffid']))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST['submit']))
{
$img = rand(). $_FILES["vehicle_img"]["name"];
move_uploaded_file($_FILES["vehicle_img"]
["tmp_name"],"imgvehicletype/".$img);
if(isset($_GET['editid']))
{
$sql = "UPDATE vehicle_type SET
location_id='$_POST[location_id]',vehicle_type='$_POST[vehicle_type]',hotel_id
='$_POST[hotel_id]'";
if($_FILES["vehicle_img"]["name"] != "")
{
$sql = $sql . ",vehicle_img='$img'";
}
$sql = $sql . ",km_cost='$_POST[km_cost]',status='$_POST[status]'
WHERE vehicle_typeid='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Vehicle Type record updated
successfully..');</script>";
}
else
{
echo mysqli_error($con);
}
}
else
{
$sql ="INSERT INTO
vehicle_type(hotel_id,vehicle_type,vehicle_img,km_cost,status,location_id)
P a g e | 94
Free-Friendly Travel Mood
values('$_POST[hotel_id]','$_POST[vehicle_type]','$img','$_POST[km_cost]','$_P
OST[status]','$_POST[location_id]')";
$qsql = mysqli_query($con,$sql);
if(mysqli_affected_rows($con) == 1)
{
echo "<script>alert('Vehicle type added
successfully..');</script>";
echo
"<script>window.location='vehicle_type.php';</script>";
}
else
{
echo mysqli_error($con);
}
}
}
if(isset($_GET['editid']))
{
$sqledit = "SELECT * FROM vehicle_type where
vehicle_typeid='$_GET[editid]'";
$qsqledit = mysqli_query($con,$sqledit);
$rsedit= mysqli_fetch_array($qsqledit);
}
?>
<!-- Sub Banner Start -->
<div class="mg_sub_banner">
<div class="container">
<h2>Vehicle type</h2>
</div>
</div>
<!-- Sub Banner Start -->
<!-- Main Contant Wrap Start -->
<div class="iqoniq_contant_wrapper">
<section>
<div class="container">
<form method="post" action="" enctype="multipart/form-data">
<div class="row">
<!-- Hotel Destination Start -->
<div class="col-md-12 col-sm-12">
<div class="mg_hotel_destination fancy-overlay">
<div class="text">
<div class="row">
<div class="col-md-2 boldfont">
Location
</div>
<div class="col-md-10">
<select name="location_id" id="location_id" class="form-control"
onchange="funloadhotel(this.value)">
<option value="">Select Location</option>
P a g e | 95
Free-Friendly Travel Mood
<?php
$sqltourism_location = "SELECT * FROM tourism_location where
status='Active'";
$qsqltourism_location = mysqli_query($con,$sqltourism_location);
while($rstourism_location = mysqli_fetch_array($qsqltourism_location))
{
if($rstourism_location['location_id'] == $rsedit['location_id'])
{
echo "<option value='$rstourism_location[location_id]'
selected>$rstourism_location[location_name]</option>";
}
else
{
echo "<option
value='$rstourism_location[location_id]'>$rstourism_location[location_name]</opt
ion>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Hotel name
</div>
<div class="col-md-10" id="divhotel"><?php include("ajaxhotel.php"); ?
></div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Vehicle
</div>
<div class="col-md-10">
<input type="text" placeholder="Enter the location"
name="vehicle_type" id="vehicle_type" class="form-control" value="<?php echo
$rsedit['vehicle_type'];?>">
</div>
</div><br>
<div class="row">
P a g e | 96
Free-Friendly Travel Mood
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Kilometer Cost
</div>
<div class="col-md-10">
<input type="text" placeholder="Kilometer Cost" name="km_cost"
id="km_cost" class="form-control" value="<?php echo $rsedit[km_cost];?>">
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
P a g e | 97
Free-Friendly Travel Mood
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function funloadhotel(location_id)
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("divhotel").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "ajaxhotel.php?location_id=" + location_id, true);
xmlhttp.send();
}
</script>
Tourism_Place
<?php
include("header.php");
if(!isset($_SESSION['staffid']))
{
echo "<script>window.location='index.php';</script>";
}
if(isset($_POST['submit']))
{
$tourism_place = mysqli_real_escape_string($con,
$_POST['tourism_place']);
$description = mysqli_real_escape_string($con,$_POST['description']);
$feature = mysqli_real_escape_string($con,$_POST['feature']);
if(isset($_GET['editid']))
{
$sql = "UPDATE tourism_place SET
location_id='$_POST[location_id]',tourism_place='$tourism_place',description='$d
escription',feature='$feature',status='$_POST[status]' WHERE
tourism_placeid='$_GET[editid]'";
$qsql = mysqli_query($con,$sql);
echo mysqli_error($con);
if(mysqli_affected_rows($con) == 1)
{
P a g e | 98
Free-Friendly Travel Mood
<div class="row">
<div class="col-md-2 boldfont">
Location
P a g e | 99
Free-Friendly Travel Mood
</div>
<div class="col-md-10">
<select placeholder="Enter the location" name="location_id"
id="location_id" class="form-control">
<option value="">Select Location</option>
<?php
$sqltourism_location = "SELECT * FROM tourism_location where
status='Active'";
$qsqltourism_location = mysqli_query($con,$sqltourism_location);
while($rstourism_location = mysqli_fetch_array($qsqltourism_location))
{
if($rstourism_location['location_id'] == $rsedit['location_id'])
{
echo "<option value='$rstourism_location[location_id]'
selected>$rstourism_location[location_name]</option>";
}
else
{
echo "<option
value='$rstourism_location[location_id]'>$rstourism_location[location_name]</opt
ion>";
}
}
?>
</select>
<span id="errlocation_id" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Tourism place
</div>
<div class="col-md-10">
<input type="text" name="tourism_place" id="tourism_place"
class="form-control" placeholder="Enter Tourism place" value="<?php echo
$rsedit['tourism_place']; ?>">
<span id="errtourism_place" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Description
</div>
<div class="col-md-10">
<textarea placeholder="Enter description" name="description"
id="description" class="form-control"><?php echo $rsedit['description'];?
></textarea>
P a g e | 100
Free-Friendly Travel Mood
<script
src="https://cdn.tiny.cloud/1/vkp7vwptosm1ao2ztjqdp0riscxgp2sxw81z6ma02p9h
4oqc/tinymce/5/tinymce.min.js" ></script>
<script>tinymce.init({ selector:'textarea' });</script>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Feature
</div>
<div class="col-md-10">
<textarea placeholder="Enter Feature and highlights" name="feature"
id="feature" class="form-control"><?php echo $rsedit[feature];?></textarea>
<script
src="https://cdn.tiny.cloud/1/vkp7vwptosm1ao2ztjqdp0riscxgp2sxw81z6ma02p9h
4oqc/tinymce/5/tinymce.min.js" ></script>
<script>tinymce.init({ selector:'textarea' });</script>
</div>
</div><br>
<div class="row">
<div class="col-md-2 boldfont">
Status
</div>
<div class="col-md-10">
<select name="status" id="status" class="form-control">
<option value="">Select status</option>
<?php
$arr = array("Active","Inactive");
foreach($arr as $val)
{
if($val == $rsedit[status])
{
echo "<option value='$val' selected>$val</option>";
}
else
{
echo "<option value='$val'>$val</option>";
}
}
?>
</select>
<span id="errstatus" class="errmsg flash"></span>
</div>
</div><br>
<div class="row">
<div class="col-md-2">
P a g e | 101
Free-Friendly Travel Mood
</div>
<div class="col-md-10">
<input type="submit" name="submit" id="submit" class="form-
control btn btn-warning " style="width: 250px;height:50px;" >
</div>
</div><br>
</form>
</div>
</div>
</div>
<!-- Hotel Destination End -->
</div>
</div>
</section>
</div>
<!-- Main Contant Wrap End -->
<?php
include("footer.php");
?>
<script>
function validatesubmit()
{
var alphaExp = /^[a-zA-Z]+$/; //Variable to validate only alphabets
var alphaspaceExp = /^[a-zA-Z\s]+$/;//Variable to validate only alphabets
with space
var alphanumericExp = /^[a-zA-Z0-9]+$/;//Variable to validate only
alphanumerics
var numericExpression = /^[0-9]+$/; //Variable to validate only numbers
var emailpattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/; //For email id
var i = 0;
$( ".errmsg" ).empty();
if(document.getElementById("location_id").value== "")
{
document.getElementById("errlocation_id").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Kindly select Location...";
i=1;
}
//
//errlocation_id errtourism_place errstatus
if(!
document.getElementById("tourism_place").value.match(alphaspaceExp))
{
document.getElementById("errtourism_place").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i> Kindly enter valid tourism
Place.....";
P a g e | 102
Free-Friendly Travel Mood
i=1;
}
if(document.getElementById("tourism_place").value== "")
{
document.getElementById("errtourism_place").innerHTML = " <i
class='fa fa-times-circle' aria-hidden='true'></i>Tourism place should not be
empty...";
i=1;
}
if(document.getElementById("status").value== "")
{
document.getElementById("errstatus").innerHTML = " <i class='fa
fa-times-circle' aria-hidden='true'></i>Kindly select status...";
i=1;
}
if(i == 0)
{
return true;
}
else
{
return false;
}
}
</script>
TESTING
P a g e | 103
Free-Friendly Travel Mood
TESTING
7.1 Introduction:
Testing is the major quality control measure used during software development. It is a
basic function to detect errors in the software. During the requirement analysis and design
the output of the document that is usually textual and non-executable after the coding
phase the computer programs are available that can be executed for testing purpose. This
implies that testing not only has to uncover errors introduce during the previous phase. The
goal of testing is to uncover requirement, design, coding errors in the program.
P a g e | 104
Free-Friendly Travel Mood
7.2Levels of Testing:
Unit Testing:
The unit testing of the source code has to be done for every individual unit of module
that was developing part of the system and some errors were found for every turn and
rectified. This form of testing was use to check for the behaviour signified the working
of the system in different environment as an independent functional unit.
Integration Testing:
From the individual parts to the cohesion of each part to make the system as a whole,
there is need to test the working between the assembled modules of the system. The
modules are integrated to makeup the entire system. The testing process is concerned
with finding errors that result from unanticipated interaction between the sub-system
and system component. It is also concerned with validating the system meets its
functional and non-functional requirement.
System Testing:
The requirement specification document that is the entire system is to be tested to see
whether it meets the requirement or not.
7.3Test Reports:
Customer Login:
Serial Condition
Test Data Expected Output Remarks
No. To be Tested
P a g e | 105
Free-Friendly Travel Mood
Email_Id,
If Email_Id and
5. Password Logged in successfully SUCCESSFUL
password is valid
Staff Login:
Serial Condition
Test Data Expected Output Remarks
No. To be Tested
4. If the entered
Email_Id and Email_Id, Entered Login SUCCESSFU
password is not Password credentials not valid L
valid
Email_Id,
If Email_Id and Logged in SUCCESSFU
5. Password
password is valid successfully L
Admin Login:
Serial Condition
Test Data Expected Output Remarks
No. To be Tested
P a g e | 106
Free-Friendly Travel Mood
3. If the entered
You have entered
Login ID and Login ID, SUCCESSFU
invalid Login
password is not Password L
credentials
valid
The Payment(Customer)
Seria Condition
Test Data Expected Output Remarks
l No. To be Tested
If Card number is
less than and Kindly enter 16 digits SUCCESSFU
6. Crad No
greater than16 Card number L
digits
If CVV number is
less than or Kindly enter 3 digit SUCCESSFU
7. CVV No
greater than 3 CVV number L
digits
P a g e | 107
Free-Friendly Travel Mood
If entered all
Payment done SUCCESSFU
8. cradentials all
successfully L
correct
If description is SUCCESSFU
3. Description Enter the description
not entered L
If location is SUCCESSFU
1. Location Kindly select location
empty. L
P a g e | 108
Free-Friendly Travel Mood
P a g e | 109
Free-Friendly Travel Mood
No. To be Tested
4.
If item image is Kindly select the item SUCCESSFU
Item image
not uploaded. image. L
3.
If Vehicle name Enter the vehicle SUCCESSFU
Vehicle
is not entered type/Name L
4.
If vehicle name Upload the vehicle SUCCESSFU
Vehicle Image
is not entered image L
P a g e | 110
Free-Friendly Travel Mood
Users(Add Staff):
Seria Condition
Test Data Expected Output Remarks
l No. To be Tested
If the confirm
Password, Password and Confirm
password and SUCCESSFU
7. Confirm password are not
password does L
password matching
not match.
Users(Change Password):
Seria Condition
Test Data Expected Output Remarks
l No. To be Tested
P a g e | 111
Free-Friendly Travel Mood
password not
Password should not be empty L
enterd
If confirm
Confirm Confirm Password SUCCESSFU
3. password not
Password should not be empty L
enterd
If existing
Existing Failed to change SUCCESSFU
4. password is
Password password L
incorrect
If confirm
Confirm Failed to change SUCCESSFU
6. password is
Password password L
incorrect
Serial Condition
Test Data Expected Output Remarks
No. To be Tested
3. If Discount
Discount Kindly enter the SUCCESSFU
percentage is not
Percentage discount percentage L
entered
4.
If Max limit is Kindly enter the max SUCCESSFU
Max Limit
not entered limit L
P a g e | 112
Free-Friendly Travel Mood
SCREENSHOT
S
P a g e | 113
Free-Friendly Travel Mood
P a g e | 114
Free-Friendly Travel Mood
P a g e | 115
Free-Friendly Travel Mood
P a g e | 116
Free-Friendly Travel Mood
P a g e | 117
Free-Friendly Travel Mood
Payment Details:
P a g e | 118
Free-Friendly Travel Mood
FUTURE
SCOPE
P a g e | 119
Free-Friendly Travel Mood
P a g e | 120
Free-Friendly Travel Mood
CONCLUSION
CONCLUSION
The project work titled "Free Friendly Travel Mood" has been designed and developed
using PHP where in many friendly from controls has been added. In order to make it, a
P a g e | 121
Free-Friendly Travel Mood
user interactive application. The project has been subjected to testing and has been
successful.
The module has fulfilled all the objectives identified. The system is developed in such a
way that the user with common knowledge of computers can handle it easily. The module
has produced all the requirements produced by the user. The module has user friendly
interface.The reports requested by the client have been generated and all documentation
required for operation and maintenance of the module has been provided.
The future enhancement to the system can be made as technology improves or changes.
P a g e | 122
Free-Friendly Travel Mood
BIBLIOGRAPHY
BIBLIOGRAPHY
P a g e | 123
Free-Friendly Travel Mood
Books:
Pankaj Jalote, An integrated approach to software engineering, ed3, publication, Narosa
Publishing House.
Nixon (Robin), Learning PHP MySQL and JavaScript, Publication: Shroffpublishers
Distributors Pvt Pnakaj Jalote Ltd.
PHP Tutorial -
http://www.w3schools.com/php/default.asp
http://www.tutorialspoint.com/php/
MySQL Tutorial -
http://www.w3schools.com/php/php_mysql_intro.asp
http://www.tutorialspoint.com/mysql/index.htm
JavaScript -
http://www.w3schools.com/js/default.asp
http://www.tutorialspoint.com/javascript/index.htm
CSS -
http://www.w3schools.com/css/default.asp
http://www.tutorialspoint.com/css/index.htm
HTML -
http://www.w3schools.com/html/default.asp
http://www.tutorialspoint.com/html/index.htm
HTML 5 - http://www.tutorialspoint.com/html5/index.htm
AJAX -
http://www.w3schools.com/ajax/default.asp
http://www.tutorialspoint.com/ajax/index.htm
P a g e | 124