-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder_details.php
More file actions
193 lines (175 loc) · 8.7 KB
/
order_details.php
File metadata and controls
193 lines (175 loc) · 8.7 KB
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
<?php
session_start();
include_once("admin/class/adminback.php");
$obj = new adminback();
$cata_info = $obj->p_display_catagory();
$cataDatas = array();
while ($data = mysqli_fetch_assoc($cata_info)) {
$cataDatas[] = $data;
}
$userid = $_SESSION['user_id'];
$username = $_SESSION['username'];
if (isset($_GET['logout'])) {
if ($_GET['logout'] == "logout") {
$obj->user_logout();
}
}
$order_id = $_GET['order_id'];
$user_id = $_SESSION['user_id'];
$limit = 6;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$offset = ($page - 1) * $limit;
$order_details = $obj->get_order_details($order_id, $user_id, $offset, $limit);
$total_items = mysqli_num_rows($obj->get_order_details($order_id, $user_id, 0, PHP_INT_MAX));
$total_pages = ceil($total_items / $limit);
if (!isset($_SESSION['user_id'])) {
header("location:user_login.php");
}
?>
<?php
include_once("includes/head.php");
?>
<style>
.pagination {
display: inline-block;
margin-top: 20px;
}
.pagination a {
color: black;
float: left;
padding: 8px 16px;
text-decoration: none;
}
.pagination a.active {
background-color: #4CAF50;
color: white;
}
.pagination a:hover:not(.active) {
background-color: #ddd;
}
</style>
<body class="biolife-body">
<?php
include_once("includes/preloader.php");
?>
<header id="header" class="header-area style-01 layout-03">
<?php
include_once("includes/header_top.php");
include_once("includes/header_middle.php");
include_once("includes/header_bottom.php");
?>
</header>
<div class="page-contain">
<div id="main-content" class="main-content">
<div class="container">
<div class="row">
<div class="col-sm-1">
<br>
<a href="exist_order.php" class="btn btn-primary">Back to Order Summary</a>
</div>
<div class="col-md-12">
<h2 class="text-center">Order Details</h2>
<table class="shop_table cart-form">
<thead>
<tr>
<th class="product-name">Product Name</th>
<th class="product-price">Price</th>
<th class="product-quantity">Quantity</th>
<th class="product-subtotal">Subtotal</th>
<!-- <th class="product-status">Status</th> -->
<th class="product-time">Placing Time</th>
<th class="product-address">Shipping Address</th>
<th class="product-mobile">Shipping Mobile</th>
<th class="product-payment">Payment Method</th>
</tr>
</thead>
<tbody>
<?php
while ($order_item = mysqli_fetch_assoc($order_details)) {
$product_name = $order_item['product_name'];
$product_qty = $order_item['product_qty'];
$product_price = $order_item['product_price'];
$subtotal = $order_item['subtotal'];
// $order_status = $order_item['order_status'];
$order_time = $order_item['order_time'];
$shipping_address = $order_item['shipping_address'];
$shipping_mobile = $order_item['shipping_mobile'];
$payment_method = $order_item['payment_method'];
?>
<tr class="cart_item">
<td class="product-name" data-title="Products">
<div class="price price-contain">
<span class="price-amount"><?php echo $product_name; ?></span>
</div>
</td>
<td class="product-price" data-title="Price">
<div class="price price-contain">
<span class="price-amount"><?php echo $product_price; ?></span>
</div>
</td>
<td class="product-quantity" data-title="Quantities">
<div class="price price-contain">
<span class="price-amount"><?php echo $product_qty; ?></span>
</div>
</td>
<td class="product-subtotal" data-title="Total">
<div class="price price-contain">
<ins><span class="price-amount"><?php echo $subtotal; ?><span class="currencySymbol"> .VND</span></span></ins>
</div>
</td>
<td class="product-time" data-title="Placing Time">
<div class="price price-contain">
<span class="price-amount"><?php echo $order_time; ?></span>
</div>
</td>
<td class="product-address" data-title="Shipping Address">
<div class="price price-contain">
<span class="price-amount">
<?php echo $order_item['address_name'] . ', P.' . $order_item['address_ward'] . ', Q.' . $order_item['address_district'] . ', ' . $order_item['address_city']; ?>
</span>
</div>
</td>
<td class="product-mobile" data-title="Shipping Mobile">
<div class="price price-contain">
<span class="price-amount"><?php echo $shipping_mobile; ?></span>
</div>
</td>
<td class="product-payment" data-title="Payment Method">
<div class="price price-contain">
<span class="price-amount"><?php echo $payment_method; ?></span>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php if ($total_pages > 1) { ?>
<div class="pagination">
<?php
if ($page > 1) {
echo '<a href="?order_id=' . $order_id . '&page=' . ($page - 1) . '">« Previous</a>';
}
for ($i = 1; $i <= $total_pages; $i++) {
echo '<a href="?order_id=' . $order_id . '&page=' . $i . '" ' . ($i == $page ? 'class="active"' : '') . '>' . $i . '</a>';
}
if ($page < $total_pages) {
echo '<a href="?order_id=' . $order_id . '&page=' . ($page + 1) . '">Next »</a>';
}
?>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php
include_once("includes/footer.php");
include_once("includes/mobile_footer.php");
include_once("includes/mobile_global.php");
?>
<a class="btn-scroll-top"><i class="biolife-icon icon-left-arrow"></i></a>
<?php
include_once("includes/script.php");
?>
</body>