code
code
DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</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>
</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');
<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';
?>
</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
--
-- Database: `sourcecodester_hoteldb`
--
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
--
-- Dumping data for table `login`
--
-- --------------------------------------------------------
--
-- Table structure for table `newsletterlog`
--
--
-- Dumping data for table `newsletterlog`
--
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
--
-- 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`
--
--
-- Dumping data for table `room`
--
-- --------------------------------------------------------
--
-- Table structure for table `roombook`
--
--
-- 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;
<li>
<a href="../index.php"><i class="fa fa-home"></i>
Homepage</a>
</li>
</ul>
</div>
</nav>
<div class="row">
</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
</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>
//
$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>";
}
}
</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());
?>