-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkout.php
278 lines (236 loc) · 10.1 KB
/
checkout.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
session_start();
include_once 'admin/database.php';
if(!(isset($_SESSION['cart'])&&count($_SESSION['cart'])>0)){
header('Location:./cart.php');
}
?>
<!doctype html>
<html lang="zxx">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>AHN Fashion</title>
<link rel="icon" href="img/favicon2.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- animate CSS -->
<link rel="stylesheet" href="css/animate.css">
<!-- owl carousel CSS -->
<link rel="stylesheet" href="css/owl.carousel.min.css">
<!-- font awesome CSS -->
<link rel="stylesheet" href="css/all.css">
<!-- flaticon CSS -->
<link rel="stylesheet" href="css/flaticon.css">
<link rel="stylesheet" href="css/themify-icons.css">
<link rel="stylesheet" href="css/nice-select.css">
<!-- font awesome CSS -->
<link rel="stylesheet" href="css/magnific-popup.css">
<!-- swiper CSS -->
<link rel="stylesheet" href="css/slick.css">
<!-- style CSS -->
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--::header part start::-->
<?php include_once 'include/header.php'; ?>
<!-- Header part end-->
<!--================Home Banner Area =================-->
<!-- breadcrumb start-->
<section class="breadcrumb breadcrumb_bg">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<p>Home / checkout</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<!--================Checkout Area =================-->
<section class="checkout_area section_padding">
<div class="container">
<?php if(!isset($_SESSION['user'])){ echo ' <div class="returning_customer">
<div class="check_title">
<h2>
Please login to checkout. Returning Customer?
<a href="./login.php?redirect=checkout">Click here to login</a>
</h2>
</div>
</div>';}else{ ?>
<div class="billing_details">
<div class="row">
<div class="col-lg-6">
<h3>Shipping Details</h3>
<form class="row contact_form" action="myorders.php" method="POST" >
<div class="col-md-12 form-group p_star">
<input type="text" placeholder="Phone number *" class="form-control" id="number" name="contact" required />
<span class="placeholder" ></span>
</div>
<div class="col-md-12 form-group p_star">
<input type="text" placeholder="Address line 1 *" class="form-control" id="add1" name="add1" required />
<span class="placeholder" placeholder="Address line 01"></span>
</div>
<div class="col-md-12 form-group p_star">
<input type="text" placeholder="Address line 2 *" class="form-control" id="add2" name="add2" required />
<span class="placeholder" placeholder="Address line 02"></span>
</div>
<div class="col-md-12 form-group p_star">
<input type="text" placeholder="Town/City *" class="form-control" id="city" name="city" required />
<span class="placeholder" placeholder="Town/City"></span>
</div>
<div class="col-md-12 form-group">
<input type="text" class="form-control" id="zip" name="zip" placeholder="Postcode/ZIP *" required />
</div>
</div>
<div class="col-lg-6">
<div class="order_box">
<h2>Your Order</h2>
<ul class="list">
<li>
<a href="#">Product
<span>Total</span>
</a>
</li>
<?php
$carttotal = 0;
for($i=0;$i<count($_SESSION['cart']);$i++){
$car = $_SESSION['cart'];
$sq = 'SELECT title,price FROM product where idProduct='.$car[$i][0];
$result = $conn->query($sq);
//$tot = floatval($r[$x][2]);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$qp = $row['price']*$car[$i][2];
echo ' <li>
<a href="#">'.$row['title'].'
<span class="middle">x '.$car[$i][2].'</span>
<span class="last">LKR '.$qp.'.00</span>
</a>
</li>';
//echo '<li class="fw-normal">'.$row['title'].' x '.$car[$i][2].' <span>LKR '.$qp.'</span></li>';
$carttotal = $carttotal+$qp;
}}
} ?>
</ul><ul class="list list_2">
<?php
echo ' <li>
<a href="#">Subtotal
<span>LKR '.$carttotal.'.00</span>
</a>
</li>';
echo ' <li>
<a href="#">Total
<span>LKR '.$carttotal.'.00</span>
</a>
</li>';
?>
</ul>
<div class="payment_item">
<div class="radion_btn">
<input type="radio" id="f-option5" value="Bank Transfer" name="pay" checked="checked" />
<label for="f-option5">Bank Tranfer</label>
<div class="check"></div>
</div>
<p>
Please Transfer the amount to HNB Bank AC No 10002546668544 and send a copy of payment slip via email.
</p>
</div>
<div class="payment_item active">
<div class="radion_btn">
<input type="radio" id="f-option6" name="pay" value="Cash On Delivery" />
<label for="f-option6">Cash on Delivery </label>
<img src="img/product/single-product/card.jpg" alt="" />
<div class="check"></div>
</div>
<p>
You can pay when you are get delivered. We accept cash and visa master credit or debit cards
</p>
</div>
<div class="creat_account">
<input type="checkbox" id="f-option4" name="selector" required />
<label for="f-option4">I’ve read and accept the </label>
<a href="#">terms & conditions*</a>
</div>
<button type="submit" name="submit" value="submit" class="btn_3" >Proceed</button>
</form>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</section>
<!--================End Checkout Area =================-->
<!-- subscribe_area part start-->
<section class="instagram_photo">
<div class="container-fluid>
<div class="row">
<div class="col-lg-12">
<div class="instagram_photo_iner">
<div class="single_instgram_photo">
<img src="img/instagram/inst_1.png" alt="">
<a href="#"><i class="ti-instagram"></i></a>
</div>
<div class="single_instgram_photo">
<img src="img/instagram/inst_2.png" alt="">
<a href="#"><i class="ti-instagram"></i></a>
</div>
<div class="single_instgram_photo">
<img src="img/instagram/inst_3.png" alt="">
<a href="#"><i class="ti-instagram"></i></a>
</div>
<div class="single_instgram_photo">
<img src="img/instagram/inst_4.png" alt="">
<a href="#"><i class="ti-instagram"></i></a>
</div>
<div class="single_instgram_photo">
<img src="img/instagram/inst_5.png" alt="">
<a href="#"><i class="ti-instagram"></i></a>
</div>
</div>
</div>
</div>
</div>
</section>
<!--::subscribe_area part end::-->
<!--::footer_part start::-->
<?php include_once 'include/footer.php'; ?>
<!--::footer_part end::-->
<!-- jquery plugins here-->
<script src="js/jquery-1.12.1.min.js"></script>
<!-- popper js -->
<script src="js/popper.min.js"></script>
<!-- bootstrap js -->
<script src="js/bootstrap.min.js"></script>
<!-- easing js -->
<script src="js/jquery.magnific-popup.js"></script>
<!-- swiper js -->
<script src="js/swiper.min.js"></script>
<!-- swiper js -->
<script src="js/mixitup.min.js"></script>
<!-- particles js -->
<script src="js/owl.carousel.min.js"></script>
<script src="js/jquery.nice-select.min.js"></script>
<!-- slick js -->
<script src="js/slick.min.js"></script>
<script src="js/jquery.counterup.min.js"></script>
<script src="js/waypoints.min.js"></script>
<script src="js/contact.js"></script>
<script src="js/jquery.ajaxchimp.min.js"></script>
<script src="js/jquery.form.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/mail-script.js"></script>
<!-- custom js -->
<script src="js/custom.js"></script>
<script type="text/javascript">
var x =document.getElementById('f-option4').required;
</script>
</body>
</html>