-
Notifications
You must be signed in to change notification settings - Fork 0
/
order-details.php
169 lines (125 loc) · 6.22 KB
/
order-details.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
<?php
session_start();
$pageName = "Order Details";
require_once './config.php';
require_once './functions.php';
?>
<!DOCTYPE html>
<html lang="en">
<?php require_once './layout/head.php'; ?>
<body class="animsition">
<?php require_once './layout/header.php'; ?>
<?php
if ($_SESSION["email"]) {
$activeUser = getOneByEmail('users', $_SESSION["email"]);
} else {
echo "<script>window.location = './index.php'</script>";
}
$user_id = $activeUser['id'];
// $userOrders = getDataByUserid('orders', $user_id);
// $userBills = getDataByUserid('bill', $user_id);
// print_r($userBills);
// print_r($_GET);
$billId = $_GET['bill_id'];
$billNum = $_GET['bill_num'];
$orderDetails = getBillDetails($billId);
// print_r($orderDetails);
?>
<!-- <section class="sec-product bg0 p-t-10 p-b-50">
<div class="container">
<div class="p-b-32">
<h3 class="ltext-105 cl5 txt-center respon1"><?php //echo $activeUser["f_name"] . " " . $activeUser['l_name']
?></h3>
<h5 class="mtext-105 cl5 txt-center respon1"><?php //echo $activeUser["email"]
?></h5>
</div>
</div>
</section> -->
<!-- breadcrumb -->
<div class="container m-b-40">
<div class="bread-crumb flex-w p-l-25 p-r-15 p-t-30 p-lr-0-lg">
<a href="index.php" class="mtext-80 cl8 hov-cl1 trans-04">
Home
<i class="fa fa-angle-right m-l-9 m-r-10" aria-hidden="true"></i>
</a>
<a href="profile.php" class="mtext-80 cl8 hov-cl1 trans-04">
Profile
<i class="fa fa-angle-right m-l-9 m-r-10" aria-hidden="true"></i>
</a>
<span class="mtext-80 cl4">
<?= $billNum ?>
</span>
</div>
</div>
<section class="sec-product bg0 p-t-10 p-b-50">
<div class="container">
<div class="row">
<div class="col-md-5 m-lr-auto m-b-50">
<div class="bor10 p-lr-30 p-t-30 p-b-40 m-r-80 m-lr-0-xl p-lr-15-sm bg2" style="border-radius: 5px !important">
<h3 class="mtext-109 cl2 p-b-30">Details for Order <br> Number: <?= $billNum ?></h3>
<h3 class="stext-105 cl5 "> <b>Billed for:</b> <?= $orderDetails[0]['f_name'] . " " . $orderDetails[0]['l_name'] ?></h3>
<h3 class="stext-105 cl5 "><b>Email:</b> <?= $orderDetails[0]['email'] ?> </h3>
<h3 class="stext-105 cl5 "><b>Phone:</b> <?= $orderDetails[0]['phone'] ?> </h3>
<h3 class="stext-105 cl5 "><b>Billing Address:</b> <?= $orderDetails[0]['address'] ?> </h3>
<h3 class="stext-105 cl5 "> <b>Total Price:</b> <?= $orderDetails[0]['total_price'] ?> JOD</h3>
</div>
</div>
<div class=" col-md-7 m-lr-auto m-b-50">
<div class="m-l-25 m-r--38 m-lr-0-xl">
<div class="wrap-table">
<table class="table">
<tr class="table_head">
<th class="column-1">Product</th>
<th class="column-2">Product image</th>
<th class="column-3">Price</th>
<th class="column-4">Status</th>
</tr>
<?php foreach ($orderDetails as $order) :
?>
<tr class="table_row">
<td class="column-1">
<a href="./product-detail.php?productid=<?php echo $order['product_id'] ?>" class="stext-104 cl4 hov-cl1 trans-04 js-name-b2 p-b-6">
<?= $order['name'] ?>
</a>
</td>
<td class="column-2">
<div class="how-itemcart1">
<img src="./admin/img/<?= $order['image'] ?>" alt="IMG">
</div>
</td>
<td class="column-3">
<?php if ($order['discount'] != 1) : ?>
<span class="stext-105 cl4" style="text-decoration:line-through"><?= $order['price'] ?> </span>
<span class="stext-105 cl2">
<?php
$discount = $order['price'] * $order['discount'];
$priceAfterDiscount = $order['price'] - $discount;
echo $priceAfterDiscount . " JOD"
?>
</span>
<?php else : ?>
<span><?= $order['price'] ?> JOD</span>
<?php endif; ?>
</td>
<td class="column-4"><?= $order['status'] ?></td>
</tr>
<?php endforeach;
?>
</table>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<?php require_once './layout/footer.php'; ?>
<!-- Back to top -->
<div class="btn-back-to-top" id="myBtn">
<span class="symbol-btn-back-to-top">
<i class="zmdi zmdi-chevron-up"></i>
</span>
</div>
<?php require_once './layout/scripts.php'; ?>
</body>
</html>