-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder.php
220 lines (184 loc) · 9.27 KB
/
order.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
<?php include './inc/header.php';
require_once "./data/migration.php";
require_once "./core/functions.php";
?>
<?php include './inc/navbar.php'; ?>
<?php include './inc/footer.php'; ?>
<?php include './data/conn.php';
require "data/database.php";
use data\database\DB;
?>
<?php
if(!isset($_SESSION['auth'])){
redirect("login.php") ;
die ;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>order</title>
</head>
<body>
<?php
$user_id = $_SESSION['auth']['0'] ;
$DB = new DB();
$row = $DB ->viewData("*","orders","user_id=$user_id AND status=0");
if(isset($row)):
@$order_id = $row['id'];
$row4 = $DB ->viewData("*","users","id=$user_id");
// order
// $query = " SELECT * FROM order_products where `order_id` ='$order_id' ";
// $result = mysqli_query($conn, $query);
// $row1 = mysqli_fetch_assoc($result);
// $query = " SELECT * FROM users where `id` ='$user_id' ";
// $result = mysqli_query($conn, $query);
// $row4 = mysqli_fetch_assoc($result);
?>
<section class="h-100 gradient-custom">
<div class="container py-5 h-100">
<div class="row d-flex justify-content-center align-items-center h-100">
<div class="col-lg-10 col-xl-8">
<div class="card" style="border-radius: 10px;">
<div class="card-header px-4 py-5">
<h5 class="text-muted mb-0">Thanks for your Order, <span style="color: #a8729a;"><?php echo $row4['name'] ?></span>!</h5>
</div>
<div class="card-body p-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<p class="lead fw-normal mb-0" style="color: #a8729a;">Receipt</p>
<p class="small text-muted mb-0">Receipt Voucher : 1KAU9-84UIL</p>
</div>
<div class="card shadow-0 border mb-4">
<?php
$row0 = $DB ->viewAllData("*","order_products","order_id=$order_id");
foreach ($row0 as $row1):
$product_id = $row1['product_id'];
$row2=$DB->viewData("*","products","`id` ='$product_id'");
$row3=$DB->viewData("*","orders","`id` ='$order_id'");
//products
// $query = " SELECT * FROM products where `id` ='$product_id' ";
// $result = mysqli_query($conn, $query);
// $row2 = mysqli_fetch_assoc($result);
// $query = " SELECT * FROM orders where `id` ='$order_id' ";
// $result = mysqli_query($conn, $query);
// $row3 = mysqli_fetch_assoc($result);
?>
<div class="card-body">
<div class="row">
<div class="col-md-2">
<img src="images/<?php echo $row2['image'] ?>"
class="img-fluid" alt="Phone">
</div>
<div class="col-md-2 text-center d-flex justify-content-center align-items-center">
<p class="text-muted mb-0"><?php echo $row2['name'] ?></p>
</div>
<div class="col-md-2 text-center d-flex justify-content-center align-items-center">
<p class="text-muted mb-0 small"><?php echo $row2['description'] ?></p>
</div>
<div class="col-md-2 text-center d-flex justify-content-center align-items-center">
<p class="text-muted mb-0 small"><?php echo $row1['quantity'] ?> peice</p>
</div>
<div class="col-md-2 text-center d-flex justify-content-center align-items-center">
<p class="text-muted mb-0 small"><?php echo $row2['price'] ?>LE</p>
</div>
<?php
endforeach ;
endif ;
if(isset($row3)):
?>
</div>
<hr class="mb-4" style="background-color: #e0e0e0; opacity: 1;">
<div class="row d-flex align-items-center">
<div class="col-md-2">
<p class="text-muted mb-0 small">Track Order</p>
</div>
<div class="col-md-10">
<div class="progress" style="height: 6px; border-radius: 16px;">
<div class="progress-bar" role="progressbar"
style="width: 65%; border-radius: 16px; background-color: #a8729a;" aria-valuenow="65"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="d-flex justify-content-around mb-1">
<p class="text-muted mt-1 mb-0 small ms-xl-5">Out for delivary</p>
<p class="text-muted mt-1 mb-0 small ms-xl-5">Delivered</p>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-between pt-2">
<p class="fw-bold mb-0">Order Details</p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Total</span> <?php echo $row3['total'] ?></p>
</div>
<div class="d-flex justify-content-between pt-2">
<p class="text-muted mb-0">Invoice Number : <?php echo $row3['order_code'] ?></p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Discount</span>0</p>
</div>
<div class="d-flex justify-content-between">
<p class="text-muted mb-0">Invoice Date : <?php echo $row3['order_date'] ?></p>
<p class="text-muted mb-0"><span class="fw-bold me-4">GST 18%</span> 123</p>
</div>
<div class="d-flex justify-content-between mb-5">
<p class="text-muted mb-0">Recepits Voucher : 18KU-62IIK</p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Delivery Charges</span> Free</p>
</div>
</div>
<div class="card-footer border-0 px-4 py-5"
style="background-color: #a8729a; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
<h5 class="d-flex align-items-center justify-content-end text-white text-uppercase mb-0">Total
paid: <span class="h2 mb-0 ms-2"> <?php echo $row3['total'] ?></span></h5>
</div>
<?php
elseif(!isset($row3)):
?>
<hr class="mb-4" style="background-color: #e0e0e0; opacity: 1;">
<div class="row d-flex align-items-center">
<div class="col-md-2">
<p class="text-muted mb-0 small">Track Order</p>
</div>
<div class="col-md-10">
<div class="progress" style="height: 6px; border-radius: 16px;">
<div class="progress-bar" role="progressbar"
style="width: 65%; border-radius: 16px; background-color: #a8729a;" aria-valuenow="65"
aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="d-flex justify-content-around mb-1">
<p class="text-muted mt-1 mb-0 small ms-xl-5">Nothing to deliver</p>
<p class="text-muted mt-1 mb-0 small ms-xl-5"></p>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-between pt-2">
<p class="fw-bold mb-0">Order Details</p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Total</span> </p>
</div>
<div class="d-flex justify-content-between pt-2">
<p class="text-muted mb-0">Invoice Number : </p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Discount</span>0</p>
</div>
<div class="d-flex justify-content-between">
<p class="text-muted mb-0">Invoice Date : </p>
<p class="text-muted mb-0"><span class="fw-bold me-4">GST 18%</span> </p>
</div>
<div class="d-flex justify-content-between mb-5">
<p class="text-muted mb-0">Recepits Voucher : </p>
<p class="text-muted mb-0"><span class="fw-bold me-4">Delivery Charges</span> Free</p>
</div>
</div>
<div class="card-footer border-0 px-4 py-5"
style="background-color: #a8729a; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
<h5 class="d-flex align-items-center justify-content-end text-white text-uppercase mb-0">Total
paid: <span class="h2 mb-0 ms-2"> </span></h5>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
</section>
</body>
</html>