-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheckout2.php
173 lines (145 loc) · 5.89 KB
/
checkout2.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
session_start();
require ("function.php");// Including the db Connection
remove();
update();
?>
<html lang="en">
<head>
<title>E-Commerce</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<style>
.form1 {
position: relative;
z-index: 1;
background: #FFFFFF;
max-width: 950px;
height: 400px;
margin: 0 auto 5px;
padding: 15px;
text-align: center;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
</style>
<body>
<nav class="navbar navbar-inverse" style="border-radius:0px;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Logo</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="home.php">Home</a></li>
<li><a href="menu.php">Food Menu</a></li>
<li><a href="stores.php">Stores</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li style="top:7px;">
<form class="form-inline my-2 my-lg-0" method="get" action="results.php" enctype="multipart/form-data">
<input class="form-control" type="search" name="user_query" placeholder="Search" aria-label="Search">
<button class="btn btn-primary" name="search" type="submit">Search</button>
</form>
<li><?php
if(!isset($_SESSION['cust_email'])){
echo "<a href='login.php'><span class='glyphicon glyphicon-user'></span> Login</a>";
}
else
{
echo "<a href='logout.php'><span class='glyphicon glyphicon-user'></span> Logout</a>";
}
?></li>
<li><a href="cart.php"><span class="glyphicon glyphicon-shopping-cart"></span> Cart</a></li>
</ul>
</div>
</div>
</nav>
<div id="all">
<div id="content">
<div class="container">
<div class="col-md-12">
<ul class="breadcrumb">
<li><a href="#">Home</a>
</li>
<li>Checkout - Delivery Method</li>
</ul>
</div>
<div class="col-md-9" id="checkout">
<form method="post" action="checkout3.php" class="form1">
<h2>Checkout</h2>
<ul class="nav nav-pills nav-justified">
<li class="disabled"><a href="#"><i class="fa fa-map-marker"></i><br>Address</a>
</li>
<li class="active"><a href="#"><i class="fa fa-truck"></i><br>Delivery Method</a>
</li>
<li class="disabled"><a href="#"><i class="fa fa-money"></i><br>Payment Method</a>
</li>
<li class="disabled"><a href="#"><i class="fa fa-eye"></i><br>Order Review</a>
</li>
</ul>
<br>
<div class="table">
<div class="content">
<hr>
<div class="row">
<div class="col-sm-6">
<a class="btn btn-default" href="checkout2.php?del_id=1&&o_id=<?php orders();?>">Home Delivery</a>
</div>
<div class="col-sm-6">
<a class="btn btn-default" href="checkout2.php?del_id=2&&o_id=<?php orders();?>">Pick up</a>
</div>
<hr>
</div>
<!-- /.row -->
<hr>
</div>
<br>
<br><br>
<div class="box-footer">
<div class="pull-left">
<a href="checkout1.php" class="btn btn-default"><i class="fa fa-chevron-left"></i>Back to Addresses</a>
</div>
<div class="pull-right">
<button type="submit" class="btn btn-primary">Continue to Payment Method<i class="fa fa-chevron-right"></i>
</button>
</div>
</div>
</div>
</form>
<!-- /.box -->
</div>
</div>
<!-- /.container -->
</div>
</div>
</body>
</html>
<?php
if(isset($_GET['del_id'])){
$delivery_id = $_GET['del_id'];
$or_id = $_GET['o_id'];
if($delivery_id == 1)
{
$update_c = "update orders set delivery_type='Home Delivery' where order_id='".$or_id."'";
}
else
{
$update_c = "update orders set delivery_type='Home Delivery' where order_id='".$or_id."'";
}
if ($conn->query($update_c) == TRUE) {
echo "";
} else {
echo "Error: " . $insert_c . "<br>" . $conn->error;
}
}
?>