-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcheckout.php
322 lines (320 loc) · 19.2 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<?php
require('require/top.php');
authorise_user();
user_vfd_efd($con);
$checkout=array();
$checkout=get_chekout_products($con);
$subtotal=0;
?>
<div class="path">
<div class="container">
<a href="index.php">Home</a>
/
<a href="checkout.php">Checkout</a>
</div>
</div>
<section class="checkout">
<section class="myac-body">
<div class="flex row">
<div class="right">
<div class="col-lg-12 col-md-12">
<div class="pdpt-bg">
<form action="process.php" method="POST" id="checkout-form">
<div class="step">
<div class="tittle" onclick="open_address(this)" id="ct-ad">
<span>1</span>
<h4>Delivery Address</h4>
</div>
<div class="span" id="chekout_address" style="height: 0">
<div class="formbody">
<div class="form-group">
<div class="product-radio">
<ul class="product-now">
<li>
<input type="radio" id="ad1" name="address1" checked=""
value="Home" />
<label for="ad1">Home</label>
</li>
<li>
<input type="radio" id="ad2" name="address1" value="Office" />
<label for="ad2">Office</label>
</li>
<li>
<input type="radio" id="ad3" name="address1" value="Other" />
<label for="ad3">Other</label>
</li>
</ul>
</div>
</div>
<div class="address-fieldset">
<div class="row">
<div class="row2">
<div class="lt">
<label for="ft">Name*</label>
<input type="text" placeholder="Name" id="dv-name" />
</div>
<div class="ft">
<label for="ft">Mobile*</label>
<input type="number" placeholder="Number" id="dv-number"
oninput="validate_number()" />
</div>
</div>
<label for="ft">City*</label>
<select name="" id="dv-city">
<option value="#">Select City</option>
<?php
$querys="select * from city order by id desc";
$ress=mysqli_query($con,$querys);
while($rows=mysqli_fetch_assoc($ress)){
?>
<option value="<?php echo $rows['id'] ?>">
<?php echo $rows['city_name'] ?></option>
<?php
}
?>
</select>
<label for="ft">Flat / House / Office No.*</label>
<input type="text" placeholder="Address" id="dv-address" />
<div class="row2">
<div class="lt">
<label for="ft">Pincode*</label>
<input type="text" placeholder="Pincode" id="dv-pin" />
</div>
<div class="ft">
<label for="ft">Landmark*</label>
<input type="text" placeholder="Landmark" id="dv-land" />
</div>
</div>
<div class="row2">
<a href="javascript:void(0)" onclick="add_new_address()"
class="save-address">Save</a>
<a href="javascript:void(0)" class="next-step"
onclick="nex_ad()">Next</a>
</div>
<br>
<h4>Added Address</h4>
<div class="row2 mt2" style="display:block" id="ad-ad">
<?php
$template='';
$uid=$_SESSION['USER_ID'];
$res=mysqli_query($con,"select user_address.*,city.city_name from user_address,city where user_address.uid='$uid' and user_address.user_city=city.id");
while($row=mysqli_fetch_assoc($res)){
$template=$template.'
<div class="address-item">
<input type="radio" name="dv-ad" value="'.$row['id'].'"
style="width:2rem; height:1.5rem;margin-right:0.8rem;margin-top:0;">
<div class="address-icon1">
<i class="uil uil-home"></i>
</div>
<div class="address-dt-all">
<h4>'.$row['type_ad'].'</h4>
<p>
'.$row['user_name'].', '.$row['user_local'].', '.$row['user_add'].',
'.$row['city_name'].', '.$row['user_pin'].',<br>'.$row['user_mobile'].'
</p>
</div>
</div>
';
}
echo $template;
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="step">
<div class="tittle" onclick="open_dvt(this)" id="ct-dt">
<span>2</span>
<h4>Delivery Time & Date</h4>
</div>
<div class="span" id="chekout_dvt" style="height: 0">
<div class="formbody">
<div class="form-group">
<div class="product-radio">
<ul class="product-now">
<li>
<input type="radio" id="ad5" name="address3" checked=""
value="Today" />
<label for="ad5">Today</label>
</li>
<li>
<input type="radio" id="ad4" name="address3" value="Tomorrow" />
<label for="ad4">Tomorrow</label>
</li>
</ul>
</div>
</div>
<div class="time-radio">
<div class="form">
<div class="fields">
<?php
$res=mysqli_query($con,"select * from dv_time");
while($r=mysqli_fetch_assoc($res)){
?>
<div class="field">
<div class="ui radio checkbox chck-rdio">
<input type="radio" name="fruit" tabindex="0"
class="hidden" value="<?php echo $r['id'] ?>" />
<label><?php echo $r['from'] ?> - <?php echo $r['tto'] ?></label>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<div class="row2">
<a href="javascript:void(0)" class="next-step" onclick="nex_pt()">Proceed To
Pay</a>
</div>
</div>
</div>
<div class="step">
<div class="tittle" onclick="open_pt(this)" id="ct-pt">
<span>3</span>
<h4>Payment</h4>
</div>
<div class="span" id="chekout_pt" style="height: 0">
<div class="formbody">
<div class="rpt100">
<ul class="radio--group-inline-container_1" style="flex-direction:column;display:flex;">
<li style="width:100%;height:6rem;">
<div class="radio-item_1">
<input id="cashondelivery1" value="1"
name="paymentmethod" type="radio" />
<label for="cashondelivery1" class="radio-label_1">Cash on
Delivery</label>
</div>
</li>
<li style="width:100%; height:6rem;">
<div class="radio-item_1">
<input id="card1" value="2" name="paymentmethod" type="radio"
/>
<label for="card1" class="radio-label_1">Credit / Debit
Card</label>
</div>
</li>
</ul>
</div>
</div>
<input type="hidden" name="order-id" id="order-id">
<div class="row2">
<button class="next-step">Place Order</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="left">
<div class="ul-wrapper">
<h4>Order Summary</h4>
<?php foreach($checkout as $product){ ?>
<div class="cart-item border_radius">
<div class="cart-product-img">
<img src="media/product/<?php echo $product['img1']; ?>" alt="" />
<div class="offer-badge">
<?php
$offn=($product['fa']*100)/$product['price'];
$off=round(100-$offn);
echo $off.'%';
?>
</div>
</div>
<div class="cart-text">
<h4><?php echo $product['product_name']; ?></h4>
<div class="cart-item-price">₹<?php echo $product['fa'];
$subtotal+=$product['fa']*$product['qty'];
?>
<span>₹<?php echo $product['price']; ?></span>
</div>
<br>
<div class="cart-item-price">
<?php echo "x".$product['qty']; ?>
</div>
</div>
</div>
<?php } ?>
<div class="total-checkout-group">
<div class="cart-total-dil">
<h4>Subtotal</h4>
<span>₹<?php echo $product['total']; ?></span>
</div>
<div class="cart-total-dil pt-3">
<h4>Delivery Charges</h4>
<span>₹<?php
echo $product['ship_fee'];
?></span>
</div>
<?php
if($product['is_applied']){
?>
<div class="cart-total-dil pt-3">
<h4>Promo Applied</h4>
<span>- ₹<?php
echo $product['promo'];
?></span>
</div>
<?php } ?>
<?php
if($product['is_add_w']){
?>
<div class="cart-total-dil pt-3">
<h4>From Wallet</h4>
<span>- ₹<?php
echo $product['wl_amt'];
?></span>
</div>
<?php } ?>
</div>
<div class="main-total-cart">
<h2>Total</h2>
<span>₹<?php echo $product['final_amt']; ?></span>
</div>
<div class="cktout">
<i class="uil uil-padlock"></i> Secure Checkout
</div>
</div>
<div class="promocode">
<a href="javascript:void(0)" onclick="show_promo()">Have A Promocode?</a>
</div>
<div class="promoform" id="promoform">
<form action="javascript:void(0)">
<?php
if($product['is_applied']==0){
?>
<input type="text" placeholder="Enter Promocode" id="promocode"/>
<button onclick="apply_promo()">Apply</button>
<?php }else{
?>
<button onclick="remove_promo()" style="width:100%;border-radius:0;">Remove Promo</button>
<?php
} ?>
</form>
</div>
<div class="promocode">
<a href="javascript:void(0)" onclick="show_wt()">Use wallet Ballance</a>
</div>
<div class="promoform" id="wt">
<form action="javascript:void(0)">
<?php
if($product['is_add_w']==0){
?>
<button onclick="apply_wallet()" style="width:100%;border-radius:0;">Use</button>
<?php }else{
?>
<button onclick="remove_wallet()" style="width:100%;border-radius:0;">Remove</button>
<?php
} ?>
</form>
</div>
</div>
</div>
</section>
</section>
<script src="assets/js/ckt.js"></script>
<?php require('require/foot.php'); ?>
<?php require('require/last.php'); ?>