Booking web app
from here you can update the code to dapt it to wordpress jomla or whatever framework you are ussing.
File architecture
root
index.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style >
#contenair{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 50px;
margin-right: 20px;
float: right;
height:95%;
width:35%;
background-color: #b7bcbd;
}
#l
{
margin-top: 5%;
margin-bottom: 50px;
margin-left:20px;
float: left;
width: 60%;
background-color: #b7bcbd;
}
</style>
<script>
function signup()
{
var alt="";
var x=document.forms["signupform"]["firstname"].value;
if (x==null || x=="")
{
alt +="First name must be filled out\n";
}
var y=document.forms["signupform"]["lastname"].value;
if (y==null || y=="")
{
alt += "Last name must be filled out\n";
}
var x=document.forms["signupform"]["daytimephone"].value;
if (x==null || x=="")
{
alt +="First name must be filled out\n";
}
var z=document.forms["signupform"]["email"].value;
var atpos=z.indexOf("@");
var dotpos=z.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=z.length)
{
alt += "Not a valid e-mail address\n";
}
var v=document.forms["signupform"]["password1"].value;
if (v==null || v=="")
{
alt += "password must be filled out\n";
}
var t=document.forms["signupform"]["password2"].value;
if (t==null || t=="")
{
alt += "confirm password must be filled out\n";
}
if (v != t)
{
alt += "password doesn't match\n";
}
if((document.forms["signupform"]["usertype1"].checked==false)&& (document.forms["signupform"]["usertype2"].checked==false))
{
alt += "payment type must be filled out\n";
}
if (alt != "")
{
alert(alt);
return false;
}
else {
form.Submit()
}
}
</script>
</head>
<body>
<div id="contenair">
<?php
include('include/db_con.php');
if(isset($_POST['Submit']))
{
$fn=$_POST['firstname'];
$ln=$_POST['lastname'];
$phone=$_POST['daytimephone'];
$email=$_POST['email'];
$pass=$_POST['password1'];
$city=$_POST['city'];
$country=$_POST['country'];
$intr=$_POST['usertype'];
$s1="INSERT INTO users (first_name,last_name,day_phone,user_name,user_password,city,country,payment_type)VALUES('".$fn."','".$ln."','".$phone."','".$email."','".$pass."','".$city."','".$country."','".$intr."')";
mysql_query($s1) or die (mysql_error($con));
}
?>
<div id="l" align="left">
<h2 align="center" >Welcome Santa Cruz </h2>
<h3 align="center"><u><i>Create A Account For New User....</i></u></h3>
<table>
<form method="POST" name="signupform" action="index.php" onSubmit="return signup();" >
<tr>
<td height="40">FirstName:</td>
<td><input name="firstname" id="firstname" size="40" />
</td>
</tr>
<tr>
<td height="40">LastName:</td>
<td><input name="lastname" id="lastname" size="40" />
</td>
</tr>
<tr>
<td height="40">Phone:</td>
<td><input name="daytimephone" id="daytimephone" size="40" />
</td>
</tr>
<tr>
<td height="40">E-mail:</td>
<td><input name="email" id="email" size="40" />
</td>
</tr>
<tr>
<td height="40">Password:</td>
<td><input name="password1" id="password1" size="40" />
</td>
</tr>
<tr>
<td height="40">Confirm Password:</td>
<td><input name="password2" id="password2" size="40" />
</td>
</tr>
<br>
<tr>
<td height="40">City/State</td>
<td><input name="city" id="city" size="40" />
</td>
</tr>
<br>
<tr>
<td height="40">Country</td>
<td><input name="country" id="country" size="40" />
</td>
</tr>
<br>
<tr>
<td>Payment Type:</td>
<td><input name="usertype" id="usertype1" value="cash" />Cash
<input name="usertype" id="usertype2" value="paypal" />Paypal/CreditCard
</td>
</tr>
<tr>
<td align="center" colspan="2"><input name="Submit" value="Submit" />
<input name="reset" value="Reset" /></td></tr>
</form>
</table>
</div>
<div id="r" align="right">
<?php
include('include/db_con.php');
session_start();
if (isset($_POST['username'],$_POST['password']))
{
$username=$_POST['username'];
$password=$_POST['password'];
if (empty($username) || empty($password))
{
$error = 'Hey All fields are required!!';
}
else {
$login="select * from users where user_name='".$username."' and user_password ='".$password."'";
$result=mysql_query($login);
print_r($result);
if(mysql_fetch_array($result)){
$_SESSION['logged_in']='true';
$_SESSION['username']=$username;
header('Location:registration.php');
exit();
} else {
$error='Incorrect details !!';
}
}
}
?>
<form action="index.php" method="POST">
<h2 align="center" id="h"><u><i>Login Here........</i></u></h2>
<table align="center" id="t">
<tr> <?php if (isset($error)) {?>
<small ><?php echo $error; ?>
<br /> <br />
<?php } ?> </tr>
<tr>
<td width="113">Email:</td>
<td width="215">
<input name="username" size="40" /></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="password" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Login" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
<html>
<head>
<style >
#contenair{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 50px;
margin-right: 20px;
float: right;
height:95%;
width:35%;
background-color: #b7bcbd;
}
#l
{
margin-top: 5%;
margin-bottom: 50px;
margin-left:20px;
float: left;
width: 60%;
background-color: #b7bcbd;
}
</style>
<script>
function signup()
{
var alt="";
var x=document.forms["signupform"]["firstname"].value;
if (x==null || x=="")
{
alt +="First name must be filled out\n";
}
var y=document.forms["signupform"]["lastname"].value;
if (y==null || y=="")
{
alt += "Last name must be filled out\n";
}
var x=document.forms["signupform"]["daytimephone"].value;
if (x==null || x=="")
{
alt +="First name must be filled out\n";
}
var z=document.forms["signupform"]["email"].value;
var atpos=z.indexOf("@");
var dotpos=z.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=z.length)
{
alt += "Not a valid e-mail address\n";
}
var v=document.forms["signupform"]["password1"].value;
if (v==null || v=="")
{
alt += "password must be filled out\n";
}
var t=document.forms["signupform"]["password2"].value;
if (t==null || t=="")
{
alt += "confirm password must be filled out\n";
}
if (v != t)
{
alt += "password doesn't match\n";
}
if((document.forms["signupform"]["usertype1"].checked==false)&& (document.forms["signupform"]["usertype2"].checked==false))
{
alt += "payment type must be filled out\n";
}
if (alt != "")
{
alert(alt);
return false;
}
else {
form.Submit()
}
}
</script>
</head>
<body>
<div id="contenair">
<?php
include('include/db_con.php');
if(isset($_POST['Submit']))
{
$fn=$_POST['firstname'];
$ln=$_POST['lastname'];
$phone=$_POST['daytimephone'];
$email=$_POST['email'];
$pass=$_POST['password1'];
$city=$_POST['city'];
$country=$_POST['country'];
$intr=$_POST['usertype'];
$s1="INSERT INTO users (first_name,last_name,day_phone,user_name,user_password,city,country,payment_type)VALUES('".$fn."','".$ln."','".$phone."','".$email."','".$pass."','".$city."','".$country."','".$intr."')";
mysql_query($s1) or die (mysql_error($con));
}
?>
<div id="l" align="left">
<h2 align="center" >Welcome Santa Cruz </h2>
<h3 align="center"><u><i>Create A Account For New User....</i></u></h3>
<table>
<form method="POST" name="signupform" action="index.php" onSubmit="return signup();" >
<tr>
<td height="40">FirstName:</td>
<td><input name="firstname" id="firstname" size="40" />
</td>
</tr>
<tr>
<td height="40">LastName:</td>
<td><input name="lastname" id="lastname" size="40" />
</td>
</tr>
<tr>
<td height="40">Phone:</td>
<td><input name="daytimephone" id="daytimephone" size="40" />
</td>
</tr>
<tr>
<td height="40">E-mail:</td>
<td><input name="email" id="email" size="40" />
</td>
</tr>
<tr>
<td height="40">Password:</td>
<td><input name="password1" id="password1" size="40" />
</td>
</tr>
<tr>
<td height="40">Confirm Password:</td>
<td><input name="password2" id="password2" size="40" />
</td>
</tr>
<br>
<tr>
<td height="40">City/State</td>
<td><input name="city" id="city" size="40" />
</td>
</tr>
<br>
<tr>
<td height="40">Country</td>
<td><input name="country" id="country" size="40" />
</td>
</tr>
<br>
<tr>
<td>Payment Type:</td>
<td><input name="usertype" id="usertype1" value="cash" />Cash
<input name="usertype" id="usertype2" value="paypal" />Paypal/CreditCard
</td>
</tr>
<tr>
<td align="center" colspan="2"><input name="Submit" value="Submit" />
<input name="reset" value="Reset" /></td></tr>
</form>
</table>
</div>
<div id="r" align="right">
<?php
include('include/db_con.php');
session_start();
if (isset($_POST['username'],$_POST['password']))
{
$username=$_POST['username'];
$password=$_POST['password'];
if (empty($username) || empty($password))
{
$error = 'Hey All fields are required!!';
}
else {
$login="select * from users where user_name='".$username."' and user_password ='".$password."'";
$result=mysql_query($login);
print_r($result);
if(mysql_fetch_array($result)){
$_SESSION['logged_in']='true';
$_SESSION['username']=$username;
header('Location:registration.php');
exit();
} else {
$error='Incorrect details !!';
}
}
}
?>
<form action="index.php" method="POST">
<h2 align="center" id="h"><u><i>Login Here........</i></u></h2>
<table align="center" id="t">
<tr> <?php if (isset($error)) {?>
<small ><?php echo $error; ?>
<br /> <br />
<?php } ?> </tr>
<tr>
<td width="113">Email:</td>
<td width="215">
<input name="username" size="40" /></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="password" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Login" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
registration.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style >
#contenar{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 5%;
margin-right: 5%;
margin-left: 5%;
float: center;
background-color: #b7bcbd;
}
</style>
</head>
<body>
<?php
include('include/db_con.php');
session_start();
if(isset($_POST['sub']))
{
$username=$_POST['username'];
$apartment$_POST['field_1'];
$startdate=$_POST['startdate'];
$enddate=$_POST['enddate'];
$apartment_nos=$_POST['apartment_nos'];
$amount=$_POST['apartment_price'];
$checkapartment= "select count(*) from apartmentdetail where apartment_'".$apartmenttype."' ";
$check=mysql_query($checkapartment) or die (mysql_error($con));
$apartmentcount=mysql_fetch_array($check);
$checkcount=$apartmentcount[0];
if($checkcount>=10)
{
?> <script>alert("Sorry apartments Are not Available :( please try another Option !!");</script>
<?php }
else{
$s1="INSERT INTO apartmentdetail (username,checkin_date,checkout_date,apartment_type,no_of_apartment,amount)VALUES('".$username."','".$startdate."','".$enddate."','".$apartmenttype."','".$apartment_nos."','".$amount."')";
mysql_query($s1) or die (mysql_error($con));
header("location:success.php");
}
}
?>
<div id="contenar">
<div id="r">
<form action="registration.php" method="POST">
<h2 align="center" id="h"><u><i>Book apartment</i></u></h2>
<h3> Welcome <?php session_start(); if(isset($_SESSION['username'])){ echo $_SESSION['username']; } ?> !!!</h3>
<table >
<tr>
<td width="113">Check in Date</td>
<td width="215">
<input name="startdate1" value="<?php if(isset($_POST['startdate1'])){ echo $_POST['startdate1']; }?>" /></td>
</tr>
<tr>
<td>Check out Date</td>
<td>
<input name="enddate1" value="<?php if(isset($_POST['enddate1'])){ echo $_POST['enddate1']; }?>" onchange='this.form.submit()' /></td>
</tr>
</table>
</form>
<form action="registration.php" method="POST">
<table >
<tr>
<td width="113"></td>
<td width="215">
<input name="startdate" value=" <?php if(isset($_POST['startdate1'])){ echo $_POST['startdate1']; }?> " /></td>
</tr>
<tr>
<td></td>
<td><input name="username" value="<?php session_start(); if(isset($_SESSION['username'])){ echo $_SESSION['username']; } ?>" />
<input name="enddate" value=" <?php if(isset($_POST['enddate1'])){ echo $_POST['enddate1']; }?> " /></td>
</tr>
<tr>
<td>apartment Type </td>
<td>
<select id="field_1" name="field_1" >
<option value="00">- Select -</option>
<?php if(isset($_POST['startdate1'])){
$paymentDate = $_POST['startdate1'];
$contractDateBegin = '2013-12-20';
$contractDateEnd ='2014-03-25';
if (($paymentDate >= $contractDateBegin) && ($paymentDate <= $contractDateEnd))
{
$s2="select * from apartmenttype where apartment_seson ='high season' ";
$s3=mysql_query($s2);
}
else
{
$s2="select * from apartmenttype where apartment_seson='low season' ";
$s3=mysql_query($s2);
}
?>
<?php while($catdata=mysql_fetch_array($s3)) { ?> <option value="<?php echo $catdata['apartment_price']; ?>"><?php echo $catdata['apartment_type']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
</tr>
<tr>
<td>Price per apartment</td>
<td>
<span id="a1" ></span>$
</td>
</tr>
<tr>
<td>No. of Guest per apartment</td>
<td>
<input name="guest" size="10"/></td>
</tr>
<tr>
<td>No. of apartments </td>
<td>
<input name="apartment_nos" id="apartment_nos" size="10" onChange="gettotal1()" /></td>
</tr>
<tr>
<td>Total Amount To Pay</td>
<td>
<input name="apartment_price" id="total1" size="10px" readonly="" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Pay & Book" /></td>
</tr>
</table>
</form>
<script language="javascript" >
function notEmpty(){
var e = document.getElementById("field_1");
var strUser = e.options[e.selectedIndex].value;
var strUser=document.getElementById('a1').innerHTML=strUser;
}
notEmpty()
document.getElementById("field_1").onchange = notEmpty;
function gettotal1(){
var gender1=document.getElementById('a1').innerHTML;
var gender2=document.getElementById('apartment_nos').value;
var gender3=parseFloat(gender1)* parseFloat(gender2);
document.getElementById('total1').value=gender3;
}
</script>
</div>
</div>
</body>
</html>
<html>
<head>
<style >
#contenar{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 5%;
margin-right: 5%;
margin-left: 5%;
float: center;
background-color: #b7bcbd;
}
</style>
</head>
<body>
<?php
include('include/db_con.php');
session_start();
if(isset($_POST['sub']))
{
$username=$_POST['username'];
$apartment$_POST['field_1'];
$startdate=$_POST['startdate'];
$enddate=$_POST['enddate'];
$apartment_nos=$_POST['apartment_nos'];
$amount=$_POST['apartment_price'];
$checkapartment= "select count(*) from apartmentdetail where apartment_'".$apartmenttype."' ";
$check=mysql_query($checkapartment) or die (mysql_error($con));
$apartmentcount=mysql_fetch_array($check);
$checkcount=$apartmentcount[0];
if($checkcount>=10)
{
?> <script>alert("Sorry apartments Are not Available :( please try another Option !!");</script>
<?php }
else{
$s1="INSERT INTO apartmentdetail (username,checkin_date,checkout_date,apartment_type,no_of_apartment,amount)VALUES('".$username."','".$startdate."','".$enddate."','".$apartmenttype."','".$apartment_nos."','".$amount."')";
mysql_query($s1) or die (mysql_error($con));
header("location:success.php");
}
}
?>
<div id="contenar">
<div id="r">
<form action="registration.php" method="POST">
<h2 align="center" id="h"><u><i>Book apartment</i></u></h2>
<h3> Welcome <?php session_start(); if(isset($_SESSION['username'])){ echo $_SESSION['username']; } ?> !!!</h3>
<table >
<tr>
<td width="113">Check in Date</td>
<td width="215">
<input name="startdate1" value="<?php if(isset($_POST['startdate1'])){ echo $_POST['startdate1']; }?>" /></td>
</tr>
<tr>
<td>Check out Date</td>
<td>
<input name="enddate1" value="<?php if(isset($_POST['enddate1'])){ echo $_POST['enddate1']; }?>" onchange='this.form.submit()' /></td>
</tr>
</table>
</form>
<form action="registration.php" method="POST">
<table >
<tr>
<td width="113"></td>
<td width="215">
<input name="startdate" value=" <?php if(isset($_POST['startdate1'])){ echo $_POST['startdate1']; }?> " /></td>
</tr>
<tr>
<td></td>
<td><input name="username" value="<?php session_start(); if(isset($_SESSION['username'])){ echo $_SESSION['username']; } ?>" />
<input name="enddate" value=" <?php if(isset($_POST['enddate1'])){ echo $_POST['enddate1']; }?> " /></td>
</tr>
<tr>
<td>apartment Type </td>
<td>
<select id="field_1" name="field_1" >
<option value="00">- Select -</option>
<?php if(isset($_POST['startdate1'])){
$paymentDate = $_POST['startdate1'];
$contractDateBegin = '2013-12-20';
$contractDateEnd ='2014-03-25';
if (($paymentDate >= $contractDateBegin) && ($paymentDate <= $contractDateEnd))
{
$s2="select * from apartmenttype where apartment_seson ='high season' ";
$s3=mysql_query($s2);
}
else
{
$s2="select * from apartmenttype where apartment_seson='low season' ";
$s3=mysql_query($s2);
}
?>
<?php while($catdata=mysql_fetch_array($s3)) { ?> <option value="<?php echo $catdata['apartment_price']; ?>"><?php echo $catdata['apartment_type']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
</tr>
<tr>
<td>Price per apartment</td>
<td>
<span id="a1" ></span>$
</td>
</tr>
<tr>
<td>No. of Guest per apartment</td>
<td>
<input name="guest" size="10"/></td>
</tr>
<tr>
<td>No. of apartments </td>
<td>
<input name="apartment_nos" id="apartment_nos" size="10" onChange="gettotal1()" /></td>
</tr>
<tr>
<td>Total Amount To Pay</td>
<td>
<input name="apartment_price" id="total1" size="10px" readonly="" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Pay & Book" /></td>
</tr>
</table>
</form>
<script language="javascript" >
function notEmpty(){
var e = document.getElementById("field_1");
var strUser = e.options[e.selectedIndex].value;
var strUser=document.getElementById('a1').innerHTML=strUser;
}
notEmpty()
document.getElementById("field_1").onchange = notEmpty;
function gettotal1(){
var gender1=document.getElementById('a1').innerHTML;
var gender2=document.getElementById('apartment_nos').value;
var gender3=parseFloat(gender1)* parseFloat(gender2);
document.getElementById('total1').value=gender3;
}
</script>
</div>
</div>
</body>
</html>
success.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<div><h1>Your apartment Booked successfully,You will be contacted soon.</h1></div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<div><h1>Your apartment Booked successfully,You will be contacted soon.</h1></div>
</body>
</html>
include
db_con.php
<?php
$con=mysql_connect("localhost","root","");
mysql_select_db("assignment",$con) or die(mysql_error($con));
error_reporting(E_ALL ^ E_NOTICE);
?>
$con=mysql_connect("localhost","root","");
mysql_select_db("assignment",$con) or die(mysql_error($con));
error_reporting(E_ALL ^ E_NOTICE);
?>
admin
Index.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<style >
#contenair{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 5%;
height:95%;
background-color: #b7bcbd;
}
</style>
</head>
<body>
<div id="contenair">
<div id="r" >
<?php
include('../include/db_con.php');
session_start();
if (isset($_POST['username'],$_POST['password']))
{
$username=$_POST['username'];
$password=$_POST['password'];
if (empty($username) || empty($password))
{
$error = 'Hey All fields are required!!';
}
else {
$login="select * from users where user_name='".$username."' and user_password ='".$password."'";
$result=mysql_query($login);
print_r($result);
if(mysql_fetch_array($result)){
$_SESSION['logged_in']='true';
$_SESSION['username']=$username;
header('Location:adminpanal.php');
exit();
} else {
$error='Incorrect details !!';
}
}
}
?>
<form action="index.php" method="POST">
<h2 align="center" id="h"><u><i>Login Here........</i></u></h2>
<table align="center">
<tr> <?php if (isset($error)) {?>
<small ><?php echo $error; ?>
<br /> <br />
<?php } ?> </tr>
<tr>
<td width="113">Email:</td>
<td width="215">
<input name="username" size="40" /></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="password" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Login" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
<html>
<head>
<style >
#contenair{
height: 100%;
width: 100%;
}
#r{
margin-top: 5%;
margin-bottom: 5%;
height:95%;
background-color: #b7bcbd;
}
</style>
</head>
<body>
<div id="contenair">
<div id="r" >
<?php
include('../include/db_con.php');
session_start();
if (isset($_POST['username'],$_POST['password']))
{
$username=$_POST['username'];
$password=$_POST['password'];
if (empty($username) || empty($password))
{
$error = 'Hey All fields are required!!';
}
else {
$login="select * from users where user_name='".$username."' and user_password ='".$password."'";
$result=mysql_query($login);
print_r($result);
if(mysql_fetch_array($result)){
$_SESSION['logged_in']='true';
$_SESSION['username']=$username;
header('Location:adminpanal.php');
exit();
} else {
$error='Incorrect details !!';
}
}
}
?>
<form action="index.php" method="POST">
<h2 align="center" id="h"><u><i>Login Here........</i></u></h2>
<table align="center">
<tr> <?php if (isset($error)) {?>
<small ><?php echo $error; ?>
<br /> <br />
<?php } ?> </tr>
<tr>
<td width="113">Email:</td>
<td width="215">
<input name="username" size="40" /></td>
</tr>
<tr>
<td>Password:</td>
<td>
<input name="password" size="40" /></td>
</tr>
<tr>
<td colspan="2" align="center">
<input name="sub" value="Login" /></td>
</tr>
</table>
</form>
</div>
</div>
</body>
</html>
adminpanal.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<h1>welcome admin</h1>
Choose option from Below to take action!!!!
Create new Booking click <a href="../registration.php"> Here</a>
<?php
include('../include/db_con.php');
$sql="select * from roomdetail ";
$row=mysql_query($sql) or die (mysql_error($con));
?><table border="1">
<?php
while($data=mysql_fetch_array($row))
{
?>
<tr>
<td><?php echo $data[id]; ?></td>
<td><?php echo $data[username]; ?></td>
<td><?php echo $data[checkin_date]; ?></td>
<td><?php echo $data[checkout_date]; ?></td>
<td><?php echo $data[room_type]; ?></td>
<td><?php echo $data[no_of_room]; ?></td>
<td><?php echo $data[amount]; ?></td>
<td><a href="update.php?id=<?php echo $data[id]; ?>">update</a></td>
<td><a href="delete.php?id=<?php echo $data[id]; ?>">delete</a></td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<h1>welcome admin</h1>
Choose option from Below to take action!!!!
Create new Booking click <a href="../registration.php"> Here</a>
<?php
include('../include/db_con.php');
$sql="select * from roomdetail ";
$row=mysql_query($sql) or die (mysql_error($con));
?><table border="1">
<?php
while($data=mysql_fetch_array($row))
{
?>
<tr>
<td><?php echo $data[id]; ?></td>
<td><?php echo $data[username]; ?></td>
<td><?php echo $data[checkin_date]; ?></td>
<td><?php echo $data[checkout_date]; ?></td>
<td><?php echo $data[room_type]; ?></td>
<td><?php echo $data[no_of_room]; ?></td>
<td><?php echo $data[amount]; ?></td>
<td><a href="update.php?id=<?php echo $data[id]; ?>">update</a></td>
<td><a href="delete.php?id=<?php echo $data[id]; ?>">delete</a></td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>
success.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<div><h1>Your luxury apartment Updated successfully.</h1></div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<div><h1>Your luxury apartment Updated successfully.</h1></div>
</body>
</html>
delete.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<?php
include('../include/db_con.php');
if(isset($_GET['id']))
{
$id=$_GET['id'];
$sql="delete from roomdetail where id='".$id."'";
mysql_query($sql) or die (mysql_error($con));
header("location:adminpanal.php");
}
?>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title></head>
<body>
<?php
include('../include/db_con.php');
if(isset($_GET['id']))
{
$id=$_GET['id'];
$sql="delete from roomdetail where id='".$id."'";
mysql_query($sql) or die (mysql_error($con));
header("location:adminpanal.php");
}
?>
</body>
</html>
sql
import to your db to creat the tables automaticly
actually the database name is assigment_001 as you can see
actually the database name is assigment_001 as you can see
-- phpMyAdmin SQL Dump
-- version 4.4.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Ma 28, 2015 at 06:04 AM
-- Server version: 5.5.20
-- PHP Version: 5.6.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `assignment`
--
-- --------------------------------------------------------
--
-- Table structure for table `apartmentdetail`
--
CREATE TABLE IF NOT EXISTS `apartmentdetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`checkin_date` date NOT NULL,
`checkout_date` date NOT NULL,
`apartment_type` varchar(50) NOT NULL,
`no_of_apartments` varchar(50) NOT NULL,
`amount` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `apartmentdetail`
--
INSERT INTO `apartmentdetail` (`id`, `username`, `checkin_date`, `checkout_date`, `apartment_type`, `no_of_apartments`, `amount`) VALUES
(2, 'avatazjoe@gmail.com', '2015-06-16', '2015-06-20', '250', '5', '1250');
-- --------------------------------------------------------
--
-- Table structure for table `apartmenttype`
--
CREATE TABLE IF NOT EXISTS `apartmenttype` (
`apartment_id` int(11) NOT NULL AUTO_INCREMENT,
`apartment_type` varchar(50) NOT NULL,
`apartment_price` varchar(50) NOT NULL,
`apartment_seson` varchar(50) NOT NULL,
PRIMARY KEY (`apartment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `apartmenttype`
--
INSERT INTO `apartmenttype` (`apartment_id`, `apaertment_type`, `apartment_price`, `apartment_seson`) VALUES
(1, 'Garden view', '100', 'low season'),
(2, 'Garden view', '200', 'high season'),
(3, 'Street view', '45', 'low season'),
(4, 'Street view', '90', 'high season'),
(5, 'Ocean view', '250', 'low season'),
(6, 'Ocean view', '500', 'high season');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(10) NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`day_phone` varchar(50) NOT NULL,
`user_name` varchar(50) NOT NULL,
`user_password` varchar(50) NOT NULL,
`city` varchar(50) NOT NULL,
`country` varchar(50) NOT NULL,
`payment_type` varchar(50) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `day_phone`, `user_name`, `user_password`, `city`, `country`, `payment_type`) VALUES
(1, 'joy', 'mendis', '8123432111', 'joy@mendis.com', '12345', 'ontario', 'canada', 'paypal');
/*!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 */;
-- version 4.4.7.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Ma 28, 2015 at 06:04 AM
-- Server version: 5.5.20
-- PHP Version: 5.6.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `assignment`
--
-- --------------------------------------------------------
--
-- Table structure for table `apartmentdetail`
--
CREATE TABLE IF NOT EXISTS `apartmentdetail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`checkin_date` date NOT NULL,
`checkout_date` date NOT NULL,
`apartment_type` varchar(50) NOT NULL,
`no_of_apartments` varchar(50) NOT NULL,
`amount` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `apartmentdetail`
--
INSERT INTO `apartmentdetail` (`id`, `username`, `checkin_date`, `checkout_date`, `apartment_type`, `no_of_apartments`, `amount`) VALUES
(2, 'avatazjoe@gmail.com', '2015-06-16', '2015-06-20', '250', '5', '1250');
-- --------------------------------------------------------
--
-- Table structure for table `apartmenttype`
--
CREATE TABLE IF NOT EXISTS `apartmenttype` (
`apartment_id` int(11) NOT NULL AUTO_INCREMENT,
`apartment_type` varchar(50) NOT NULL,
`apartment_price` varchar(50) NOT NULL,
`apartment_seson` varchar(50) NOT NULL,
PRIMARY KEY (`apartment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `apartmenttype`
--
INSERT INTO `apartmenttype` (`apartment_id`, `apaertment_type`, `apartment_price`, `apartment_seson`) VALUES
(1, 'Garden view', '100', 'low season'),
(2, 'Garden view', '200', 'high season'),
(3, 'Street view', '45', 'low season'),
(4, 'Street view', '90', 'high season'),
(5, 'Ocean view', '250', 'low season'),
(6, 'Ocean view', '500', 'high season');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(10) NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`day_phone` varchar(50) NOT NULL,
`user_name` varchar(50) NOT NULL,
`user_password` varchar(50) NOT NULL,
`city` varchar(50) NOT NULL,
`country` varchar(50) NOT NULL,
`payment_type` varchar(50) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `day_phone`, `user_name`, `user_password`, `city`, `country`, `payment_type`) VALUES
(1, 'joy', 'mendis', '8123432111', 'joy@mendis.com', '12345', 'ontario', 'canada', 'paypal');
/*!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 */;
Security ussues :-D
Zum Bearbeiten hier klicken.sql injections are part of the life, hackers loves to steal paswords from litle luxury hostels where clients uses the same password of his main accounts. i recomended nosql db but any way welcome to tijuana gringos.
clients gonna be really happy after know that his imformation was stolen
clients gonna be really happy after know that his imformation was stolen
briefing.
- Authenticate and authorize a user.
- Store a number of data records describing a collection of apartments. Each record will hold the following attributes:
- Apartment number
- Apartment name
- Apartment location (Building A, Building B, and so on)
- Apartment capacity (number of seats)
- Apartment picture
- ---------room description------------------------
Apartment has conference phone (yes/no)
Apartment has video screen or projector (yes/no)
Apartment has wireless internet access (yes/no)
--------end room description----------------- - Apartment is active in the system (yes/no)
- Allow users to search for available apartment by entering the desired date and time, duration, location and other room attributes, and produce a list of available apartment that satisfy the criteria.
- Allow users to reserve a apartment that is open for reservation during a given time span.
- Allow users to review the apartment reservations that they have made for a given date
- Allow users to browse the apartment that are active (reserved or not) for a given location and date
- Allow administrators to browse the apartment that are set up in the system.
- Allow administrators to add apartment to the system
- Allow administrators to change the attributes of an existing apartment.
- As well, allow administrators to remove an existing apartment from the system.
![]()
|
![]()
|