-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder.php
More file actions
59 lines (53 loc) · 1.58 KB
/
Copy pathorder.php
File metadata and controls
59 lines (53 loc) · 1.58 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
<?php
require_once('init.php');
header('Content-type: text/html; charset=utf-8');
$order = db_load_object("SELECT * FROM orders WHERE order_id='".(int)$_GET['order_id']."'");
?><!doctype html>
<html lang="en-US">
<head>
<title>Заказы - Тестовый магазин</title>
</head>
<body>
<table align="center" cellspacing="0" cellpadding="0">
<tr>
<td><h1>Заказ - <?php echo $_GET['order_id'].' - '.($order ? $order->order_date : 'не найден'); ?></h1></td>
<td align="right" style="padding-left:10px;">
<a href="orders.php">Заказы</a><br />
<a href=".">Каталог</a>
</td>
</tr>
<?php
$order_items = json_decode($order->order_items);
if ($order_items) :
?>
<tr>
<td colspan="2">
<h2>Товары</h2>
<table border="1" cellpadding="5">
<tr>
<th>ID</th>
<th>Название</th>
<th>Цена</th>
<th>Кол-во</th>
<th>Сумма</th>
</tr>
<?php foreach ($order_items as $order_item) : ?>
<tr>
<td><?php echo $order_item->product_id; ?></td>
<td><?php echo $order_item->product_name; ?></td>
<td><?php echo $order_item->product_price; ?></td>
<td><?php echo $order_item->quantity; ?></td>
<td><?php echo $order_item->product_price * $order_item->quantity; ?></td>
</tr>
<?php endforeach; ?>
<td>
<th colspan="3" align="right">Итог</th>
<td><?php echo $order->order_total; ?></td>
</td>
</table>
</td>
</tr>
<?php endif; ?>
</table>
</body>
</html>