-
Notifications
You must be signed in to change notification settings - Fork 4
/
reservation_form4.php
135 lines (117 loc) · 5.44 KB
/
reservation_form4.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
require_once 'url.php';
session_start();
#To check whether user is logined or not
if (!isset($_COOKIE['user'])) {
header("Location: $rootURL/loginform.php");
}
#To check whether the session is working or not
if ( !isset($_SESSION['f_date']) ) {
require_once 'url.php';
header("Location: $rootURL/index.php");
}
#To act upon when form is clicked
if (isset($_POST['pay'])) {
require_once 'cnntdb.php';
connect();
$Uname = $_COOKIE['user'];
$fdate = $_SESSION['f_date'];
$tdate = $_SESSION['t_date'];
$Rname = $_SESSION['Rname'];
if (!$conn) {
die("<div class=\"alert alert-danger\" role=\"alert\">Connection failed: ".mysqli_connect_error()."</div>");
}
$sql = "INSERT INTO BkingDetail VALUES ('$Uname' ,'$Rname' ,'active' ,'$fdate' ,'$tdate')";
$result = $conn->query($sql);
if($result){
header("Location: $rootURL/dstryssn.php");
}
else echo "'$Uname'".$conn->error;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="dist/css/bootstrap.min.css">
</head>
<body>
<!--Navigation Bar-->
<nav class = "navbar navbar-default">
<div class = "container-fluid">
<div class = "navbar-header">
<a class = "navbar-brand" href="index.php">RmBkingSys</a>
</div>
<div>
<ul class = "nav navbar-nav">
<li><a href = "index.php">Home</a></li>
<li class = "active"><a href = "#">Reservation</a></li>
<li><a href = "brwsrm.php">Room Availability</a></li>
<li><a href = "upmingents.php">Upcoming Events</a></li>
<li><a href = "index.php#cntctus">Contact</a></li>
<li><a href = "index.php#faq">FAQ</a></li>
<li><a href = "index.php#about">About Us</a></li>
</ul>
<ul class = "nav navbar-nav navbar-right">
<?php
if (!isset( $_COOKIE['root_user'] )) {
echo "<li>"
."<a href = \"root_user/rtloginform.php\">Admin Login</a></li>";
}
else echo "<li class=\"dropdown\">"
."<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">Admin <span class=\"caret\"></span></a>"
."<ul class=\"dropdown-menu\">"
."<li><a href=\"root_user/adrm.php\">Add Room</a></li>"
."<li><a href=\"root_user/delrm.php\">Delete Room</a></li>"
."<li><a href=\"root_user/rmresvion.php\">Cancel Reservation</a></li>"
."<li><a href = \"root_user/rmuser.php\">Remove User</a></li>"
."<li><a href=\"root_user/rtlogout.php\">Log Out</a></li>"
."</ul>"
."</li>";
?>
<?php
if (!isset( $_COOKIE['user'] )) {
echo "<li>"
."<a href = \"loginform.php\">Login</a></li>";
}
else echo "<li class=\"dropdown\">"
."<a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">My Account <span class=\"caret\"></span></a>"
."<ul class=\"dropdown-menu\">"
."<li><a href=\"My_Account/shwple.php\">Show Profile</a></li>"
."<li><a href=\"My_Account/edit.php\">Edit</a></li>"
."<li><a href=\"My_Account/bkinghtry.php\">Booking History</a></li>"
."<li><a href=\"My_Account/logout.php\">Log Out</a></li>"
."</ul>"
."</li>";
?>
</ul>
</div>
</div>
</nav>
<!--Page Content-->
<div class = "container">
<form role = "form" name = "Checkout Form" onsubmit="return validateForm()" method = "post" action = 'reservation_form4.php' >
<div class = "form-group">
<label>Payment Options:</label>
<select name="payment" class = "form-control">
<option>Debit Card</option>
<option>Credit Card</option>
<option>Net Banking</option>
<option>Cash in Person</option>
</select>
</div>
<input type="submit" name="pay" value="Pay" class = "btn btn-default"/>
</form>
</div>
<div class = "container">
<br><a href = "reservation_form1.php" class = "btn btn-default">Back</a>
<a href = "index.php" class = "btn btn-default">Cancel</a>
</div>
</form>
<!--JavaScript Files-->
<script src="dist/js/jquery.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
</body>
</html>