-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcheckout.php
executable file
·127 lines (113 loc) · 4.23 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
<?php
include "includes/head.php"
?>
<body>
<div class="site-wrap">
<?php
include "includes/header.php";
$data = get_user($_SESSION['user_id']);
?>
<div class="bg-light py-3">
<div class="container">
<div class="row">
<div class="col-md-12 mb-0">
<a href="index.php">Home</a> <span class="mx-2 mb-0">/</span>
<strong class="text-black">Checkout</strong>
</div>
</div>
</div>
</div>
<div class="site-section">
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="row mb-5">
<div class="col-md-12">
<h2 class="h3 mb-3 text-black">Delivery Details</h2>
<div class="p-3 p-lg-5 border">
<table class="table site-block-order-table mb-5">
<thead>
<th>Costumer Details</th>
</thead>
<tbody>
<tr>
<td>First Name </td>
<td><?php echo $data[0]['user_fname'] ?></td>
</tr>
<tr>
<td>Last Name </td>
<td><?php echo $data[0]['user_lname'] ?></td>
</tr>
<tr>
<td>Email </td>
<td><?php echo $data[0]['email'] ?></td>
</tr>
<tr>
<td>Address </td>
<td><?php echo $data[0]['user_address'] ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row mb-5">
<div class="col-md-12">
<h2 class="h3 mb-3 text-black">Your Order</h2>
<div class="p-3 p-lg-5 border">
<table class="table site-block-order-table mb-5">
<thead>
<th>Product</th>
<th>Total</th>
</thead>
<tbody>
<?php
if (!empty($_SESSION['cart'])) {
$data = get_cart();
$num = sizeof($data);
for ($i = 0; $i < $num; $i++) {
if (isset($data[$i])) {
?>
<tr>
<td><?php echo $data[$i][0]['item_title'] ?><strong class="mx-2">x</strong><?php echo $_SESSION['cart'][$i]['quantity'] ?></td>
<td>₹<?php echo ($data[$i][0]['item_price'] * $_SESSION['cart'][$i]['quantity']) ?></td>
</tr>
<?php
}
}
}
?>
<tr>
<td class="text-black font-weight-bold"><strong>Cart Subtotal</strong></td>
<td class="text-black">₹<?php echo total_price($data) ?></td>
</tr>
<tr>
<td class="text-black font-weight-bold"><strong>Delivery Fees</strong></td>
<td class="text-black">₹<?php echo delivery_fees($data) ?></td>
</tr>
<tr>
<td class="text-black font-weight-bold"><strong>Order Total</strong></td>
<td class="text-black font-weight-bold"><strong>₹<?php echo delivery_fees($data) + total_price($data) ?></strong></td>
</tr>
</tbody>
</table>
<div class="form-group">
<button class="btn btn-primary btn-lg btn-block" onclick="window.location='thankyou.php?order=done'">Place
Order</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- </form> -->
</div>
</div>
<?php
include "includes/footer.php"
?>
</div>
</body>
</html>