Académique Documents
Professionnel Documents
Culture Documents
227
<?php session_start();
include_once 'admin/include/class.user.php';
$user=new User();
$uid=$_SESSION[ 'uid'];
if(!$user->get_session())
header("location:admin/login.php");
if(isset($_GET['q']))
$user->user_logout();
header("location:index.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Admin Panel</title>
<style>
.well {
border: none;
height: 200px;
body {
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
h4 {
color: #ffbb2b;
ul {
color: white;
font-size: 13px;
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
</ul>
<li>
<a href="admin.php?q=logout">
</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-md-3"></div>
<h4>Room Category</h4>
<hr>
<ul>
</ul>
</div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-3"></div>
<h4>Bookings</h4>
<hr>
<ul>
</ul>
</div>
<div class="col-md-3"></div>
</div>
<div class="row">
<div class="col-md-3"></div>
<h4>Add Manager</h4>
<hr>
<ul>
</ul>
</div>
<div class="col-md-3"></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
$roomname=$_GET['roomname'];
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
if($result)
alert('".$result."');
</script>";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( ".datepicker" ).datepicker({
dateFormat : 'yy-mm-dd'
});
} );
</script>
</head>
<body>
<div class="well">
<hr>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
<br>
<div id="click_here">
</div>
</form>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
$id=$_GET['id'];
$query=mysqli_query($user->db, $sql);
$row = mysqli_fetch_array($query);
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
if($result)
alert('".$result."');
</script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( ".datepicker" ).datepicker({
dateFormat : 'yy-mm-dd'
});
} );
</script>
</head>
<body>
<div class="container">
<div class="well">
<h2>EDIT</h2>
<hr>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
</div>
<br>
<div id="click_here">
</div>
</form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
.well
background: rgba(0,0,0,0.7);
border: none;
.wellfix
background: rgba(0,0,0,0.7);
border: none;
height: 150px;
body
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
font-size: 13px;
.pro_pic
border-radius: 50%;
height: 50px;
width: 50px;
margin-bottom: 15px;
margin-right: 15px;
</head>
<body>
<div class="container">
<div class="container-fluid">
<li><a href="admin.php">Admin</a></li>
</ul>
</ul>
</div>
</nav>
<div class="jumbotron">
</div>
</div>
<hr>
<p>Online hotel reservations are a popular method for booking hotel rooms. Travelers can book
rooms on a computer by using online security to protect their privacy and financial information and by
using several online travel agents to compare prices and facilities at different hotels</p>
<br>
<p>Prior to the Internet, travelers could write, telephone the hotel directly, or use a travel agent
to make a reservation. Nowadays, online travel agents have pictures of hotels and rooms, information
on prices and deals, and even information on local resorts. Many also allow reviews of the traveler to be
recorded with the online travel agent.</p>
<br>
<p>Online hotel reservations are also helpful for making last minute travel arrangements. Hotels
may drop the price of a room if some rooms are still available. There are several websites that specialize
in searches for deals on rooms.</p>
</div>
</div>
<h4><strong>Contact Us</strong></h4><hr>
</div>
<div class="col-md-4"></div>
<h4><strong>Developed By</strong></h4><hr>
</div>
</div>
</div>
<script src="my_js/slide.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
$result=$user->check_available($checkin, $checkout);
if(!($result))
echo $result;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$( function() {
$( ".datepicker" ).datepicker({
dateFormat : 'yy-mm-dd'
});
} );
</script>
<style>
.well {
border: none;
height: 200px;
body {
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
h4 {
color: #ffbb2b;
h6
color: navajowhite;
font-family: monospace;
label
color:#ffbb2b;
font-size: 13px;
font-weight: 100;
</style>
</head>
<body>
<div class="container"
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
</ul>
</div>
</nav>
<div class='row'>
<div class='col-md-4'></div>
<div class="form-group">
</div>
<div class="form-group">
</div>
&n
bsp;
</form>
</div>
<div class="col-md-3"></div>
</div>
<?php
if(isset($_REQUEST[ 'submit']))
if(mysqli_num_rows($result) > 0)
while($row = mysqli_fetch_array($result))
$room_cat=$row['room_cat'];
$row2 = mysqli_fetch_array($query);
echo "
<div class='row'>
<div class='col-md-4'></div>
<h4>".$row2['roomname']."</h4><hr>
<h6>Facilities: ".$row2['facility']."</h6>
</div>
<div class='col-md-3'>
</div>
</div>?>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<style>
.well
background: rgba(0,0,0,0.5);
border: none;
body
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
</style>
</head>
<body>
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
</ul>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
.well {
border: none;
height: 200px;
body {
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
h4 {
color: #ffbb2b;
h6
color: navajowhite;
font-family: monospace;
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
<li><a href="review.php">Review</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
</ul>
</div>
</nav>
<?php
if($result)
if(mysqli_num_rows($result) > 0)
while($row = mysqli_fetch_array($result))
echo "
<div class='row'>
<div class='col-md-3'></div>
<h4>".$row['roomname']."</h4><hr>
<h6>Facilities: ".$row['facility']."</h6>
</div>
<div class='col-md-3'>
</div>
</div>
else
else
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<style>
.well {
border: none;
height: 200px;
body {
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
h4 {
color: #ffbb2b;
h6
color: navajowhite;
font-family: monospace;
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
<li><a href="review.php">Review</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
<li>
<a href="admin.php?q=logout">
</a>
</li>
</ul>
</ul>
</div>
</nav>
<?php
if($result)
if(mysqli_num_rows($result) > 0)
while($row = mysqli_fetch_array($result))
echo "
<div class='row'>
<div class='col-md-2'></div>
<h4>".$row['room_cat']."</h4><hr>
<h6>Name: ".$row['name']."</h6>
<h6>Phone: ".$row['phone']."</h6>
</div>
</div>
else
else
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<?php
include_once 'admin/include/class.user.php';
$user=new User();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after*
these tags -->
<title>Hotel Booking</title>
<style>
.well {
border: none;
height: 200px;
body {
background-image: url('images/home_bg.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
h4 {
color: #ffbb2b;
h6
color: navajowhite;
font-family: monospace;
</style>
</head>
<body>
<div class="container">
<div class="container-fluid">
<li><a href="index.php">Home</a></li>
<li><a href="admin.php">Admin</a></li>
</ul>
<li>
<a href="admin.php?q=logout">
</a>
</li>
</ul>
</ul>
</div>
</nav>
<?php
if($result)
if(mysqli_num_rows($result) > 0)
while($row = mysqli_fetch_array($result))
echo "
<div class='row'>
<div class='col-md-2'></div>
<h4>".$row['roomname']."</h4><hr>
<h6>Facilities: ".$row['facility']."</h6>
</div>
<a href='admin/edit_room_cat.php?roomname=".$row['roomname']."'><button
class='btn btn-primary button'>Edit</button></a>
</div>
else
else
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
FILENAME:- addroom,php
<?php
include_once 'include/class.user.php';
$user=new User();
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
if($result)
</script>";
else
echo $result;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Panel</title>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="well">
<hr>
<div class="form-group">
</div>
<div class="form-group">
<select name="room_qnty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div class="form-group">
<select name="no_bed">
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
<div class="form-group">
<select name="bedtype">
<option value="single">single</option>
<option value="double">double</option>
</select>
</div>
<div class="form-group">
<label for="Facility">Facility</label>
</div>
<div class="form-group">
</div>
<br>
<div id="click_here">
</div>
</form>
</div>
</div>
</body>
</html>
<?php
include_once 'include/class.user.php';
$user=new User();
$room_cat=$_GET['roomname'];
$query=mysqli_query($user->db, $sql);
$row = mysqli_fetch_array($query);
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
if($result)
alert('".$result."');
</script>";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Panel</title>
<meta charset="utf-8">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="well">
<hr>
<div class="form-group">
</div>
<div class="form-group">
<select name="room_qnty">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div class="form-group">
<select name="no_bed">
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>
<div class="form-group">
<select name="bedtype">
<option value="single">single</option>
<option value="double">double</option>
</select>
</div>
<div class="form-group">
<label for="Facility">Facility</label>
</div>
<div class="form-group">
</div>
<br>
<div id="click_here">
</div>
</form>
</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Panel</title>
<meta charset="utf-8">
function submitlogin() {
if (form.emailusername.value == "") {
return false;
} else if (form.password.value == ) {
alert("Enter Password.");
return false;
</script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h2>Log In</h2>
<hr>
<div class="form-group">
</div>
<div class="form-group">
<label for="password">Password:</label>
</div>
<br>
else{?>
<script type="text/javascript">
</script>
<?php } }?>
</form>
</div>
</div>
</body>
</html>
<?php
include_once 'include/class.user.php';
$user=new User();
if(isset($_REQUEST[ 'submit']))
extract($_REQUEST);
if($register)
echo "
<script type='text/javascript'>
</script>";
echo "
<script type='text/javascript'>
window.location.href = '../admin.php';
</script>";
else
echo "
<script type='text/javascript'>
</script>";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Panel</title>
<meta charset="utf-8">
function submitreg() {
if (form.name.value == "") {
alert("Enter Name.");
return false;
alert("Enter username.");
return false;
alert("Enter Password.");
return false;
alert("Enter email.");
return false;
</script>
</head>
<body>
<div class="container">
<div class="well">
<hr>
<div class="form-group">
</div>
<div class="form-group">
</div>
<div class="form-group">
<label for="uemail">Email:</label>
</div>
<div class="form-group">
<label for="upass">Password</label>
</div>
<br>
<div id="click_here">
</div
</form>
</div>
</div>
</body>
</html>
<?php
include "db_config.php";
class user
public $db;
$this->db=new mysqli(DB_SERVER,DB_USERNAME,DB_PASSWORD,'hotel');
if(mysqli_connect_errno())
exit;
//$password=md5($password);
$check=$this->db->query($sql);
$count_row=$check->num_rows;
if($count_row==0)
return $result;
else
return false;
$available=$room_qnty;
$booked=0;
for($i=0;$i<$room_qnty;$i++)
mysqli_query($this->db,$sql2);
return $result;
$sql="SELECT DISTINCT room_cat FROM rooms WHERE room_id NOT IN (SELECT DISTINCT
room_id
FROM rooms WHERE (checkin <= '$checkin' AND checkout >='$checkout') OR (checkin >= '$checkin'
AND checkin <='$checkout') OR (checkin <= '$checkin' AND checkout >='$checkin') )";
return $check;
if(mysqli_num_rows($check) > 0)
$row = mysqli_fetch_array($check);
$id=$row['room_id'];
$send=mysqli_query($this->db,$sql2);
if($send)
else
else
$send=mysqli_query($this->db,$sql2);
if($send)
else
return $result;
mysqli_query($this->db,$sql2);
for($i=0;$i<$room_qnty;$i++)
mysqli_query($this->db,$sql3);
} $available=$room_qnty;
$booked=0;
$send=mysqli_query($this->db,$sql);
if($send)
$result="Updated Successfully!!";
else
return $result;
//$password=md5($password);
$result=mysqli_query($this->db,$sql2);
$user_data=mysqli_fetch_array($result);
$count_row=$result->num_rows;
if($count_row==1)
$_SESSION['login']=true;
$_SESSION['uid']=$user_data['uid'];
return true;
else
return false;
return $_SESSION['login'];
$_SESSION['login']=false;
session_destroy();
?>
<?php
define('DB_SERVER','localhost');
define('DB_USERNAME','root');
define('DB_PASSWORD','');
define('DB_DATABASE','hotel');
?>
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
START TRANSACTION;
--
-- Database: `hotel
--
--
--
--
-- --------------------------------------------------------
--
--
--
--
INSERT INTO `rooms` (`room_id`, `room_cat`, `checkin`, `checkout`, `name`, `phone`, `book`) VALUES
-- -------------------------------------------------------
--
COMMIT;