-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorders.php
More file actions
66 lines (62 loc) · 1.75 KB
/
Copy pathorders.php
File metadata and controls
66 lines (62 loc) · 1.75 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
<?php
require_once('init.php');
header('Content-type: text/html; charset=utf-8');
$orders = db_load_object_list("SELECT * FROM orders ORDER BY order_date DESC");
?><!doctype html>
<html lang="en-US">
<head>
<title>Заказы - Тестовый магазин</title>
</head>
<body>
<table align="center" cellspacing="0" cellpadding="0">
<?php if ($_SESSION['message']) : ?>
<tr>
<td colspan="2" align="center" style="border: solid 2px green; padding:10px;">
<?php echo $_SESSION['message']; ?>
</td>
</tr>
<?php
unset($_SESSION['message']);
endif;
?>
<tr>
<td><h1>Заказы</h1></td>
<td align="right" style="padding-left:10px;">
<a href=".">Каталог</a><br />
</td>
</tr>
<tr>
<td colspan="2">
<?php if ($orders) : ?>
<table border="1" cellpadding="5">
<tr>
<th>ID</th>
<th>Дата</th>
<th>Сумма заказа</th>
<th> </th>
<th> </th>
</tr>
<?php foreach ($orders as $order) : ?>
<tr>
<td><?php echo $order->order_id; ?></td>
<td><?php echo $order->order_date; ?></td>
<td><?php echo $order->order_total; ?></td>
<td><a href="order.php?order_id=<?php echo $order->order_id; ?>">Товары</a></td>
<td>
<form method="POST" action="">
<input type="hidden" name="action" value="delete_order" />
<input type="hidden" name="order_id" value="<?php echo $order->order_id; ?>" />
<button type="submit">Удалить заказ</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php else : ?>
<p align="center">Нет заказов!</p>
<?php endif; ?>
</td>
</tr>
</table>
</body>
</html>