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

code

The document is a PHP-based web application for a hotel management system that includes a login page and various sections such as navigation, services, portfolio, and contact information. It utilizes session management to store system settings and includes AJAX functionality for user login. The layout is responsive and styled with CSS to enhance user experience.

Uploaded by

maharanabiswa53
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

code

The document is a PHP-based web application for a hotel management system that includes a login page and various sections such as navigation, services, portfolio, and contact information. It utilizes session management to store system settings and includes AJAX functionality for user login. The layout is responsive and styled with CSS to enhance user experience.

Uploaded by

maharanabiswa53
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 20

<!

DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">

<title>Admin | Hotel Management System</title>

<?php include('./header.php'); ?>


<?php include('./db_connect.php'); ?>
<?php
session_start();
if(isset($_SESSION['login_id']))
header("location:index.php?page=home");

$query = $conn->query("SELECT * FROM system_settings limit 1")->fetch_array();


foreach ($query as $key => $value) {
if(!is_numeric($key))
$_SESSION['setting_'.$key] = $value;
}
?>

</head>
<style>
body{
width: 100%;
height: calc(100%);
/*background: #007bff;*/
}
main#main{
width:100%;
height: calc(100%);
background:white;
}
#login-right{
position: absolute;
right:0;
width:40%;
height: calc(100%);
background:white;
display: flex;
align-items: center;
}
#login-left{
position: absolute;
left:0;
width:60%;
height: calc(100%);
background:#00000061;
display: flex;
align-items: center;
}
#login-right .card{
margin: auto
}
.logo {
margin: auto;
font-size: 8rem;
background: white;
padding: .5em 0.8em;
border-radius: 50% 50%;
color: #000000b3;
}
#login-left {
background: url(../assets/img/<?php echo $_SESSION['setting_cover_img'] ?
>);
background-repeat: no-repeat;
background-size: cover;
}
</style>

<body>

<main id="main" class=" alert-info">


<div id="login-left">
<!-- == You can logo or image herre == -->
<!-- <div class="logo">
<i class="fa fa-poll-h"></i>
</div> -->
</div>
<div id="login-right">
<div class="card col-md-8">
<div class="card-body">
<form id="login-form" >
<div class="form-group">
<label for="username" class="control-
label">Username</label>
<input type="text" id="username"
name="username" class="form-control">
</div>
<div class="form-group">
<label for="password" class="control-
label">Password</label>
<input type="password" id="password"
name="password" class="form-control">
</div>
<center><button class="btn-sm btn-block btn-
wave col-md-4 btn-primary">Login</button></center>
</form>
</div>
</div>
</div>

</main>

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

</body>
<script>
$('#login-form').submit(function(e){
e.preventDefault()
$('#login-form
button[type="button"]').attr('disabled',true).html('Logging in...');
if($(this).find('.alert-danger').length > 0 )
$(this).find('.alert-danger').remove();
$.ajax({
url:'ajax.php?action=login',
method:'POST',
data:$(this).serialize(),
error:err=>{
console.log(err)
$('#login-form
button[type="button"]').removeAttr('disabled').html('Login');

},
success:function(resp){
if(resp == 1){
location.href ='index.php?page=home';
}else if(resp == 2){
location.href ='voting.php';
}else{
$('#login-form').prepend('<div class="alert alert-
danger">Username or password is incorrect.</div>')
$('#login-form
button[type="button"]').removeAttr('disabled').html('Login');
}
}
})
})
</script>
</html>
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
include('header.php');
include('admin/db_connect.php');

$query = $conn->query("SELECT * FROM system_settings limit 1")-


>fetch_array();
foreach ($query as $key => $value) {
if(!is_numeric($key))
$_SESSION['setting_'.$key] = $value;
}
?>

<style>
header.masthead {
background: url(assets/img/<?php echo
$_SESSION['setting_cover_img'] ?>);
background-repeat: no-repeat;
background-size: cover;
}
</style>
<body id="page-top">
<!-- Navigation-->
<div class="toast" id="alert_toast" role="alert" aria-live="assertive"
aria-atomic="true">
<div class="toast-body text-white">
</div>
</div>
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3"
id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="./"><?php echo
$_SESSION['setting_hotel_name'] ?></a>
<button class="navbar-toggler navbar-toggler-right" type="button"
data-toggle="collapse" data-target="#navbarResponsive" aria-
controls="navbarResponsive" aria-expanded="false" aria-label="Toggle
navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="index.php?page=home">Home</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="index.php?page=list">Rooms</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="index.php?page=about">About</a></li>
</ul>
</div>
</div>
</nav>

<?php
$page = isset($_GET['page']) ?$_GET['page'] : "home";
include $page.'.php';
?>

<div class="modal fade" id="confirm_modal" role='dialog'>


<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Confirmation</h5>
</div>
<div class="modal-body">
<div id="delete_content"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id='confirm'
onclick="">Continue</button>
<button type="button" class="btn btn-secondary" data-
dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="uni_modal" role='dialog'>
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"></h5>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id='submit' onclick="$
('#uni_modal form').submit()">Save</button>
<button type="button" class="btn btn-secondary" data-
dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<footer class="bg-light py-5">
<div class="container"><div class="small text-center text-muted">Hotel
Mangement system | <a href="https://1sourcecodr.blogspot.com/" target="_blank">1
SOURCE CODE</a></div></div>
</footer>

<?php include('footer.php') ?>


</body>

<?php $conn->close() ?>

</html>
<!DOCTYPE html>
<html lang="en">
<head>

</head>
<body id="page-top">
<!-- Navigation-->
<nav class="navbar navbar-expand-lg navbar-light fixed-top py-3"
id="mainNav">
<div class="container">
<a class="navbar-brand js-scroll-trigger" href="#page-top">Start
Bootstrap</a>
<button class="navbar-toggler navbar-toggler-right" type="button"
data-toggle="collapse" data-target="#navbarResponsive" aria-
controls="navbarResponsive" aria-expanded="false" aria-label="Toggle
navigation"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto my-2 my-lg-0">
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="#about">About</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="#services">Services</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="#portfolio">Portfolio</a></li>
<li class="nav-item"><a class="nav-link js-scroll-trigger"
href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<!-- Masthead-->
<header class="masthead">
<div class="container h-100">
<div class="row h-100 align-items-center justify-content-center
text-center">
<div class="col-lg-10 align-self-end">
<h1 class="text-uppercase text-white font-weight-bold">Your
Favorite Source of Free Bootstrap Themes</h1>
<hr class="divider my-4" />
</div>
<div class="col-lg-8 align-self-baseline">
<p class="text-white-75 font-weight-light mb-5">Start
Bootstrap can help you build better websites using the Bootstrap framework! Just
download a theme and start customizing, no strings attached!</p>
<a class="btn btn-primary btn-xl js-scroll-trigger"
href="#about">Find Out More</a>
</div>
</div>
</div>
</header>
<!-- About-->
<section class="page-section bg-primary" id="about">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8 text-center">
<h2 class="text-white mt-0">We've got what you need!</h2>
<hr class="divider light my-4" />
<p class="text-white-50 mb-4">Start Bootstrap has
everything you need to get your new website up and running in no time! Choose one
of our open source, free to download, and easy to use themes! No strings attached!
</p>
<a class="btn btn-light btn-xl js-scroll-trigger"
href="#services">Get Started!</a>
</div>
</div>
</div>
</section>
<!-- Services-->
<section class="page-section" id="services">
<div class="container">
<h2 class="text-center mt-0">At Your Service</h2>
<hr class="divider my-4" />
<div class="row">
<div class="col-lg-3 col-md-6 text-center">
<div class="mt-5">
<i class="fas fa-4x fa-gem text-primary mb-4"></i>
<h3 class="h4 mb-2">Sturdy Themes</h3>
<p class="text-muted mb-0">Our themes are updated
regularly to keep them bug free!</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="mt-5">
<i class="fas fa-4x fa-laptop-code text-primary mb-
4"></i>
<h3 class="h4 mb-2">Up to Date</h3>
<p class="text-muted mb-0">All dependencies are kept
current to keep things fresh.</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="mt-5">
<i class="fas fa-4x fa-globe text-primary mb-4"></i>
<h3 class="h4 mb-2">Ready to Publish</h3>
<p class="text-muted mb-0">You can use this design as
is, or you can make changes!</p>
</div>
</div>
<div class="col-lg-3 col-md-6 text-center">
<div class="mt-5">
<i class="fas fa-4x fa-heart text-primary mb-4"></i>
<h3 class="h4 mb-2">Made with Love</h3>
<p class="text-muted mb-0">Is it really open source if
it's not made with love?</p>
</div>
</div>
</div>
</div>
</section>
<!-- Portfolio-->
<div id="portfolio">
<div class="container-fluid p-0">
<div class="row no-gutters">
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/1.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/1.jpg" alt="" />
<div class="portfolio-box-caption">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/2.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/2.jpg" alt="" />
<div class="portfolio-box-caption">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/3.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/3.jpg" alt="" />
<div class="portfolio-box-caption">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/4.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/4.jpg" alt="" />
<div class="portfolio-box-caption">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/5.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/5.jpg" alt="" />
<div class="portfolio-box-caption">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
<div class="col-lg-4 col-sm-6">
<a class="portfolio-box"
href="assets/img/portfolio/fullsize/6.jpg">
<img class="img-fluid"
src="assets/img/portfolio/thumbnails/6.jpg" alt="" />
<div class="portfolio-box-caption p-3">
<div class="project-category text-white-
50">Category</div>
<div class="project-name">Project Name</div>
</div>
</a>
</div>
</div>
</div>
</div>
<!-- Call to action-->
<section class="page-section bg-dark text-white">
<div class="container text-center">
<h2 class="mb-4">Free Download at Start Bootstrap!</h2>
<a class="btn btn-light btn-xl"
href="https://startbootstrap.com/themes/creative/">Download Now!</a>
</div>
</section>
<!-- Contact-->
<section class="page-section" id="contact">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8 text-center">
<h2 class="mt-0">Let's Get In Touch!</h2>
<hr class="divider my-4" />
<p class="text-muted mb-5">Ready to start your next project
with us? Give us a call or send us an email and we will get back to you as soon as
possible!</p>
</div>
</div>
<div class="row">
<div class="col-lg-4 ml-auto text-center mb-5 mb-lg-0">
<i class="fas fa-phone fa-3x mb-3 text-muted"></i>
<div>+1 (555) 123-4567</div>
</div>
<div class="col-lg-4 mr-auto text-center">
<i class="fas fa-envelope fa-3x mb-3 text-muted"></i>
<!-- Make sure to change the email address in BOTH the
anchor text and the link target below!-->
<a class="d-block"
href="mailto:[email protected]">[email protected]</a>
</div>
</div>
</div>
</section>
<!-- Footer-->
<footer class="bg-light py-5">
<div class="container"><div class="small text-center text-
muted">Copyright © 2020 - Start Bootstrap</div></div>
</footer>
<!-- Bootstrap core JS-->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js"
></script>
<!-- Third party plugin JS-->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.min.j
s"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/
jquery.magnific-popup.min.js"></script>
<!-- Core theme JS-->
<script src="js/scripts.js"></script>
</body>
</html>
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 10, 2020 at 06:23 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.39

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";


SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;


/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `sourcecodester_hoteldb`
--

-- --------------------------------------------------------

--
-- Table structure for table `contact`
--

CREATE TABLE `contact` (


`id` int(10) UNSIGNED NOT NULL,
`fullname` varchar(100) DEFAULT NULL,
`phoneno` int(10) DEFAULT NULL,
`email` text,
`cdate` date DEFAULT NULL,
`approval` varchar(12) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `login`
--

CREATE TABLE `login` (


`id` int(10) UNSIGNED NOT NULL,
`usname` varchar(30) DEFAULT NULL,
`pass` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `login`
--

INSERT INTO `login` (`id`, `usname`, `pass`) VALUES


(1, 'janobe', 'janobe');

-- --------------------------------------------------------

--
-- Table structure for table `newsletterlog`
--

CREATE TABLE `newsletterlog` (


`id` int(10) UNSIGNED NOT NULL,
`title` varchar(52) DEFAULT NULL,
`subject` varchar(100) DEFAULT NULL,
`news` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `newsletterlog`
--

INSERT INTO `newsletterlog` (`id`, `title`, `subject`, `news`) VALUES


(1, 'asd', 'Send me an Email', 'asd');

-- --------------------------------------------------------

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (


`id` int(11) DEFAULT NULL,
`title` varchar(5) DEFAULT NULL,
`fname` varchar(30) DEFAULT NULL,
`lname` varchar(30) DEFAULT NULL,
`troom` varchar(30) DEFAULT NULL,
`tbed` varchar(30) DEFAULT NULL,
`nroom` int(11) DEFAULT NULL,
`cin` date DEFAULT NULL,
`cout` date DEFAULT NULL,
`ttot` double(8,2) DEFAULT NULL,
`fintot` double(8,2) DEFAULT NULL,
`mepr` double(8,2) DEFAULT NULL,
`meal` varchar(30) DEFAULT NULL,
`btot` double(8,2) DEFAULT NULL,
`noofdays` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `payment`
--

INSERT INTO `payment` (`id`, `title`, `fname`, `lname`, `troom`, `tbed`, `nroom`,
`cin`, `cout`, `ttot`, `fintot`, `mepr`, `meal`, `btot`, `noofdays`) VALUES
(2, 'Dr.', 'janobe', 'janobe', 'Superior Room', 'Single', 1, '2020-10-10', '2020-
10-11', 320.00, 323.20, 0.00, 'Room only', 3.20, 1);

-- --------------------------------------------------------

--
-- Table structure for table `room`
--

CREATE TABLE `room` (


`id` int(10) UNSIGNED NOT NULL,
`type` varchar(15) DEFAULT NULL,
`bedding` varchar(10) DEFAULT NULL,
`place` varchar(10) DEFAULT NULL,
`cusid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `room`
--

INSERT INTO `room` (`id`, `type`, `bedding`, `place`, `cusid`) VALUES


(1, 'Superior Room', 'Single', 'Free', 0),
(2, 'Superior Room', 'Double', 'Free', NULL),
(3, 'Superior Room', 'Triple', 'Free', NULL),
(4, 'Single Room', 'Quad', 'Free', NULL),
(5, 'Superior Room', 'Quad', 'Free', NULL),
(6, 'Deluxe Room', 'Single', 'Free', NULL),
(7, 'Deluxe Room', 'Double', 'Free', NULL),
(8, 'Deluxe Room', 'Triple', 'Free', NULL),
(9, 'Deluxe Room', 'Quad', 'Free', NULL),
(10, 'Guest House', 'Single', 'Free', NULL),
(11, 'Guest House', 'Double', 'Free', NULL),
(12, 'Guest House', 'Quad', 'Free', NULL),
(13, 'Single Room', 'Single', 'Free', NULL),
(14, 'Single Room', 'Double', 'Free', NULL),
(15, 'Single Room', 'Triple', 'Free', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `roombook`
--

CREATE TABLE `roombook` (


`id` int(10) UNSIGNED NOT NULL,
`Title` varchar(5) DEFAULT NULL,
`FName` text,
`LName` text,
`Email` varchar(50) DEFAULT NULL,
`National` varchar(30) DEFAULT NULL,
`Country` varchar(30) DEFAULT NULL,
`Phone` text,
`TRoom` varchar(20) DEFAULT NULL,
`Bed` varchar(10) DEFAULT NULL,
`NRoom` varchar(2) DEFAULT NULL,
`Meal` varchar(15) DEFAULT NULL,
`cin` date DEFAULT NULL,
`cout` date DEFAULT NULL,
`stat` varchar(15) DEFAULT NULL,
`nodays` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `newsletterlog`
--
ALTER TABLE `newsletterlog`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `room`
--
ALTER TABLE `room`
ADD PRIMARY KEY (`id`);

--
-- Indexes for table `roombook`
--
ALTER TABLE `roombook`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `contact`
--
ALTER TABLE `contact`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `login`
--
ALTER TABLE `login`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `newsletterlog`
--
ALTER TABLE `newsletterlog`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `room`
--
ALTER TABLE `room`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `roombook`
--
ALTER TABLE `roombook`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;


/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<?php
include('db.php')
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>RESERVATION SUNRISE HOTEL</title>
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
<!-- Google Fonts-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet'
type='text/css' />
</head>
<body>
<div id="wrapper">
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">

<li>
<a href="../index.php"><i class="fa fa-home"></i>
Homepage</a>
</li>

</ul>

</div>

</nav>

<div id="page-wrapper" >


<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h1 class="page-header">
RESERVATION <small></small>
</h1>
</div>
</div>

<div class="row">

<div class="col-md-5 col-sm-5">


<div class="panel panel-primary">
<div class="panel-heading">
PERSONAL INFORMATION
</div>
<div class="panel-body">
<form name="form" method="post">
<div class="form-group">
<label>Title*</label>
<select name="title" class="form-
control" required >
<option
value selected ></option>
<option value="Dr.">Dr.</option>
<option
value="Miss.">Miss.</option>
<option value="Mr.">Mr.</option>
<option value="Mrs.">Mrs.</option>
<option
value="Prof.">Prof.</option>
<option
value="Rev .">Rev .</option>
<option
value="Rev . Fr">Rev . Fr .</option>
</select>
</div>
<div class="form-group">
<label>First Name</label>
<input name="fname" class="form-
control" required>

</div>
<div class="form-group">
<label>Last Name</label>
<input name="lname" class="form-
control" required>

</div>
<div class="form-group">
<label>Email</label>
<input name="email" type="email"
class="form-control" required>

</div>
<div class="form-group">
<label>Nationality*</label>
<label class="radio-inline">
<input type="radio" name="nation"
value="Sri Lankan" checked="">Sri Lankan
</label>
<label class="radio-inline">
<input type="radio" name="nation"
value="Non Sri Lankan ">Non Sri Lankan
</label>

</div>
<?php

$countries = array("Afghanistan",
"Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla",
"Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia",
"Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus",
"Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and
Herzegowina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean
Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia",
"Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic",
"Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands",
"Colombia", "Comoros", "Congo", "Congo, the Democratic Republic of the", "Cook
Islands", "Costa Rica", "Cote d'Ivoire", "Croatia (Hrvatska)", "Cuba", "Cyprus",
"Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East
Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea",
"Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji",
"Finland", "France", "France Metropolitan", "French Guiana", "French Polynesia",
"French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana",
"Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala",
"Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Holy
See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India",
"Indonesia", "Iran (Islamic Republic of)", "Iraq", "Ireland", "Israel", "Italy",
"Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic
People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao, People's
Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab
Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macau", "Macedonia, The
Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives",
"Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius",
"Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of",
"Monaco", "Mongolia", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia",
"Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New
Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern
Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New
Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal",
"Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda",
"Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines",
"Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal",
"Seychelles", "Sierra Leone", "Singapore", "Slovakia (Slovak Republic)",
"Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and the
South Sandwich Islands", "Spain", "Sri Lanka", "St. Helena", "St. Pierre and
Miquelon", "Sudan", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland",
"Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China",
"Tajikistan", "Tanzania, United Republic of", "Thailand", "Togo", "Tokelau",
"Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and
Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United
Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay",
"Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Virgin Islands (British)",
"Virgin Islands (U.S.)", "Wallis and Futuna Islands", "Western Sahara", "Yemen",
"Yugoslavia", "Zambia", "Zimbabwe");

?>
<div class="form-group">
<label>Passport Country*</label>
<select name="country" class="form-
control" required>
<option
value selected ></option>
<?php

foreach($countries as $key => $value):


echo
'<option value="'.$value.'">'.$value.'</option>'; //close your tags!!
endforeach;
?>
</select>
</div>
<div class="form-group">
<label>Phone Number</label>
<input name="phone" type ="text"
class="form-control" required>

</div>

</div>

</div>
</div>

<div class="row">
<div class="col-md-6 col-sm-6">
<div class="panel panel-primary">
<div class="panel-heading">
RESERVATION INFORMATION
</div>
<div class="panel-body">
<div class="form-group">
<label>Type Of Room *</label>
<select name="troom" class="form-
control" required>
<option
value selected ></option>
<option value="Superior
Room">SUPERIOR ROOM</option>
<option value="Deluxe Room">DELUXE
ROOM</option>
<option
value="Guest House">GUEST HOUSE</option>
<option
value="Single Room">SINGLE ROOM</option>
</select>
</div>
<div class="form-group">
<label>Bedding Type</label>
<select name="bed" class="form-control"
required>
<option
value selected ></option>
<option
value="Single">Single</option>
<option
value="Double">Double</option>
<option
value="Triple">Triple</option>
<option value="Quad">Quad</option>
<option
value="None">None</option>

</select>
</div>
<div class="form-group">
<label>No.of Rooms *</label>
<select name="nroom" class="form-
control" required>
<option
value selected ></option>
<option value="1">1</option>
<!-- <option value="2">2</option>
<option
value="3">3</option>
<option
value="4">4</option>
<option
value="5">5</option>
<option
value="6">6</option>
<option
value="7">7</option> -->
</select>
</div>

<div class="form-group">
<label>Meal Plan</label>
<select name="meal" class="form-
control"required>
<option
value selected ></option>
<option value="Room only">Room
only</option>
<option
value="Breakfast">Breakfast</option>
<option
value="Half Board">Half Board</option>
<option
value="Full Board">Full Board</option>
</select>
</div>
<div class="form-group">
<label>Check-In</label>
<input name="cin" type ="date"
class="form-control">

</div>
<div class="form-group">
<label>Check-Out</label>
<input name="cout" type ="date"
class="form-control">

</div>
</div>

</div>
</div>

<div class="col-md-12 col-sm-12">


<div class="well">
<h4>HUMAN VERIFICATION</h4>
<p>Type Below this code <?php $Random_code=rand();
echo$Random_code; ?> </p><br />
<p>Enter the random code<br /></p>
<input type="text" name="code1"
title="random code" />
<input type="hidden" name="code"
value="<?php echo $Random_code; ?>" />
<input type="submit" name="submit" class="btn
btn-primary">
<?php
if(isset($_POST['submit']))
{
$code1=$_POST['code1'];
$code=$_POST['code'];
if($code1!="$code")
{
$msg="Invalide code";
}
else
{

//
$con=mysqli_connect("localhost","root","","hotel");
$check="SELECT * FROM
roombook WHERE email = '$_POST[email]'";
$rs = mysqli_query($con,
$check);
$data =
mysqli_fetch_array($rs, MYSQLI_NUM);
if($data[0] > 1) {
echo "<script
type='text/javascript'> alert('User Already in Exists')</script>";

}
else
{
$new ="Not Conform";
$newUser="INSERT INTO
`roombook`(`Title`, `FName`, `LName`, `Email`, `National`, `Country`, `Phone`,
`TRoom`, `Bed`, `NRoom`, `Meal`, `cin`, `cout`,`stat`,`nodays`) VALUES
('$_POST[title]','$_POST[fname]','$_POST[lname]','$_POST[email]','$_POST[nation]','
$_POST[country]','$_POST[phone]','$_POST[troom]','$_POST[bed]','$_POST[nroom]','$_P
OST[meal]','$_POST[cin]','$_POST[cout]','$new',datediff('$_POST[cout]','$_POST[cin]
'))";
if (mysqli_query($con,
$newUser))
{
echo "<script
type='text/javascript'> alert('Your Booking application has been sent')</script>";

}
else
{
echo "<script
type='text/javascript'> alert('Error adding user in database')</script>";

}
}

$msg="Your code is correct";


}
}
?>
</form>

</div>
</div>
</div>

</div>

</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->
</div>
<!-- /. WRAPPER -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>

</body>
</html>
<?php
$con = mysqli_connect("localhost","root","","sourcecodester_hoteldb") or
die(mysql_error());

?>

You might also like