-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbooking.php
148 lines (141 loc) · 3.9 KB
/
booking.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
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
session_start();
require("config.php");
if(isset($_SESSION['id']))
{
$uid = $_SESSION['id'];
$bus = $_GET['bus'];
$bust = $bus.'bus';
$sql = mysql_query("select * from customers where id = '$uid'") or die(mysql_error());
if(mysql_num_rows($sql)>0)
{
$r = mysql_fetch_array($sql);
$name = $r['name'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Booking</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.4.2.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Myriad_Pro_600.font.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="http://info.template-help.com/files/ie6_warning/ie6_script_other.js"></script>
<script type="text/javascript" src="js/html5.js"></script>
<![endif]-->
</head>
<body id="page2">
<div class="extra">
<div class="main">
<!-- header -->
<header>
<div class="wrapper">
<h1><a href="index.php" id="logo">Greyhound Buses</a></h1>
<div class="right">
<div class="wrapper">
</div>
<div class="wrapper">
<nav>
<ul id="top_nav">
<li>Welcome! <a href ="profile.php?id"><h3><?php //echo $name;?></h3></a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</nav>
</div>
</div>
</div>
<nav>
<ul id="menu">
<li><a href="index.php" class="nav1">Home</a></li>
<li><a href="About.html" class="nav2">About Us </a></li>
<li><a href="Tours.html" class="nav3">Our Tours</a></li>
<li><a href="Destinations.html" class="nav4">Destinations</a></li>
<li class="end"><a href="Contacts.html" class="nav5">Contacts</a></li>
</ul>
</nav>
<div class="text">
<h2>Book Your tickets</h2>
<?php
$uid = $_SESSION['id'];
echo $bus = $_GET['bus'];
$bust = $bus.'bus';
?>
<?php
if(isset($_POST['book']))
{
$seat = $_POST['seat'];
$choice = $_POST['choice'];
$date = date("Y-m-d");
echo "<br>";
if($seat !='')
{
if($choice !='')
{
header("Location:pay.php?id=$uid&bus=$bus&seat=$seat&c=$choice"); //Enter the payment gateway
}
else
{
?>
<script>
alert("Enter your Choice");
</script>
<?php
}
}
else
{
?>
<script>
alert("Enter Number of seats to be booked");
</script>
<?php
}
}
?>
<form id="ContactForm" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>?id=<?php echo $uid;?>&bus=<?php echo $bus;?>">
<div class="wrapper">
No. of Seats: <input style="width:280px;" class="input" type="text" name="seat" required></div>
<div class="wrapper">
Choice:
<select style="width:280px; height:25px;" name="choice" required>
<option value=""></option>
<option value="N">Aisle</option>
<option value="W">Window</option>
</select></div>
<input class="button" type="submit" name="book" value="Book">
</form>
<br />
</div>
<div class="img"> </div>
<div class="img" style="margin-top:20px;"> <img src="images/bus.jpg" alt=""></div>
<div class="img" style="margin-top:20px;"><b><?php echo date("D d-M-Y");?></b></div>
</header>
<!-- / header -->
</div>
</div>
<div class="body1">
<div class="main">
<!-- footer -->
<footer>
<a rel="nofollow" href="" target="_blank"></a>© 2014 Greyhound Buses<br>
</footer>
<!-- / footer -->
</div>
</div>
<script type="text/javascript"> Cufon.now(); </script>
<?php
}
else
{
header("Location:Home.php?id=$uid");
}
?>
</body>
</html>