-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorderdetails.php
More file actions
117 lines (103 loc) · 4.84 KB
/
orderdetails.php
File metadata and controls
117 lines (103 loc) · 4.84 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
<?php
require_once './data/dbconnect.php';
include './ultility/userultilities.php';
include './ultility/orderultilities.php';
include './ultility/productultilities.php';
session_start();
function getCountProducts() {
if (isset($_SESSION['GuestCarts'])) {
return count($_SESSION['GuestCarts']);
} else {
return 0;
}
}
$order = '';
if (isset($_GET['id'])) {
$order = getOrderById($con, $_GET['id']);
if ($order != NULL) {
}
else {
header("Location: 404.php");
}
}
else {
header("Location: 404.php");
}
?>
<!doctype html>
<html>
<!-- Head HTML -->
<head>
<meta charset="utf-8">
<title>Items</title>
<link href="styles/site.css" rel="stylesheet" type="text/css">
<link href="styles/guestcart.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="javascript.js"></script>
</head>
<!-- Body HTML -->
<body>
<div class="divContainer">
<!-- Header -->
<?php include './Templates/header.php'; ?>
<!-- Top Menu -->
<?php include './Templates/topmenu.php'; ?>
<!-- Body Wrapper Second Level -->
<div class="divWrapper_2">
<!-- Body Wrapper First Level -->
<div class="divWrapper_1">
<!-- Left Menu -->
<?php include './Templates/leftmenu.php'; ?>
<!-- Main -->
<div class="divMain">
<article class="articleContent">
<p class="pPageTitle">ITEMS <?php $order['Id']; ?></p>
<section>
<p>Code orders: <?php echo $order['Id']; ?> <br/>
Time Order: <?php echo $order['CreateTime']; ?><br/>
Status: <?php echo getOrderStatus($con, $order['Status']); ?><br/>
Delivery address: <?php echo $order['Address']; ?><br/>
Phone number: <?php echo $order['Phone']; ?><br/>
Request: <?php echo $order['Request']; ?><br/>
</p>
</section>
<p> </p>
<section>
<table class="tableCart" id="tableCart" border="1" cellpadding="5" cellspacing="0">
<!-- Top Table -->
<tr id="trTop_TableCart">
<th width="200px">Product</th>
<th width="140px">Price</th>
<th width="100px">Amount</th>
<th width="140px">Payed</th>
</tr>
<?php
$lines = $order['lines'];
foreach ($lines as $line) {
$thistoBuy = getProductById($con, $line['ItemsId']);
if ($thistoBuy != NULL) {
?>
<tr>
<td><a class="aContent" href="itemsShop.php?id=<?php echo $thistoBuy['Id']; ?>"><?php echo $thistoBuy['CodeName']; ?></a></td>
<td><?php echo number_format(floatval($thistoBuy['Price']), 0, ".", ",") . " $"; ?></td>
<td><?php echo $line['Quantity']; ?></td>
<td><?php echo number_format(floatval($thistoBuy['Price']) * floatval($line['Quantity']), 0, ".", ",") . "$"; ?></td>
</tr>
<?php
}
}
?>
<tr id="trBottom_TableCart">
<td colspan="3" style="text-align: right">TOTAL: </td>
<td style="font-weight: bold"><?php echo $order['total']; ?> $</td>
</tr>
</table>
</section>
</article>
</div>
</div>
</div>
<!-- Footer -->
<?php include './Templates/footer.php'; ?>
</div>
</body>
</html>